all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: "Thompson, David" <dthompson2@worcester.edu>
Cc: 37478@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>,
	"Brett Gilio" <brettg@posteo.net>
Subject: [bug#37478] [PATCH] Support canonical guix environment -l guix.scm.
Date: Tue, 10 Dec 2019 21:59:22 +0100	[thread overview]
Message-ID: <87a77z7v85.fsf@gnu.org> (raw)
In-Reply-To: <CAJ=RwfYvSNmuRnuxh3_szybFw1ucEYDsZJK8w1eqaXBe9kQBuw@mail.gmail.com> (David Thompson's message of "Tue, 10 Dec 2019 13:45:18 -0500")

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 "04pajp8v31na34ls4730ig5f6miiplhdvkmsb9ls1b8bbmw2vb4n"))))
      (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

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

      reply	other threads:[~2019-12-10 21:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-22 11:09 [bug#37478] [PATCH] Support canonical guix environment -l guix.scm Jan Nieuwenhuizen
2019-09-25 13:28 ` Ludovic Courtès
2019-10-05  9:25   ` Jan Nieuwenhuizen
2019-12-10  4:52     ` Brett Gilio
2019-12-10 18:45       ` Thompson, David
2019-12-10 20:59         ` Jan Nieuwenhuizen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a77z7v85.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=37478@debbugs.gnu.org \
    --cc=brettg@posteo.net \
    --cc=dthompson2@worcester.edu \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.