nixpkgs/pkgs/tools/misc/osm2pgsql/default.nix

47 lines
1.0 KiB
Nix
Raw Normal View History

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