1{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, apacheHttpd, apr, cairo, iniparser, mapnik }:
2
3stdenv.mkDerivation rec {
4 pname = "mod_tile";
5 version = "unstable-2017-01-08";
6
7 src = fetchFromGitHub {
8 owner = "openstreetmap";
9 repo = "mod_tile";
10 rev = "e25bfdba1c1f2103c69529f1a30b22a14ce311f1";
11 sha256 = "12c96avka1dfb9wxqmjd57j30w9h8yx4y4w34kyq6xnf6lwnkcxp";
12 };
13
14 patches = [
15 # Pull upstream fix for -fno-common toolchains:
16 # https://github.com/openstreetmap/mod_tile/pull/202
17 (fetchpatch {
18 name = "fno-common";
19 url = "https://github.com/openstreetmap/mod_tile/commit/a22065b8ae3c018820a5ca9bf8e2b2bb0a0bfeb4.patch";
20 sha256 = "1ywfa14xn9aa96vx1adn1ndi29qpflca06x986bx9c5pqk761yz3";
21 })
22 ];
23
24 nativeBuildInputs = [ autoreconfHook ];
25 buildInputs = [ apacheHttpd apr cairo iniparser mapnik ];
26
27 configureFlags = [
28 "--with-apxs=${apacheHttpd.dev}/bin/apxs"
29 ];
30
31 installPhase = ''
32 mkdir -p $out/modules
33 make install-mod_tile DESTDIR=$out
34 mv $out${apacheHttpd}/* $out
35 rm -rf $out/nix
36 '';
37
38 meta = with lib; {
39 homepage = "https://github.com/openstreetmap/mod_tile";
40 description = "Efficiently render and serve OpenStreetMap tiles using Apache and Mapnik";
41 license = licenses.gpl2;
42 maintainers = with maintainers; [ jglukasik ];
43 platforms = platforms.linux;
44 };
45}