@@ -14,6 +14,9 @@ stdenv.mkDerivation rec {
1414 nativeBuildInputs = [ which ]
1515 ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
1616
17+ preConfigure = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64)
18+ "echo 'HAVE_SANDBOX_INIT=0' > configure.local";
19+
1720 configurePhase = ''
1821 runHook preConfigure
1922 ./configure PREFIX=''${!outputDev} \
@@ -24,17 +27,12 @@ stdenv.mkDerivation rec {
2427 '';
2528
2629 # Fix lib extension so that fixDarwinDylibNames detects it
27− postInstall = lib.optionalString (stdenv.isDarwin && !stdenv.isAarch64) ''
30+ postInstall = lib.optionalString (stdenv.isDarwin) ''
2831 mv $lib/lib/liblowdown.{so,dylib}
2932 '';
3033
3134 patches = lib.optional (!stdenv.hostPlatform.isStatic) ./shared.patch;
3235
33− patchPhase = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
34− substituteInPlace main.c \
35− --replace '#elif HAVE_SANDBOX_INIT' '#elif 0'
36− '';
37−
3836 doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform;
3937 installCheckPhase = "echo '# TEST' > test.md; $out/bin/lowdown test.md";
4038