depot/third_party/nixpkgs/pkgs/tools/misc/osm2pgsql/default.nix
Default email c7f94ff3ce Project import generated by Copybara.
GitOrigin-RevId: b85ed9dcbf187b909ef7964774f8847d554fab3b
2023-08-22 22:05:09 +02:00

75 lines
1.3 KiB
Nix

{ lib, stdenv
, fetchFromGitHub
, cmake
, expat
, fmt
, proj
, bzip2
, zlib
, boost
, cimg
, postgresql
, withLuaJIT ? false
, lua
, luajit
, libosmium
, nlohmann_json
, potrace
, protozero
, testers
}:
stdenv.mkDerivation (finalAttrs: {
pname = "osm2pgsql";
version = "1.9.0";
src = fetchFromGitHub {
owner = "openstreetmap";
repo = "osm2pgsql";
rev = finalAttrs.version;
hash = "sha256-ZIjT4uKJas5RgxcMSoR8hWCM9pdu3hSzWwfIn1ZvU8Y=";
};
postPatch = ''
# Remove bundled libraries
rm -r contrib
'';
nativeBuildInputs = [ cmake ];
buildInputs = [
boost
bzip2
cimg
expat
fmt
libosmium
nlohmann_json
postgresql
potrace
proj
protozero
zlib
] ++ lib.optional withLuaJIT luajit
++ lib.optional (!withLuaJIT) lua;
cmakeFlags = [
"-DEXTERNAL_LIBOSMIUM=ON"
"-DEXTERNAL_PROTOZERO=ON"
"-DEXTERNAL_FMT=ON"
] ++ lib.optional withLuaJIT "-DWITH_LUAJIT:BOOL=ON";
installFlags = [ "install-gen" ];
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
};
meta = with lib; {
description = "OpenStreetMap data to PostgreSQL converter";
homepage = "https://osm2pgsql.org";
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = with maintainers; [ jglukasik das-g ];
};
})