gnu: gtk+-2: Split binaries.
[jackhill/guix/guix.git] / gnu / packages / version-control.scm
index 21b3d76..cf60f02 100644 (file)
@@ -141,6 +141,10 @@ changes to project files over time.  It supports both a distributed workflow
 as well as the classic centralized workflow.")
     (license license:gpl2+)))
 
+(define git-cross-configure-flags
+  '("ac_cv_fread_reads_directories=yes"
+    "ac_cv_snprintf_returns_bogus=no"))
+
 (define-public git
   (package
    (name "git")
@@ -238,7 +242,10 @@ as well as the classic centralized workflow.")
       ;; absolute file name to 'wish'.
       #:configure-flags (list (string-append "--with-tcltk="
                                              (assoc-ref %build-inputs "tk")
-                                             "/bin/wish8.6")) ; XXX
+                                             "/bin/wish8.6")  ; XXX
+                              ,@(if (%current-target-system)
+                                    git-cross-configure-flags
+                                    '()))
 
       #:modules ((srfi srfi-1)
                  (srfi srfi-26)
@@ -255,6 +262,15 @@ as well as the classic centralized workflow.")
                               (remove (cut string-prefix? bash-full <>) path)
                               ":"))
               #t)))
+        ;; Add cross curl-config script to PATH when cross-compiling.
+        ,@(if (%current-target-system)
+              '((add-before 'configure 'add-cross-curl-config
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (setenv "PATH"
+                             (string-append (assoc-ref inputs "curl") "/bin:"
+                                            (getenv "PATH")))
+                     #t)))
+              '())
         (add-after 'configure 'patch-makefiles
           (lambda _
             (substitute* "Makefile"
@@ -513,7 +529,10 @@ everything from small to very large projects with speed and efficiency.")
        ((#:make-flags flags)
         `(delete "USE_LIBPCRE2=yes" ,flags))
        ((#:configure-flags flags)
-        ''())
+        `(list
+          ,@(if (%current-target-system)
+                git-cross-configure-flags
+                '())))
        ((#:disallowed-references lst '())
         `(,perl ,@lst))))
     (outputs '("out"))
@@ -531,7 +550,7 @@ everything from small to very large projects with speed and efficiency.")
 (define-public libgit2
   (package
     (name "libgit2")
-    (version "0.28.3")
+    (version "0.28.4")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -540,7 +559,7 @@ everything from small to very large projects with speed and efficiency.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "07068flm9xi25wmcs65nyfg6a7ikgfv96i2nhgyj5gzs9gljqiz2"))
+                "171b25aym4q88bidc4c76y4l6jmdwifm3q9zjqsll0wjhlkycfy1"))
               (patches (search-patches "libgit2-avoid-python.patch"
                                        "libgit2-mtime-0.patch"))
 
@@ -552,7 +571,14 @@ everything from small to very large projects with speed and efficiency.")
     (build-system cmake-build-system)
     (outputs '("out" "debug"))
     (arguments
-     `(#:configure-flags '("-DUSE_SHA1DC=ON") ; SHA-1 collision detection
+     `(#:configure-flags
+       (list "-DUSE_SHA1DC=ON"  ; SHA-1 collision detection
+             ,@(if (%current-target-system)
+                   `((string-append
+                      "-DPKG_CONFIG_EXECUTABLE="
+                      (assoc-ref %build-inputs "pkg-config")
+                      "/bin/" ,(%current-target-system) "-pkg-config"))
+                   '()))
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-hardcoded-paths
@@ -567,9 +593,13 @@ everything from small to very large projects with speed and efficiency.")
            (lambda _
              (for-each make-file-writable (find-files "."))
              #t))
-         ;; Run checks more verbosely.
+         ;; Run checks more verbosely, unless we are cross-compiling.
          (replace 'check
-           (lambda _ (invoke "./libgit2_clar" "-v" "-Q"))))))
+           (lambda* (#:key (tests? #t) #:allow-other-keys)
+             (if tests?
+                 (invoke "./libgit2_clar" "-v" "-Q")
+                 ;; Tests may be disabled if cross-compiling.
+                 (format #t "Test suite not run.~%")))))))
     (inputs
      `(("libssh2" ,libssh2)
        ("http-parser" ,http-parser)))