diff --git a/pkgs/servers/http/apache-modules/mod_tile/default.nix b/pkgs/servers/http/apache-modules/mod_tile/default.nix index 33d02f07093c..359dc17b390d 100644 --- a/pkgs/servers/http/apache-modules/mod_tile/default.nix +++ b/pkgs/servers/http/apache-modules/mod_tile/default.nix @@ -1,77 +1,66 @@ -{ lib +{ fetchFromGitHub +, lib , stdenv -, fetchFromGitHub -, fetchpatch -, autoreconfHook +, cmake +, pkg-config , apacheHttpd , apr -, cairo -, iniparser -, mapnik +, aprutil , boost -, icu +, cairo +, curl +, glib +, gtk2 , harfbuzz -, libjpeg -, libtiff -, libwebp -, proj -, sqlite +, icu +, iniparser +, libmemcached +, mapnik }: stdenv.mkDerivation rec { pname = "mod_tile"; - version = "unstable-2017-01-08"; + version = "0.6.1+unstable=2023-03-09"; src = fetchFromGitHub { owner = "openstreetmap"; repo = "mod_tile"; - rev = "e25bfdba1c1f2103c69529f1a30b22a14ce311f1"; - sha256 = "12c96avka1dfb9wxqmjd57j30w9h8yx4y4w34kyq6xnf6lwnkcxp"; + rev = "f521540df1003bb000d7367a59ad612161eab0f0"; + sha256 = "sha256-jIqeplAQt4W97PNKm6ZDGPDUc/PEiLM5yEdPeI+H03A="; }; - patches = [ - # Pull upstream fix for -fno-common toolchains: - # https://github.com/openstreetmap/mod_tile/pull/202 - (fetchpatch { - name = "fno-common"; - url = "https://github.com/openstreetmap/mod_tile/commit/a22065b8ae3c018820a5ca9bf8e2b2bb0a0bfeb4.patch"; - sha256 = "1ywfa14xn9aa96vx1adn1ndi29qpflca06x986bx9c5pqk761yz3"; - }) + nativeBuildInputs = [ + cmake + pkg-config ]; - # test is broken and I couldn't figure out a better way to disable it. - postPatch = '' - echo "int main(){return 0;}" > src/gen_tile_test.cpp - ''; - - nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ apacheHttpd apr - cairo - iniparser - mapnik + aprutil boost - icu + cairo + curl + glib harfbuzz - libjpeg - libtiff - libwebp - proj - sqlite + icu + iniparser + libmemcached + mapnik ]; - configureFlags = [ - "--with-apxs=${apacheHttpd.dev}/bin/apxs" - ]; - - installPhase = '' - mkdir -p $out/modules - make install-mod_tile DESTDIR=$out - mv $out${apacheHttpd}/* $out - rm -rf $out/nix + # the install script wants to install mod_tile.so into apache's modules dir + postPatch = '' + sed -i "s|\''${HTTPD_MODULES_DIR}|$out/modules|" CMakeLists.txt ''; + enableParallelBuilding = true; + + # We need to either disable the `render_speedtest` and `download_tile` tests + # or fix the URLs they try to download from + #cmakeFlags = [ "-DENABLE_TESTS=1" ]; + #doCheck = true; + meta = with lib; { homepage = "https://github.com/openstreetmap/mod_tile"; description = "Efficiently render and serve OpenStreetMap tiles using Apache and Mapnik";