2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, freetype
|
|
|
|
, cmake
|
|
|
|
, static ? stdenv.hostPlatform.isStatic
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.3.14";
|
|
|
|
pname = "graphite2";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/silnrsi/graphite/releases/download/"
|
|
|
|
+ "${version}/graphite2-${version}.tgz";
|
|
|
|
sha256 = "1790ajyhk0ax8xxamnrk176gc9gvhadzy78qia4rd8jzm89ir7gr";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2022-12-17 10:02:37 +00:00
|
|
|
buildInputs = [ freetype ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
patches = lib.optionals stdenv.isDarwin [ ./macosx.patch ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
cmakeFlags = lib.optionals static [
|
|
|
|
"-DBUILD_SHARED_LIBS=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Remove a test that fails to statically link (undefined reference to png and
|
|
|
|
# freetype symbols)
|
2021-08-22 07:53:02 +00:00
|
|
|
postConfigure = lib.optionalString static ''
|
2021-07-14 22:03:04 +00:00
|
|
|
sed -e '/freetype freetype.c/d' -i ../tests/examples/CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An advanced font engine";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://graphite.sil.org/";
|
|
|
|
license = licenses.lgpl21;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.raskin ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "gr2fonttest";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|