aboutsummaryrefslogtreecommitdiff
path: root/converters/osm2pgsql
diff options
context:
space:
mode:
Diffstat (limited to 'converters/osm2pgsql')
-rw-r--r--converters/osm2pgsql/Makefile43
-rw-r--r--converters/osm2pgsql/distinfo6
-rw-r--r--converters/osm2pgsql/files/patch-CMakeLists.txt18
-rw-r--r--converters/osm2pgsql/pkg-descr2
-rw-r--r--converters/osm2pgsql/pkg-plist4
5 files changed, 54 insertions, 19 deletions
diff --git a/converters/osm2pgsql/Makefile b/converters/osm2pgsql/Makefile
index 6ffd8439a343..4eff88d5a992 100644
--- a/converters/osm2pgsql/Makefile
+++ b/converters/osm2pgsql/Makefile
@@ -1,50 +1,65 @@
PORTNAME= osm2pgsql
-PORTVERSION= 1.5.1
+PORTVERSION= 1.11.0
+PORTREVISION= 1
CATEGORIES= converters geography
MAINTAINER= amdmi3@FreeBSD.org
COMMENT= Convert OSM XML data to PostgreSQL database
+WWW= https://osm2pgsql.org/ \
+ https://wiki.openstreetmap.org/wiki/Osm2pgsql \
+ https://github.com/openstreetmap/osm2pgsql
LICENSE= GPLv2+
LICENSE_FILE= ${WRKSRC}/COPYING
+NOT_FOR_ARCHS= armv7 i386 powerpc
+NOT_FOR_ARCHS_REASON= needs a 64 bit architecture
+
LIB_DEPENDS= libproj.so:graphics/proj \
libboost_system.so:devel/boost-libs \
- libexpat.so:textproc/expat2 \
- libfmt.so:devel/libfmt
+ libexpat.so:textproc/expat2
BUILD_DEPENDS= ${LOCALBASE}/include/osmium/version.hpp:astro/libosmium \
${LOCALBASE}/include/protozero/version.hpp:devel/protozero \
- ${LOCALBASE}/include/rapidjson/stringbuffer.h:devel/rapidjson
+ ${LOCALBASE}/include/nlohmann/json.hpp:devel/nlohmann-json \
+ ${LOCALBASE}/include/CLI/Version.hpp:devel/cli11
+USES= cmake compiler:c++17-lang pgsql python:run shebangfix
USE_GITHUB= yes
GH_ACCOUNT= openstreetmap
-
-USES= cmake compiler:c++14-lang pgsql
+SHEBANG_FILES= scripts/osm2pgsql-replication
CMAKE_ON= CMAKE_DISABLE_FIND_PACKAGE_Git \
EXTERNAL_LIBOSMIUM \
EXTERNAL_PROTOZERO \
- EXTERNAL_FMT \
- EXTERNAL_RAPIDJSON
-
-PLIST_FILES= bin/osm2pgsql \
- share/man/man1/osm2pgsql.1.gz
+ EXTERNAL_CLI11
+# EXTERNAL_FMT # XXX: does not build with libfmt 9.x from ports, so use bundled version until upstream fixes
+CMAKE_ARGS= -DLUA_EXE="${LOCALBASE}/bin/${LUA_CMD}"
PORTDOCS= AUTHORS CONTRIBUTING.md README.md
PORTDATA= *
-OPTIONS_DEFINE= DOCS LUAJIT TEST
+OPTIONS_DEFINE= DOCS LUAJIT TEST # GEN (utility built with this option is not installed)
+OPTIONS_DEFAULT=GEN
LUAJIT_DESC= Build with LuaJIT support
LUAJIT_CMAKE_BOOL= WITH_LUAJIT
-LUAJIT_LIB_DEPENDS= libluajit-5.1.so:lang/luajit
-LUAJIT_USES_OFF= lua:53
+LUAJIT_USES= luajit lua:54:build # lua is needed just for running tests
+LUAJIT_USES_OFF= lua:54
TEST_CMAKE_BOOL= BUILD_TESTS
TEST_TEST_TARGET= test
TEST_CMAKE_ON= -DCMAKE_CTEST_ARGUMENTS="--label-regex;NoDB;--output-on-failure"
+TEST_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}behave>=0:devel/py-behave@${PY_FLAVOR}
+TEST_TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}behave>=0:devel/py-behave@${PY_FLAVOR}
+#GEN_DESC= Build experimental osm2pgsql-gen data generalization utility
+#GEN_LIB_DEPENDS= libpotrace.so:graphics/libpotrace \
+ #libopencv_core.so:graphics/opencv
+#GEN_CMAKE_BOOL= BUILD_GEN
post-patch:
@${REINPLACE_CMD} -e 's|find_package(Lua |&${LUA_VER} EXACT |' \
${WRKSRC}/CMakeLists.txt
+# for post-patch-GEN-off: when GEN option is implemented
+ @${REINPLACE_CMD} -Ee '/find_(path|library)/ s,(potrace|opencv),no&,' \
+ ${WRKSRC}/CMakeLists.txt
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/converters/osm2pgsql/distinfo b/converters/osm2pgsql/distinfo
index 80bb88b7ea0d..d9f27f95afc8 100644
--- a/converters/osm2pgsql/distinfo
+++ b/converters/osm2pgsql/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1629133137
-SHA256 (openstreetmap-osm2pgsql-1.5.1_GH0.tar.gz) = 4df0d332e5d77a9d363f2f06f199da0ac23a0dc7890b3472ea1b5123ac363f6e
-SIZE (openstreetmap-osm2pgsql-1.5.1_GH0.tar.gz) = 2577801
+TIMESTAMP = 1709050981
+SHA256 (openstreetmap-osm2pgsql-1.11.0_GH0.tar.gz) = 6b46313813b816f15ce906c04cd4108bbb05362740e0a1a8889055f4e25977d2
+SIZE (openstreetmap-osm2pgsql-1.11.0_GH0.tar.gz) = 2722008
diff --git a/converters/osm2pgsql/files/patch-CMakeLists.txt b/converters/osm2pgsql/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..0e047aebe443
--- /dev/null
+++ b/converters/osm2pgsql/files/patch-CMakeLists.txt
@@ -0,0 +1,18 @@
+--- CMakeLists.txt.orig 2023-11-07 15:25:19 UTC
++++ CMakeLists.txt
+@@ -28,6 +28,7 @@ endif()
+
+ option(BUILD_TESTS "Build test suite" OFF)
+ option(BUILD_COVERAGE "Build with coverage" OFF)
++option(BUILD_GEN "Build gen" OFF)
+ option(WITH_LUA "Build with Lua support" ON)
+ option(WITH_LUAJIT "Build with LuaJIT support" OFF)
+
+@@ -289,7 +290,6 @@ if (${POTRACE_LIBRARY} STREQUAL "POTRACE_LIBRARY-NOTFO
+ else()
+ if (WITH_LUA)
+ message(STATUS "Found opencv and potrace library. Building osm2pgsql-gen.")
+- set(BUILD_GEN 1)
+ include_directories(SYSTEM ${POTRACE_INCLUDE_DIR})
+ add_executable(osm2pgsql-gen src/gen/osm2pgsql-gen.cpp
+ src/gen/canvas.cpp
diff --git a/converters/osm2pgsql/pkg-descr b/converters/osm2pgsql/pkg-descr
index ae8f596e912d..a61b8724af4c 100644
--- a/converters/osm2pgsql/pkg-descr
+++ b/converters/osm2pgsql/pkg-descr
@@ -4,5 +4,3 @@ for rendering into map tiles by Mapnik.
The format of the database is optimised for ease of rendering
by mapnik. It may be less suitable for other general purpose
processing.
-
-WWW: https://wiki.openstreetmap.org/wiki/Osm2pgsql
diff --git a/converters/osm2pgsql/pkg-plist b/converters/osm2pgsql/pkg-plist
new file mode 100644
index 000000000000..040cb3369780
--- /dev/null
+++ b/converters/osm2pgsql/pkg-plist
@@ -0,0 +1,4 @@
+bin/osm2pgsql
+bin/osm2pgsql-replication
+share/man/man1/osm2pgsql.1.gz
+share/man/man1/osm2pgsql-replication.1.gz