default.nix (1815B)
1 { 2 lib, 3 fetchFromGitHub, 4 python3Packages, 5 click, 6 gnumake, 7 curl, 8 unzip, 9 gzip, 10 gdal, 11 testers, 12 elevation, 13 }: 14 15 python3Packages.buildPythonApplication rec { 16 pname = "elevation"; 17 version = "1.1.3"; 18 19 src = fetchFromGitHub { 20 owner = "bopen"; 21 repo = "elevation"; 22 rev = version; 23 hash = "sha256-sZStJgToQtWYrBH1BjqxCUwQUT5dcAlyZwnb4aYga+4="; 24 }; 25 26 build-system = with python3Packages; [ setuptools-scm ]; 27 28 SETUPTOOLS_SCM_PRETEND_VERSION = version; 29 30 dependencies = with python3Packages; [ 31 fasteners 32 appdirs 33 click 34 setuptools 35 ]; 36 37 postPatch = '' 38 for f in elevation/datasource.* \ 39 elevation/util.py \ 40 tests/test_*.py; do 41 substituteInPlace $f \ 42 --replace-warn "make " "${lib.getBin gnumake}/bin/make " \ 43 --replace-warn "curl " "${lib.getBin curl}/bin/curl " \ 44 --replace-warn "gunzip " "gunzip.t " \ 45 --replace-warn "unzip " "${lib.getBin unzip}/bin/unzip " \ 46 --replace-warn "gunzip.t " "${lib.getBin gzip}/bin/gunzip " \ 47 --replace-warn "gdal_translate " "${lib.getBin gdal}/bin/gdal_translate " \ 48 --replace-warn "gdalbuildvrt " "${lib.getBin gdal}/bin/gdalbuildvrt " 49 done 50 ''; 51 52 nativeCheckInputs = with python3Packages; [ 53 pytestCheckHook 54 pytest-mock 55 ]; 56 57 postInstall = '' 58 install -Dm644 elevation/datasource.mk -t $out/lib/${python3Packages.python.libPrefix}/site-packages/elevation 59 ''; 60 61 passthru.tests.version = testers.testVersion { package = elevation; }; 62 63 meta = { 64 description = "Python script to download global terrain digital elevation models, SRTM 30m DEM and SRTM 90m DEM"; 65 homepage = "http://elevation.bopen.eu/"; 66 license = lib.licenses.asl20; 67 maintainers = [ lib.maintainers.sikmir ]; 68 mainProgram = "eio"; 69 }; 70 }