nur-packages

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

default.nix (1515B)


      1 { lib, stdenv, fetchFromGitHub, makeWrapper, cairo, mapnik, perl, perlPackages }:
      2 
      3 stdenv.mkDerivation (finalAttrs: {
      4   pname = "tirex";
      5   version = "0.7.0";
      6 
      7   src = fetchFromGitHub {
      8     owner = "openstreetmap";
      9     repo = "tirex";
     10     rev = "v${finalAttrs.version}";
     11     hash = "sha256-0QbPfCPBdNBbUiZ8Ppg2zao98+Ddl3l+yX6y1/J50rg=";
     12   };
     13 
     14   postPatch = ''
     15     substituteInPlace Makefile --replace "/usr" "" --replace ": Makefile.perl" ":"
     16     substituteInPlace backend-mapnik/Makefile --replace "/usr" ""
     17     substituteInPlace lib/Tirex.pm --replace "/etc" "$out/etc"
     18   '';
     19 
     20   preConfigure = ''
     21     perl Makefile.PL PREFIX=$out DESTDIR= FIRST_MAKEFILE=Makefile.perl
     22   '';
     23 
     24   nativeBuildInputs = [ makeWrapper ];
     25 
     26   buildInputs = [ cairo mapnik perl ];
     27 
     28   installFlags = [ "DESTDIR=$(out)" "INSTALLOPTS:=" ];
     29 
     30   installTargets = [ "install-all" ];
     31 
     32   preInstall = ''
     33     # https://github.com/openstreetmap/tirex/pull/42
     34     install -m 755 -d $out/libexec
     35   '';
     36 
     37   postInstall = ''
     38     mv $out$out/lib/* $out/lib
     39     mv $out$out/man/* $out/man
     40     rm -r $out/nix
     41   '';
     42 
     43   postFixup = ''
     44     for cmd in `ls $out/bin`; do
     45       wrapProgram $out/bin/$cmd \
     46         --prefix PERL5LIB : "${with perlPackages; makeFullPerlPath [ JSON IpcShareLite ]}:"$out/lib/perl5
     47     done
     48   '';
     49 
     50   meta = with lib; {
     51     description = "Tirex tile queue manager";
     52     homepage = "http://wiki.openstreetmap.org/wiki/Tirex";
     53     license = licenses.gpl2;
     54     maintainers = [ maintainers.sikmir ];
     55     platforms = platforms.unix;
     56   };
     57 })
     58