commit a2be8cda953facf7a6ebd5df9a5602823e040970 parent 7720eb7a003b6aff22c703a40d8466d1a5f35fda Author: Nikolay Korotkiy <sikmir@gmail.com> Date: Sun, 8 Aug 2021 14:31:14 +0300 Add mbtiles2osmand Diffstat:
M | pkgs/default.nix | | | 1 | + |
A | pkgs/tools/geo/mbtiles2osmand/default.nix | | | 44 | ++++++++++++++++++++++++++++++++++++++++++++ |
2 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -113,6 +113,7 @@ lib.makeScope newScope ( click = click-6-7; }; go-staticmaps = callPackage ./tools/geo/go-staticmaps { }; + mbtiles2osmand = callPackage ./tools/geo/mbtiles2osmand { }; py-staticmaps = callPackage ./tools/geo/py-staticmaps { }; render_geojson = callPackage ./tools/geo/render_geojson { }; supermercado = callPackage ./tools/geo/supermercado { }; diff --git a/pkgs/tools/geo/mbtiles2osmand/default.nix b/pkgs/tools/geo/mbtiles2osmand/default.nix @@ -0,0 +1,44 @@ +{ lib +, fetchFromGitHub +, python3Packages +}: + +python3Packages.buildPythonApplication rec { + pname = "mbtiles2osmand"; + version = "2021-01-01"; + + src = fetchFromGitHub { + owner = "tarwirdur"; + repo = pname; + rev = "5084a6ff9c60794044a751cc62ef84b6e37a342e"; + hash = "sha256-vghESjT6Pklq7IjxTEIHfTxX2B3eCgUl9CP+eJntByA="; + }; + + dontUseSetuptoolsBuild = true; + dontUseSetuptoolsCheck = true; + + installPhase = + let + pythonEnv = python3Packages.python.withPackages (p: with p; [ + pillow + ]); + in + '' + site_packages=$out/lib/${python3Packages.python.libPrefix}/site-packages + mkdir -p $site_packages + cp *.py $site_packages + + makeWrapper ${pythonEnv.interpreter} $out/bin/mbtiles2osmand \ + --add-flags "$site_packages/mbtiles2osmand.py" + makeWrapper ${pythonEnv.interpreter} $out/bin/unite_osmand \ + --add-flags "$site_packages/unite_osmand.py" + ''; + + meta = with lib; { + description = "Converts mbtiles format to sqlitedb format suitable for OsmAnd and RMaps"; + inherit (src.meta) homepage; + license = licenses.mit; + maintainers = with maintainers; [ sikmir ]; + platforms = platforms.unix; + }; +}