From c23cf1832aba44c03ba50a6f318b0415a4437d53 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 26 Nov 2018 10:35:41 +0100 Subject: gnu: Add 'git-minimal'. * gnu/packages/version-control.scm (git-minimal): New variable. --- gnu/packages/version-control.scm | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'gnu') diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index ecd5789397..cec3e5fc6c 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -457,6 +457,70 @@ (define-public git (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") -- cgit v1.2.3