Hi,
here's a long overdue update to osm2pgsql 1.4.1, compatible with newer
proj API, and requires the libosmium update i sent yesterday.
All tests but 3 fail, i consider that 'pretty decent':
95% tests passed, 3 tests failed out of 64
The following tests FAILED:
21 - test-output-pgsql-tablespace (Failed)
52 - test-output-flex-tablespace (Failed)
64 - regression-test-pbf (Failed)
as i'm not really using this, but just want to have it more up to date
for a proj update, feedback is welcome !
Landry
? patches-no
Index: Makefile
===================================================================
RCS file: /cvs/ports/geo/osm2pgsql/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- Makefile 23 Feb 2021 19:39:24 -0000 1.16
+++ Makefile 3 Mar 2021 08:06:15 -0000
@@ -2,14 +2,13 @@
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
@@ -32,7 +31,7 @@
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 \
@@ -46,19 +45,16 @@
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
Index: distinfo
===================================================================
RCS file: /cvs/ports/geo/osm2pgsql/distinfo,v
retrieving revision 1.4
diff -u -r1.4 distinfo
--- distinfo 28 Oct 2018 14:49:25 -0000 1.4
+++ distinfo 3 Mar 2021 08:06:15 -0000
@@ -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
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: /cvs/ports/geo/osm2pgsql/patches/patch-CMakeLists_txt,v
retrieving revision 1.2
diff -u -r1.2 patch-CMakeLists_txt
--- patches/patch-CMakeLists_txt 28 Oct 2018 14:49:25 -0000 1.2
+++ patches/patch-CMakeLists_txt 3 Mar 2021 08:06:15 -0000
@@ -1,20 +1,14 @@
-$OpenBSD: patch-CMakeLists_txt,v 1.2 2018/10/28 14:49:25 landry Exp $
+$OpenBSD$
+
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)
Index: patches/patch-docs_CMakeLists_txt
===================================================================
RCS file: patches/patch-docs_CMakeLists_txt
diff -N patches/patch-docs_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-docs_CMakeLists_txt 3 Mar 2021 08:06:15 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+
+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)
+
Index: patches/patch-docs_osm2pgsql_1
===================================================================
RCS file: /cvs/ports/geo/osm2pgsql/patches/patch-docs_osm2pgsql_1,v
retrieving revision 1.3
diff -u -r1.3 patch-docs_osm2pgsql_1
--- patches/patch-docs_osm2pgsql_1 28 Oct 2018 14:49:25 -0000 1.3
+++ patches/patch-docs_osm2pgsql_1 3 Mar 2021 08:06:15 -0000
@@ -1,21 +1,23 @@
-$OpenBSD: patch-docs_osm2pgsql_1,v 1.3 2018/10/28 14:49:25 landry Exp $
+$OpenBSD$
+
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
Index: patches/patch-options_cpp
===================================================================
RCS file: patches/patch-options_cpp
diff -N patches/patch-options_cpp
--- patches/patch-options_cpp 28 Oct 2018 14:49:25 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@
-$OpenBSD: patch-options_cpp,v 1.3 2018/10/28 14:49:25 landry Exp $
-
-Set the default cache size to 100M
-
-Index: options.cpp
---- options.cpp.orig
-+++ options.cpp
-@@ -98,7 +98,7 @@ namespace
- printf("\
- %s.\n", DEFAULT_STYLE);
- printf("%s", "\
-- -C|--cache Use up to this many MB for caching nodes (default:
800)\n\
-+ -C|--cache Use up to this many MB for caching nodes (default:
100)\n\
- -F|--flat-nodes Specifies the flat file to use to persistently store
node \n\
- information in slim mode instead of in PostgreSQL.\n\
- This file is a single > 40Gb large file. Only
recommended\n\
-@@ -267,7 +267,7 @@ std::string database_options_t::conninfo() const
- options_t::options_t()
- : prefix("planet_osm"),
- projection(reprojection::create_projection(PROJ_SPHERE_MERC)),
append(false),
-- slim(false), cache(800), tblsmain_index(boost::none),
-+ slim(false), cache(100), tblsmain_index(boost::none),
- tblsslim_index(boost::none), tblsmain_data(boost::none),
- tblsslim_data(boost::none), style(DEFAULT_STYLE),
- expire_tiles_zoom(0), expire_tiles_zoom_min(0),
Index: patches/patch-src_options_cpp
===================================================================
RCS file: patches/patch-src_options_cpp
diff -N patches/patch-src_options_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_options_cpp 3 Mar 2021 08:06:15 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+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\
Index: patches/patch-src_options_hpp
===================================================================
RCS file: patches/patch-src_options_hpp
diff -N patches/patch-src_options_hpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_options_hpp 3 Mar 2021 08:06:15 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+
+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{};
Index: patches/patch-tests_regression-test_py
===================================================================
RCS file: patches/patch-tests_regression-test_py
diff -N patches/patch-tests_regression-test_py
--- patches/patch-tests_regression-test_py 28 Oct 2018 14:49:25 -0000
1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-$OpenBSD: patch-tests_regression-test_py,v 1.2 2018/10/28 14:49:25 landry Exp $
-Index: tests/regression-test.py
---- tests/regression-test.py.orig
-+++ tests/regression-test.py
-@@ -494,7 +494,7 @@ def findContribSql(filename):
-
- # Try to get base dir for postgres contrib
- try:
-- postgis_base_dir = os.popen('pg_config | grep -m 1 "^INCLUDEDIR
="').read().strip().split(' ')[2].split('/include')[0]
-+ postgis_base_dir = os.popen('pg_config | grep "^INCLUDEDIR =" |head
-n1').read().strip().split(' ')[2].split('/include')[0]
- except:
- postgis_base_dir = '/usr'
-
-@@ -554,6 +554,9 @@ def setupDB():
- global created_tablespace
- created_tablespace = 0
-
-+ subprocess.call(["/bin/rm", "-rf", "/tmp/psql-tablespace"])
-+ os.makedirs("/tmp/psql-tablespace")
-+ test_cur.execute("""CREATE TABLESPACE tablespacetest LOCATION
'/tmp/psql-tablespace'""")
- test_cur.execute("""SELECT spcname FROM pg_tablespace WHERE
spcname = 'tablespacetest'""")
- if test_cur.fetchone():
- print "We already have a tablespace, can use that"
-@@ -613,7 +616,7 @@ def tearDownDB():
- gen_cur.close()
- gen_conn.close()
- if (created_tablespace == 1):
-- returncode = subprocess.call(["/usr/bin/sudo", "/bin/rmdir",
"/tmp/psql-tablespace"])
-+ returncode = subprocess.call(["/bin/rm", "-rf",
"/tmp/psql-tablespace"])
-
-
- if __name__ == "__main__":