From e4e5628b7f2410a75c30623fe40e218e6d2ee419 Mon Sep 17 00:00:00 2001 From: Alex James Date: Wed, 23 Jul 2025 01:07:31 -0700 Subject: [PATCH] harfbuzz: fix `checkPhase` on sandboxed Darwin The native_coretext_variations test in harfbuzz's test suite depends on the system-provided fonts and will fail if they cannot be read [1]. Add /System/Library/Fonts to __impureHostDeps (which updates the sandbox profile) to resolve the test failure on Darwin. [1]: https://gist.github.com/al3xtjames/c6f5f2e1217c9e8607ac9d70ce333e0c#file-harfbuzz-11-2-1-drv-log-L789-L812 --- pkgs/by-name/ha/harfbuzz/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/ha/harfbuzz/package.nix b/pkgs/by-name/ha/harfbuzz/package.nix index 92f3eb567c3c..432c675f3a86 100644 --- a/pkgs/by-name/ha/harfbuzz/package.nix +++ b/pkgs/by-name/ha/harfbuzz/package.nix @@ -103,6 +103,11 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; + # test_native_coretext_variations depends on the system fonts. + __impureHostDeps = lib.optionals stdenv.hostPlatform.isDarwin [ + "/System/Library/Fonts" + ]; + # Slightly hacky; some pkgs expect them in a single directory. postFixup = lib.optionalString withIcu '' rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc"