diff mbox series

[bug#56766] Adjust patch according to review

Message ID 4af56c93a8d990220918c65bc58c32f1c8c07aa3.1658907553.git.marcel@van-der-boom.nl
State Accepted
Headers show
Series [bug#56766] Adjust patch according to review | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Marcel van der Boom July 27, 2022, 7:41 a.m. UTC
* gnu/packages/image.scm (exiv3): use substitution instead of patch
---
 gnu/packages/image.scm                 | 18 ++++++++++++------
 gnu/packages/patches/exiv2-ppc64.patch | 11 -----------
 2 files changed, 12 insertions(+), 17 deletions(-)
 delete mode 100644 gnu/packages/patches/exiv2-ppc64.patch


base-commit: 212ca81895b2baa819ea11a308ad21880b84a546
prerequisite-patch-id: a7093ef8ccbab6d6dd7474a08f75970bcf3b9d4b

Comments

Ludovic Courtès Aug. 1, 2022, 12:10 p.m. UTC | #1
Hi Marcel,

I squashed the two patches into one, tweaked it to make the new build
phase conditional as a whole, added it for aarch64-linux as well, added
comments taken from your commit log, and tweaked the commit log.

Thank you, and thanks Maxime for reviewing!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index dc4bf76790..9febb883b4 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -1342,13 +1342,10 @@  (define-public exiv2
        (uri (string-append "https://www.exiv2.org/builds/exiv2-" version
                            "-Source.tar.gz"))
        (sha256
-        (base32 "1qm6bvj28l42km009nc60gffn1qhngc0m2wjlhf90si3mcc8d99m"))
-       (patches
-        (if (target-ppc64le?)
-            (list (search-patch "exiv2-ppc64.patch"))))))
+        (base32 "1qm6bvj28l42km009nc60gffn1qhngc0m2wjlhf90si3mcc8d99m"))))
     (build-system cmake-build-system)
     (arguments
-     '(#:test-target "tests"
+     `(#:test-target "tests"
        #:configure-flags (list "-DEXIV2_BUILD_UNIT_TESTS=ON"
                                ;; darktable needs BMFF to support
                                ;; CR3 files.
@@ -1359,7 +1356,16 @@  (define-public exiv2
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (lib (string-append out "/lib")))
-               (for-each delete-file (find-files lib "\\.a$"))))))))
+               (for-each delete-file (find-files lib "\\.a$")))))
+         (add-after 'unpack 'adjust-ppc6-tests
+           (lambda _
+             ,@(if (target-ppc64le?)
+                   ;; Adjust test on ppc64
+                   ;; See: https://github.com/Exiv2/exiv2/issues/933
+                   '((substitute* "tests/bugfixes/github/test_CVE_2018_12265.py"
+                        (("\\$uncaught_exception \\$addition_overflow_message\n") "")
+                        (("retval = \\[1\\]") "retval = [0]")))
+                   '()))))))
     (propagated-inputs
      (list expat zlib))
     (native-inputs
diff --git a/gnu/packages/patches/exiv2-ppc64.patch b/gnu/packages/patches/exiv2-ppc64.patch
deleted file mode 100644
index a74a7ac1b7..0000000000
--- a/gnu/packages/patches/exiv2-ppc64.patch
+++ /dev/null
@@ -1,11 +0,0 @@ 
---- /tests/bugfixes/github/test_CVE_2018_12265.py
-+++ /tests/bugfixes/github/test_CVE_2018_12265.py
-@@ -18,7 +18,6 @@
- Warning: Directory Image, entry 0x0201: Strip 0 is outside of the data area; ignored.
- Warning: Directory Image, entry 0x0201: Strip 7 is outside of the data area; ignored.
- Error: Offset of directory Thumbnail, entry 0x0201 is out of bounds: Offset = 0x00000000; truncating the entry
--$uncaught_exception $addition_overflow_message
- """
-     ]
--    retval = [1]
-+    retval = [0]