diff options
author | Kyle Meyer <kyle@kyleam.com> | 2019-07-21 15:50:57 -0400 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2019-08-08 20:14:14 +0200 |
commit | 3d45d8f14bea0468494442597e005c9a6b46155b (patch) | |
tree | 1eb640a951bf4987bef527dd1037d5f4d1bc4009 /gnu/packages/haskell-apps.scm | |
parent | deccffb264e2027fb439735f5d71f7d01071a4fd (diff) | |
download | patches-3d45d8f14bea0468494442597e005c9a6b46155b.tar patches-3d45d8f14bea0468494442597e005c9a6b46155b.tar.gz |
gnu: git-annex: Don't patch shebang used in hooks.
git-annex relies on configuring Git's pre-commit and post-receive hooks.
Avoid patching the shebang that git-annex embeds when generating these hooks
so that the hooks don't fail if garbage collection claims the bash that was
current when the annex repository was initialized.
* gnu/packages/haskell-apps.scm (git-annex):[arguments]: Patch hook shebangs
only temporarily for tests.
Signed-off-by: Marius Bakke <mbakke@fastmail.com>
Diffstat (limited to 'gnu/packages/haskell-apps.scm')
-rw-r--r-- | gnu/packages/haskell-apps.scm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm index e01f796178..818e691a6e 100644 --- a/gnu/packages/haskell-apps.scm +++ b/gnu/packages/haskell-apps.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name> ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> +;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -157,8 +158,13 @@ unique algebra of patches called @url{http://darcs.net/Theory,Patchtheory}. '("--flags=-Android -Assistant -Pairing -S3 -Webapp -WebDAV") #:phases (modify-phases %standard-phases - (add-before 'configure 'patch-shell + (add-before 'configure 'patch-shell-for-tests (lambda _ + ;; Shell.hs defines "/bin/sh" that is used in Git hooks. We + ;; shouldn't patch hooks with Guix's current bash because the + ;; hooks can exist after that bash is garbage collected, but + ;; let's temporarily patch it so that we can run the tests. + (copy-file "Utility/Shell.hs" "/tmp/Shell.hs") (substitute* "Utility/Shell.hs" (("/bin/sh") (which "sh"))) #t)) @@ -192,6 +198,11 @@ unique algebra of patches called @url{http://darcs.net/Theory,Patchtheory}. (symlink "git-annex" "git-annex-shell")) (invoke "git-annex" "test") #t)) + (add-after 'check 'unpatch-shell-and-rebuild + (lambda args + ;; Undo `patch-shell-for-tests'. + (copy-file "/tmp/Shell.hs" "Utility/Shell.hs") + (apply (assoc-ref %standard-phases 'build) args))) (add-after 'install 'install-symlinks (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) |