gnu: git-lfs: Support building on more systems.

* gnu/packages/version-control.scm (git-lfs)[arguments]: Only run
man-page related phases when ruby-asciidoctor is available.
[native-inputs]: Only include ronn-ng, ruby-asciidoctor when building on
a platform which has support for ruby-asciidoctor.

Change-Id: Icbf8416998dc5d1f9d7c8299b4f929380dc29165
This commit is contained in:
Efraim Flashner 2023-11-08 09:25:24 +02:00
parent 5da6e8961c
commit e8739da12e
No known key found for this signature in database
GPG Key ID: 41AAE7DCCA3D8351

View File

@ -3188,26 +3188,33 @@ will reconstruct the object along its delta-base chain and return it.")
#$(file-append (this-package-input "go-golang-org-x-net") #$(file-append (this-package-input "go-golang-org-x-net")
"/src/golang.org/x/net/publicsuffix/data") "/src/golang.org/x/net/publicsuffix/data")
"src/golang.org/x/net/publicsuffix/data"))) "src/golang.org/x/net/publicsuffix/data")))
(add-before 'build 'man-gen ;; Only build the man pages if ruby-asciidoctor is available.
;; Without this, the binary generated in 'build #$@(if (this-package-native-input "ruby-asciidoctor")
;; phase won't have any embedded usage-text. #~((add-before 'build 'man-gen
(lambda _ ;; Without this, the binary generated in 'build
(with-directory-excursion "src/github.com/git-lfs/git-lfs" ;; phase won't have any embedded usage-text.
(invoke "make" "mangen")))) (lambda _
(add-after 'build 'build-man-pages (with-directory-excursion "src/github.com/git-lfs/git-lfs"
(lambda _ (invoke "make" "mangen"))))
(with-directory-excursion "src/github.com/git-lfs/git-lfs" (add-after 'build 'build-man-pages
(invoke "make" "man")))) (lambda _
(add-after 'install 'install-man-pages (with-directory-excursion "src/github.com/git-lfs/git-lfs"
(lambda* (#:key outputs #:allow-other-keys) (invoke "make" "man"))))
(with-directory-excursion "src/github.com/git-lfs/git-lfs/man" (add-after 'install 'install-man-pages
(for-each (lambda* (#:key outputs #:allow-other-keys)
(lambda (manpage) (with-directory-excursion "src/github.com/git-lfs/git-lfs/man"
(install-file manpage (for-each
(string-append #$output "/share/man/man1"))) (lambda (manpage)
(find-files "." "^git-lfs.*\\.1$")))))))) (install-file manpage
(string-append #$output "/share/man/man1")))
(find-files "." "^git-lfs.*\\.1$"))))))
#~()))))
;; make `ronn` available during build for man page generation ;; make `ronn` available during build for man page generation
(native-inputs (list ronn-ng git-minimal ruby-asciidoctor)) (native-inputs
(append (list git-minimal)
(if (supported-package? ruby-asciidoctor)
(list ronn-ng ruby-asciidoctor)
'())))
(propagated-inputs (propagated-inputs
(list go-github-com-xeipuuv-gojsonschema (list go-github-com-xeipuuv-gojsonschema
go-github-com-xeipuuv-gojsonreference go-github-com-xeipuuv-gojsonreference