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

60 lines
1.2 KiB
Nix
Raw Normal View History

{ lib, stdenv
2020-06-28 23:19:38 +01:00
, fetchFromGitHub
, cmake
, expat
2022-08-15 09:04:01 +01:00
, fmt
2020-06-28 23:19:38 +01:00
, proj
, bzip2
, zlib
, boost
, postgresql
, withLuaJIT ? false
, lua
, luajit
2020-06-28 23:21:06 +01:00
, libosmium
2020-06-28 23:23:21 +01:00
, protozero
2022-08-15 09:04:01 +01:00
, rapidjson
2022-10-04 21:34:02 +01:00
, testers
2020-06-28 23:19:38 +01:00
}:
2017-04-17 21:19:41 +01:00
2022-10-04 21:34:02 +01:00
stdenv.mkDerivation (finalAttrs: {
pname = "osm2pgsql";
2023-02-26 10:39:17 +00:00
version = "1.8.1";
2017-04-17 21:19:41 +01:00
2019-07-11 12:06:01 +01:00
src = fetchFromGitHub {
owner = "openstreetmap";
2022-10-04 21:34:02 +01:00
repo = "osm2pgsql";
rev = finalAttrs.version;
2023-02-26 10:39:17 +00:00
hash = "sha256-8Jefd8dfoh/an7wd+8iTM0uOKA4UiUo8t2WzZs4r/Ck=";
2017-04-17 21:19:41 +01:00
};
2022-08-15 09:04:01 +01:00
postPatch = ''
# Remove bundled libraries
rm -r contrib
'';
2019-07-11 12:06:01 +01:00
nativeBuildInputs = [ cmake ];
2023-01-28 20:14:45 +00:00
buildInputs = [ expat fmt proj bzip2 zlib boost postgresql libosmium protozero ]
2021-01-15 09:19:50 +00:00
++ lib.optional withLuaJIT luajit
++ lib.optional (!withLuaJIT) lua;
2020-02-10 18:28:33 +00:00
2022-08-15 09:04:01 +01:00
cmakeFlags = [
"-DEXTERNAL_LIBOSMIUM=ON"
"-DEXTERNAL_PROTOZERO=ON"
"-DEXTERNAL_FMT=ON"
] ++ lib.optional withLuaJIT "-DWITH_LUAJIT:BOOL=ON";
2019-07-11 12:06:01 +01:00
2022-10-04 21:34:02 +01:00
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
};
meta = with lib; {
2017-04-17 21:19:41 +01:00
description = "OpenStreetMap data to PostgreSQL converter";
homepage = "https://osm2pgsql.org";
2021-06-21 18:50:05 +01:00
license = licenses.gpl2Plus;
2022-08-15 09:04:01 +01:00
platforms = platforms.unix;
maintainers = with maintainers; [ jglukasik das-g ];
2017-04-17 21:19:41 +01:00
};
2022-10-04 21:34:02 +01:00
})