Skip to content

Commit

Permalink
geo/osm2pgsql: update to 1.4.1.
Browse files Browse the repository at this point in the history
new website at https://osm2pgsql.org/

osm2pgsql-dev/osm2pgsql#922 was fixed so this
now builds against upcoming devel/proj 8 update.

use MODPOSTGRESQL_TEST_CMD = ${MODCMAKE_TEST_TARGET} to run the tests
using the cmake goop, pleasantly surprised to see that this works !
  • Loading branch information
landryb committed Mar 7, 2021
1 parent f8a6c7f commit 9d0d5e5
Show file tree
Hide file tree
Showing 9 changed files with 77 additions and 102 deletions.
14 changes: 5 additions & 9 deletions geo/osm2pgsql/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# $OpenBSD: Makefile,v 1.16 2021/02/23 19:39:24 sthen Exp $
# $OpenBSD: Makefile,v 1.17 2021/03/07 17:33:37 landry Exp $

COMMENT = OSM data to PostgreSQL converter

GH_TAGNAME = 0.96.0
GH_TAGNAME = 1.4.1
GH_PROJECT = osm2pgsql
GH_ACCOUNT = openstreetmap
REVISION = 0

CATEGORIES = geo databases

HOMEPAGE = http://wiki.openstreetmap.org/wiki/Osm2pgsql
HOMEPAGE = https://osm2pgsql.org/

# GPLv2
PERMIT_PACKAGE = Yes
Expand All @@ -32,7 +31,7 @@ LIB_DEPENDS = databases/postgresql \

BUILD_DEPENDS = devel/libtool \
devel/protozero \
geo/libosmium
geo/libosmium>=2.15.6

# postgresql,-contrib is needed for hstore extension
TEST_DEPENDS = databases/py-psycopg2 \
Expand All @@ -46,19 +45,16 @@ MODPY_ADJ_FILES = tests/regression-test.py
MODLUA_VERSION = 5.2
MODLUA_SA = Yes

# https://github.com/openstreetmap/osm2pgsql/issues/922 for proj6
CONFIGURE_ARGS = -DBUILD_TESTS=ON \
-DEXTERNAL_LIBOSMIUM=ON \
-DEXTERNAL_PROTOZERO=ON \
-DCMAKE_CXX_FLAGS="-I${LOCALBASE}/include/utfcpp \
-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 \
${CXXFLAGS}"

# bump postgresql,-server limits according to its README otherwise some
# tests fail
MODPOSTGRESQL_TEST_DBNAME = osm2pgsql-test
MODPOSTGRESQL_TEST_CMD = cd ${WRKSRC} && ${MODPY_BIN} tests/regression-test.py \
-x ${WRKBUILD}/osm2pgsql
MODPOSTGRESQL_TEST_CMD = ${MODCMAKE_TEST_TARGET}

pre-configure:
${SUBST_CMD} ${WRKSRC}/CMakeLists.txt
Expand Down
4 changes: 2 additions & 2 deletions geo/osm2pgsql/distinfo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SHA256 (osm2pgsql-0.96.0.tar.gz) = tgIOd9iHcpiSeaaa5GeOl4KYm2MGE3VOSDtRks05xyM=
SIZE (osm2pgsql-0.96.0.tar.gz) = 1219163
SHA256 (osm2pgsql-1.4.1.tar.gz) = M8SBfc7tmXZLCJ6tDo4vZ8TGZ152F3Izm2NYAJcOZuI=
SIZE (osm2pgsql-1.4.1.tar.gz) = 2463328
28 changes: 11 additions & 17 deletions geo/osm2pgsql/patches/patch-CMakeLists_txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
$OpenBSD: patch-CMakeLists_txt,v 1.2 2018/10/28 14:49:25 landry Exp $
$OpenBSD: patch-CMakeLists_txt,v 1.3 2021/03/07 17:33:37 landry Exp $

