gnu: Add 'git-minimal'.

* gnu/packages/version-control.scm (git-minimal): New variable.
This commit is contained in:
Ludovic Courtès 2018-11-26 10:35:41 +01:00
parent e6c64d0a3f
commit c23cf1832a
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 64 additions and 0 deletions

View File

@ -457,6 +457,70 @@ everything from small to very large projects with speed and efficiency.")
(license license:gpl2)
(home-page "https://git-scm.com/")))
(define-public git-minimal
;; 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.
(package
(inherit git)
(name "git-minimal")
(arguments
(substitute-keyword-arguments (package-arguments git)
((#:phases phases)
`(modify-phases ,phases
(replace 'patch-makefiles
(lambda _
(substitute* "Makefile"
(("/usr/bin/perl") (which "perl")))
#t))
(delete 'build-subtree)
(delete 'split)
(delete 'install-man-pages)
(delete 'install-subtree)
(delete 'install-credential-netrc)
(add-before 'check 'delete-svn-test
(lambda _
;; This test cannot run since we are not building 'git-svn'.
(delete-file "t/t9020-remote-svn.sh")
#t))
(add-after 'install 'remove-unusable-perl-commands
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(libexec (string-append out "/libexec")))
(for-each (lambda (file)
(delete-file (string-append libexec
"/git-core/" file)))
'("git-svn" "git-cvsimport" "git-archimport"
"git-cvsserver" "git-request-pull"
"git-add--interactive" "git-cvsexportcommit"
"git-instaweb" "git-send-email"))
(delete-file (string-append bin "/git-cvsserver"))
;; These templates typically depend on Perl. Remove them.
(delete-file-recursively
(string-append out "/share/git-core/templates/hooks"))
;; Gitweb depends on Perl as well.
(delete-file-recursively
(string-append out "/share/gitweb"))
#t)))))
((#:configure-flags flags)
''())
((#:disallowed-references lst '())
`(,perl ,@lst))))
(outputs '("out"))
(native-inputs
`(("native-perl" ,perl)
("gettext" ,gettext-minimal)))
(inputs
`(("curl" ,curl) ;for HTTP(S) access
("expat" ,expat) ;for 'git push' over HTTP(S)
("openssl" ,openssl)
("perl" ,perl)
("zlib" ,zlib)
("bash-for-tests" ,bash)))))
(define-public libgit2
(package
(name "libgit2")