about summary refs log tree commit diff
path: root/pkgs/tools/typesetting
diff options
context:
space:
mode:
authorhlolli <hlolli@gmail.com>2021-05-31 01:16:46 +0200
committerhlolli <hlolli@gmail.com>2021-05-31 01:16:46 +0200
commit1f4163d8394b5fa933368d10853f106bebe9c18d (patch)
treede6403392df2d2868b20b5c76ac8edfb96153039 /pkgs/tools/typesetting
parentfbb9b0f1b32409d4493afea15a53f8ef5705a7a5 (diff)
downloadnixlib-1f4163d8394b5fa933368d10853f106bebe9c18d.tar
nixlib-1f4163d8394b5fa933368d10853f106bebe9c18d.tar.gz
nixlib-1f4163d8394b5fa933368d10853f106bebe9c18d.tar.bz2
nixlib-1f4163d8394b5fa933368d10853f106bebe9c18d.tar.lz
nixlib-1f4163d8394b5fa933368d10853f106bebe9c18d.tar.xz
nixlib-1f4163d8394b5fa933368d10853f106bebe9c18d.tar.zst
nixlib-1f4163d8394b5fa933368d10853f106bebe9c18d.zip
fix deprecated sandbox.h features, causing impure syscalls on aarch64-darwin
Diffstat (limited to 'pkgs/tools/typesetting')
-rw-r--r--pkgs/tools/typesetting/lowdown/default.nix11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/tools/typesetting/lowdown/default.nix b/pkgs/tools/typesetting/lowdown/default.nix
index b9b5e806a4ec..2de00702a388 100644
--- a/pkgs/tools/typesetting/lowdown/default.nix
+++ b/pkgs/tools/typesetting/lowdown/default.nix
@@ -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;
   };
 }
-