1{ fetchFromGitHub
2, lib
3, stdenv
4, cmake
5, pkg-config
6, apacheHttpd
7, apr
8, aprutil
9, boost
10, cairo
11, curl
12, glib
13, gtk2
14, harfbuzz
15, icu
16, iniparser
17, libmemcached
18, mapnik
19}:
20
21stdenv.mkDerivation rec {
22 pname = "mod_tile";
23 version = "0.6.1+unstable=2023-03-09";
24
25 src = fetchFromGitHub {
26 owner = "openstreetmap";
27 repo = "mod_tile";
28 rev = "f521540df1003bb000d7367a59ad612161eab0f0";
29 sha256 = "sha256-jIqeplAQt4W97PNKm6ZDGPDUc/PEiLM5yEdPeI+H03A=";
30 };
31
32 nativeBuildInputs = [
33 cmake
34 pkg-config
35 ];
36
37 buildInputs = [
38 apacheHttpd
39 apr
40 aprutil
41 boost
42 cairo
43 curl
44 glib
45 harfbuzz
46 icu
47 iniparser
48 libmemcached
49 mapnik
50 ];
51
52 # the install script wants to install mod_tile.so into apache's modules dir
53 # also mapnik pkg-config config is missing this patch: https://github.com/mapnik/mapnik/commit/692c2faa0ef168a8c908d262c2bbfe51a74a8336.patch
54 postPatch = ''
55 sed -i "s|\''${HTTPD_MODULES_DIR}|$out/modules|" CMakeLists.txt
56 sed -i -e "s|@MAPNIK_FONTS_DIR@|$(mapnik-config --fonts)|" -e "s|@MAPNIK_PLUGINS_DIR@|$(mapnik-config --input-plugins)|" tests/renderd.conf.in
57 '';
58
59 enableParallelBuilding = true;
60
61 cmakeFlags = [ "-DENABLE_TESTS=1" ];
62 doCheck = true;
63
64 meta = with lib; {
65 homepage = "https://github.com/openstreetmap/mod_tile";
66 description = "Efficiently render and serve OpenStreetMap tiles using Apache and Mapnik";
67 license = licenses.gpl2;
68 maintainers = with maintainers; [ jglukasik ];
69 platforms = platforms.linux;
70 };
71}