nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1211B)


      1 {
      2   lib,
      3   python3Packages,
      4   fetchFromGitHub,
      5   fetchurl,
      6   writableTmpDirAsHomeHook,
      7 }:
      8 let
      9   testdata = import ./testdata.nix { inherit fetchurl; };
     10 in
     11 python3Packages.buildPythonApplication rec {
     12   pname = "gpxelevations";
     13   version = "0.3.7";
     14 
     15   src = fetchFromGitHub {
     16     owner = "tkrajina";
     17     repo = "srtm.py";
     18     tag = "v${version}";
     19     hash = "sha256-/AGvFE74sJTnn70VklQp0MG+7dsooavAdSTyV2oJM+I=";
     20   };
     21 
     22   postPatch = ''
     23     # https://docs.python.org/3/whatsnew/3.12.html#id3
     24     substituteInPlace test.py \
     25       --replace-fail assertNotEquals assertNotEqual
     26   '';
     27 
     28   dependencies = with python3Packages; [
     29     requests
     30     gpxpy
     31   ];
     32 
     33   nativeCheckInputs = [ writableTmpDirAsHomeHook ];
     34 
     35   dontUseSetuptoolsCheck = true;
     36 
     37   checkPhase = ''
     38     mkdir -p $HOME/.cache/srtm
     39     ${lib.concatMapStringsSep "\n" (hgt: ''
     40       cp ${hgt} $HOME/.cache/srtm/${hgt.name}
     41     '') testdata}
     42 
     43     ${python3Packages.python.interpreter} -m unittest test
     44   '';
     45 
     46   meta = {
     47     description = "Geo elevation data parser for \"The Shuttle Radar Topography Mission\" data";
     48     homepage = "https://github.com/tkrajina/srtm.py";
     49     license = lib.licenses.asl20;
     50     maintainers = [ lib.maintainers.sikmir ];
     51   };
     52 }