From b2bc84602aec214978d05ac006da8171b9870c2c Mon Sep 17 00:00:00 2001 From: Hermenix Date: Sun, 11 Oct 2026 23:04:17 +0000 Subject: [PATCH] build: point TURBOJPEG_PATH at lib.getLib, not the package's default output The default output of libjpeg-turbo in this nixpkgs is the tools (-bin), which has no lib/ at all, so the check failed with 'cannot load libjpeg-turbo from .../-bin/lib/libturbojpeg.so'. lib.getLib selects the output that actually holds the shared library. --- checks/unit.nix | 2 +- nix/package.nix | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/checks/unit.nix b/checks/unit.nix index f5b91ac..7fdaaf2 100644 --- a/checks/unit.nix +++ b/checks/unit.nix @@ -77,7 +77,7 @@ runCommand "hhstream-unit" # exporting it here had no effect and the suite failed with the library plainly # present on the machine. `jpeg._load_library` reads this variable first. export LD_LIBRARY_PATH=${libjpeg_turbo}/lib - export TURBOJPEG_PATH=${libjpeg_turbo}/lib/libturbojpeg.so + export TURBOJPEG_PATH=${lib.getLib libjpeg_turbo}/lib/libturbojpeg.so export PYTHONDONTWRITEBYTECODE=1 export HOME=$PWD python3 -c 'import hhstream; print("testing hhstream", hhstream.__version__, "from", hhstream.__file__)' diff --git a/nix/package.nix b/nix/package.nix index 117ce53..6ac1346 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -38,7 +38,10 @@ python3.pkgs.buildPythonApplication { # one that actually decides, and `jpeg._load_library` checks it first. makeWrapperArgs = [ "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjpeg_turbo ]}" - "--set TURBOJPEG_PATH ${libjpeg_turbo}/lib/libturbojpeg.so" + # `lib.getLib`, not the bare package: the default output of libjpeg-turbo in + # this nixpkgs is the *tools* (`-bin`), which has no `lib/` at all -- pointing + # at it produced "cannot load libjpeg-turbo from .../-bin/lib/libturbojpeg.so". + "--set TURBOJPEG_PATH ${lib.getLib libjpeg_turbo}/lib/libturbojpeg.so" ]; # Unit tests are wired up in the flake's `checks` so they can run without