summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-09-29 17:30:04 +0200
committerLudovic Courtès <ludo@gnu.org>2013-09-29 17:30:41 +0200
commited5f49ff0cc1c320a2c1aa64f329de4290af3206 (patch)
tree56feb5590d4cd396c057dc0238c24fcb0280abc8
parent8b2fe7853d6b81f8a2b334b7f8f0af929194c2de (diff)
downloadguix-ed5f49ff0cc1c320a2c1aa64f329de4290af3206.tar.gz
gnu: git: Add "svn" output for 'git-svn'.
* gnu/packages/version-control.scm (git): Add SUBVERSION as an input.
  Add 'split' phase.
-rw-r--r--gnu/packages/version-control.scm43
1 files changed, 41 insertions, 2 deletions
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 8a0242cfd4..e0287fd1a1 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -90,7 +90,11 @@ from a command line or use a GUI application.")
       ("openssl" ,openssl)
       ("perl" ,perl)
       ("python" ,python-2) ; CAVEAT: incompatible with python-3 according to INSTALL
-      ("zlib" ,zlib)))
+      ("zlib" ,zlib)
+
+      ;; For 'git-svn'.
+      ("subversion" ,subversion)))
+   (outputs '("out" "svn"))
    (arguments
     `(#:make-flags `("V=1") ; more verbose compilation
       #:test-target "test"
@@ -105,7 +109,42 @@ from a command line or use a GUI application.")
                    (("/bin/sh") (which "sh"))
                    (("/usr/bin/perl") (which "perl"))
                    (("/usr/bin/python") (which "python"))))))
-         %standard-phases)))
+        (alist-cons-after
+         'install 'split
+         (lambda* (#:key inputs outputs #:allow-other-keys)
+           (let* ((out      (assoc-ref outputs "out"))
+                  (svn      (assoc-ref outputs "svn"))
+                  (git-svn  (string-append out "/libexec/git-core/git-svn"))
+                  (git-svn* (string-append svn "/libexec/git-core/git-svn")))
+             (mkdir-p (string-append svn "/libexec/git-core"))
+             (copy-file git-svn git-svn*)
+             (delete-file git-svn)
+             (chmod git-svn* #o555)
+
+             ;; Tell 'git-svn' where Subversion is.
+             (wrap-program git-svn*
+                           `("PATH" ":" prefix
+                             (,(string-append (assoc-ref inputs "subversion")
+                                              "/bin"))))
+
+             ;; Tell 'git' to look for core programs in the user's profile.
+             ;; This allows user to install other outputs of this package and
+             ;; have them transparently taken into account.  There's a
+             ;; 'GIT_EXEC_PATH' environment variable, but it's supposed to
+             ;; specify a single directory, not a search path.
+             (wrap-program (string-append out "/bin/git")
+                           `("PATH" ":" prefix
+                             ("$HOME/.guix-profile/libexec/git-core"))
+                           `("PERL5LIB" ":" prefix
+                             (,(string-append (assoc-ref inputs "subversion")
+                                              "/lib/perl5/site_perl")))
+
+                           ;; 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"))))))
+         %standard-phases))))
    (synopsis "Distributed version control system")
    (description
     "Git is a free distributed version control system designed to handle