nur-packages

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

default.nix (2317B)


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