nur-packages

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

default.nix (1626B)


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