summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-11-26 10:35:41 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-26 11:10:19 +0100
commitc23cf1832aba44c03ba50a6f318b0415a4437d53 (patch)
treeb756dcd6a1993c32775dc8e6a0d20bf7b0da314a
parente6c64d0a3f0f615d12518b4797ec0b8f174269f2 (diff)
gnu: Add 'git-minimal'.
* gnu/packages/version-control.scm (git-minimal): New variable.
-rw-r--r--gnu/packages/version-control.scm64
1 files changed, 64 insertions, 0 deletions
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 @@ 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")