Skip to content

Commit

Permalink
gdal: wrap executables in environment containing numpy
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mpickering authored and imincik committed Feb 14, 2024
1 parent c5e9528 commit 76fd69c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkgs/development/libraries/gdal/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 76fd69c

Please sign in to comment.