nur-packages

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

default.nix (1150B)


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