nur-packages

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

default.nix (1935B)


      1 { lib
      2 , stdenv
      3 , fetchFromGitHub
      4 , fetchpatch
      5 , makeWrapper
      6 , boost
      7 , cairo
      8 , harfbuzz
      9 , icu
     10 , libtiff
     11 , libwebp
     12 , mapnik
     13 , perl
     14 , perlPackages
     15 , proj
     16 , sqlite
     17 }:
     18 
     19 stdenv.mkDerivation (finalAttrs: {
     20   pname = "tirex";
     21   version = "0.7.0";
     22 
     23   src = fetchFromGitHub {
     24     owner = "openstreetmap";
     25     repo = "tirex";
     26     rev = "v${finalAttrs.version}";
     27     hash = "sha256-0QbPfCPBdNBbUiZ8Ppg2zao98+Ddl3l+yX6y1/J50rg=";
     28   };
     29 
     30   patches = [
     31     (fetchpatch {
     32       url = "https://github.com/openstreetmap/tirex/pull/54/commits/da0c5db926bc0939c53dd902a969b689ccf9edde.patch";
     33       hash = "sha256-bnL1ZGy8ZNSZuCRbZn59qRVLg3TL0GjFYnhRKroeVO0=";
     34     })
     35   ];
     36 
     37   postPatch = ''
     38     substituteInPlace Makefile --replace-fail "/usr" "" --replace-fail ": Makefile.perl" ":"
     39     substituteInPlace backend-mapnik/Makefile --replace-fail "/usr" ""
     40     substituteInPlace lib/Tirex.pm --replace-fail "/etc" "$out/etc"
     41   '';
     42 
     43   preConfigure = ''
     44     perl Makefile.PL PREFIX=$out DESTDIR= FIRST_MAKEFILE=Makefile.perl
     45   '';
     46 
     47   nativeBuildInputs = [ makeWrapper ];
     48 
     49   buildInputs = [
     50     boost
     51     cairo
     52     harfbuzz
     53     icu
     54     libtiff
     55     libwebp
     56     mapnik
     57     perl
     58     proj
     59     sqlite
     60   ];
     61 
     62   installFlags = [ "DESTDIR=$(out)" "INSTALLOPTS:=" ];
     63 
     64   installTargets = [ "install-all" ];
     65 
     66   preInstall = ''
     67     # https://github.com/openstreetmap/tirex/pull/42
     68     install -m 755 -d $out/libexec
     69   '';
     70 
     71   postInstall = ''
     72     mv $out$out/lib/* $out/lib
     73     mv $out$out/man/* $out/man
     74     rm -r $out/nix
     75   '';
     76 
     77   postFixup = ''
     78     for cmd in `ls $out/bin`; do
     79       wrapProgram $out/bin/$cmd \
     80         --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ JSON IpcShareLite ]}:"$out/lib/perl5
     81     done
     82   '';
     83 
     84   meta = with lib; {
     85     description = "Tirex tile queue manager";
     86     homepage = "http://wiki.openstreetmap.org/wiki/Tirex";
     87     license = licenses.gpl2;
     88     maintainers = [ maintainers.sikmir ];
     89     platforms = platforms.unix;
     90   };
     91 })
     92