package.nix (2417B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 perlPackages, 6 python2Packages, 7 gimp, 8 bc, 9 fig2dev, 10 imagemagick, 11 m4, 12 netpbm, 13 pkg-config, 14 scons, 15 boost, 16 curl, 17 giflib, 18 gtkmm2, 19 jansson, 20 libjpeg, 21 libpng, 22 libshell, 23 libtiff, 24 libusb1, 25 libxml2, 26 libyaml, 27 libzip, 28 proj_7, 29 shapelib, 30 zlib, 31 getopt, 32 }: 33 34 stdenv.mkDerivation (finalAttrs: { 35 pname = "mapsoft"; 36 version = "20220624-alt1"; 37 38 __structuredAttrs = true; 39 40 src = fetchFromGitHub { 41 owner = "ushakov"; 42 repo = "mapsoft"; 43 rev = "e51645da7bbb7f6ca6505dd6e6f9a009556a78c1"; 44 hash = "sha256-GPlLVMWqYXs0K3UzQnYlWPm0t9qz6rzQmW1dTOUtPDY="; 45 }; 46 47 patches = [ ./0001-fix-build.patch ]; 48 49 postPatch = '' 50 sed -i '4i #include <cstdint>' core/loaders/image_png.cpp 51 substituteInPlace scripts/map_rescale \ 52 --replace-fail "/usr/share/mapsoft" "$out/share/mapsoft" 53 substituteInPlace core/vmap/vmap_ocad.cpp \ 54 --replace-fail "/usr/share/mapsoft" "$out/share/mapsoft" 55 substituteInPlace core/vmap/zn.cpp \ 56 --replace-fail "/usr/share/mapsoft" "$out/share/mapsoft" 57 ''; 58 59 nativeBuildInputs = [ 60 fig2dev 61 imagemagick 62 m4 63 netpbm 64 perlPackages.perl 65 pkg-config 66 python2Packages.wrapPython 67 scons 68 ]; 69 buildInputs = [ 70 boost 71 curl 72 giflib 73 gtkmm2 74 jansson 75 libjpeg 76 libpng 77 libtiff 78 libusb1 79 libxml2 80 libyaml 81 libzip 82 perlPackages.TextIconv 83 proj_7 84 shapelib 85 zlib 86 ]; 87 propagatedBuildInputs = [ 88 bc 89 libshell 90 ]; 91 92 preBuild = '' 93 export CPPFLAGS="-I${boost.dev}/include -I${giflib}/include -I${proj_7.dev}/include" 94 export LINKFLAGS="-L${giflib}/lib -lgif -L${proj_7}/lib -lproj" 95 ''; 96 97 sconsFlags = [ 98 "minimal=1" 99 "prefix=$(out)" 100 ]; 101 102 postInstall = '' 103 wrapPythonProgramsIn $out/lib/gimp/${lib.versions.major gimp.version}.0/plug-ins/ 104 substituteInPlace $out/bin/mapsoft_wp_parse \ 105 --replace-fail "/usr/bin/perl" "${perlPackages.perl}/bin/perl" 106 wrapProgram $out/bin/mapsoft_wp_parse --prefix PERL5LIB : "$PERL5LIB" 107 substituteInPlace $out/bin/map_rescale \ 108 --replace-fail "getopt " "${getopt}/bin/getopt " 109 ''; 110 111 meta = { 112 description = "Mapping software for linux"; 113 homepage = "https://github.com/ushakov/mapsoft"; 114 license = lib.licenses.gpl3; 115 maintainers = [ lib.maintainers.sikmir ]; 116 platforms = lib.platforms.linux; 117 skip.ci = true; 118 }; 119 })
