From 79db2573fcf2840cd463e675063625771e411211 Mon Sep 17 00:00:00 2001 From: Julien Lepiller
Date: Thu, 16 Feb 2017 17:47:51 +0100 Subject: [PATCH] gnu: php: Update to 7.1.2. * gnu/packages/php.scm (php): Update to 7.1.2. --- gnu/local.mk | 1 + gnu/packages/gd.scm | 46 +++------ .../patches/gd-php-73968-Fix-109-XBM-reading.patch | 111 +++++++++++++++++++++ gnu/packages/php.scm | 20 ++-- 4 files changed, 140 insertions(+), 38 deletions(-) create mode 100644 gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch diff --git a/gnu/local.mk b/gnu/local.mk index 060de25..7e6dd31 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -576,6 +576,7 @@ dist_patch_DATA = \ %D%/packages/patches/gd-fix-gd2-read-test.patch \ %D%/packages/patches/gd-fix-tests-on-i686.patch \ %D%/packages/patches/gd-fix-truecolor-format-correction.patch \ + %D%/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch \ %D%/packages/patches/gegl-CVE-2012-4433.patch \ %D%/packages/patches/geoclue-config.patch \ %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch \ diff --git a/gnu/packages/gd.scm b/gnu/packages/gd.scm index 713f7ae..b8f9495 100644 --- a/gnu/packages/gd.scm +++ b/gnu/packages/gd.scm @@ -36,12 +36,11 @@ (define-public gd (package (name "gd") - (replacement gd-2.2.4) ;; Note: With libgd.org now pointing to github.com, genuine old ;; tarballs are no longer available. Notably, versions 2.0.x are ;; missing. - (version "2.2.3") + (version "2.2.4") (source (origin (method url-fetch) @@ -50,10 +49,8 @@ version "/libgd-" version ".tar.xz")) (sha256 (base32 - "0g3xz8jpz1pl2zzmssglrpa9nxiaa7rmcmvgpbrjz8k9cyynqsvl")) - (patches (search-patches "gd-CVE-2016-7568.patch" - "gd-CVE-2016-8670.patch" - "gd-fix-gd2-read-test.patch" + "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk")) + (patches (search-patches "gd-fix-gd2-read-test.patch" "gd-fix-tests-on-i686.patch")))) (build-system gnu-build-system) (native-inputs @@ -65,6 +62,17 @@ (propagated-inputs `(("fontconfig" ,fontconfig) ("libjpeg" ,libjpeg))) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; This test is known to fail on i686-linux: + ;; https://github.com/libgd/libgd/issues/359 + ;; TODO Replace this substitution with an upstream bug fix. + (add-after 'unpack 'disable-failing-test + (lambda _ + (substitute* "tests/gdimagegrayscale/basic.c" + (("return gdNumFailures\\(\\)") + "return 0"))))))) (home-page "http://www.libgd.org/") (synopsis "Library for the dynamic creation of images by programmers") (description @@ -78,32 +86,6 @@ most common applications of GD involve website development.") "See COPYING file in the distribution.")) (properties '((cpe-name . "libgd"))))) -(define gd-2.2.4 - (package - (inherit gd) - (version "2.2.4") - (source - (origin - (method url-fetch) - (uri (string-append "https://github.com/libgd/libgd/releases/download/" - "gd-" version "/libgd-" version ".tar.xz")) - (patches (search-patches "gd-fix-gd2-read-test.patch" - "gd-fix-tests-on-i686.patch")) - (sha256 - (base32 - "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk")))) - (arguments - `(#:phases - (modify-phases %standard-phases - ;; This test is known to fail on i686-linux: - ;; https://github.com/libgd/libgd/issues/359 - ;; TODO Replace this substitution with an upstream bug fix. - (add-after 'unpack 'disable-failing-test - (lambda _ - (substitute* "tests/gdimagegrayscale/basic.c" - (("return gdNumFailures\\(\\)") - "return 0"))))))))) - (define-public perl-gd (package (name "perl-gd") diff --git a/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch new file mode 100644 index 0000000..ce69a73 --- /dev/null +++ b/gnu/packages/patches/gd-php-73968-Fix-109-XBM-reading.patch @@ -0,0 +1,111 @@ +From 082c5444838ea0d84f9fb6441aefdb44d78d9bba Mon Sep 17 00:00:00 2001 +From: "Christoph M. Becker" +Date: Fri, 20 Jan 2017 22:48:20 +0100 +Subject: [PATCH] Fix #109: XBM reading fails with printed error + +When calculating the number of required bytes of an XBM image, we have +to take the line padding into account. +--- + src/gd_xbm.c | 2 +- + tests/xbm/CMakeLists.txt | 1 + + tests/xbm/Makemodule.am | 5 ++++- + tests/xbm/github_bug_109.c | 35 +++++++++++++++++++++++++++++++++++ + tests/xbm/github_bug_109.xbm | 5 +++++ + 5 files changed, 47 insertions(+), 2 deletions(-) + create mode 100644 tests/xbm/github_bug_109.c + create mode 100644 tests/xbm/github_bug_109.xbm + create mode 100644 tests/xbm/github_bug_109_exp.png + +diff --git a/src/gd_xbm.c b/src/gd_xbm.c +index 5f09b56..c2ba2ad 100644 +--- a/src/gd_xbm.c ++++ b/src/gd_xbm.c +@@ -108,7 +108,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXbm(FILE * fd) + max_bit = 32768; + } + if (max_bit) { +- bytes = (width * height / 8) + 1; ++ bytes = (width + 7) / 8 * height; + if (!bytes) { + return 0; + } +diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt +index 183cf5e..08576e0 100644 +--- a/tests/xbm/CMakeLists.txt ++++ b/tests/xbm/CMakeLists.txt +@@ -1,4 +1,5 @@ + LIST(APPEND TESTS_FILES ++ github_bug_109 + github_bug_170 + ) + +diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am +index ba1eabd..0f5beb6 100644 +--- a/tests/xbm/Makemodule.am ++++ b/tests/xbm/Makemodule.am +@@ -1,5 +1,8 @@ + libgd_test_programs += \ ++ xbm/github_bug_109 \ + xbm/github_bug_170 + + EXTRA_DIST += \ +- xbm/CMakeLists.txt ++ xbm/CMakeLists.txt \ ++ xbm/github_bug_109.xbm \ ++ xbm/github_bug_109_exp.png +diff --git a/tests/xbm/github_bug_109.c b/tests/xbm/github_bug_109.c +new file mode 100644 +index 0000000..1a020c6 +--- /dev/null ++++ b/tests/xbm/github_bug_109.c +@@ -0,0 +1,35 @@ ++/** ++ * Test reading of XBM images with a width that is not a multiple of 8 ++ * ++ * We're reading such an XBM image, and check that we got what we've expected, ++ * instead of an error message. ++ * ++ * See also