mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-27 23:02:16 -05:00
gnu: git: Invert inheritance relationship.
It's simpler to add features on top of a minimal variant than to remove them, and helps avoiding mistakenly changing git-minimal, which has many dependents. * gnu/packages/version-control.scm (git-minimal): Move above git and severe inheritance. Remove input label. Repatriate most fields from... (git): ... here. Define as package/inherit to inherit from git-minimal. Extend minimal values instead of overriding them whole. Reviewed-by: Liliana Marie Prikler <liliana.prikler@gmail.com> Change-Id: Ia0ef0e7e4f007c2fafad3550344638b6661a408b
This commit is contained in:
parent
f288604428
commit
59505384c3
1 changed files with 288 additions and 307 deletions
|
@ -236,13 +236,16 @@ (define-public bazaar
|
||||||
(deprecated-package "bazaar" breezy))
|
(deprecated-package "bazaar" breezy))
|
||||||
|
|
||||||
(define git-cross-configure-flags
|
(define git-cross-configure-flags
|
||||||
'("ac_cv_fread_reads_directories=yes"
|
#~(list "ac_cv_fread_reads_directories=yes"
|
||||||
"ac_cv_snprintf_returns_bogus=no"
|
"ac_cv_snprintf_returns_bogus=no"
|
||||||
"ac_cv_iconv_omits_bom=no"))
|
"ac_cv_iconv_omits_bom=no"))
|
||||||
|
|
||||||
(define-public git
|
;; The size of the closure of 'git-minimal' is two thirds that of 'git'.
|
||||||
|
;; Its test suite runs slightly faster and most importantly it doesn't
|
||||||
|
;; depend on packages that are expensive to build such as Subversion.
|
||||||
|
(define-public git-minimal
|
||||||
(package
|
(package
|
||||||
(name "git")
|
(name "git-minimal")
|
||||||
(version "2.45.2")
|
(version "2.45.2")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
|
@ -252,60 +255,19 @@ (define-public git
|
||||||
(base32
|
(base32
|
||||||
"1nws1vjgj54sv32wxl1h3n1jkcpabqv7a605hhafsby0n5zfigsi"))))
|
"1nws1vjgj54sv32wxl1h3n1jkcpabqv7a605hhafsby0n5zfigsi"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
(native-inputs
|
|
||||||
(list perl
|
|
||||||
;; Add bash-minimal explicitly to ensure it comes before bash-for-tests,
|
|
||||||
;; see <https://bugs.gnu.org/39513>.
|
|
||||||
bash-minimal
|
|
||||||
bash
|
|
||||||
gettext-minimal
|
|
||||||
;; For subtree documentation.
|
|
||||||
asciidoc
|
|
||||||
docbook2x
|
|
||||||
docbook-xsl
|
|
||||||
libxslt
|
|
||||||
pkg-config
|
|
||||||
texinfo
|
|
||||||
xmlto))
|
|
||||||
(inputs
|
|
||||||
(list curl
|
|
||||||
expat
|
|
||||||
openssl
|
|
||||||
perl
|
|
||||||
python ;for git-p4
|
|
||||||
zlib
|
|
||||||
|
|
||||||
;; For PCRE support in git grep (USE_LIBPCRE2).
|
|
||||||
pcre2
|
|
||||||
|
|
||||||
;; For 'gitweb.cgi'.
|
|
||||||
perl-cgi
|
|
||||||
|
|
||||||
;; For 'git-svn'.
|
|
||||||
subversion
|
|
||||||
perl-term-readkey
|
|
||||||
|
|
||||||
;; For 'git-send-email'.
|
|
||||||
perl-authen-sasl
|
|
||||||
perl-net-smtp-ssl
|
|
||||||
perl-io-socket-ssl
|
|
||||||
|
|
||||||
;; For 'git gui', 'gitk', and 'git citool'.
|
|
||||||
tcl
|
|
||||||
tk
|
|
||||||
|
|
||||||
;; For 'git-credential-libsecret'
|
|
||||||
glib
|
|
||||||
libsecret))
|
|
||||||
(outputs '("out" ;the core
|
|
||||||
"send-email" ;for git-send-email
|
|
||||||
"svn" ;git-svn
|
|
||||||
"credential-netrc" ;git-credential-netrc
|
|
||||||
"credential-libsecret" ;git-credential-libsecret
|
|
||||||
"subtree" ;git-subtree
|
|
||||||
"gui")) ;gitk, git gui
|
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
|
#:modules `((srfi srfi-1)
|
||||||
|
(srfi srfi-26)
|
||||||
|
((guix build gnu-build-system) #:prefix gnu:)
|
||||||
|
,@%gnu-build-system-modules)
|
||||||
|
;; Make sure the full bash does not end up in the final closure.
|
||||||
|
#:disallowed-references (list bash perl)
|
||||||
|
#:test-target "test"
|
||||||
|
#:configure-flags
|
||||||
|
(if (%current-target-system)
|
||||||
|
git-cross-configure-flags
|
||||||
|
#~(list))
|
||||||
#:make-flags
|
#:make-flags
|
||||||
#~(list "V=1" ;more verbose compilation
|
#~(list "V=1" ;more verbose compilation
|
||||||
(string-append "SHELL_PATH="
|
(string-append "SHELL_PATH="
|
||||||
|
@ -317,32 +279,10 @@ (define-public git
|
||||||
#$(this-package-native-input "bash")
|
#$(this-package-native-input "bash")
|
||||||
"/bin/bash")
|
"/bin/bash")
|
||||||
|
|
||||||
"USE_LIBPCRE2=yes"
|
|
||||||
|
|
||||||
;; By default 'make install' creates hard links for
|
;; By default 'make install' creates hard links for
|
||||||
;; things in 'libexec/git-core', which leads to huge
|
;; things in 'libexec/git-core', which leads to huge
|
||||||
;; nars; see <https://bugs.gnu.org/21949>.
|
;; nars; see <https://bugs.gnu.org/21949>.
|
||||||
"NO_INSTALL_HARDLINKS=indeed")
|
"NO_INSTALL_HARDLINKS=indeed")
|
||||||
|
|
||||||
;; Make sure the full bash does not end up in the final closure.
|
|
||||||
#:disallowed-references (list bash)
|
|
||||||
|
|
||||||
#:test-target "test"
|
|
||||||
|
|
||||||
;; The explicit --with-tcltk forces the build system to hardcode the
|
|
||||||
;; absolute file name to 'wish'.
|
|
||||||
#:configure-flags
|
|
||||||
#~(list (string-append "--with-tcltk="
|
|
||||||
(search-input-file %build-inputs
|
|
||||||
"bin/wish8.6"))
|
|
||||||
#$@(if (%current-target-system)
|
|
||||||
git-cross-configure-flags
|
|
||||||
#~()))
|
|
||||||
|
|
||||||
#:modules `((srfi srfi-1)
|
|
||||||
(srfi srfi-26)
|
|
||||||
((guix build gnu-build-system) #:prefix gnu:)
|
|
||||||
,@%gnu-build-system-modules)
|
|
||||||
#:phases
|
#:phases
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
#$@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
|
@ -366,6 +306,13 @@ (define-public git
|
||||||
(remove (cut string-prefix? bash-full <>)
|
(remove (cut string-prefix? bash-full <>)
|
||||||
path)
|
path)
|
||||||
":")))))))
|
":")))))))
|
||||||
|
#$@(if (system-hurd?)
|
||||||
|
#~((add-after 'unpack 'delete-tests/hurd
|
||||||
|
(lambda _
|
||||||
|
(delete-file "t/t0052-simple-ipc.sh")
|
||||||
|
(delete-file "t/t5562-http-backend-content-length.sh")
|
||||||
|
(delete-file "t/t9902-completion.sh"))))
|
||||||
|
#~())
|
||||||
;; Add cross curl-config script to PATH when cross-compiling.
|
;; Add cross curl-config script to PATH when cross-compiling.
|
||||||
#$@(if (%current-target-system)
|
#$@(if (%current-target-system)
|
||||||
#~((add-before 'configure 'add-cross-curl-config
|
#~((add-before 'configure 'add-cross-curl-config
|
||||||
|
@ -379,34 +326,11 @@ (define-public git
|
||||||
(add-after 'configure 'patch-makefiles
|
(add-after 'configure 'patch-makefiles
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "Makefile"
|
(substitute* "Makefile"
|
||||||
(("/usr/bin/perl") (which "perl"))
|
(("/usr/bin/perl") (which "perl")))))
|
||||||
(("/usr/bin/python") (which "python3")))))
|
|
||||||
(add-after 'configure 'add-PM.stamp
|
(add-after 'configure 'add-PM.stamp
|
||||||
(lambda _
|
(lambda _
|
||||||
;; Add the "PM.stamp" to avoid "no rule to make target".
|
;; Add the "PM.stamp" to avoid "no rule to make target".
|
||||||
(call-with-output-file "perl/PM.stamp" (const #t))))
|
(call-with-output-file "perl/PM.stamp" (const #t))))
|
||||||
(add-after 'build 'build-subtree
|
|
||||||
(lambda* (#:key native-inputs inputs #:allow-other-keys)
|
|
||||||
(with-directory-excursion "contrib/subtree"
|
|
||||||
(substitute* "Makefile"
|
|
||||||
;; Apparently `xmlto' does not bother to looks up the
|
|
||||||
;; stylesheets specified in the XML, unlike the above
|
|
||||||
;; substitution. Instead it uses a hard-coded URL. Work
|
|
||||||
;; around it here, but if this is common perhaps we should
|
|
||||||
;; hardcode this path in xmlto itself.
|
|
||||||
(("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)")
|
|
||||||
(string-append "$(XMLTO) -x "
|
|
||||||
(search-input-directory
|
|
||||||
(or native-inputs inputs)
|
|
||||||
(string-append
|
|
||||||
"xml/xsl/docbook-xsl-"
|
|
||||||
#$(package-version docbook-xsl)))
|
|
||||||
"/manpages/docbook.xsl -m $(MANPAGE_XSL)")))
|
|
||||||
(invoke "make")
|
|
||||||
(invoke "make" "install")
|
|
||||||
(invoke "make" "install-doc")
|
|
||||||
(substitute* "git-subtree"
|
|
||||||
(("/bin/sh") (which "sh"))))))
|
|
||||||
(add-before 'check 'patch-tests
|
(add-before 'check 'patch-tests
|
||||||
(lambda _
|
(lambda _
|
||||||
(let ((store-directory (%store-directory)))
|
(let ((store-directory (%store-directory)))
|
||||||
|
@ -448,16 +372,6 @@ (define-public git
|
||||||
'("t/t9128-git-svn-cmd-branch.sh"
|
'("t/t9128-git-svn-cmd-branch.sh"
|
||||||
"t/t9167-git-svn-cmd-branch-subproject.sh"
|
"t/t9167-git-svn-cmd-branch-subproject.sh"
|
||||||
"t/t9141-git-svn-multiple-branches.sh")))))
|
"t/t9141-git-svn-multiple-branches.sh")))))
|
||||||
(add-after 'install 'install-info-manual
|
|
||||||
(lambda* (#:key parallel-build? #:allow-other-keys)
|
|
||||||
(define job-count (if parallel-build?
|
|
||||||
(number->string (parallel-job-count))
|
|
||||||
"1"))
|
|
||||||
(invoke "make" "-C" "Documentation" "install-info"
|
|
||||||
"-j" job-count
|
|
||||||
;; The Makefile refer to 'docbook2x-texi', but our binary
|
|
||||||
;; is named 'docbook2texi'.
|
|
||||||
"DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl")))
|
|
||||||
(add-after 'install 'install-shell-completion
|
(add-after 'install 'install-shell-completion
|
||||||
(lambda _
|
(lambda _
|
||||||
(let ((completions (string-append #$output
|
(let ((completions (string-append #$output
|
||||||
|
@ -467,36 +381,34 @@ (define job-count (if parallel-build?
|
||||||
(mkdir-p completions)
|
(mkdir-p completions)
|
||||||
(copy-file "contrib/completion/git-completion.bash"
|
(copy-file "contrib/completion/git-completion.bash"
|
||||||
(string-append completions "/git")))))
|
(string-append completions "/git")))))
|
||||||
(add-after 'install 'install-credential-netrc
|
(add-after 'install 'remove-unusable-perl-commands
|
||||||
(lambda _
|
(lambda _
|
||||||
(install-file "contrib/credential/netrc/git-credential-netrc.perl"
|
(let ((bin (string-append #$output "/bin"))
|
||||||
(string-append #$output:credential-netrc "/bin"))
|
(libexec (string-append #$output "/libexec")))
|
||||||
(rename-file (string-append #$output:credential-netrc
|
(for-each (lambda (file)
|
||||||
"/bin/git-credential-netrc.perl")
|
(delete-file (string-append libexec
|
||||||
(string-append #$output:credential-netrc
|
"/git-core/" file)))
|
||||||
"/bin/git-credential-netrc"))
|
'("git-svn" "git-cvsimport" "git-archimport"
|
||||||
;; Previously, Git.pm was automatically found by netrc.
|
"git-cvsserver" "git-request-pull"
|
||||||
;; Perl 5.26 changed how it locates modules so that @INC no
|
|
||||||
;; longer includes the current working directory (the Perl
|
;; git-add--interactive was removed in Git 2.40 but
|
||||||
;; community calls this "dotless @INC").
|
;; this phase is inherited by older versions.
|
||||||
(wrap-program (string-append #$output:credential-netrc
|
#$@(if (version>=? (package-version this-package)
|
||||||
"/bin/git-credential-netrc")
|
"2.40.1")
|
||||||
`("PERL5LIB" ":" prefix
|
#~()
|
||||||
(,(string-append #$output "/share/perl5"))))))
|
#~("git-add--interactive"))
|
||||||
(add-after 'install 'install-credential-libsecret
|
|
||||||
(lambda _
|
"git-cvsexportcommit"
|
||||||
(with-directory-excursion "contrib/credential/libsecret"
|
"git-instaweb" "git-send-email"))
|
||||||
((assoc-ref gnu:%standard-phases 'build))
|
(delete-file (string-append bin "/git-cvsserver"))
|
||||||
(install-file "git-credential-libsecret"
|
|
||||||
(string-append #$output:credential-libsecret
|
;; These templates typically depend on Perl. Remove them.
|
||||||
"/bin")))))
|
(delete-file-recursively
|
||||||
(add-after 'install 'install-subtree
|
(string-append #$output "/share/git-core/templates/hooks"))
|
||||||
(lambda _
|
|
||||||
(install-file "contrib/subtree/git-subtree"
|
;; Gitweb depends on Perl as well.
|
||||||
(string-append #$output:subtree "/bin"))
|
(delete-file-recursively
|
||||||
(install-file "contrib/subtree/git-subtree.1"
|
(string-append #$output "/share/gitweb")))))
|
||||||
(string-append #$output:subtree
|
|
||||||
"/share/man/man1"))))
|
|
||||||
(add-after 'install 'restore-sample-hooks-shebang
|
(add-after 'install 'restore-sample-hooks-shebang
|
||||||
(lambda _
|
(lambda _
|
||||||
(let* ((dir (string-append #$output
|
(let* ((dir (string-append #$output
|
||||||
|
@ -505,111 +417,20 @@ (define job-count (if parallel-build?
|
||||||
(format #t "restoring shebang on `~a'~%" file)
|
(format #t "restoring shebang on `~a'~%" file)
|
||||||
(substitute* file
|
(substitute* file
|
||||||
(("^#!.*/bin/sh") "#!/bin/sh")))
|
(("^#!.*/bin/sh") "#!/bin/sh")))
|
||||||
(find-files dir ".*")))))
|
(find-files dir ".*"))))))))
|
||||||
(add-after 'install 'split
|
(native-inputs
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
;; Add bash-minimal explicitly to ensure it comes before bash-for-tests,
|
||||||
;; Split the binaries to the various outputs.
|
;; see <https://bugs.gnu.org/39513>.
|
||||||
(let* ((out #$output)
|
(list bash-minimal
|
||||||
(se #$output:send-email)
|
bash
|
||||||
(svn #$output:svn)
|
gettext-minimal
|
||||||
(gui #$output:gui)
|
perl))
|
||||||
(gitk (string-append out "/bin/gitk"))
|
(inputs
|
||||||
(gitk* (string-append gui "/bin/gitk"))
|
(list curl ;for HTTP(S) access
|
||||||
(git-gui (string-append
|
expat ;for 'git push' over HTTP(S)
|
||||||
out "/libexec/git-core/git-gui"))
|
openssl
|
||||||
(git-gui* (string-append gui "/libexec/git-core/git-gui"))
|
perl
|
||||||
(git-cit (string-append
|
zlib))
|
||||||
out "/libexec/git-core/git-citool"))
|
|
||||||
(git-cit* (string-append
|
|
||||||
gui "/libexec/git-core/git-citool"))
|
|
||||||
(git-se (string-append
|
|
||||||
out "/libexec/git-core/git-send-email"))
|
|
||||||
(git-se* (string-append
|
|
||||||
se "/libexec/git-core/git-send-email"))
|
|
||||||
(git-svn (string-append out "/libexec/git-core/git-svn"))
|
|
||||||
(git-svn* (string-append svn "/libexec/git-core/git-svn"))
|
|
||||||
(git-sm (string-append
|
|
||||||
out "/libexec/git-core/git-submodule")))
|
|
||||||
(mkdir-p (string-append gui "/bin"))
|
|
||||||
(mkdir-p (string-append gui "/libexec/git-core"))
|
|
||||||
(mkdir-p (string-append se "/libexec/git-core"))
|
|
||||||
(mkdir-p (string-append svn "/libexec/git-core"))
|
|
||||||
|
|
||||||
(for-each (lambda (old new)
|
|
||||||
(copy-file old new)
|
|
||||||
(delete-file old)
|
|
||||||
(chmod new #o555))
|
|
||||||
(list gitk git-gui git-cit git-se git-svn)
|
|
||||||
(list gitk* git-gui* git-cit* git-se* git-svn*))
|
|
||||||
|
|
||||||
;; Tell 'git-svn' where Subversion and perl-term-readkey are.
|
|
||||||
|
|
||||||
;; FIXME: Old school 'assoc-ref' is used to retrieve
|
|
||||||
;; subversion here, as #$(this-package-input "subversion")
|
|
||||||
;; causes a dependency cycle for unknown reasons.
|
|
||||||
(wrap-program git-svn*
|
|
||||||
`("PATH" ":" prefix
|
|
||||||
(,(dirname (search-input-file inputs "bin/perl"))))
|
|
||||||
`("PERL5LIB" ":" prefix
|
|
||||||
,(search-path-as-list
|
|
||||||
'("lib/perl5/site_perl")
|
|
||||||
(list (assoc-ref inputs "subversion")
|
|
||||||
#$(this-package-input "perl-term-readkey"))))
|
|
||||||
|
|
||||||
;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
|
|
||||||
;; help it find 'libsvn_client-1.so'.
|
|
||||||
`("LD_LIBRARY_PATH" ":" prefix
|
|
||||||
(,(string-append (assoc-ref inputs "subversion")
|
|
||||||
"/lib"))))
|
|
||||||
|
|
||||||
;; Tell 'git-send-email' where perl modules are.
|
|
||||||
(wrap-program git-se*
|
|
||||||
`("PERL5LIB" ":" prefix
|
|
||||||
,(search-path-as-list
|
|
||||||
'("lib/perl5/site_perl")
|
|
||||||
'#$(delete-duplicates
|
|
||||||
(append-map
|
|
||||||
(compose last package-transitive-propagated-inputs)
|
|
||||||
(list (this-package-input "perl-authen-sasl")
|
|
||||||
(this-package-input "perl-net-smtp-ssl")
|
|
||||||
(this-package-input "perl-io-socket-ssl")))))))
|
|
||||||
;; Tell 'gitweb.cgi' where perl modules are.
|
|
||||||
(wrap-program (string-append out "/share/gitweb/gitweb.cgi")
|
|
||||||
`("PERL5LIB" ":" prefix
|
|
||||||
,(search-path-as-list
|
|
||||||
'("lib/perl5/site_perl")
|
|
||||||
'#$(delete-duplicates
|
|
||||||
(append-map
|
|
||||||
(compose last package-transitive-propagated-inputs)
|
|
||||||
(list (this-package-input "perl-cgi")))))))
|
|
||||||
|
|
||||||
;; Tell 'git-submodule' where Perl is.
|
|
||||||
(wrap-program git-sm
|
|
||||||
`("PATH" ":" prefix
|
|
||||||
(,(dirname (search-input-file inputs "bin/perl"))))))))
|
|
||||||
(add-after 'split 'install-man-pages
|
|
||||||
(lambda _
|
|
||||||
(let ((man (string-append #$output "/share/man")))
|
|
||||||
(mkdir-p man)
|
|
||||||
(with-directory-excursion man
|
|
||||||
(invoke
|
|
||||||
"tar" "xvf"
|
|
||||||
#$(origin
|
|
||||||
(method url-fetch)
|
|
||||||
(uri (string-append
|
|
||||||
"mirror://kernel.org/software/scm/git/"
|
|
||||||
"git-manpages-" version ".tar.xz"))
|
|
||||||
(sha256
|
|
||||||
(base32
|
|
||||||
"1w6r2liifafsxydmc48p578z7z70ys0spm6qp5ygdd0l26mxf8p6"))))))))
|
|
||||||
#$@(if (system-hurd?)
|
|
||||||
#~((add-after 'unpack 'delete-tests/hurd
|
|
||||||
(lambda _
|
|
||||||
(delete-file "t/t0052-simple-ipc.sh")
|
|
||||||
(delete-file "t/t5562-http-backend-content-length.sh")
|
|
||||||
(delete-file "t/t9902-completion.sh"))))
|
|
||||||
#~()))))
|
|
||||||
|
|
||||||
(native-search-paths
|
(native-search-paths
|
||||||
;; For HTTPS access, Git needs a single-file certificate bundle, specified
|
;; For HTTPS access, Git needs a single-file certificate bundle, specified
|
||||||
;; with $GIT_SSL_CAINFO.
|
;; with $GIT_SSL_CAINFO.
|
||||||
|
@ -622,7 +443,6 @@ (define job-count (if parallel-build?
|
||||||
(variable "GIT_EXEC_PATH")
|
(variable "GIT_EXEC_PATH")
|
||||||
(separator #f) ;single entry
|
(separator #f) ;single entry
|
||||||
(files '("libexec/git-core")))))
|
(files '("libexec/git-core")))))
|
||||||
|
|
||||||
(synopsis "Distributed version control system")
|
(synopsis "Distributed version control system")
|
||||||
(description
|
(description
|
||||||
"Git is a free distributed version control system designed to handle
|
"Git is a free distributed version control system designed to handle
|
||||||
|
@ -644,76 +464,237 @@ (define job-count (if parallel-build?
|
||||||
(license license:gpl2)
|
(license license:gpl2)
|
||||||
(home-page "https://git-scm.com/")))
|
(home-page "https://git-scm.com/")))
|
||||||
|
|
||||||
(define-public git-minimal
|
(define-public git
|
||||||
;; The size of the closure of 'git-minimal' is two thirds that of 'git'.
|
(package/inherit git-minimal
|
||||||
;; Its test suite runs slightly faster and most importantly it doesn't
|
(name "git")
|
||||||
;; depend on packages that are expensive to build such as Subversion.
|
(outputs '("out" ;the core
|
||||||
(package
|
"send-email" ;for git-send-email
|
||||||
(inherit git)
|
"svn" ;git-svn
|
||||||
(name "git-minimal")
|
"credential-netrc" ;git-credential-netrc
|
||||||
|
"credential-libsecret" ;git-credential-libsecret
|
||||||
|
"subtree" ;git-subtree
|
||||||
|
"gui")) ;gitk, git gui
|
||||||
(arguments
|
(arguments
|
||||||
(substitute-keyword-arguments (package-arguments git)
|
(substitute-keyword-arguments (package-arguments git-minimal)
|
||||||
((#:phases phases)
|
((#:disallowed-references disallowed-refs ''())
|
||||||
|
(delete perl disallowed-refs))
|
||||||
|
((#:make-flags flags #~'())
|
||||||
|
#~(cons "USE_LIBPCRE2=yes" #$flags))
|
||||||
|
((#:configure-flags flags #~'())
|
||||||
|
;; The explicit --with-tcltk forces the build system to hardcode the
|
||||||
|
;; absolute file name to 'wish'.
|
||||||
|
#~(cons (string-append "--with-tcltk="
|
||||||
|
(search-input-file %build-inputs
|
||||||
|
"bin/wish8.6"))
|
||||||
|
#$flags))
|
||||||
|
((#:phases phases '%standard-phases)
|
||||||
#~(modify-phases #$phases
|
#~(modify-phases #$phases
|
||||||
|
(delete 'remove-unusable-perl-commands)
|
||||||
(replace 'patch-makefiles
|
(replace 'patch-makefiles
|
||||||
(lambda _
|
(lambda _
|
||||||
(substitute* "Makefile"
|
(substitute* "Makefile"
|
||||||
(("/usr/bin/perl") (which "perl")))))
|
(("/usr/bin/perl") (which "perl"))
|
||||||
(delete 'build-subtree)
|
(("/usr/bin/python") (which "python3")))))
|
||||||
(delete 'split)
|
(add-after 'build 'build-subtree
|
||||||
(delete 'install-man-pages)
|
(lambda* (#:key native-inputs inputs #:allow-other-keys)
|
||||||
(delete 'install-info-manual)
|
(with-directory-excursion "contrib/subtree"
|
||||||
(delete 'install-subtree)
|
(substitute* "Makefile"
|
||||||
(delete 'install-credential-netrc)
|
;; Apparently `xmlto' does not bother to looks up the
|
||||||
(delete 'install-credential-libsecret)
|
;; stylesheets specified in the XML, unlike the above
|
||||||
(add-after 'install 'remove-unusable-perl-commands
|
;; substitution. Instead it uses a hard-coded URL. Work
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
;; around it here, but if this is common perhaps we should
|
||||||
(let ((bin (string-append #$output "/bin"))
|
;; hardcode this path in xmlto itself.
|
||||||
(libexec (string-append #$output "/libexec")))
|
(("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)")
|
||||||
(for-each (lambda (file)
|
(string-append "$(XMLTO) -x "
|
||||||
(delete-file (string-append libexec
|
(search-input-directory
|
||||||
"/git-core/" file)))
|
(or native-inputs inputs)
|
||||||
'("git-svn" "git-cvsimport" "git-archimport"
|
(string-append
|
||||||
"git-cvsserver" "git-request-pull"
|
"xml/xsl/docbook-xsl-"
|
||||||
|
#$(package-version docbook-xsl)))
|
||||||
|
"/manpages/docbook.xsl -m $(MANPAGE_XSL)")))
|
||||||
|
(invoke "make")
|
||||||
|
(invoke "make" "install")
|
||||||
|
(invoke "make" "install-doc")
|
||||||
|
(substitute* "git-subtree"
|
||||||
|
(("/bin/sh") (which "sh"))))))
|
||||||
|
(add-after 'install 'install-info-manual
|
||||||
|
(lambda* (#:key parallel-build? #:allow-other-keys)
|
||||||
|
(define job-count (if parallel-build?
|
||||||
|
(number->string (parallel-job-count))
|
||||||
|
"1"))
|
||||||
|
(invoke "make" "-C" "Documentation" "install-info"
|
||||||
|
"-j" job-count
|
||||||
|
;; The Makefile refer to 'docbook2x-texi', but our
|
||||||
|
;; binary is named 'docbook2texi'.
|
||||||
|
"DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl")))
|
||||||
|
(add-after 'install 'install-credential-netrc
|
||||||
|
(lambda _
|
||||||
|
(install-file
|
||||||
|
"contrib/credential/netrc/git-credential-netrc.perl"
|
||||||
|
(string-append #$output:credential-netrc "/bin"))
|
||||||
|
(rename-file (string-append #$output:credential-netrc
|
||||||
|
"/bin/git-credential-netrc.perl")
|
||||||
|
(string-append #$output:credential-netrc
|
||||||
|
"/bin/git-credential-netrc"))
|
||||||
|
;; Previously, Git.pm was automatically found by netrc.
|
||||||
|
;; Perl 5.26 changed how it locates modules so that @INC no
|
||||||
|
;; longer includes the current working directory (the Perl
|
||||||
|
;; community calls this "dotless @INC").
|
||||||
|
(wrap-program (string-append #$output:credential-netrc
|
||||||
|
"/bin/git-credential-netrc")
|
||||||
|
`("PERL5LIB" ":" prefix
|
||||||
|
(,(string-append #$output "/share/perl5"))))))
|
||||||
|
(add-after 'install 'install-credential-libsecret
|
||||||
|
(lambda _
|
||||||
|
(with-directory-excursion "contrib/credential/libsecret"
|
||||||
|
((assoc-ref gnu:%standard-phases 'build))
|
||||||
|
(install-file "git-credential-libsecret"
|
||||||
|
(string-append #$output:credential-libsecret
|
||||||
|
"/bin")))))
|
||||||
|
(add-after 'install 'install-subtree
|
||||||
|
(lambda _
|
||||||
|
(install-file "contrib/subtree/git-subtree"
|
||||||
|
(string-append #$output:subtree "/bin"))
|
||||||
|
(install-file "contrib/subtree/git-subtree.1"
|
||||||
|
(string-append #$output:subtree
|
||||||
|
"/share/man/man1"))))
|
||||||
|
(add-after 'install 'split
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
;; Split the binaries to the various outputs.
|
||||||
|
(let* ((out #$output)
|
||||||
|
(se #$output:send-email)
|
||||||
|
(svn #$output:svn)
|
||||||
|
(gui #$output:gui)
|
||||||
|
(gitk (string-append out "/bin/gitk"))
|
||||||
|
(gitk* (string-append gui "/bin/gitk"))
|
||||||
|
(git-gui (string-append
|
||||||
|
out "/libexec/git-core/git-gui"))
|
||||||
|
(git-gui* (string-append
|
||||||
|
gui "/libexec/git-core/git-gui"))
|
||||||
|
(git-cit (string-append
|
||||||
|
out "/libexec/git-core/git-citool"))
|
||||||
|
(git-cit* (string-append
|
||||||
|
gui "/libexec/git-core/git-citool"))
|
||||||
|
(git-se (string-append
|
||||||
|
out "/libexec/git-core/git-send-email"))
|
||||||
|
(git-se* (string-append
|
||||||
|
se "/libexec/git-core/git-send-email"))
|
||||||
|
(git-svn (string-append
|
||||||
|
out "/libexec/git-core/git-svn"))
|
||||||
|
(git-svn* (string-append
|
||||||
|
svn "/libexec/git-core/git-svn"))
|
||||||
|
(git-sm (string-append
|
||||||
|
out "/libexec/git-core/git-submodule")))
|
||||||
|
(mkdir-p (string-append gui "/bin"))
|
||||||
|
(mkdir-p (string-append gui "/libexec/git-core"))
|
||||||
|
(mkdir-p (string-append se "/libexec/git-core"))
|
||||||
|
(mkdir-p (string-append svn "/libexec/git-core"))
|
||||||
|
|
||||||
;; git-add--interactive was removed in Git 2.40 but
|
(for-each (lambda (old new)
|
||||||
;; this phase is inherited by older versions.
|
(copy-file old new)
|
||||||
#$@(if (version>=? (package-version this-package)
|
(delete-file old)
|
||||||
"2.40.1")
|
(chmod new #o555))
|
||||||
#~()
|
(list gitk git-gui git-cit git-se git-svn)
|
||||||
#~("git-add--interactive"))
|
(list gitk* git-gui* git-cit* git-se* git-svn*))
|
||||||
|
|
||||||
"git-cvsexportcommit"
|
;; Tell 'git-svn' where Subversion and perl-term-readkey are.
|
||||||
"git-instaweb" "git-send-email"))
|
|
||||||
(delete-file (string-append bin "/git-cvsserver"))
|
|
||||||
|
|
||||||
;; These templates typically depend on Perl. Remove them.
|
;; FIXME: Old school 'assoc-ref' is used to retrieve
|
||||||
(delete-file-recursively
|
;; subversion here, as #$(this-package-input "subversion")
|
||||||
(string-append #$output "/share/git-core/templates/hooks"))
|
;; causes a dependency cycle for unknown reasons.
|
||||||
|
(wrap-program git-svn*
|
||||||
|
`("PATH" ":" prefix
|
||||||
|
(,(dirname (search-input-file inputs "bin/perl"))))
|
||||||
|
`("PERL5LIB" ":" prefix
|
||||||
|
,(search-path-as-list
|
||||||
|
'("lib/perl5/site_perl")
|
||||||
|
(list (assoc-ref inputs "subversion")
|
||||||
|
#$(this-package-input "perl-term-readkey"))))
|
||||||
|
|
||||||
;; Gitweb depends on Perl as well.
|
;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
|
||||||
(delete-file-recursively
|
;; help it find 'libsvn_client-1.so'.
|
||||||
(string-append #$output "/share/gitweb")))))))
|
`("LD_LIBRARY_PATH" ":" prefix
|
||||||
((#:make-flags flags)
|
(,(string-append (assoc-ref inputs "subversion")
|
||||||
#~(delete "USE_LIBPCRE2=yes" #$flags))
|
"/lib"))))
|
||||||
((#:configure-flags flags)
|
|
||||||
#~(list #$@(if (%current-target-system)
|
;; Tell 'git-send-email' where perl modules are.
|
||||||
git-cross-configure-flags
|
(wrap-program git-se*
|
||||||
'())))
|
`("PERL5LIB" ":" prefix
|
||||||
((#:disallowed-references lst '())
|
,(search-path-as-list
|
||||||
`(,perl ,@lst))))
|
'("lib/perl5/site_perl")
|
||||||
(outputs '("out"))
|
'#$(delete-duplicates
|
||||||
|
(append-map
|
||||||
|
(compose last package-transitive-propagated-inputs)
|
||||||
|
(list (this-package-input "perl-authen-sasl")
|
||||||
|
(this-package-input "perl-net-smtp-ssl")
|
||||||
|
(this-package-input
|
||||||
|
"perl-io-socket-ssl")))))))
|
||||||
|
;; Tell 'gitweb.cgi' where perl modules are.
|
||||||
|
(wrap-program (string-append out "/share/gitweb/gitweb.cgi")
|
||||||
|
`("PERL5LIB" ":" prefix
|
||||||
|
,(search-path-as-list
|
||||||
|
'("lib/perl5/site_perl")
|
||||||
|
'#$(delete-duplicates
|
||||||
|
(append-map
|
||||||
|
(compose last package-transitive-propagated-inputs)
|
||||||
|
(list (this-package-input "perl-cgi")))))))
|
||||||
|
|
||||||
|
;; Tell 'git-submodule' where Perl is.
|
||||||
|
(wrap-program git-sm
|
||||||
|
`("PATH" ":" prefix
|
||||||
|
(,(dirname (search-input-file inputs "bin/perl"))))))))
|
||||||
|
(add-after 'split 'install-man-pages
|
||||||
|
(lambda _
|
||||||
|
(let ((man (string-append #$output "/share/man")))
|
||||||
|
(mkdir-p man)
|
||||||
|
(with-directory-excursion man
|
||||||
|
(invoke
|
||||||
|
"tar" "xvf"
|
||||||
|
#$(origin
|
||||||
|
(method url-fetch)
|
||||||
|
(uri (string-append
|
||||||
|
"mirror://kernel.org/software/scm/git/"
|
||||||
|
"git-manpages-" (package-version this-package)
|
||||||
|
".tar.xz"))
|
||||||
|
(sha256
|
||||||
|
(base32
|
||||||
|
"1pqrp46kwbxycqld39027ph1cvkq9am156y3sswn6w2khsg30f09"))))))))))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("bash" ,bash-minimal)
|
(modify-inputs (package-native-inputs git-minimal)
|
||||||
("bash-for-tests" ,bash)
|
;; For subtree documentation.
|
||||||
("native-perl" ,perl)
|
(append asciidoc
|
||||||
("gettext" ,gettext-minimal)))
|
docbook2x
|
||||||
|
docbook-xsl
|
||||||
|
libxslt
|
||||||
|
pkg-config
|
||||||
|
texinfo
|
||||||
|
xmlto)))
|
||||||
(inputs
|
(inputs
|
||||||
(list curl ;for HTTP(S) access
|
(modify-inputs (package-inputs git-minimal)
|
||||||
expat ;for 'git push' over HTTP(S)
|
(append python ;for git-p4
|
||||||
openssl
|
|
||||||
perl
|
;; For PCRE support in git grep (USE_LIBPCRE2).
|
||||||
zlib))))
|
pcre2
|
||||||
|
|
||||||
|
;; For 'gitweb.cgi'.
|
||||||
|
perl-cgi
|
||||||
|
|
||||||
|
;; For 'git-svn'.
|
||||||
|
subversion
|
||||||
|
perl-term-readkey
|
||||||
|
|
||||||
|
;; For 'git-send-email'.
|
||||||
|
perl-authen-sasl
|
||||||
|
perl-net-smtp-ssl
|
||||||
|
perl-io-socket-ssl
|
||||||
|
|
||||||
|
;; For 'git gui', 'gitk', and 'git citool'.
|
||||||
|
tcl
|
||||||
|
tk
|
||||||
|
|
||||||
|
;; For 'git-credential-libsecret'
|
||||||
|
glib
|
||||||
|
libsecret)))))
|
||||||
|
|
||||||
;;; The symbol git-minimal/fixed should be used when git-minimal needs fixes
|
;;; The symbol git-minimal/fixed should be used when git-minimal needs fixes
|
||||||
;;; (security or else) and this deprecation could be removed.
|
;;; (security or else) and this deprecation could be removed.
|
||||||
|
|
Loading…
Reference in a new issue