1{
2 lib,
3 buildPerlPackage,
4 fetchFromGitHub,
5 GD,
6 IPCShareLite,
7 JSON,
8 LWP,
9 mapnik,
10 boost,
11 nix-update-script,
12 pkg-config,
13}:
14
15buildPerlPackage rec {
16 pname = "Tirex";
17 version = "0.8.0";
18
19 src = fetchFromGitHub {
20 owner = "openstreetmap";
21 repo = "tirex";
22 tag = "v${version}";
23 hash = "sha256-tFDyN3slj9ipa9JPB6f+mnzMIW926vOge4ZSbmxjtiE=";
24 };
25
26 patches = [
27 # Support Mapnik >= v4.0.0 (no more mapnik-config)
28 ./use-pkg-config.patch
29 ];
30
31 nativeBuildInputs = [
32 pkg-config
33 ];
34
35 buildInputs = [
36 GD
37 IPCShareLite
38 JSON
39 LWP
40 mapnik
41 boost
42 ]
43 ++ mapnik.buildInputs;
44
45 installPhase = ''
46 install -m 755 -d $out/usr/libexec
47 make install DESTDIR=$out INSTALLOPTS=""
48 mv $out/$out/lib $out/$out/share $out
49 rmdir $out/$out $out/nix/store $out/nix
50 '';
51
52 passthru.updateScript = nix-update-script { };
53
54 meta = {
55 description = "Tools for running a map tile server";
56 homepage = "https://wiki.openstreetmap.org/wiki/Tirex";
57 maintainers = with lib.maintainers; [ jglukasik ];
58 license = with lib.licenses; [ gpl2Only ];
59 };
60}