summaryrefslogtreecommitdiffstats
path: root/pkgs/development/perl-modules/Tirex/default.nix
blob: 97dbab07d25f9e2391cb13600e3845dfae766285 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
  lib,
  buildPerlPackage,
  fetchFromGitHub,
  GD,
  IPCShareLite,
  JSON,
  LWP,
  mapnik,
  boost,
  nix-update-script,
  pkg-config,
}:

buildPerlPackage rec {
  pname = "Tirex";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "openstreetmap";
    repo = "tirex";
    tag = "v${version}";
    hash = "sha256-tFDyN3slj9ipa9JPB6f+mnzMIW926vOge4ZSbmxjtiE=";
  };

  patches = [
    # Support Mapnik >= v4.0.0 (no more mapnik-config)
    ./use-pkg-config.patch
  ];

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [
    GD
    IPCShareLite
    JSON
    LWP
    mapnik
    boost
  ]
  ++ mapnik.buildInputs;

  installPhase = ''
    install -m 755 -d $out/usr/libexec
    make install DESTDIR=$out INSTALLOPTS=""
    mv $out/$out/lib $out/$out/share $out
    rmdir $out/$out $out/nix/store $out/nix
  '';

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Tools for running a map tile server";
    homepage = "https://wiki.openstreetmap.org/wiki/Tirex";
    maintainers = with lib.maintainers; [ jglukasik ];
    license = lib.licenses.gpl2Only;
  };
}