commit 89a5d4266abc2563eef3763b079416f1d5ab38a3
parent fea6c665969de9fff9954d2862b463df08fb4949
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Wed, 19 Feb 2020 09:46:06 +0300
Add slazav maps
Diffstat:
6 files changed, 210 insertions(+), 0 deletions(-)
diff --git a/nix/sources.json b/nix/sources.json
@@ -246,6 +246,32 @@
"url": "https://github.com/sv99/lsdreader/archive/c78ab22e794f1fbfbc93ffb3ee7ae481f54dd8c2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
+ "map_hr": {
+ "branch": "master",
+ "builtin": false,
+ "description": "Slazav mountains",
+ "homepage": "http://slazav.mccme.ru/maps/",
+ "owner": "slazav",
+ "repo": "map_hr",
+ "rev": "1555f0e49e8b26b5991c6b8ce8ea1f0688b26047",
+ "sha256": "1ymyyx4z35vicrr5hz12fcjgdy60vfbjfv2m4m154vw4ay7216wa",
+ "type": "tarball",
+ "url": "https://github.com/slazav/map_hr/archive/1555f0e49e8b26b5991c6b8ce8ea1f0688b26047.tar.gz",
+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
+ },
+ "map_podm": {
+ "branch": "master",
+ "builtin": false,
+ "description": "Карты Подмосковья в виде номенклатурных листов 1:100000 - исходники в формате mapsoft vmap",
+ "homepage": "http://slazav.mccme.ru/maps/",
+ "owner": "slazav",
+ "repo": "map_podm",
+ "rev": "6083ef51c543c4587186acf9792ebc8299554773",
+ "sha256": "1pww6zkh2wphh595g137xlpqxsrjki7bx1iv437dcsn7gg0a5mh9",
+ "type": "tarball",
+ "url": "https://github.com/slazav/map_podm/archive/6083ef51c543c4587186acf9792ebc8299554773.tar.gz",
+ "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
+ },
"mapper": {
"branch": "master",
"builtin": false,
diff --git a/pkgs/data/maps/slazav/0001-fix-hr.patch b/pkgs/data/maps/slazav/0001-fix-hr.patch
@@ -0,0 +1,62 @@
+diff --git i/Makefile w/Makefile
+index d15480e..5c2a0d1 100644
+--- i/Makefile
++++ w/Makefile
+@@ -9,9 +9,9 @@ sync:
+
+ img:
+ gmt -j -v -m "SLAZAV-1" -o ${IMG_NAME} OUT/*.img /usr/share/mapsoft/slazav.typ
+- mv -f ${IMG_NAME} /home/sla/CH/data/maps/
+- sed -e "/${IMG_NAME}/s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/$(date +%F)/"\
+- -i /home/sla/CH/data/maps/index.m4i
++ #mv -f ${IMG_NAME} /home/sla/CH/data/maps/
++ #sed -e "/${IMG_NAME}/s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/$(date +%F)/"\
++ # -i /home/sla/CH/data/maps/index.m4i
+
+ index: index_fan index_pam index_zab index_saj index_tsh index_kav index_nep index_put\
+ index_ura index_sun index_chi
+diff --git i/bin/make_in.sh w/bin/make_in.sh
+index 84ab728..47c25ec 100755
+--- i/bin/make_in.sh
++++ w/bin/make_in.sh
+@@ -59,7 +59,7 @@ for i in $IN_DIR/*.fig $IN_DIR/*.mp; do
+ $sources -o "$vmap"
+
+ if [ -s "$old" ]; then
+- ~/mapsoft/vector/vmap3/vmap_fix_diff "$old" "$vmap" "$vmap"
++ vmap_fix_diff "$old" "$vmap" "$vmap"
+ fi
+
+ rm -f "$old"
+diff --git i/bin/make_out.sh w/bin/make_out.sh
+index 3d8eb2a..7e26b23 100755
+--- i/bin/make_out.sh
++++ w/bin/make_out.sh
+@@ -33,6 +33,7 @@ for i in $VMAP_DIR/*.vmap; do
+ if [ "$png" -ot "$i" ]; then
+ echo "Updating png: $name"
+
++ mkdir -p -- "$LAST_PNG_DIR"
+ [ -s "$png" ] &&
+ convert "$png" -scale 50% "$LAST_PNG_DIR/${name}_o.png" ||:
+
+diff --git i/settings.sh w/settings.sh
+index 369dcef..13a7669 100644
+--- i/settings.sh
++++ w/settings.sh
+@@ -5,11 +5,11 @@ export PATH=./:bin/:$PATH
+ export STYLE=hr
+
+ export FIG_DIR=fig
+-export VMAP_DIR=/home/sla/map_hr/vmap
++export VMAP_DIR=vmap
+
+ export SCALE=100000
+
+-export IN_DIR=/home/sla/map_hr/IN
+-export OUT_DIR=/home/sla/map_hr/OUT
++export IN_DIR=IN
++export OUT_DIR=OUT
+
+ export FILTER=mmb
+\ No newline at end of file
diff --git a/pkgs/data/maps/slazav/0001-fix-podm.patch b/pkgs/data/maps/slazav/0001-fix-podm.patch
@@ -0,0 +1,30 @@
+diff --git i/Makefile w/Makefile
+index 71dc2f7..5b91335 100644
+--- i/Makefile
++++ w/Makefile
+@@ -6,9 +6,9 @@ sync:
+ ./sync_sv
+ img:
+ gmt -j -v -m "SLAZAV-1" -o podm.img OUT/?36*.img OUT/?37*.img /usr/share/mapsoft/slazav.typ
+- mv -f podm.img /home/sla/CH/data/maps/
+- sed -e "/podm.img/s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/$(date +%F)/"\
+- -i /home/sla/CH/data/maps/index.m4i
++ #mv -f podm.img /home/sla/CH/data/maps/
++ #sed -e "/podm.img/s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/$(date +%F)/"\
++ # -i /home/sla/CH/data/maps/index.m4i
+
+ #index:
+ # . ./settings.sh; map_update_index.sh 600000x400000+7085000+5970000
+diff --git i/bin/make_in.sh w/bin/make_in.sh
+index 731dcc6..ce3f59f 100755
+--- i/bin/make_in.sh
++++ w/bin/make_in.sh
+@@ -54,7 +54,7 @@ for i in $IN_DIR/*.fig $IN_DIR/*.mp; do
+ $sources -o "$vmap"
+
+ if [ -s "$old" ]; then
+- ~/mapsoft/vector/vmap3/vmap_fix_diff "$old" "$vmap" "$vmap"
++ vmap_fix_diff "$old" "$vmap" "$vmap"
+ fi
+
+ rm -f "$old"
diff --git a/pkgs/data/maps/slazav/hr.nix b/pkgs/data/maps/slazav/hr.nix
@@ -0,0 +1,46 @@
+{ stdenv, cgpsmapper, gmaptool, imagemagick, mapsoft, netpbm, zip, sources }:
+
+stdenv.mkDerivation rec {
+ pname = "slazav-hr";
+ version = stdenv.lib.substring 0 7 src.rev;
+ src = sources.map_hr;
+
+ patches = [ ./0001-fix-hr.patch ];
+
+ nativeBuildInputs = [
+ cgpsmapper
+ gmaptool
+ imagemagick
+ mapsoft
+ netpbm
+ zip
+ ];
+
+ postPatch = ''
+ substituteInPlace Makefile \
+ --replace "/usr/share/mapsoft" "${mapsoft}/share/mapsoft"
+ substituteInPlace bin/map_update_index.sh \
+ --replace "/usr/share/mapsoft" "${mapsoft}/share/mapsoft"
+
+ patchShebangs ./bin
+ '';
+
+ dontConfigure = true;
+
+ preBuild = "mkdir -p OUT";
+
+ buildFlags = [ "out" "img" ];
+
+ preferLocalBuild = true;
+
+ installPhase = ''
+ install -Dm644 hr.img -t "$out/share/gpxsee/maps"
+ '';
+
+ meta = with stdenv.lib; {
+ inherit (src) description homepage;
+ license = licenses.free;
+ maintainers = with maintainers; [ sikmir ];
+ platforms = platforms.all;
+ };
+}
diff --git a/pkgs/data/maps/slazav/podm.nix b/pkgs/data/maps/slazav/podm.nix
@@ -0,0 +1,44 @@
+{ stdenv, cgpsmapper, gmaptool, imagemagick, mapsoft, netpbm, zip, sources }:
+
+stdenv.mkDerivation rec {
+ pname = "slazav-podm";
+ version = stdenv.lib.substring 0 7 src.rev;
+ src = sources.map_podm;
+
+ patches = [ ./0001-fix-podm.patch ];
+
+ nativeBuildInputs = [
+ cgpsmapper
+ gmaptool
+ imagemagick
+ mapsoft
+ netpbm
+ zip
+ ];
+
+ postPatch = ''
+ substituteInPlace Makefile \
+ --replace "/usr/share/mapsoft" "${mapsoft}/share/mapsoft"
+
+ patchShebangs ./bin
+ '';
+
+ dontConfigure = true;
+
+ preBuild = "mkdir -p OUT";
+
+ buildFlags = [ "out" "img" ];
+
+ preferLocalBuild = true;
+
+ installPhase = ''
+ install -Dm644 podm.img -t "$out/share/gpxsee/maps"
+ '';
+
+ meta = with stdenv.lib; {
+ inherit (src) description homepage;
+ license = licenses.free;
+ maintainers = with maintainers; [ sikmir ];
+ platforms = platforms.all;
+ };
+}
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -70,6 +70,8 @@ lib.makeScope newScope (self: with self; {
inherit sources;
};
sendmap20 = callPackage ./tools/geo/sendmap20 { };
+ slazav-hr = callPackage ./data/maps/slazav/hr.nix { };
+ slazav-podm = callPackage ./data/maps/slazav/podm.nix { };
stardict-tools =
# Needed for nixos-19.09
if pkgs ? libmysql