2021-06-18 19:32:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, pkg-config
|
|
|
|
, freetype
|
|
|
|
, cmake
|
|
|
|
, static ? stdenv.hostPlatform.isStatic
|
2021-05-17 21:43:27 +00:00
|
|
|
, libgcc
|
2021-06-18 19:32:56 +00:00
|
|
|
}:
|
2013-10-14 06:36:39 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-01 12:37:32 +00:00
|
|
|
version = "1.3.14";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "graphite2";
|
2013-11-24 11:43:22 +00:00
|
|
|
|
2013-10-14 06:36:39 +00:00
|
|
|
src = fetchurl {
|
2016-03-14 14:18:57 +00:00
|
|
|
url = "https://github.com/silnrsi/graphite/releases/download/"
|
2019-11-25 03:05:39 +00:00
|
|
|
+ "${version}/graphite2-${version}.tgz";
|
2020-04-01 12:37:32 +00:00
|
|
|
sha256 = "1790ajyhk0ax8xxamnrk176gc9gvhadzy78qia4rd8jzm89ir7gr";
|
2013-10-14 06:36:39 +00:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
2021-05-17 21:43:27 +00:00
|
|
|
buildInputs = [ freetype ]
|
2021-09-14 17:49:09 +00:00
|
|
|
# On aarch64-darwin libgcc won't even build currently, and it doesn't seem needed.
|
|
|
|
++ lib.optionals (with stdenv; !cc.isGNU && !(isDarwin && isAarch64)) [ libgcc ];
|
2013-10-14 06:36:39 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
patches = lib.optionals stdenv.isDarwin [ ./macosx.patch ];
|
2014-06-01 05:51:16 +00:00
|
|
|
|
2021-06-18 19:32:56 +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-18 00:14:20 +00:00
|
|
|
postConfigure = lib.optionalString static ''
|
2021-06-18 19:32:56 +00:00
|
|
|
sed -e '/freetype freetype.c/d' -i ../tests/examples/CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/src/
|
|
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/src/
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2018-08-08 19:02:57 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2013-10-14 06:36:39 +00:00
|
|
|
description = "An advanced font engine";
|
2018-10-27 13:27:09 +00:00
|
|
|
maintainers = [ maintainers.raskin ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.lgpl21;
|
2013-10-14 06:36:39 +00:00
|
|
|
};
|
|
|
|
}
|