gnu: direnv: Change to the go-build-system.

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.
This commit is contained in:
Christopher Baines 2019-04-23 00:57:19 +01:00
parent d779de1817
commit 81aa6c721b
No known key found for this signature in database
GPG Key ID: 5E28A33B0B84F577
1 changed files with 28 additions and 23 deletions

View File

@ -105,35 +105,40 @@ are already there.")
(name "direnv") (name "direnv")
(version "2.15.2") (version "2.15.2")
(source (source
(origin (method url-fetch) (origin (method git-fetch)
(uri (string-append "https://github.com/direnv/" name (uri (git-reference
"/archive/v" version ".tar.gz")) (url "https://github.com/direnv/direnv.git")
(file-name (string-append name "-" version ".tar.gz")) (commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256 (sha256
(base32 (base32
"1hhmc6rb7b1d4s4kgb4blrq35h388ax37ap88dq3dgfcw9w6j1rm")))) "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w"))))
(build-system gnu-build-system) (build-system go-build-system)
(arguments (arguments
`(#:test-target "test" '(#:import-path "github.com/direnv/direnv"
#: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))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(delete 'configure) (add-after 'unpack 'delete-vendor
;; Help the build scripts find the Go language dependencies. (lambda _
(add-before 'unpack 'setup-go-environment ;; Using a snippet causes issues with the name of the directory,
(assoc-ref go:%standard-phases 'setup-go-environment)) ;; so delete the extra source code here.
(add-after 'install 'remove-go-references (delete-file-recursively "src/github.com/direnv/direnv/vendor")
(assoc-ref go:%standard-phases 'remove-go-references))))) #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 (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) ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv)
("which" ,which))) ("which" ,which)))
(home-page "https://direnv.net/") (home-page "https://direnv.net/")