2.nix (2145B)
1 { lib 2 , stdenv 3 , fetchFromGitHub 4 , substituteAll 5 , db 6 , fig2dev 7 , giflib 8 , gsettings-desktop-schemas 9 , gtkmm3 10 , imagemagick 11 , jansson 12 , curl 13 , libjpeg 14 , libpng 15 , librsvg 16 , libtiff 17 , libxml2 18 , libzip 19 , perlPackages 20 , pkg-config 21 , proj 22 , shapelib 23 , unzip 24 , wrapGAppsHook 25 }: 26 27 stdenv.mkDerivation (finalAttrs: { 28 pname = "mapsoft2"; 29 version = "2.0"; 30 31 src = fetchFromGitHub { 32 owner = "slazav"; 33 repo = "mapsoft2"; 34 rev = "${finalAttrs.version}-alt1"; 35 hash = "sha256-cZHxCqfAY0DT3Zr3AdY3BMtzsiC9yXA2CUD/uM27SRE="; 36 fetchSubmodules = true; 37 }; 38 39 patches = (substituteAll { 40 src = ./0002-fix-build.patch; 41 db = db.dev; 42 giflib = giflib; 43 }); 44 45 postPatch = '' 46 substituteInPlace modules/get_deps \ 47 --replace "/usr/bin/perl" "${perlPackages.perl}/bin/perl" 48 substituteInPlace modules/mapview/mapview.cpp \ 49 --replace "/usr/share" "$out/share" 50 patchShebangs . 51 52 substituteInPlace vmap_data/scripts/vmaps_preview --replace "vmaps.sh" "$out/bin/vmaps.sh" 53 substituteInPlace vmap_data/scripts/vmaps_out --replace "vmaps.sh" "$out/bin/vmaps.sh" 54 substituteInPlace vmap_data/scripts/vmaps_get_fig --replace "vmaps.sh" "$out/bin/vmaps.sh" 55 substituteInPlace vmap_data/scripts/vmaps_in --replace "vmaps.sh" "$out/bin/vmaps.sh" 56 substituteInPlace vmap_data/scripts/vmaps.sh --replace "/usr" "$out" 57 ''; 58 59 nativeBuildInputs = [ 60 fig2dev 61 imagemagick 62 perlPackages.perl 63 pkg-config 64 unzip 65 wrapGAppsHook 66 ]; 67 68 buildInputs = [ 69 db 70 gsettings-desktop-schemas 71 gtkmm3 72 jansson 73 curl 74 libjpeg 75 libpng 76 librsvg 77 libtiff 78 libxml2 79 libzip 80 proj 81 shapelib 82 ]; 83 84 preBuild = "export SKIP_IMG_DIFFS=1"; 85 86 makeFlags = [ "prefix=$(out)" ]; 87 88 dontWrapGApps = true; 89 90 postFixup = '' 91 for f in $out/bin/ms2*; do 92 wrapGApp $f 93 done 94 ''; 95 96 meta = with lib; { 97 description = "A collection of tools and libraries for working with maps and geo-data"; 98 homepage = "http://slazav.github.io/mapsoft2"; 99 license = licenses.gpl3; 100 maintainers = [ maintainers.sikmir ]; 101 platforms = platforms.linux; 102 skip.ci = true; 103 }; 104 })