[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: gnu: libgit2: Fix Clar test framework.
From: |
Ludovic Courtès |
Subject: |
01/01: gnu: libgit2: Fix Clar test framework. |
Date: |
Sat, 3 Jun 2017 18:58:50 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 34cfeca84e62b92e4f2b32c5bf33fe4982253f48
Author: Sergei Trofimovich <address@hidden>
Date: Sat Jun 3 16:17:58 2017 +0100
gnu: libgit2: Fix Clar test framework.
This commit reverts 'patch' hack introduced in
a48a1071a686b250bf8b7982ca0ce8dda1d93c61 and fixes bug in the Clar test
framework.
Patch is proposed to Clar upstream as
<https://github.com/vmg/clar/pull/78>.
* gnu/local.mk: Add libgit2-0.25.1-mtime-0.patch.
* gnu/packages/patches/libgit2-0.25.1-mtime-0.patch: New file.
* gnu/packages/version-control.scm (libgit2)[arguments]:
Remove 'apply-patch' phase.
[inputs]: Remove "patch".
[source]: Add 'patches' field.
Signed-off-by: Sergei Trofimovich <address@hidden>
Signed-off-by: Ludovic Courtès <address@hidden>
---
gnu/local.mk | 1 +
gnu/packages/patches/libgit2-0.25.1-mtime-0.patch | 14 ++++++++++++++
gnu/packages/version-control.scm | 18 ++++--------------
3 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index e7d5ee2..c94291f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -729,6 +729,7 @@ dist_patch_DATA =
\
%D%/packages/patches/libevent-2.1-dns-tests.patch \
%D%/packages/patches/libevent-2.1-skip-failing-test.patch \
%D%/packages/patches/libextractor-ffmpeg-3.patch \
+ %D%/packages/patches/libgit2-0.25.1-mtime-0.patch \
%D%/packages/patches/libgit2-use-after-free.patch \
%D%/packages/patches/libjxr-fix-function-signature.patch \
%D%/packages/patches/libjxr-fix-typos.patch \
diff --git a/gnu/packages/patches/libgit2-0.25.1-mtime-0.patch
b/gnu/packages/patches/libgit2-0.25.1-mtime-0.patch
new file mode 100644
index 0000000..a6fdb50
--- /dev/null
+++ b/gnu/packages/patches/libgit2-0.25.1-mtime-0.patch
@@ -0,0 +1,14 @@
+The Clar test framework has a bug whereby it skips the parsing phase
+on files with mtime=0.
+
+Reported upstream at <https://github.com/vmg/clar/pull/78>.
+
+diff --git a/tests/generate.py b/tests/generate.py
+index b639c8f..111ca41 100644
+--- a/tests/generate.py
++++ b/tests/generate.py
+@@ -63,3 +63,3 @@ class Module(object):
+
+- self.mtime = 0
++ self.mtime = None # Guix sets all file mtimes to '0'
+ self.enabled = True
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 12fc2c6..32c9a13 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -336,7 +336,9 @@ everything from small to very large projects with speed and
efficiency.")
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "1cdwcw38frc1wf28x5ppddazv9hywc718j92f3xa3ybzzycyds3s"))))
+ "1cdwcw38frc1wf28x5ppddazv9hywc718j92f3xa3ybzzycyds3s"))
+ (patches (search-patches "libgit2-use-after-free.patch"
+ "libgit2-0.25.1-mtime-0.patch"))))
(build-system cmake-build-system)
(arguments
`(#:phases
@@ -349,25 +351,13 @@ everything from small to very large projects with speed
and efficiency.")
(("/bin/cp") (which "cp"))
(("/bin/rm") (which "rm")))
#t))
- (add-after 'unpack 'apply-patch
- (lambda* (#:key inputs #:allow-other-keys)
- ;; XXX: For some reason adding the patch in 'patches', which
- ;; leads to a new tarball with all timestamps reset and ordering
- ;; by name (slightly different file order compared to the
- ;; original tarball) leads to an obscure Python error while
- ;; running 'generate.py':
- ;; 'Module' object has no attribute 'callbacks'
- ;; Thus, apply the patch here, which minimizes disruption.
- (let ((patch (assoc-ref inputs "patch")))
- (zero? (system* "patch" "-p1" "--force" "--input" patch)))))
;; Run checks more verbosely.
(replace 'check
(lambda _ (zero? (system* "./libgit2_clar" "-v" "-Q")))))))
(inputs
`(("libssh2" ,libssh2)
("libcurl" ,curl)
- ("python" ,python-wrapper)
- ("patch" ,(search-patch "libgit2-use-after-free.patch"))))
+ ("python" ,python-wrapper)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(propagated-inputs