From 76fd69c674dcb3fe75e8ff97d8219f2392d7d5a0 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 31 Jan 2024 23:53:03 +0000 Subject: [PATCH] gdal: wrap executables in environment containing numpy Since gdal 3.8.1 there is a numpy dependency on the python library it seems. This resulted in broken python scrips such as gdal2tiles.py ``` [nix-shell:~/map-scraper/shake-rg]$ gdal2tiles.py --help ModuleNotFoundError: No module named 'numpy' ``` Therefore it's important to wrap the executables in an environment which contains numpy. --- pkgs/development/libraries/gdal/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix index fd1aaf9c2e92..11228c572e34 100644 --- a/pkgs/development/libraries/gdal/default.nix +++ b/pkgs/development/libraries/gdal/default.nix @@ -198,8 +198,9 @@ stdenv.mkDerivation (finalAttrs: { ++ darwinDeps ++ nonDarwinDeps; + pythonPath = [ python3.pkgs.numpy ]; postInstall = '' - wrapPythonPrograms + wrapPythonProgramsIn "$out/bin" "$out $pythonPath" '' + lib.optionalString useJava '' cd $out/lib ln -s ./jni/libgdalalljni${stdenv.hostPlatform.extensions.sharedLibrary}