default.nix (1551B)
1 { lib, stdenv, buildPerlPackage, fetchwebarchive, unzip, dos2unix, cgpsmapper, ocad2mp, ModulePluggable, Tk }: 2 3 buildPerlPackage { 4 pname = "ocad2img"; 5 version = "2009-10-11"; 6 7 src = fetchwebarchive { 8 url = "http://worldofo.com/div/ocad2img.zip"; 9 timestamp = "20150326063156"; 10 hash = "sha256-toLKnAY9guAcwOWqgZHsrwBeFLvJLMR+Y8L7GTiXyPA="; 11 }; 12 13 sourceRoot = "."; 14 15 outputs = [ "out" ]; 16 17 nativeBuildInputs = [ unzip dos2unix ]; 18 19 propagatedBuildInputs = [ ModulePluggable Tk ]; 20 21 postPatch = '' 22 substituteInPlace ocad2img.pl \ 23 --replace-fail "cgpsmapper" "${cgpsmapper}/bin/cgpsmapper-static" \ 24 --replace-fail "ocad2mp.exe" "${ocad2mp}/bin/ocad2mp" \ 25 --replace-fail "symbols.txt" "$out/share/ocad2img/symbols.txt" \ 26 --replace-fail "use Win32" "#use Win32" \ 27 --replace-fail "require \"unicore/lib/gc_sc" "#require \"unicore/lib/gc_sc" 28 ''; 29 30 preConfigure = '' 31 dos2unix ocad2img.pl 32 patchShebangs . 33 touch Makefile.PL 34 ''; 35 36 installPhase = '' 37 install -Dm755 ocad2img.pl $out/bin/ocad2img 38 install -Dm644 symbols.txt -t $out/share/ocad2img 39 install -dm755 $out/lib/perl5/site_perl 40 cp -r Convert $out/lib/perl5/site_perl 41 ''; 42 43 meta = with lib; { 44 description = "Converter from OCAD map format to Garmin format"; 45 homepage = "http://news.worldofo.com/2009/10/11/howto-convert-any-orienteering-map-to-a-garmin-map/"; 46 license = licenses.gpl3Plus; 47 maintainers = [ maintainers.sikmir ]; 48 platforms = platforms.linux; 49 skip.ci = stdenv.isDarwin; 50 }; 51 }