Unverified Commit d680ded2 authored by Nikolay Korotkiy's avatar Nikolay Korotkiy Committed by GitHub
Browse files

Merge pull request #250044 from sikmir/osm2pgsql

osm2pgsql: 1.8.1 → 1.9.0
parents b107015d 5fc08598
Loading
Loading
Loading
Loading
+21 −13
Original line number Diff line number Diff line
@@ -2,40 +2,34 @@
, fetchFromGitHub
, cmake
, expat
, fetchpatch
, fmt
, proj
, bzip2
, zlib
, boost
, cimg
, postgresql
, withLuaJIT ? false
, lua
, luajit
, libosmium
, nlohmann_json
, potrace
, protozero
, testers
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "osm2pgsql";
  version = "1.8.1";
  version = "1.9.0";

  src = fetchFromGitHub {
    owner = "openstreetmap";
    repo = "osm2pgsql";
    rev = finalAttrs.version;
    hash = "sha256-8Jefd8dfoh/an7wd+8iTM0uOKA4UiUo8t2WzZs4r/Ck=";
    hash = "sha256-ZIjT4uKJas5RgxcMSoR8hWCM9pdu3hSzWwfIn1ZvU8Y=";
  };

  patches = [
    # Fix compatiblity with fmt 10.0. Remove with the next release
    (fetchpatch {
      url = "https://github.com/openstreetmap/osm2pgsql/commit/37aae6c874b58cd5cd27e70b2b433d6624fd7498.patch";
      hash = "sha256-Fv2zPqhRDoJXlqB1Q9q5iskn28iqq3TYPcdqfu/pvD4=";
    })
  ];

  postPatch = ''
    # Remove bundled libraries
    rm -r contrib
@@ -43,8 +37,20 @@ stdenv.mkDerivation (finalAttrs: {

  nativeBuildInputs = [ cmake ];

  buildInputs = [ expat fmt proj bzip2 zlib boost postgresql libosmium protozero ]
    ++ lib.optional withLuaJIT luajit
  buildInputs = [
    boost
    bzip2
    cimg
    expat
    fmt
    libosmium
    nlohmann_json
    postgresql
    potrace
    proj
    protozero
    zlib
  ] ++ lib.optional withLuaJIT luajit
    ++ lib.optional (!withLuaJIT) lua;

  cmakeFlags = [
@@ -53,6 +59,8 @@ stdenv.mkDerivation (finalAttrs: {
    "-DEXTERNAL_FMT=ON"
  ] ++ lib.optional withLuaJIT "-DWITH_LUAJIT:BOOL=ON";

  installFlags = [ "install-gen" ];

  passthru.tests.version = testers.testVersion {
    package = finalAttrs.finalPackage;
  };