nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (2380B)


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