2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv
|
2020-06-29 00:19:38 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, expat
|
|
|
|
, proj
|
|
|
|
, bzip2
|
|
|
|
, zlib
|
|
|
|
, boost
|
|
|
|
, postgresql
|
|
|
|
, withLuaJIT ? false
|
|
|
|
, lua
|
|
|
|
, luajit
|
2020-06-29 00:21:06 +02:00
|
|
|
, libosmium
|
2020-06-29 00:23:21 +02:00
|
|
|
, protozero
|
2020-06-29 00:19:38 +02:00
|
|
|
}:
|
2017-04-17 22:19:41 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "osm2pgsql";
|
2021-02-03 22:59:12 +01:00
|
|
|
version = "1.4.1";
|
2017-04-17 22:19:41 +02:00
|
|
|
|
2019-07-11 13:06:01 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openstreetmap";
|
2019-10-13 11:37:39 +02:00
|
|
|
repo = pname;
|
2019-07-11 13:06:01 +02:00
|
|
|
rev = version;
|
2021-02-03 22:59:12 +01:00
|
|
|
sha256 = "0ld43k7xx395hd6kcn8wyacvb1cfjy670lh9w6yhfi78nxqj9mmy";
|
2017-04-17 22:19:41 +02:00
|
|
|
};
|
|
|
|
|
2019-07-11 13:06:01 +02:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2020-06-29 00:23:21 +02:00
|
|
|
buildInputs = [ expat proj bzip2 zlib boost postgresql libosmium protozero ]
|
2021-01-15 10:19:50 +01:00
|
|
|
++ lib.optional withLuaJIT luajit
|
|
|
|
++ lib.optional (!withLuaJIT) lua;
|
2020-02-10 19:28:33 +01:00
|
|
|
|
2020-06-29 00:23:21 +02:00
|
|
|
cmakeFlags = [ "-DEXTERNAL_LIBOSMIUM=ON" "-DEXTERNAL_PROTOZERO=ON" ]
|
2021-01-15 10:19:50 +01:00
|
|
|
++ lib.optional withLuaJIT "-DWITH_LUAJIT:BOOL=ON";
|
2019-07-11 13:06:01 +02:00
|
|
|
|
2019-10-30 12:34:47 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H";
|
2019-07-11 13:06:01 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-04-17 22:19:41 +02:00
|
|
|
description = "OpenStreetMap data to PostgreSQL converter";
|
2020-12-09 14:07:19 +01:00
|
|
|
homepage = "https://osm2pgsql.org";
|
2019-07-11 13:06:01 +02:00
|
|
|
license = licenses.gpl2;
|
2020-02-10 19:28:33 +01:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2020-06-29 00:35:02 +02:00
|
|
|
maintainers = with maintainers; [ jglukasik das-g ];
|
2017-04-17 22:19:41 +02:00
|
|
|
};
|
|
|
|
}
|