gnu: spice: Fix CVE-2017-7506.
[jackhill/guix/guix.git] / gnu / packages / gd.scm
index 1c2be11..aac0f96 100644 (file)
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
+;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,7 +32,7 @@
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages pkg-config)
-  #:use-module ((guix licenses) #:select (non-copyleft)))
+  #:use-module ((guix licenses) #:select (non-copyleft perl-license)))
 
 (define-public gd
   (package
               (base32
                "1rp4v7n1dq38b92kl7gkvpvqqkw7nvdfnz6d5kip5klkxfki6zqk"))
              (patches (search-patches "gd-fix-gd2-read-test.patch"
-                                      "gd-fix-tests-on-i686.patch"))))
+                                      "gd-fix-tests-on-i686.patch"
+                                      "gd-freetype-test-failure.patch"
+                                      "gd-php-73968-Fix-109-XBM-reading.patch"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases
+      ;; As recommended by github.com/libgd/libgd/issues/278 to fix rounding
+      ;; issues on aarch64 and other architectures.
+     `(#:make-flags '("CFLAGS=-ffp-contract=off")
+       #:phases
        (modify-phases %standard-phases
          ;; This test is known to fail on i686-linux:
          ;; https://github.com/libgd/libgd/issues/359
@@ -63,7 +69,8 @@
            (lambda _
              (substitute* "tests/gdimagegrayscale/basic.c"
                (("return gdNumFailures\\(\\)")
-                 "return 0")))))))
+                 "return 0"))
+             #t)))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
@@ -132,7 +139,7 @@ most common applications of GD involve website development.")
     (description "GD.pm is an autoloadable interface module for libgd, a
 popular library for creating and manipulating PNG files.  With this library
 you can create PNG images on the fly or modify existing files.")
-    (license (package-license perl))))
+    (license perl-license)))
 
 (define-public perl-gd-securityimage
   (package
@@ -159,4 +166,4 @@ security (captcha) images.  The final output is the actual graphic data, the
 mime type of the graphic, and the created random string.  The module also has
 some \"styles\" that are used to create the background (or foreground) of the
 image.")
-    (license (package-license perl))))
+    (license perl-license)))