1{ lib, stdenv, fetchFromGitHub, postgresql, perl, cmake, boost }:
2
3stdenv.mkDerivation rec {
4 pname = "pgrouting";
5 version = "3.2.1";
6
7 nativeBuildInputs = [ cmake perl ];
8 buildInputs = [ postgresql boost ];
9
10 src = fetchFromGitHub {
11 owner = "pgRouting";
12 repo = pname;
13 rev = "v${version}";
14 sha256 = "1zn3yyp4zz14yn2mmqwn7c4m65zfb2nj9zg4qj97ppsahs5xc6vw";
15 };
16
17 installPhase = ''
18 install -D lib/*.so -t $out/lib
19 install -D sql/pgrouting--${version}.sql -t $out/share/postgresql/extension
20 install -D sql/common/pgrouting.control -t $out/share/postgresql/extension
21 '';
22
23 meta = with lib; {
24 description = "A PostgreSQL/PostGIS extension that provides geospatial routing functionality";
25 homepage = "https://pgrouting.org/";
26 changelog = "https://github.com/pgRouting/pgrouting/releases/tag/v${version}";
27 maintainers = [ maintainers.steve-chavez ];
28 platforms = postgresql.meta.platforms;
29 license = licenses.gpl2Plus;
30 };
31}