From 1079029f407cbcfa386164eb76710efee62de8c1 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 20 Jun 2023 00:42:59 +0200 Subject: [PATCH] lowdown: make assertions in postInstall prettier --- pkgs/tools/typesetting/lowdown/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/typesetting/lowdown/default.nix b/pkgs/tools/typesetting/lowdown/default.nix index dde9e5ac9ce6..e4c904fffbc6 100644 --- a/pkgs/tools/typesetting/lowdown/default.nix +++ b/pkgs/tools/typesetting/lowdown/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, fixDarwinDylibNames, which +{ lib, stdenv, fetchurl, fixDarwinDylibNames, which, dieHook , enableShared ? !(stdenv.hostPlatform.isStatic) , enableStatic ? stdenv.hostPlatform.isStatic # for passthru.tests @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { sha512 = "1cizrzmldi7lrgdkpn4b6skp1b5hz2jskkbcbv9k6lmz08clm02gyifh7fgd8j2rklqsim34n5ifyg83xhsjzd57xqjys1ccjdn3a5m"; }; - nativeBuildInputs = [ which ] + nativeBuildInputs = [ which dieHook ] ++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ]; preConfigure = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) '' @@ -52,9 +52,8 @@ stdenv.mkDerivation rec { # Check that soVersion is up to date even if we are not on darwin lib.optionalString (enableShared && !stdenv.isDarwin) '' - set -x - test -f $lib/lib/liblowdown.so.${soVersion} - set +x + test -f $lib/lib/liblowdown.so.${soVersion} || \ + die "postInstall: expected $lib/lib/liblowdown.so.${soVersion} is missing" '' # Fix lib extension so that fixDarwinDylibNames detects it, see # . @@ -63,7 +62,8 @@ stdenv.mkDerivation rec { mv "$lib/lib/liblowdown.so.${soVersion}" "$darwinDylib" # Make sure we are re-creating a symbolic link here - test -L "$lib/lib/liblowdown.so" + test -L "$lib/lib/liblowdown.so" || \ + die "postInstall: expected $lib/lib/liblowdown.so to be a symlink" ln -s "$darwinDylib" "$lib/lib/liblowdown.dylib" rm "$lib/lib/liblowdown.so" '';