GNU bug report logs - #35386
[PATCH] gnu: direnv: Change to the go-build-system.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Mon, 22 Apr 2019 23:58:02 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35386 in the body.
You can then email your comments to 35386 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#35386; Package guix-patches. (Mon, 22 Apr 2019 23:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Baines <mail <at> cbaines.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 22 Apr 2019 23:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: direnv: Change to the go-build-system.
Date: Tue, 23 Apr 2019 00:57:19 +0100
The go-build-system is slightly more appropriate, and switching resolves an
issue with combining the 'unpack phase from the gnu-build-system, and the
'setup-go-environment from the go-build-system. With both of those phases
creating a directory, the first-subdirectory call at the end of the 'unpack
phase can return different values depending on the filesystem ordering.

* gnu/packages/shellutils.scm (direnv)[source]: Use the git repository, as
this works better with the go-build-system.
[build-system]: Change to the go-build-system.
[arguments]: Adjust for the go-build-system.
[native-inputs]: Remove go.
---
 gnu/packages/shellutils.scm | 51 ++++++++++++++++++++-----------------
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 59a8b744eb..56359ce160 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -105,35 +105,40 @@ are already there.")
     (name "direnv")
     (version "2.15.2")
     (source
-     (origin (method url-fetch)
-             (uri (string-append "https://github.com/direnv/" name
-                                 "/archive/v" version ".tar.gz"))
-             (file-name (string-append name "-" version ".tar.gz"))
+     (origin (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/direnv/direnv.git")
+                   (commit (string-append "v" version))))
+             (file-name (git-file-name name version))
              (sha256
               (base32
-               "1hhmc6rb7b1d4s4kgb4blrq35h388ax37ap88dq3dgfcw9w6j1rm"))))
-    (build-system gnu-build-system)
+               "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w"))))
+    (build-system go-build-system)
     (arguments
-     `(#:test-target "test"
-       #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
-       #:modules ((guix build gnu-build-system)
-                  ((guix build go-build-system) #:prefix go:)
-                  (guix build union)
-                  (guix build utils))
-       #:imported-modules (,@%gnu-build-system-modules
-                            (guix build union)
-                            (guix build go-build-system))
+     '(#:import-path "github.com/direnv/direnv"
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure)
-         ;; Help the build scripts find the Go language dependencies.
-         (add-before 'unpack 'setup-go-environment
-           (assoc-ref go:%standard-phases 'setup-go-environment))
-         (add-after 'install 'remove-go-references
-           (assoc-ref go:%standard-phases 'remove-go-references)))))
+         (add-after 'unpack 'delete-vendor
+           (lambda _
+             ;; Using a snippet causes issues with the name of the directory,
+             ;; so delete the extra source code here.
+             (delete-file-recursively "src/github.com/direnv/direnv/vendor")
+             #t))
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (setenv "HOME" "/tmp")
+               (with-directory-excursion "src/github.com/direnv/direnv"
+                 ;; The following file needs to be writable so it can be
+                 ;; modified by the testsuite.
+                 (make-file-writable "test/scenarios/base/.envrc")
+                 (invoke "make" "test")
+                 ;; Clean up from the tests, especially so that the extra
+                 ;; direnv executable that's generated is removed.
+                 (invoke "make" "clean")))
+             #t)))))
     (native-inputs
-     `(("go" ,go)
-       ("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
+     `(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml)
        ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)
        ("which" ,which)))
     (home-page "https://direnv.net/")
-- 
2.21.0





Information forwarded to guix-patches <at> gnu.org:
bug#35386; Package guix-patches. (Mon, 29 Apr 2019 08:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 35386 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 35386 <at> debbugs.gnu.org
Subject: Re: [bug#35386] [PATCH] gnu: direnv: Change to the go-build-system.
Date: Mon, 29 Apr 2019 09:58:54 +0200
Hello Chris,

Christopher Baines <mail <at> cbaines.net> skribis:

> The go-build-system is slightly more appropriate, and switching resolves an
> issue with combining the 'unpack phase from the gnu-build-system, and the
> 'setup-go-environment from the go-build-system. With both of those phases
> creating a directory, the first-subdirectory call at the end of the 'unpack
> phase can return different values depending on the filesystem ordering.
>
> * gnu/packages/shellutils.scm (direnv)[source]: Use the git repository, as
> this works better with the go-build-system.
> [build-system]: Change to the go-build-system.
> [arguments]: Adjust for the go-build-system.
> [native-inputs]: Remove go.

It does look a bit nicer this way, go for it!

Thanks,
Ludo’.




Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Mon, 29 Apr 2019 19:44:01 GMT) Full text and rfc822 format available.

Notification sent to Christopher Baines <mail <at> cbaines.net>:
bug acknowledged by developer. (Mon, 29 Apr 2019 19:44:02 GMT) Full text and rfc822 format available.

Message #13 received at 35386-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 35386-done <at> debbugs.gnu.org
Subject: Re: [bug#35386] [PATCH] gnu: direnv: Change to the go-build-system.
Date: Mon, 29 Apr 2019 20:42:53 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello Chris,
>
> Christopher Baines <mail <at> cbaines.net> skribis:
>
>> The go-build-system is slightly more appropriate, and switching resolves an
>> issue with combining the 'unpack phase from the gnu-build-system, and the
>> 'setup-go-environment from the go-build-system. With both of those phases
>> creating a directory, the first-subdirectory call at the end of the 'unpack
>> phase can return different values depending on the filesystem ordering.
>>
>> * gnu/packages/shellutils.scm (direnv)[source]: Use the git repository, as
>> this works better with the go-build-system.
>> [build-system]: Change to the go-build-system.
>> [arguments]: Adjust for the go-build-system.
>> [native-inputs]: Remove go.
>
> It does look a bit nicer this way, go for it!

Great, I actually pushed this yesterday, and was slow with closing the
bug.

Thanks for taking a look :)
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 28 May 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 327 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.