From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:33296) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iemc0-0001UL-Af for guix-patches@gnu.org; Tue, 10 Dec 2019 16:00:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iemby-0007ke-Vc for guix-patches@gnu.org; Tue, 10 Dec 2019 16:00:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iemby-0007ix-OD for guix-patches@gnu.org; Tue, 10 Dec 2019 16:00:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iemby-0008Ek-Mr for guix-patches@gnu.org; Tue, 10 Dec 2019 16:00:02 -0500 Subject: [bug#37478] [PATCH] Support canonical guix environment -l guix.scm. Resent-Message-ID: From: Jan Nieuwenhuizen References: <871rw88u5s.fsf@gnu.org> <871rw4mro9.fsf@gnu.org> <87k19jy26l.fsf@gnu.org> <874ky8n5nw.fsf@posteo.net> Date: Tue, 10 Dec 2019 21:59:22 +0100 In-Reply-To: (David Thompson's message of "Tue, 10 Dec 2019 13:45:18 -0500") Message-ID: <87a77z7v85.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: "Thompson, David" Cc: 37478@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Brett Gilio Thompson, David writes: > (package > (name "chickadee") > (version "0.1") > (source #f) [..] > Initially I thought a package made sense because, in addition to being > used as the basis of a dev environment, I could build the same file as > part of a CI system or pre-release make target, but in practice I > can't really do that, thus the '(source #f)' bit and all the other > boilerplate like version, synopsis, description, and license fields to > satisfy the syntax rules. It's also not a suitable package for > upstreaming to Guix later because building from git requires > additional dependencies that aren't needed when building from a > release tarball. So, if I were to rewrite this file today, I think I > would just make a manifest instead. > > Of course, Guix could also just eval the file, use package? and > manifest? predicates to see what it got, and act accordingly. That > might be the best choice from a usability standpoint. Interesting! I've been flipping here too. Currently, I am using a split setup. The upstream(able) package lives in a subdirectory --8<---------------cut here---------------start------------->8--- ;;; guix/git/mes.scm: (define-module (git mes) (define-public mes (let ((triplet "i686-unknown-linux-gnu") (version "0.21")) (package (name "mes") (version version) (source (origin (method url-fetch) (uri (string-append "https://ftp.gnu.org/pub/gnu/mes/mes-" version ".tar.= gz")) (sha256 (base32 "04pajp8v31na34ls4730ig5f6miiplhdvkmsb9ls1b8bbmw2v= b4n")))) (build-system gnu-build-system) ... (home-page "https://www.gnu.org/software/mes") (license gpl3+)))) --8<---------------cut here---------------end--------------->8--- and my guix.scm then uses that --8<---------------cut here---------------start------------->8--- ;;; guix.scm (use-modules (guix gexp) (guix git-download) (guix packages) (gnu packages)) (define %source-dir (dirname (current-filename))) (add-to-load-path (string-append %source-dir "/guix")) (use-modules (git mes)) (define-public mes.git (package (inherit mes) (source (local-file %source-dir #:recursive? #t #:select? (git-predicate %source-dir))))) mes.git --8<---------------cut here---------------end--------------->8--- This way, I can maintain an upstream(able) package literally, build from git and have my environment set up. As a bonus, you can then use a .guix-channel file --8<---------------cut here---------------start------------->8--- (channel (version 0) (directory "guix")) --8<---------------cut here---------------end--------------->8--- so that you can guix pull straight from your repo. Greetings, janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com