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