1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 apacheHttpd,
6 sqlite,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "mod_mbtiles";
11 version = "unstable-2022-05-25";
12
13 src = fetchFromGitHub {
14 owner = "systemed";
15 repo = pname;
16 rev = "f9d12a9581820630dd923c3c90aa8dcdcf65cb87";
17 sha256 = "sha256-wOoLSNLgh0YXHUFn7WfUkQXpyWsgCrVZlMg55rvi9q4=";
18 };
19
20 buildInputs = [
21 apacheHttpd
22 sqlite
23 ];
24
25 buildPhase = ''
26 apxs -lsqlite3 -ca mod_mbtiles.c
27 '';
28
29 installPhase = ''
30 runHook preInstall
31 install -D .libs/mod_mbtiles.so -t $out/modules
32 runHook postInstall
33 '';
34
35 meta = with lib; {
36 homepage = "https://github.com/systemed/mod_mbtiles";
37 description = "Serve tiles with Apache directly from an .mbtiles file";
38 license = licenses.free;
39 maintainers = with maintainers; [ sikmir ];
40 platforms = platforms.unix;
41 };
42}