From 35fb990b504eeda9fc7b86002a229f57d89332e5 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sat, 3 Jun 2023 19:10:02 +0200 Subject: Fix build of php-imagick --- tw/packages/php.scm | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'tw/packages') diff --git a/tw/packages/php.scm b/tw/packages/php.scm index 345babf4..a64446f7 100644 --- a/tw/packages/php.scm +++ b/tw/packages/php.scm @@ -90,18 +90,24 @@ which provides a drop in replacement for APC.") (add-before 'check 'set-env-vars-for-check (lambda _ (setenv "NO_INTERACTION" "1") + ;; We need to patch fonts.conf to point to at least one writable + ;; cache directory, else the test output will contain spurious + ;; "Fontconfig error: No writable cache directories" lines, which + ;; causes tests to fail. + (copy-file (string-append + (assoc-ref %build-inputs "fontconfig-minimal") + "/etc/fonts/fonts.conf") + "fonts.conf") + (substitute* "fonts.conf" + (("~/\\.fontconfig") + (string-append (getcwd) "/.fccache"))) + (setenv "FONTCONFIG_FILE" (string-append (getcwd) "/fonts.conf")) ;; https://github.com/Imagick/imagick/blob/master/docker/nixos/shell.nix - ;; Needed to avoid error message when using fonts - ;; https://github.com/Imagick/imagick/issues/398 - (setenv "FONTCONFIG_FILE" - (string-append - (assoc-ref %build-inputs "fontconfig-minimal") - "/etc/fonts/fonts.conf")) ;; Needed to allow Imagick::getConfigureOptions() to have all info ;; https://github.com/Imagick/imagick/issues/399 (setenv "MAGICK_CONFIGURE_PATH" - (car (find-files (assoc-ref %build-inputs "imagemagick") - "^configure\\.xml$"))))) + (dirname (car (find-files (assoc-ref %build-inputs "imagemagick") + "^configure\\.xml$")))))) (replace 'install (lambda* (#:key inputs outputs #:allow-other-keys) (use-modules (ice-9 popen) @@ -130,8 +136,7 @@ which provides a drop in replacement for APC.") (inputs (list php pcre2 imagemagick fontconfig)) (native-inputs (list autoconf ; for phpize pkg-config - re2c ; according to https://github.com/Imagick/imagick/blob/master/docker/nixos/shell.nix - font-dejavu)) ; for unit tests + re2c)) ; according to https://github.com/Imagick/imagick/blob/master/docker/nixos/shell.nix (home-page "https://pecl.php.net/package/imagick") (synopsis "A PHP wrapper for the ImageMagick library") (description "Imagick is a native PHP extension to create and modify -- cgit v1.2.3