about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/geospatial/mapserver/default.nix
blob: c46aa3d48d0da76e6d3043f27b92fdf5345ada4f (plain) (blame)
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
61
62
63
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
, cairo, curl, fcgi, freetype, fribidi, gdal, geos, giflib, harfbuzz
, libjpeg, libpng, librsvg, libxml2, postgresql, proj, protobufc, zlib
, withPython ? true, swig, python3
}:

stdenv.mkDerivation rec {
  pname = "mapserver";
  version = "8.0.1";

  src = fetchFromGitHub {
    owner = "MapServer";
    repo = "MapServer";
    rev = "rel-${lib.replaceStrings [ "." ] [ "-" ] version}";
    sha256 = "sha256-fAf4kOe/6bQW0i46+EZbD/6iWI2Bjkn2no6XeR/+mg4=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
  ] ++ lib.optionals withPython [ swig python3.pkgs.setuptools ];

  buildInputs = [
    cairo
    curl
    fcgi
    freetype
    fribidi
    gdal
    geos
    giflib
    harfbuzz
    libjpeg
    libpng
    librsvg
    libxml2
    postgresql
    proj
    protobufc
    zlib
  ] ++ lib.optional withPython python3;

  cmakeFlags = [
    "-DWITH_KML=ON"
    "-DWITH_SOS=ON"
    "-DWITH_RSVG=ON"
    "-DWITH_CURL=ON"
    "-DWITH_CLIENT_WMS=ON"
    "-DWITH_CLIENT_WFS=ON"

    # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
    "-DCMAKE_SKIP_BUILD_RPATH=ON"
  ] ++ lib.optional withPython "-DWITH_PYTHON=ON";

  meta = with lib; {
    description = "Platform for publishing spatial data and interactive mapping applications to the web";
    homepage = "https://mapserver.org/";
    changelog = "https://mapserver.org/development/changelog/";
    license = licenses.mit;
    maintainers = teams.geospatial.members;
    platforms = platforms.unix;
  };
}