diff options
| author | Christopher Baines <mail@cbaines.net> | 2019-04-23 00:57:19 +0100 |
|---|---|---|
| committer | Christopher Baines <mail@cbaines.net> | 2019-04-28 23:13:31 +0100 |
| commit | 81aa6c721b0277a24456ae78364929dc38cb7e57 (patch) | |
| tree | 4ddcfbfda986692e9e6398409fc2cea7f066b685 | |
| parent | d779de18175fe99f4ed490bc8af2e80571389144 (diff) | |
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.
| -rw-r--r-- | gnu/packages/shellutils.scm | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm index 59a8b744eb4..56359ce1603 100644 --- a/gnu/packages/shellutils.scm +++ b/gnu/packages/shellutils.scm | |||
| @@ -105,35 +105,40 @@ are already there.") | |||
| 105 | (name "direnv") | 105 | (name "direnv") |
| 106 | (version "2.15.2") | 106 | (version "2.15.2") |
| 107 | (source | 107 | (source |
| 108 | (origin (method url-fetch) | 108 | (origin (method git-fetch) |
| 109 | (uri (string-append "https://github.com/direnv/" name | 109 | (uri (git-reference |
| 110 | "/archive/v" version ".tar.gz")) | 110 | (url "https://github.com/direnv/direnv.git") |
| 111 | (file-name (string-append name "-" version ".tar.gz")) | 111 | (commit (string-append "v" version)))) |
| 112 | (file-name (git-file-name name version)) | ||
| 112 | (sha256 | 113 | (sha256 |
| 113 | (base32 | 114 | (base32 |
| 114 | "1hhmc6rb7b1d4s4kgb4blrq35h388ax37ap88dq3dgfcw9w6j1rm")))) | 115 | "1y18619pmhfl0vrf4w0h75ybkkwgi9wcb7d9kv4n8drg1xp4aw4w")))) |
| 115 | (build-system gnu-build-system) | 116 | (build-system go-build-system) |
| 116 | (arguments | 117 | (arguments |
| 117 | `(#:test-target "test" | 118 | '(#:import-path "github.com/direnv/direnv" |
| 118 | #:make-flags (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))) | ||
| 119 | #:modules ((guix build gnu-build-system) | ||
| 120 | ((guix build go-build-system) #:prefix go:) | ||
| 121 | (guix build union) | ||
| 122 | (guix build utils)) | ||
| 123 | #:imported-modules (,@%gnu-build-system-modules | ||
| 124 | (guix build union) | ||
| 125 | (guix build go-build-system)) | ||
| 126 | #:phases | 119 | #:phases |
| 127 | (modify-phases %standard-phases | 120 | (modify-phases %standard-phases |
| 128 | (delete 'configure) | 121 | (add-after 'unpack 'delete-vendor |
| 129 | ;; Help the build scripts find the Go language dependencies. | 122 | (lambda _ |
| 130 | (add-before 'unpack 'setup-go-environment | 123 | ;; Using a snippet causes issues with the name of the directory, |
| 131 | (assoc-ref go:%standard-phases 'setup-go-environment)) | 124 | ;; so delete the extra source code here. |
| 132 | (add-after 'install 'remove-go-references | 125 | (delete-file-recursively "src/github.com/direnv/direnv/vendor") |
| 133 | (assoc-ref go:%standard-phases 'remove-go-references))))) | 126 | #t)) |
| 127 | (replace 'check | ||
| 128 | (lambda* (#:key tests? #:allow-other-keys) | ||
| 129 | (when tests? | ||
| 130 | (setenv "HOME" "/tmp") | ||
| 131 | (with-directory-excursion "src/github.com/direnv/direnv" | ||
| 132 | ;; The following file needs to be writable so it can be | ||
| 133 | ;; modified by the testsuite. | ||
| 134 | (make-file-writable "test/scenarios/base/.envrc") | ||
| 135 | (invoke "make" "test") | ||
| 136 | ;; Clean up from the tests, especially so that the extra | ||
| 137 | ;; direnv executable that's generated is removed. | ||
| 138 | (invoke "make" "clean"))) | ||
| 139 | #t))))) | ||
| 134 | (native-inputs | 140 | (native-inputs |
| 135 | `(("go" ,go) | 141 | `(("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml) |
| 136 | ("go-github-com-burntsushi-toml" ,go-github-com-burntsushi-toml) | ||
| 137 | ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv) | 142 | ("go-github-com-direnv-go-dotenv" ,go-github-com-direnv-go-dotenv) |
| 138 | ("which" ,which))) | 143 | ("which" ,which))) |
| 139 | (home-page "https://direnv.net/") | 144 | (home-page "https://direnv.net/") |
