From 86a6a4887639ebae64e8d200b75c5b7055e173a3 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 27 May 2023 12:51:13 +0200 Subject: [PATCH] lowdown: check if soVersion is up to date on non darwin --- pkgs/tools/typesetting/lowdown/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/typesetting/lowdown/default.nix b/pkgs/tools/typesetting/lowdown/default.nix index 6064f6ddc96c..8dd9a1fd7cd0 100644 --- a/pkgs/tools/typesetting/lowdown/default.nix +++ b/pkgs/tools/typesetting/lowdown/default.nix @@ -44,15 +44,21 @@ stdenv.mkDerivation rec { "install_static" ]; - # Fix lib extension so that fixDarwinDylibNames detects it, see - # . postInstall = let inherit (stdenv.hostPlatform.extensions) sharedLibrary; soVersion = "2"; in - lib.optionalString (enableShared && stdenv.isDarwin) '' + # 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 + '' + # Fix lib extension so that fixDarwinDylibNames detects it, see + # . + + lib.optionalString (enableShared && stdenv.isDarwin) '' darwinDylib="$lib/lib/liblowdown.${soVersion}.dylib" mv "$lib/lib/liblowdown.so.${soVersion}" "$darwinDylib"