nur-packages

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

default.nix (1762B)


      1 { lib, stdenv, fetchFromGitHub, fetchurl, unzip, mkgmap, mkgmap-splitter }:
      2 let
      3   version = "220808";
      4   data = fetchurl {
      5     url = "https://download.geofabrik.de/russia/northwestern-fed-district-${version}.osm.pbf";
      6     hash = "sha256-YEIsIPrJQYF9HI5lzkU9BOR4D3FxFeTbBMecojunx7A=";
      7   };
      8   bounds = fetchurl {
      9     url = "http://osm.thkukuk.de/data/bounds-20220729.zip";
     10     hash = "sha256-u/8uDVR0RCWn28wez39J4fya5czIG2tTLyAAExiYcFM=";
     11   };
     12   sea = fetchurl {
     13     url = "http://osm.thkukuk.de/data/sea-20220809001529.zip";
     14     hash = "sha256-0Nnt7tDZ/qvKfkCfE6Q1CjrqpPRxv1Gd762CK75a0Mo=";
     15   };
     16 in
     17 stdenv.mkDerivation rec {
     18   pname = "opentopomap";
     19   inherit version;
     20 
     21   src = fetchFromGitHub {
     22     owner = "der-stefan";
     23     repo = "OpenTopoMap";
     24     rev = "e4467cfc2064afc379b0f8e8360db1740099cca3";
     25     hash = "sha256-3fymFZHFnivdgIWaJiRK6bvIRIay4+AnN1ns67lvq5I=";
     26   };
     27 
     28   sourceRoot = "${src.name}/garmin";
     29 
     30   nativeBuildInputs = [ mkgmap mkgmap-splitter unzip ];
     31 
     32   postPatch = ''
     33     unzip ${bounds} -d bounds
     34     unzip ${sea}
     35     mkdir data
     36   '';
     37 
     38   buildPhase = ''
     39     (cd data && splitter --precomp-sea=../sea --output=o5m ${data})
     40     (cd style/typ && mkgmap --family-id=35 opentopomap.txt)
     41 
     42     mkgmap \
     43       -c opentopomap_options \
     44       --style-file=style/opentopomap \
     45       --precomp-sea=sea \
     46       --output-dir=output \
     47       --bounds=bounds \
     48       data/6324*.o5m \
     49       style/typ/opentopomap.typ
     50   '';
     51 
     52   installPhase = ''
     53     install -Dm644 output/gmapsupp.img $out/otm-russia-nwfd.img
     54   '';
     55 
     56   meta = with lib; {
     57     description = "OpenTopoMap Garmin Edition";
     58     homepage = "https://garmin.opentopomap.org/";
     59     license = licenses.free;
     60     maintainers = [ maintainers.sikmir ];
     61     platforms = platforms.all;
     62     skip.ci = true;
     63   };
     64 }