libepoxy: refactor conditional preCheck

This commit is contained in:
Dmitry Kalinkin 2021-12-11 23:49:24 -05:00
parent c9809bb908
commit 5f9866d1e6
No known key found for this signature in database
GPG Key ID: 5157B3EC8B2CA333

View File

@ -16,7 +16,7 @@ let
inherit (lib) getLib optional optionalString;
in
stdenv.mkDerivation (rec {
stdenv.mkDerivation rec {
pname = "libepoxy";
version = "1.5.9";
@ -55,6 +55,12 @@ stdenv.mkDerivation (rec {
NIX_CFLAGS_COMPILE = ''-DLIBGL_PATH="${getLib libGL}/lib"'';
# cgl_epoxy_api fails in darwin sandbox and on Hydra (because it's headless?)
preCheck = lib.optionalString stdenv.isDarwin ''
substituteInPlace ../test/meson.build \
--replace "[ 'cgl_epoxy_api', [ 'cgl_epoxy_api.c' ] ]," ""
'';
# tests are running from version 1.5.9
doCheck = true;
@ -65,10 +71,4 @@ stdenv.mkDerivation (rec {
maintainers = with maintainers; [ goibhniu erictapen ];
platforms = platforms.unix;
};
} // lib.optionalAttrs stdenv.isDarwin {
# cgl_epoxy_api fails in darwin sandbox and on Hydra (because it's headless?)
preCheck = ''
substituteInPlace ../test/meson.build \
--replace "[ 'cgl_epoxy_api', [ 'cgl_epoxy_api.c' ] ]," ""
'';
})
}