7 , static ? stdenv.hostPlatform.isStatic
10 stdenv.mkDerivation rec {
15 url = "https://github.com/silnrsi/graphite/releases/download/"
16 + "${version}/graphite2-${version}.tgz";
17 sha256 = "1790ajyhk0ax8xxamnrk176gc9gvhadzy78qia4rd8jzm89ir7gr";
20 outputs = [ "out" "dev" ];
22 nativeBuildInputs = [ pkg-config cmake ];
23 buildInputs = [ freetype ];
25 patches = lib.optionals stdenv.isDarwin [ ./macosx.patch ];
27 # disable broken 'nametabletest' test, fails on gcc-13:
28 # https://github.com/silnrsi/graphite/pull/74
29 substituteInPlace tests/CMakeLists.txt \
30 --replace 'add_subdirectory(nametabletest)' '#add_subdirectory(nametabletest)'
33 cmakeFlags = lib.optionals static [
34 "-DBUILD_SHARED_LIBS=OFF"
37 # Remove a test that fails to statically link (undefined reference to png and
39 postConfigure = lib.optionalString static ''
40 sed -e '/freetype freetype.c/d' -i ../tests/examples/CMakeLists.txt
46 description = "An advanced font engine";
47 homepage = "https://graphite.sil.org/";
48 license = licenses.lgpl21;
49 maintainers = [ maintainers.raskin ];
50 mainProgram = "gr2fonttest";
51 platforms = platforms.unix;