gnu: fontconfig: Use (locally) deterministic caching
Make fontconfig use directory contents rather than modification time to determine cache validity (by pretending that mtime is broken). * gnu/packages/patches/fontconfig-cache-ignore-mtime.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/fontutils.scm (fontconfig)[source]: Use it. [arguments]: Unset SOURCE_DATE_EPOCH for tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>master
parent
9b4c3c675c
commit
6f12880a76
|
@ -1019,6 +1019,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/fifo-map-remove-catch.hpp.patch \
|
%D%/packages/patches/fifo-map-remove-catch.hpp.patch \
|
||||||
%D%/packages/patches/findutils-localstatedir.patch \
|
%D%/packages/patches/findutils-localstatedir.patch \
|
||||||
%D%/packages/patches/flann-cmake-3.11.patch \
|
%D%/packages/patches/flann-cmake-3.11.patch \
|
||||||
|
%D%/packages/patches/fontconfig-cache-ignore-mtime.patch \
|
||||||
%D%/packages/patches/foobillard++-pkg-config.patch \
|
%D%/packages/patches/foobillard++-pkg-config.patch \
|
||||||
%D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \
|
%D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \
|
||||||
%D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \
|
%D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||||
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
||||||
;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
||||||
|
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -331,7 +332,8 @@ Font Format (WOFF).")
|
||||||
"https://www.freedesktop.org/software/"
|
"https://www.freedesktop.org/software/"
|
||||||
"fontconfig/release/fontconfig-" version ".tar.xz"))
|
"fontconfig/release/fontconfig-" version ".tar.xz"))
|
||||||
(sha256 (base32
|
(sha256 (base32
|
||||||
"1850q4k80yxma5g3yxkvyv8i5a3xqzswwml8gjy3jmywx8qqd5pa"))))
|
"1850q4k80yxma5g3yxkvyv8i5a3xqzswwml8gjy3jmywx8qqd5pa"))
|
||||||
|
(patches (search-patches "fontconfig-cache-ignore-mtime.patch"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
;; In Requires or Requires.private of fontconfig.pc.
|
;; In Requires or Requires.private of fontconfig.pc.
|
||||||
(propagated-inputs `(("expat" ,expat)
|
(propagated-inputs `(("expat" ,expat)
|
||||||
|
@ -362,6 +364,9 @@ Font Format (WOFF).")
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-before 'check 'skip-problematic-tests
|
(add-before 'check 'skip-problematic-tests
|
||||||
(lambda _
|
(lambda _
|
||||||
|
;; SOURCE_DATE_EPOCH doesn't make sense when ignoring mtime
|
||||||
|
(unsetenv "SOURCE_DATE_EPOCH")
|
||||||
|
|
||||||
(substitute* "test/run-test.sh"
|
(substitute* "test/run-test.sh"
|
||||||
;; The crbug1004254 test attempts to fetch fonts from the
|
;; The crbug1004254 test attempts to fetch fonts from the
|
||||||
;; network.
|
;; network.
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
Pretend that stat's mtime is broken, so that the fontconfig cache does not
|
||||||
|
depend upon modification time to determine if a cache is stale.
|
||||||
|
|
||||||
|
diff --git a/src/fcstat.c b/src/fcstat.c
|
||||||
|
index 5a2bd7c..d603a96 100644
|
||||||
|
--- a/src/fcstat.c
|
||||||
|
+++ b/src/fcstat.c
|
||||||
|
@@ -431,6 +431,7 @@ FcIsFsMmapSafe (int fd)
|
||||||
|
FcBool
|
||||||
|
FcIsFsMtimeBroken (const FcChar8 *dir)
|
||||||
|
{
|
||||||
|
+ return FcTrue;
|
||||||
|
int fd = FcOpen ((const char *) dir, O_RDONLY);
|
||||||
|
|
||||||
|
if (fd != -1)
|
Reference in New Issue