graphite2: enable static build and check phase

This commit is contained in:
Marco A L Barbosa 2021-06-18 16:32:56 -03:00
parent d1ac06b009
commit 5df7099df9

View file

@ -1,4 +1,11 @@
{ lib, stdenv, fetchurl, pkg-config, freetype, cmake }:
{ lib
, stdenv
, fetchurl
, pkg-config
, freetype
, cmake
, static ? stdenv.hostPlatform.isStatic
}:
stdenv.mkDerivation rec {
version = "1.3.14";
@ -15,7 +22,22 @@ stdenv.mkDerivation rec {
patches = lib.optionals stdenv.isDarwin [ ./macosx.patch ];
doCheck = false; # fails, probably missing something
cmakeFlags = lib.optionals static [
"-DBUILD_SHARED_LIBS=OFF"
];
# Remove a test that fails to statically link (undefined reference to png and
# freetype symbols)
postConfigure = lib.optionals static ''
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;
meta = with lib; {
description = "An advanced font engine";