remove unneccecary substitute and aarch64 platform check

This commit is contained in:
hlolli 2021-05-31 02:18:05 +02:00
parent 1f4163d839
commit b62962b274

View File

@ -14,6 +14,9 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ which ]
++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
preConfigure = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64)
"echo 'HAVE_SANDBOX_INIT=0' > configure.local";
configurePhase = ''
runHook preConfigure
./configure PREFIX=''${!outputDev} \
@ -24,17 +27,12 @@ stdenv.mkDerivation rec {
'';
# Fix lib extension so that fixDarwinDylibNames detects it
postInstall = lib.optionalString (stdenv.isDarwin && !stdenv.isAarch64) ''
postInstall = lib.optionalString (stdenv.isDarwin) ''
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";