From 3bb7b6d06e1d0350b2681252ec9e5b32cdd9af04 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 16 Nov 2025 11:20:19 +0100 Subject: [PATCH 1/4] lowdown: unset doInstallCheck instead of emptying installCheckPhase --- pkgs/by-name/lo/lowdown/package.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/lo/lowdown/package.nix b/pkgs/by-name/lo/lowdown/package.nix index 0ed05f596982..d9ba6692ae52 100644 --- a/pkgs/by-name/lo/lowdown/package.nix +++ b/pkgs/by-name/lo/lowdown/package.nix @@ -97,9 +97,8 @@ stdenv.mkDerivation rec { rm "$lib/lib/liblowdown.so" ''; - doInstallCheck = true; - - installCheckPhase = lib.optionalString (!stdenv.hostPlatform.isDarwin || !enableDarwinSandbox) '' + doInstallCheck = !stdenv.hostPlatform.isDarwin || !enableDarwinSandbox; + installCheckPhase = '' runHook preInstallCheck echo '# TEST' > test.md From 4a9fbcf73f675e8fa902e16adf804406d40f6bc9 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sun, 16 Nov 2025 11:23:19 +0100 Subject: [PATCH 2/4] lowdown: add unsandboxed variant to passthru.tests --- pkgs/by-name/lo/lowdown/package.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/lo/lowdown/package.nix b/pkgs/by-name/lo/lowdown/package.nix index d9ba6692ae52..527512bfb963 100644 --- a/pkgs/by-name/lo/lowdown/package.nix +++ b/pkgs/by-name/lo/lowdown/package.nix @@ -11,6 +11,7 @@ enableDarwinSandbox ? true, # for passthru.tests nix, + lowdown-unsandboxed, }: stdenv.mkDerivation rec { @@ -111,8 +112,8 @@ stdenv.mkDerivation rec { checkTarget = "regress"; passthru.tests = { - # most important consumer in nixpkgs - inherit nix; + # most important consumers in nixpkgs + inherit nix lowdown-unsandboxed; }; meta = with lib; { From 44da5f3b3519c0c95c4da042d7b3dae4e627b9c5 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 16 Nov 2025 10:55:14 +0000 Subject: [PATCH 3/4] lowdown: 2.0.2 -> 2.0.3 Changes: https://github.com/kristapsdz/lowdown/releases/tag/VERSION_2_0_3 - 2.0.3 notably adds support for building a proper Darwin dylib, but messes up the naming scheme of versioned dylibs, so we still have to rename them in postInstall. See https://github.com/kristapsdz/lowdown/issues/168. - make regress no longer ignores failures (?!), so we can no longer run the test suite on darwin if sandboxing is enabled. See https://github.com/kristapsdz/lowdown/commit/4bfd934330ffdb92126. Co-authored-by: sternenseemann --- pkgs/by-name/lo/lowdown/package.nix | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/lo/lowdown/package.nix b/pkgs/by-name/lo/lowdown/package.nix index 527512bfb963..22e9d4347433 100644 --- a/pkgs/by-name/lo/lowdown/package.nix +++ b/pkgs/by-name/lo/lowdown/package.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { pname = "lowdown${ lib.optionalString (stdenv.hostPlatform.isDarwin && !enableDarwinSandbox) "-unsandboxed" }"; - version = "2.0.2"; + version = "2.0.3"; outputs = [ "out" @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz"; - hash = "sha512-cfzhuF4EnGmLJf5EGSIbWqJItY3npbRSALm+GarZ7SMU7Hr1xw0gtBFMpOdi5PBar4TgtvbnG4oRPh+COINGlA=="; + hash = "sha512-QJ+SOuL0BgvhUBscCuoAPeVcfUBGBmSZoSK5imQftwg8z8fQa7y4fjiq3FERx4dXVocchR8F4a43lL51KPWj/g=="; }; nativeBuildInputs = [ @@ -39,6 +39,12 @@ stdenv.mkDerivation rec { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; + postPatch = '' + # fails test, some column width mismatch + rm regress/table-footnotes.md + rm regress/table-styles.md + ''; + # The Darwin sandbox calls fail inside Nix builds, presumably due to # being nested inside another sandbox. preConfigure = lib.optionalString (stdenv.hostPlatform.isDarwin && !enableDarwinSandbox) '' @@ -85,17 +91,16 @@ stdenv.mkDerivation rec { 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 - # . + # Versioned lib doesn't end in .dylib which is required by fixDarwinDylibNames + # . + lib.optionalString (enableShared && stdenv.hostPlatform.isDarwin) '' darwinDylib="$lib/lib/liblowdown.${soVersion}.dylib" - mv "$lib/lib/liblowdown.so.${soVersion}" "$darwinDylib" + mv "$lib/lib/liblowdown.dylib.${soVersion}" "$darwinDylib" # Make sure we are re-creating a symbolic link here - 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" + test -L "$lib/lib/liblowdown.dylib" || \ + die "postInstall: expected $lib/lib/liblowdown.dylib to be a symlink" + ln -sf "$darwinDylib" "$lib/lib/liblowdown.dylib" ''; doInstallCheck = !stdenv.hostPlatform.isDarwin || !enableDarwinSandbox; @@ -108,7 +113,7 @@ stdenv.mkDerivation rec { runHook postInstallCheck ''; - doCheck = true; + doCheck = !stdenv.hostPlatform.isDarwin || !enableDarwinSandbox; checkTarget = "regress"; passthru.tests = { From 5d1fa9f208adc656e05e03b1b72e3aaa84d3cefa Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Fri, 21 Nov 2025 15:27:30 +0100 Subject: [PATCH 4/4] lowdown: 2.0.3 -> 2.0.4 This version finally installs correctly named .dylibs on darwin! --- pkgs/by-name/lo/lowdown/package.nix | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/pkgs/by-name/lo/lowdown/package.nix b/pkgs/by-name/lo/lowdown/package.nix index 22e9d4347433..7ea55e19f137 100644 --- a/pkgs/by-name/lo/lowdown/package.nix +++ b/pkgs/by-name/lo/lowdown/package.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { pname = "lowdown${ lib.optionalString (stdenv.hostPlatform.isDarwin && !enableDarwinSandbox) "-unsandboxed" }"; - version = "2.0.3"; + version = "2.0.4"; outputs = [ "out" @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { src = fetchurl { url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz"; - hash = "sha512-QJ+SOuL0BgvhUBscCuoAPeVcfUBGBmSZoSK5imQftwg8z8fQa7y4fjiq3FERx4dXVocchR8F4a43lL51KPWj/g=="; + sha512 = "649a508b7727df6e7e1203abb3853e05f167b64832fd5e1271f142ccf782e600b1de73c72dc02673d7b175effdc54f2c0f60318208a968af9f9763d09cf4f9ef"; }; nativeBuildInputs = [ @@ -81,28 +81,6 @@ stdenv.mkDerivation rec { "install_static" ]; - postInstall = - let - soVersion = "2"; - in - - # Check that soVersion is up to date even if we are not on darwin - lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin) '' - test -f $lib/lib/liblowdown.so.${soVersion} || \ - die "postInstall: expected $lib/lib/liblowdown.so.${soVersion} is missing" - '' - # Versioned lib doesn't end in .dylib which is required by fixDarwinDylibNames - # . - + lib.optionalString (enableShared && stdenv.hostPlatform.isDarwin) '' - darwinDylib="$lib/lib/liblowdown.${soVersion}.dylib" - mv "$lib/lib/liblowdown.dylib.${soVersion}" "$darwinDylib" - - # Make sure we are re-creating a symbolic link here - test -L "$lib/lib/liblowdown.dylib" || \ - die "postInstall: expected $lib/lib/liblowdown.dylib to be a symlink" - ln -sf "$darwinDylib" "$lib/lib/liblowdown.dylib" - ''; - doInstallCheck = !stdenv.hostPlatform.isDarwin || !enableDarwinSandbox; installCheckPhase = '' runHook preInstallCheck