From e8739da12e3cf9bc0477c3df65875de6a64d74c5 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 8 Nov 2023 09:25:24 +0200 Subject: 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 --- gnu/packages/version-control.scm | 45 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'gnu/packages/version-control.scm') diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 76fa8ef5d0..cf9a2f7a4c 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -3188,26 +3188,33 @@ (define-public git-lfs #$(file-append (this-package-input "go-golang-org-x-net") "/src/golang.org/x/net/publicsuffix/data") "src/golang.org/x/net/publicsuffix/data"))) - (add-before 'build 'man-gen - ;; Without this, the binary generated in 'build - ;; phase won't have any embedded usage-text. - (lambda _ - (with-directory-excursion "src/github.com/git-lfs/git-lfs" - (invoke "make" "mangen")))) - (add-after 'build 'build-man-pages - (lambda _ - (with-directory-excursion "src/github.com/git-lfs/git-lfs" - (invoke "make" "man")))) - (add-after 'install 'install-man-pages - (lambda* (#:key outputs #:allow-other-keys) - (with-directory-excursion "src/github.com/git-lfs/git-lfs/man" - (for-each - (lambda (manpage) - (install-file manpage - (string-append #$output "/share/man/man1"))) - (find-files "." "^git-lfs.*\\.1$")))))))) + ;; Only build the man pages if ruby-asciidoctor is available. + #$@(if (this-package-native-input "ruby-asciidoctor") + #~((add-before 'build 'man-gen + ;; Without this, the binary generated in 'build + ;; phase won't have any embedded usage-text. + (lambda _ + (with-directory-excursion "src/github.com/git-lfs/git-lfs" + (invoke "make" "mangen")))) + (add-after 'build 'build-man-pages + (lambda _ + (with-directory-excursion "src/github.com/git-lfs/git-lfs" + (invoke "make" "man")))) + (add-after 'install 'install-man-pages + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion "src/github.com/git-lfs/git-lfs/man" + (for-each + (lambda (manpage) + (install-file manpage + (string-append #$output "/share/man/man1"))) + (find-files "." "^git-lfs.*\\.1$")))))) + #~())))) ;; 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 (list go-github-com-xeipuuv-gojsonschema go-github-com-xeipuuv-gojsonreference -- cgit v1.2.3