fix deprecated sandbox.h features, causing impure syscalls on aarch64-darwin

This commit is contained in:
hlolli 2021-05-31 01:16:46 +02:00
parent fbb9b0f1b3
commit 1f4163d839

View file

@ -24,12 +24,20 @@ stdenv.mkDerivation rec {
'';
# Fix lib extension so that fixDarwinDylibNames detects it
postInstall = lib.optionalString stdenv.isDarwin ''
postInstall = lib.optionalString (stdenv.isDarwin && !stdenv.isAarch64) ''
mv $lib/lib/liblowdown.{so,dylib}
'';
patches = lib.optional (!stdenv.hostPlatform.isStatic) ./shared.patch;
patchPhase = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
substituteInPlace main.c \
--replace '#elif HAVE_SANDBOX_INIT' '#elif 0'
'';
doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform;
installCheckPhase = "echo '# TEST' > test.md; $out/bin/lowdown test.md";
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
checkTarget = "regress";
@ -41,4 +49,3 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
};
}