commit 04b956b7d63b27eaf195c2ad72506be3abea3705
parent 3fddc554ad7cf867f9a3a4c8aa44e17a3c0b2274
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Fri, 17 Apr 2020 08:31:00 +0300
Add ocad2img
Diffstat:
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -111,6 +111,9 @@ lib.makeScope newScope (
morse-talk = python3Packages.callPackage ./tools/morse-talk {
inherit sources;
};
+ ocad2img = perlPackages.callPackage ./tools/geo/ocad2img {
+ inherit cgpsmapper ocad2mp;
+ };
ocad2mp = callPackage ./tools/geo/ocad2mp {};
openmtbmap_openvelomap_linux = callPackage ./tools/geo/openmtbmap_openvelomap_linux {};
osm2mp = perlPackages.callPackage ./tools/geo/osm2mp {
diff --git a/pkgs/tools/geo/ocad2img/default.nix b/pkgs/tools/geo/ocad2img/default.nix
@@ -0,0 +1,48 @@
+{ lib, buildPerlPackage, fetchzip, dos2unix, cgpsmapper, ocad2mp, ModulePluggable, Tk }:
+
+buildPerlPackage rec {
+ pname = "ocad2img";
+ version = "2009-10-11";
+
+ src = fetchzip {
+ url = "http://worldofo.com/div/${pname}.zip";
+ sha256 = "0d5aryahl5662w65fpqa5camq1c0wlyrnxgsdqb7xsgmk1sivvmz";
+ stripRoot = false;
+ };
+
+ outputs = [ "out" ];
+
+ nativeBuildInputs = [ dos2unix ];
+
+ propagatedBuildInputs = [ ModulePluggable Tk ];
+
+ postPatch = ''
+ substituteInPlace ocad2img.pl \
+ --replace "cgpsmapper" "${cgpsmapper}/bin/cgpsmapper-static" \
+ --replace "ocad2mp.exe" "${ocad2mp}/bin/ocad2mp" \
+ --replace "symbols.txt" "$out/share/ocad2img/symbols.txt" \
+ --replace "use Win32" "#use Win32" \
+ --replace "require \"unicore/lib/gc_sc" "#require \"unicore/lib/gc_sc"
+ '';
+
+ preConfigure = ''
+ dos2unix ocad2img.pl
+ patchShebangs .
+ touch Makefile.PL
+ '';
+
+ installPhase = ''
+ install -Dm755 ocad2img.pl $out/bin/ocad2img
+ install -Dm644 symbols.txt -t $out/share/ocad2img
+ install -dm755 $out/lib/perl5/site_perl
+ cp -r Convert $out/lib/perl5/site_perl
+ '';
+
+ meta = with lib; {
+ description = "Converter from OCAD map format to Garmin format";
+ homepage = "http://news.worldofo.com/2009/10/11/howto-convert-any-orienteering-map-to-a-garmin-map/";
+ license = licenses.gpl3;
+ maintainers = with maintainers; [ sikmir ];
+ platforms = platforms.unix;
+ };
+}