gnu: git-annex: Install manpages.

* gnu/packages/haskell-apps.scm (git-annex)[source]: Download using
git-fetch.
[arguments]: Rewrite 'build-manpages and 'install-manpages to use the
Makefile.

Change-Id: I58e58382e6d8c57830aa5ddb40f02cf949089aa1
This commit is contained in:
Efraim Flashner 2023-11-19 09:41:05 +02:00
parent f7ef5a7f46
commit d87ce1a336
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -297,10 +297,14 @@ (define-public git-annex
(version "10.20230828")
(source
(origin
(method url-fetch)
(uri (hackage-uri "git-annex" version))
;; hackage release doesn't include everything needed for extra bits.
(method git-fetch)
(uri (git-reference
(url "https://git.joeyh.name/git/git-annex.git")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32 "0pb6834dwjs9kdki977rfkdyg58dfzy8wfwvswrz3n7h6bcnjd0b"))))
(base32 "1k13mspwlpw6wwnf0cjlqcy3563kyprc6s5parrmsh07dysff7fi"))))
(build-system haskell-build-system)
(properties '((upstream-name . "git-annex")))
(arguments
@ -348,16 +352,7 @@ (define-public git-annex
(invoke "runhaskell" "PreConf.hs")))
(add-after 'build 'build-manpages
(lambda _
;; The Setup.hs rewrite above removed custom code for building
;; the man pages. In addition to that code, git-annex's source
;; tree has a file that's not included in the tarball but is used
;; by the Makefile to build man pages. Copy the core bits here.
(call-with-output-file "Build/MakeMans.hs"
(lambda (out)
(format out "module Main where~%")
(format out "import Build.Mans~%")
(format out "main = buildMansOrWarn~%")))
(invoke "runhaskell" "Build/MakeMans.hs")))
(invoke "make" "mans")))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
;; We need to set the path so that Git recognizes
@ -375,11 +370,8 @@ (define-public git-annex
(apply (assoc-ref %standard-phases 'build) args)))
(add-after 'install 'install-manpages
(lambda* (#:key outputs #:allow-other-keys)
(let ((man (string-append (assoc-ref outputs "out")
"/man/man1/")))
(mkdir-p man)
(for-each (lambda (file) (install-file file man))
(find-files "man")))))
(setenv "PREFIX" (assoc-ref outputs "out"))
(invoke "make" "install-mans")))
(add-after 'install 'install-symlinks
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))