Index: CMakeLists.txt
--- CMakeLists.txt.orig
+++ CMakeLists.txt
@@ -100,7 +100,7 @@ if (WITH_LUA)
include_directories(${LUAJIT_INCLUDE_DIR})
set(HAVE_LUAJIT 1)
else()
- find_package(Lua REQUIRED)
+ find_package(Lua ${MODLUA_VERSION} REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
endif()
set(HAVE_LUA 1)
@@ -260,5 +260,5 @@ endif()
#############################################################

install(TARGETS osm2pgsql DESTINATION bin)
-install(FILES docs/osm2pgsql.1 DESTINATION share/man/man1)
+install(FILES docs/osm2pgsql.1 DESTINATION man/man1)
install(FILES default.style empty.style DESTINATION share/osm2pgsql)
@@ -185,7 +185,7 @@ if (WITH_LUA)
include_directories(SYSTEM ${LUAJIT_INCLUDE_DIR})
set(HAVE_LUAJIT 1)
else()
- find_package(Lua REQUIRED)
+ find_package(Lua ${MODLUA_VERSION} REQUIRED)
include_directories(SYSTEM ${LUA_INCLUDE_DIR})
endif()
set(HAVE_LUA 1)
12 changes: 12 additions & 0 deletions geo/osm2pgsql/patches/patch-docs_CMakeLists_txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$OpenBSD: patch-docs_CMakeLists_txt,v 1.1 2021/03/07 17:33:37 landry Exp $

Index: docs/CMakeLists.txt
--- docs/CMakeLists.txt.orig
+++ docs/CMakeLists.txt
@@ -27,5 +27,5 @@ else()
message(STATUS " Manual page can not be built")
endif()

-install(FILES osm2pgsql.1 DESTINATION share/man/man1)
+install(FILES osm2pgsql.1 DESTINATION man/man1)

36 changes: 19 additions & 17 deletions geo/osm2pgsql/patches/patch-docs_osm2pgsql_1
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
$OpenBSD: patch-docs_osm2pgsql_1,v 1.3 2018/10/28 14:49:25 landry Exp $
$OpenBSD: patch-docs_osm2pgsql_1,v 1.4 2021/03/07 17:33:37 landry Exp $

Index: docs/osm2pgsql.1
--- docs/osm2pgsql.1.orig
+++ docs/osm2pgsql.1
@@ -107,14 +107,14 @@ to be able to update your database, as these tables ar
@@ -197,7 +197,7 @@ If the RAM is not big enough, use about 75% of memory.
Make sure to leave enough RAM for PostgreSQL.
It needs at least the amount of \f[C]shared_buffers\f[] given in its
configuration.
-Defaults to 800.
+Defaults to 100.
.RS
.RE
.TP
\fB\-S\fR|\-\-style /path/to/style
Location of the osm2pgsql style file. This specifies which tags from the data get
-imported into database columns and which tags get dropped. Defaults to /usr/share/osm2pgsql/default.style.
+imported into database columns and which tags get dropped. Defaults to ${TRUEPREFIX}/share/osm2pgsql/default.style.
.TP
\fB\-C\fR|\-\-cache num
Only for slim mode: Use up to num many MB of RAM for caching nodes. Giving osm2pgsql sufficient cache
to store all imported nodes typically greatly increases the speed of the import. Each cached node
requires 8 bytes of cache, plus about 10% \- 30% overhead. For a current OSM full planet import with
its ~ 3 billion nodes, a good value would be 27000 if you have enough RAM. If you don't have enough
-RAM, it is likely beneficial to give osm2pgsql close to the full available amount of RAM. Defaults to 800.
+RAM, it is likely beneficial to give osm2pgsql close to the full available amount of RAM. Defaults to 100.
.TP
\fB\ \fR\-\-cache\-strategy strategy
There are a number of different modes in which osm2pgsql can organize its
@@ -290,7 +290,7 @@ The style file.
This specifies how the data is imported into the database, its format
depends on the output.
(For the \f[B]pgsql\f[] output, the default is
-\f[C]/usr/share/osm2pgsql/default.style\f[], for other outputs there is
+\f[C]${TRUEPREFIX}/usr/share/osm2pgsql/default.style\f[], for other outputs there is
no default.)
.RS
.RE
25 changes: 0 additions & 25 deletions geo/osm2pgsql/patches/patch-options_cpp

This file was deleted.

14 changes: 14 additions & 0 deletions geo/osm2pgsql/patches/patch-src_options_cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$OpenBSD: patch-src_options_cpp,v 1.1 2021/03/07 17:33:37 landry Exp $

Index: src/options.cpp
--- src/options.cpp.orig
+++ src/options.cpp
@@ -136,7 +136,7 @@ Common options:\n\
required if you want to update with --append later.\n\
--drop Only with --slim: drop temporary tables after import\n\
(no updates are possible).\n\
- -C|--cache=SIZE Use up to SIZE MB for caching nodes (default: 800).\n\
+ -C|--cache=SIZE Use up to SIZE MB for caching nodes (default: 100).\n\
-F|--flat-nodes=FILE Specifies the file to use to persistently store node\n\
information in slim mode instead of in PostgreSQL.\n\
This is a single large file (> 50GB). Only recommended\n\
14 changes: 14 additions & 0 deletions geo/osm2pgsql/patches/patch-src_options_hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
$OpenBSD: patch-src_options_hpp,v 1.1 2021/03/07 17:33:37 landry Exp $

Index: src/options.hpp
--- src/options.hpp.orig
+++ src/options.hpp
@@ -72,7 +72,7 @@ class options_t (public)
std::shared_ptr<reprojection> projection; ///< SRS of projection
bool append = false; ///< Append to existing data
bool slim = false; ///< In slim mode
- int cache = 800; ///< Memory usable for cache in MB
+ int cache = 100; ///< Memory usable for cache in MB

/// Pg Tablespace to store indexes on main tables (no default TABLESPACE)
std::string tblsmain_index{};
32 changes: 0 additions & 32 deletions geo/osm2pgsql/patches/patch-tests_regression-test_py

This file was deleted.

0 comments on commit 9d0d5e5

Please sign in to comment.