9 static ? stdenv.hostPlatform.isStatic,
13 stdenv.mkDerivation (finalAttrs: {
20 "https://github.com/silnrsi/graphite/releases/download/${version}/${pname}-${version}.tgz";
21 sha256 = "1790ajyhk0ax8xxamnrk176gc9gvhadzy78qia4rd8jzm89ir7gr";
35 ++ lib.optional (stdenv.targetPlatform.useLLVM or false) (
36 llvmPackages.compiler-rt.override {
41 patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./macosx.patch ];
43 # disable broken 'nametabletest' test, fails on gcc-13:
44 # https://github.com/silnrsi/graphite/pull/74
45 substituteInPlace tests/CMakeLists.txt \
46 --replace 'add_subdirectory(nametabletest)' '#add_subdirectory(nametabletest)'
48 # support cross-compilation by using target readelf binary:
49 substituteInPlace Graphite.cmake \
50 --replace 'readelf' "${stdenv.cc.targetPrefix}readelf"
53 cmakeFlags = lib.optionals static [
54 "-DBUILD_SHARED_LIBS=OFF"
57 # Remove a test that fails to statically link (undefined reference to png and
59 postConfigure = lib.optionalString static ''
60 sed -e '/freetype freetype.c/d' -i ../tests/examples/CMakeLists.txt
66 pkg-config = testers.hasPkgConfigModules {
67 package = finalAttrs.finalPackage;
72 description = "Advanced font engine";
73 homepage = "https://graphite.sil.org/";
74 license = licenses.lgpl21;
75 maintainers = [ maintainers.raskin ];
76 pkgConfigModules = [ "graphite2" ];
77 mainProgram = "gr2fonttest";
78 platforms = platforms.unix ++ platforms.windows;