[PATCH] gnu: direnv: Change to the go-build-system.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal
C
C
Christopher Baines wrote on 23 Apr 2019 01:57
(address . guix-patches@gnu.org)
20190422235719.5427-1-mail@cbaines.net
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(-)

Toggle diff (70 lines)
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
L
L
Ludovic Courtès wrote on 29 Apr 2019 09:58
(name . Christopher Baines)(address . mail@cbaines.net)(address . 35386@debbugs.gnu.org)
87pnp5i6o1.fsf@gnu.org
Hello Chris,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (12 lines)
> 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’.
C
C
Christopher Baines wrote on 29 Apr 2019 21:42
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 35386-done@debbugs.gnu.org)
87y33sr41u.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (18 lines)
> Hello Chris,
>
> Christopher Baines <mail@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 :)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlzHU75fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XeYDw//ajrn2Exlax5CLz/qMRT5Sb91poT8uYVJ6GCjHicF0XtYLkqadmCQpWIT
lFJ0Opp/qbTeICjqrMO1lVlLU+9jWrcXaeKp1vDkAcxCejvhziGEWI/UpS6fk7eo
pSa4RXqkXiuerFpPjwPsETEBAyDhzf3sNUdavLW5ovNDWbvWg/qAEJ2XxfbYgwRP
NCDZ4Z2+YU0LBc9HevrVChrOhyvYmmqpk0jXws4HRd3KC/UXpQXqMF7EbkGvLLoI
Khj4BozEyYqylHBJL79TVIuPOvqxaw2nQyNryV3gA1CJUrLeU4SqjGMPJTanDt75
qfF9hON12az/YbvzbpXaA49p8sDOwlSJxgyxM2lClZ3g9Qj++zhDItx7Q8TCdmVQ
dLADmUMAvZ4p9SrgqzJMN2IleEqyTyzU7li8M6HLCj3XO5t7GJ+o1lC+l6LBw4vd
M/2HjEaZe25/IE+U+GkcDLsPzUzOeLWGwxL5u5Zr3njFHcg/d2aUdme/2Yyb5i9w
lMoAidKnLnTKnE4czAH9DZZgBfr7Jh70Klx638yBSWntZ94KgpQJxqLGnUZeZro0
BfUF51GpvWJ+JH6FA8iL+efKecS48xaSyRgLgR2UWzFn+Xweu6zdP/z4b3V52VJZ
ZrgB99UDVzqhnp3Csy5m8tDmxjQ/LV0QvKw1nq8TRRkQ+fMJRcI=
=+MKQ
-----END PGP SIGNATURE-----

Closed
?