Skip to contentSkip to conversation

package/protozero: new package

PATCH New Maxim Kochetkov 2 participants 8 messages Apr 15, 2021 – Apr 16, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/3 package/protozero: new package

Minimalistic protocol buffer decoder and encoder in C++. Designed for high performance. Suitable for writing zero copy parsers and encoders with minimal need for run-time allocation of memory.

Low-level: this is designed to be a building block for writing a very customized decoder for a stable protobuf schema. If your protobuf schema is changing frequently or lazy decoding is not critical for your application then this approach offers no value: just use the C++ API that can be generated with the Google Protobufs protoc program.

https://github.com/mapbox/protozero

---
 DEVELOPERS                       |  1 +
 package/Config.in                |  1 +
 package/protozero/Config.in      | 20 ++++++++++++++++++++
 package/protozero/protozero.hash |  4 ++++
 package/protozero/protozero.mk   | 17 +++++++++++++++++
 5 files changed, 43 insertions(+)
 create mode 100644 package/protozero/Config.in
 create mode 100644 package/protozero/protozero.hash
 create mode 100644 package/protozero/protozero.mk
DEVELOPERS +1 -0
index 1348b8eb91..9390daa2fa 100644
@@ -1840,6 +1840,7 @@ N:	Max Filippov <[email protected]>
 F:	arch/Config.in.xtensa
 
 N:	Maxim Kochetkov <[email protected]>
+F:	package/protozero/
 F:	package/timescaledb/
 
 N:	Maxime Hadjinlian <[email protected]>
package/Config.in +1 -0
index ea0e9edc3e..c5014faba1 100644
@@ -1966,6 +1966,7 @@ endif
 	source "package/poco/Config.in"
 	source "package/protobuf/Config.in"
 	source "package/protobuf-c/Config.in"
+	source "package/protozero/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
 	source "package/riemann-c-client/Config.in"
package/protozero/Config.in new file +20 -0
new file mode 100644
index 0000000000..f187840565
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_PROTOZERO
+	bool "protozero"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
+	help
+	  Minimalistic protocol buffer decoder and encoder in C++.
+	  Designed for high performance. Suitable for writing zero copy
+	  parsers and encoders with minimal need for run-time allocation
+	  of memory.
+	  Low-level: this is designed to be a building block for writing
+	  a very customized decoder for a stable protobuf schema. If your
+	  protobuf schema is changing frequently or lazy decoding is not
+	  critical for your application then this approach offers
+	  no value: just use the C++ API that can be generated with
+	  the Google Protobufs protoc program.
+
+	  https://github.com/mapbox/protozero
+
+comment "protozero needs a toolchain w/ C++,  gcc >= 4.7"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
package/protozero/protozero.hash new file +4 -0
new file mode 100644
index 0000000000..5453e01ecf
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  beffbdfab060854fd770178a8db9c028b5b6ee4a059a2fed82c46390a85f3f31  protozero-1.7.0.tar.gz
+sha256  1f4d477e3c2d74d8706c8f05437bd86804abe46853b1f233ce1549a4de76fa49  LICENSE.md
+sha256  0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594  LICENSE.from_folly
package/protozero/protozero.mk new file +17 -0
new file mode 100644
index 0000000000..e4ce1a4730
@@ -0,0 +1,17 @@
+################################################################################
+#
+# protozero
+#
+################################################################################
+
+PROTOZERO_VERSION = 1.7.0
+PROTOZERO_SITE = $(call github,mapbox,protozero,v$(PROTOZERO_VERSION))
+PROTOZERO_LICENSE = BSD-2-Clause, Apache-2.0
+PROTOZERO_LICENSE_FILES = LICENSE.md LICENSE.from_folly
+PROTOZERO_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_PROTOBUF),y)
+PROTOZERO_DEPENDENCIES += protobuf
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.30.2
#1 lore raw

PATCH v3 2/3 package/libosmium: new package

A fast and flexible C++ library for working with OpenStreetMap data. Libosmium works on Linux, macOS and Windows.

https://osmcode.org/libosmium/

---
 DEVELOPERS                       |  1 +
 package/Config.in                |  1 +
 package/libosmium/Config.in      | 17 +++++++++++++++++
 package/libosmium/libosmium.hash |  3 +++
 package/libosmium/libosmium.mk   | 30 ++++++++++++++++++++++++++++++
 5 files changed, 52 insertions(+)
 create mode 100644 package/libosmium/Config.in
 create mode 100644 package/libosmium/libosmium.hash
 create mode 100644 package/libosmium/libosmium.mk
DEVELOPERS +1 -0
index 9390daa2fa..ceb7428e95 100644
@@ -1840,6 +1840,7 @@ N:	Max Filippov <[email protected]>
 F:	arch/Config.in.xtensa
 
 N:	Maxim Kochetkov <[email protected]>
+F:	package/libosmium/
 F:	package/protozero/
 F:	package/timescaledb/
 
package/Config.in +1 -0
index c5014faba1..61c67e5ce1 100644
@@ -1936,6 +1936,7 @@ menu "Other"
 	source "package/libtasn1/Config.in"
 	source "package/libtommath/Config.in"
 	source "package/libtpl/Config.in"
+	source "package/libosmium/Config.in"
 	source "package/libubox/Config.in"
 	source "package/libuci/Config.in"
 	source "package/libunwind/Config.in"
package/libosmium/Config.in new file +17 -0
new file mode 100644
index 0000000000..e774dd0bd2
@@ -0,0 +1,17 @@
+config BR2_PACKAGE_LIBOSMIUM
+	bool "libosmium"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
+	depends on BR2_TOOLCHAIN_HAS_THREADS # boost
+	depends on BR2_USE_WCHAR # boost
+	select BR2_PACKAGE_BOOST
+
+	help
+	  A fast and flexible C++ library for working with OpenStreetMap data.
+	  Libosmium works on Linux, macOS and Windows.
+
+	  https://osmcode.org/libosmium/
+
+comment "libosmium needs a toolchain w/ C++,  wchar, threads, gcc >= 4.7"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || !BR2_TOOLCHAIN_HAS_THREADS
package/libosmium/libosmium.hash new file +3 -0
new file mode 100644
index 0000000000..b90690e9aa
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  42bbef97226d7db7ce3eeb474603e5b1f2f0f86cec85498868e9416e7cdf5bd5  libosmium-2.16.0.tar.gz
+sha256  c9bff75738922193e67fa726fa225535870d2aa1059f91452c411736284ad566  LICENSE
package/libosmium/libosmium.mk new file +30 -0
new file mode 100644
index 0000000000..1ef99e47fc
@@ -0,0 +1,30 @@
+################################################################################
+#
+# libosmium
+#
+################################################################################
+
+LIBOSMIUM_VERSION = 2.16.0
+LIBOSMIUM_SITE = $(call github,osmcode,libosmium,v$(LIBOSMIUM_VERSION))
+LIBOSMIUM_LICENSE = BSL-1.0
+LIBOSMIUM_LICENSE_FILES = LICENSE
+LIBOSMIUM_INSTALL_STAGING = YES
+LIBOSMIUM_DEPENDENCIES = boost
+
+ifeq ($(BR2_PACKAGE_BZIP2),y)
+LIBOSMIUM_DEPENDENCIES += bzip2
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGEOS),y)
+LIBOSMIUM_DEPENDENCIES += libgeos
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGDAL),y)
+LIBOSMIUM_DEPENDENCIES += libgdal
+endif
+
+ifeq ($(BR2_PACKAGE_PROJ),y)
+LIBOSMIUM_DEPENDENCIES += proj
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.30.2
#2 lore raw

PATCH v3 2/3 package/libosmium: new package

Quoted 6 lines · Maxim Kochetkov

A fast and flexible C++ library for working with OpenStreetMap data. Libosmium works on Linux, macOS and Windows.

https://osmcode.org/libosmium/

I wanted to apply, however, it fails to build in a very basic config for me:

CMake Error at cmake/FindProtozero.cmake:47 (file):
file STRINGS file

"/home/arnout/src/buildroot/output/build/libosmium-2.16.0/PROTOZERO_INCLUDE_DIR-NOTFOUND/protozero/version.hpp"
cannot be read.
Call Stack (most recent call first):
cmake/FindOsmium.cmake:118 (find_package)
CMakeLists.txt:170 (find_package)

-- Could NOT find Protozero: Found unsuitable version "unknown", but required is at least "1.6.3" (found PROTOZERO_INCLUDE_DIR-NOTFOUND)
CMake Warning at cmake/FindOsmium.cmake:138 (message):
Osmium: Can not find some libraries for PBF input/output, please install them or configure the paths.
Call Stack (most recent call first):
CMakeLists.txt:170 (find_package)

-- Found EXPAT:
/home/arnout/src/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libexpat.so (found version "2.3.0")
-- Found BZip2:
/home/arnout/src/buildroot/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libbz2.so (found version "1.0.8")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
CMake Warning at cmake/FindOsmium.cmake:190 (message):
Osmium: GEOS library is required but not found, please install it or configure the paths.
Call Stack (most recent call first):
CMakeLists.txt:170 (find_package)

-- Could NOT find GDAL (missing: GDAL_LIBRARY GDAL_INCLUDE_DIR) (found version "GDAL_VERSION-NOTFOUND")
CMake Warning at cmake/FindOsmium.cmake:204 (message):
Osmium: GDAL library is required but not found, please install it or configure the paths.
Call Stack (most recent call first):
CMakeLists.txt:170 (find_package)

CMake Warning at cmake/FindOsmium.cmake:220 (message):
Osmium: PROJ.4 library is required but not found, please install it or configure the paths.
Call Stack (most recent call first):
CMakeLists.txt:170 (find_package)

CMake Warning at cmake/FindOsmium.cmake:254 (message):
Osmium: Google SparseHash library is required but not found, please install it or configure the paths.
Call Stack (most recent call first):
CMakeLists.txt:170 (find_package)

-- Could NOT find Osmium (missing: PROTOZERO_INCLUDE_DIR GEOS_INCLUDE_DIR GEOS_LIBRARY GDAL_FOUND PROJ_INCLUDE_DIR PROJ_LIBRARY SPARSEHASH_INCLUDE_DIR)

So it seems that the dependencies on protozero, gdal, geos, proj and sparsehash
are not optional. And in fact, the bzip2, zlib, expat dependencies are also not optional, if I read cmake/FindOsmium.cmake correctly.

Also I can't find sparsehash in buildroot, so how did you manage to build this?

Quoted 28 lines
---
 DEVELOPERS                       |  1 +
 package/Config.in                |  1 +
 package/libosmium/Config.in      | 17 +++++++++++++++++
 package/libosmium/libosmium.hash |  3 +++
 package/libosmium/libosmium.mk   | 30 ++++++++++++++++++++++++++++++
 5 files changed, 52 insertions(+)
 create mode 100644 package/libosmium/Config.in
 create mode 100644 package/libosmium/libosmium.hash
 create mode 100644 package/libosmium/libosmium.mk
DEVELOPERS +1 -0
index 9390daa2fa..ceb7428e95 100644
@@ -1840,6 +1840,7 @@ N:	Max Filippov <[email protected]>
 F:	arch/Config.in.xtensa
 
 N:	Maxim Kochetkov <[email protected]>
+F:	package/libosmium/
 F:	package/protozero/
 F:	package/timescaledb/
 
package/Config.in +0 -0
index c5014faba1..61c67e5ce1 100644

package/Config.in menu "Other" · line 1939

Quoted 4 lines
package/Config.in +1 -0
@@ -1936,6 +1936,7 @@ menu "Other"
 	source "package/libtasn1/Config.in"
 	source "package/libtommath/Config.in"
 	source "package/libtpl/Config.in"
+	source "package/libosmium/Config.in"

Alphabetical ordering (as reported by check-package).

Regards,
Arnout

[snip]

#3 lore raw

PATCH v3 2/3 package/libosmium: new package

This is header-only library. It only checks some externals headers. All dependencies except protozero are optional.

15.04.2021 23:24, Arnout Vandecappelle ?????:

Quoted 6 lines

So it seems that the dependencies on protozero, gdal, geos, proj and sparsehash
are not optional. And in fact, the bzip2, zlib, expat dependencies are also not optional, if I read cmake/FindOsmium.cmake correctly.

Also I can't find sparsehash in buildroot, so how did you manage to build this?

#4 lore raw

PATCH v3 3/3 package/osm2pgsql: new package

In reply to Maxim Kochetkov

osm2pgsql is a tool for loading OpenStreetMap data into a PostgreSQL / PostGIS database suitable for applications like rendering into a map, geocoding with Nominatim, or general analysis.

https://osm2pgsql.org

---
Changes v2 -> v3 (after review of Arnout Vandecappelle):
- Move include to "if BR2_PACKAGE_POSTGRESQL"
- Add comment about what's missing in the toolchain
- Use unbundled version of libosmium and protozero

Changes v1 -> v2 (after review of Peter Seiderer):
- Add dependencies
- Disable tests
- Fix license
- Fix check-package warnings
- Add myself to DEVELOPERS
- Test all lua versions (5.1, 5.3, 5.4)

 DEVELOPERS                       |  1 +
 package/Config.in                |  3 +++
 package/osm2pgsql/Config.in      | 27 +++++++++++++++++++++++
 package/osm2pgsql/osm2pgsql.hash |  3 +++
 package/osm2pgsql/osm2pgsql.mk   | 37 ++++++++++++++++++++++++++++++++
 5 files changed, 71 insertions(+)
 create mode 100644 package/osm2pgsql/Config.in
 create mode 100644 package/osm2pgsql/osm2pgsql.hash
 create mode 100644 package/osm2pgsql/osm2pgsql.mk
DEVELOPERS +1 -0
index ceb7428e95..7053c67b6c 100644
@@ -1841,6 +1841,7 @@ F:	arch/Config.in.xtensa
 
 N:	Maxim Kochetkov <[email protected]>
 F:	package/libosmium/
+F:	package/osm2pgsql/
 F:	package/protozero/
 F:	package/timescaledb/
 
package/Config.in +3 -0
index 61c67e5ce1..00f639915f 100644
@@ -1407,6 +1407,9 @@ menu "Database"
 	source "package/mongodb/Config.in"
 	source "package/mysql/Config.in"
 	source "package/postgresql/Config.in"
+if BR2_PACKAGE_POSTGRESQL
+	source "package/osm2pgsql/Config.in"
+endif
 if BR2_PACKAGE_POSTGRESQL_FULL
 	source "package/postgis/Config.in"
 endif
package/osm2pgsql/Config.in new file +27 -0
new file mode 100644
index 0000000000..e4163b5e66
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_OSM2PGSQL
+	bool "osm2pgsql"
+	depends on BR2_PACKAGE_POSTGRESQL
+	depends on BR2_INSTALL_LIBSTDCPP # boost, fmt
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
+	depends on BR2_TOOLCHAIN_HAS_THREADS # boost
+	depends on BR2_USE_WCHAR # boost, fmt
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_SYSTEM
+	select BR2_PACKAGE_BOOST_FILESYSTEM
+	select BR2_PACKAGE_BZIP2
+	select BR2_PACKAGE_EXPAT
+	select BR2_PACKAGE_FMT
+	select BR2_PACKAGE_PROTOZERO
+	select BR2_PACKAGE_LIBOSMIUM
+	select BR2_PACKAGE_ZLIB
+	help
+	  osm2pgsql is a tool for loading OpenStreetMap data into a
+	  PostgreSQL / PostGIS database suitable for applications like
+	  rendering into a map, geocoding with Nominatim,
+	  or general analysis.
+
+	  https://osm2pgsql.org
+
+comment "osm2pgsql needs a toolchain w/ C++,  wchar, threads, gcc >= 4.7"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || !BR2_TOOLCHAIN_HAS_THREADS
\ No newline at end of file
package/osm2pgsql/osm2pgsql.hash new file +3 -0
new file mode 100644
index 0000000000..13e8de4b51
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  fc68283930ccd468ed9b28685150741b16083fec86800a4b011884ae22eb061c  osm2pgsql-1.4.2.tar.gz
+sha256  ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  COPYING
package/osm2pgsql/osm2pgsql.mk new file +37 -0
new file mode 100644
index 0000000000..f331955604
@@ -0,0 +1,37 @@
+################################################################################
+#
+# osm2pgsql
+#
+################################################################################
+
+OSM2PGSQL_VERSION = 1.4.2
+OSM2PGSQL_SITE = $(call github,openstreetmap,osm2pgsql,$(OSM2PGSQL_VERSION))
+OSM2PGSQL_LICENSE = GPL-2.0+
+OSM2PGSQL_LICENSE_FILES = COPYING
+OSM2PGSQL_SUPPORTS_IN_SOURCE_BUILD = NO
+
+OSM2PGSQL_DEPENDENCIES =  boost bzip2 expat fmt libosmium postgresql protozero zlib
+
+OSM2PGSQL_CONF_OPTS += -DBUILD_TESTS=OFF -DBUILD_COVERAGE=OFF
+OSM2PGSQL_CONF_OPTS += -DEXTERNAL_FMT=ON -DEXTERNAL_LIBOSMIUM=ON -DEXTERNAL_PROTOZERO=ON
+
+ifeq ($(BR2_PACKAGE_LUAJIT),y)
+OSM2PGSQL_DEPENDENCIES += luajit
+OSM2PGSQL_CONF_OPTS +=  -DWITH_LUA=ON -DWITH_LUAJIT=ON
+else
+ifeq ($(BR2_PACKAGE_LUA),y)
+OSM2PGSQL_DEPENDENCIES += lua
+OSM2PGSQL_CONF_OPTS +=  -DWITH_LUA=ON -DWITH_LUAJIT=OFF
+else
+OSM2PGSQL_CONF_OPTS += -DWITH_LUA=OFF -DWITH_LUAJIT=OFF
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_PROJ),y)
+OSM2PGSQL_DEPENDENCIES += proj
+OSM2PGSQL_CONF_OPTS += -DUSE_PROJ_LIB=auto
+else
+OSM2PGSQL_CONF_OPTS += -DUSE_PROJ_LIB=off
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.30.2
#5 lore raw

PATCH v3 3/3 package/osm2pgsql: new package

On 15/04/2021 17:03, Maxim Kochetkov wrote:
[snip]

package/Config.in menu "Database" · line 1413

Quoted 12 lines
package/Config.in +3 -0
index 61c67e5ce1..00f639915f 100644
@@ -1407,6 +1407,9 @@ menu "Database"
 	source "package/mongodb/Config.in"
 	source "package/mysql/Config.in"
 	source "package/postgresql/Config.in"
+if BR2_PACKAGE_POSTGRESQL
+	source "package/osm2pgsql/Config.in"
+endif
 if BR2_PACKAGE_POSTGRESQL_FULL

The intention was to have only a single condition here. I've pushed a
preparatory patch that changes the condition to BR2_PACKAGE_POSTGRESQL, so please rebase on that.

Quoted 17 lines
package/Config.in +0 -0
 	source "package/postgis/Config.in"
 endif
package/osm2pgsql/Config.in new file +9 -0
new file mode 100644
index 0000000000..e4163b5e66
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_OSM2PGSQL
+	bool "osm2pgsql"
+	depends on BR2_PACKAGE_POSTGRESQL
+	depends on BR2_INSTALL_LIBSTDCPP # boost, fmt
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
+	depends on BR2_TOOLCHAIN_HAS_THREADS # boost
+	depends on BR2_USE_WCHAR # boost, fmt
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_SYSTEM

package/osm2pgsql/Config.in line 19

Quoted 10 lines
package/osm2pgsql/Config.in new file +10 -0
+	select BR2_PACKAGE_BOOST_FILESYSTEM
+	select BR2_PACKAGE_BZIP2
+	select BR2_PACKAGE_EXPAT
+	select BR2_PACKAGE_FMT
+	select BR2_PACKAGE_PROTOZERO
+	select BR2_PACKAGE_LIBOSMIUM
+	select BR2_PACKAGE_ZLIB
+	help
+	  osm2pgsql is a tool for loading OpenStreetMap data into a
+	  PostgreSQL / PostGIS database suitable for applications like

Line too long, as reported by check-package.

Quoted 36 lines
package/osm2pgsql/Config.in new file +8 -0
+	  rendering into a map, geocoding with Nominatim,
+	  or general analysis.
+
+	  https://osm2pgsql.org
+
+comment "osm2pgsql needs a toolchain w/ C++,  wchar, threads, gcc >= 4.7"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || !BR2_TOOLCHAIN_HAS_THREADS
\ No newline at end of file
package/osm2pgsql/osm2pgsql.hash new file +3 -0
new file mode 100644
index 0000000000..13e8de4b51
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  fc68283930ccd468ed9b28685150741b16083fec86800a4b011884ae22eb061c  osm2pgsql-1.4.2.tar.gz
+sha256  ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  COPYING
package/osm2pgsql/osm2pgsql.mk new file +12 -0
new file mode 100644
index 0000000000..f331955604
@@ -0,0 +1,37 @@
+################################################################################
+#
+# osm2pgsql
+#
+################################################################################
+
+OSM2PGSQL_VERSION = 1.4.2
+OSM2PGSQL_SITE = $(call github,openstreetmap,osm2pgsql,$(OSM2PGSQL_VERSION))
+OSM2PGSQL_LICENSE = GPL-2.0+
+OSM2PGSQL_LICENSE_FILES = COPYING
+OSM2PGSQL_SUPPORTS_IN_SOURCE_BUILD = NO
+

package/osm2pgsql/osm2pgsql.mk line 22

Quoted 10 lines
package/osm2pgsql/osm2pgsql.mk new file +10 -0
+OSM2PGSQL_DEPENDENCIES =  boost bzip2 expat fmt libosmium postgresql protozero zlib
+
+OSM2PGSQL_CONF_OPTS += -DBUILD_TESTS=OFF -DBUILD_COVERAGE=OFF
+OSM2PGSQL_CONF_OPTS += -DEXTERNAL_FMT=ON -DEXTERNAL_LIBOSMIUM=ON -DEXTERNAL_PROTOZERO=ON
+
+ifeq ($(BR2_PACKAGE_LUAJIT),y)
+OSM2PGSQL_DEPENDENCIES += luajit
+OSM2PGSQL_CONF_OPTS +=  -DWITH_LUA=ON -DWITH_LUAJIT=ON
+else
+ifeq ($(BR2_PACKAGE_LUA),y)

This can be put on one line:

else ifeq ($(BR2_PACKAGE_LUA),y)

package/osm2pgsql/osm2pgsql.mk line 28

Quoted 6 lines
package/osm2pgsql/osm2pgsql.mk new file +6 -0
+OSM2PGSQL_DEPENDENCIES += lua
+OSM2PGSQL_CONF_OPTS +=  -DWITH_LUA=ON -DWITH_LUAJIT=OFF
+else
+OSM2PGSQL_CONF_OPTS += -DWITH_LUA=OFF -DWITH_LUAJIT=OFF
+endif
+endif

... and then you have only one endif here.

Regards,
Arnout

Quoted 10 lines
package/osm2pgsql/osm2pgsql.mk new file +9 -0
+
+ifeq ($(BR2_PACKAGE_PROJ),y)
+OSM2PGSQL_DEPENDENCIES += proj
+OSM2PGSQL_CONF_OPTS += -DUSE_PROJ_LIB=auto
+else
+OSM2PGSQL_CONF_OPTS += -DUSE_PROJ_LIB=off
+endif
+
+$(eval $(cmake-package))
#6 lore raw

PATCH v3 3/3 package/osm2pgsql: new package

Strange situation:

./utils/check-package package/osm2pgsql/*
65 lines processed
0 warnings generated

15.04.2021 23:32, Arnout Vandecappelle ?????:

Quoted 6 lines

package/osm2pgsql/Config.in line 19

Quoted 4 lines
package/osm2pgsql/Config.in new file +4 -0
+	select BR2_PACKAGE_ZLIB
+	help
+	  osm2pgsql is a tool for loading OpenStreetMap data into a
+	  PostgreSQL / PostGIS database suitable for applications like

Line too long, as reported by check-package.

#7 lore raw

PATCH v3 1/3 package/protozero: new package

In reply to Maxim Kochetkov
Quoted 12 lines · Maxim Kochetkov

Minimalistic protocol buffer decoder and encoder in C++. Designed for high performance. Suitable for writing zero copy parsers and encoders with minimal need for run-time allocation of memory.

Low-level: this is designed to be a building block for writing a very customized decoder for a stable protobuf schema. If your protobuf schema is changing frequently or lazy decoding is not critical for your application then this approach offers no value: just use the C++ API that can be generated with the Google Protobufs protoc program.

Quoted 3 lines

https://github.com/mapbox/protozero

Applied to master, thanks. However, I did have to make a few formatting fixups.
Please run utils/check-package on the patch before sending.

Regards,
Arnout

Quoted 95 lines
---
 DEVELOPERS                       |  1 +
 package/Config.in                |  1 +
 package/protozero/Config.in      | 20 ++++++++++++++++++++
 package/protozero/protozero.hash |  4 ++++
 package/protozero/protozero.mk   | 17 +++++++++++++++++
 5 files changed, 43 insertions(+)
 create mode 100644 package/protozero/Config.in
 create mode 100644 package/protozero/protozero.hash
 create mode 100644 package/protozero/protozero.mk
DEVELOPERS +1 -0
index 1348b8eb91..9390daa2fa 100644
@@ -1840,6 +1840,7 @@ N:	Max Filippov <[email protected]>
 F:	arch/Config.in.xtensa
 
 N:	Maxim Kochetkov <[email protected]>
+F:	package/protozero/
 F:	package/timescaledb/
 
 N:	Maxime Hadjinlian <[email protected]>
package/Config.in +1 -0
index ea0e9edc3e..c5014faba1 100644
@@ -1966,6 +1966,7 @@ endif
 	source "package/poco/Config.in"
 	source "package/protobuf/Config.in"
 	source "package/protobuf-c/Config.in"
+	source "package/protozero/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
 	source "package/riemann-c-client/Config.in"
package/protozero/Config.in new file +20 -0
new file mode 100644
index 0000000000..f187840565
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_PROTOZERO
+	bool "protozero"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
+	help
+	  Minimalistic protocol buffer decoder and encoder in C++.
+	  Designed for high performance. Suitable for writing zero copy
+	  parsers and encoders with minimal need for run-time allocation
+	  of memory.
+	  Low-level: this is designed to be a building block for writing
+	  a very customized decoder for a stable protobuf schema. If your
+	  protobuf schema is changing frequently or lazy decoding is not
+	  critical for your application then this approach offers
+	  no value: just use the C++ API that can be generated with
+	  the Google Protobufs protoc program.
+
+	  https://github.com/mapbox/protozero
+
+comment "protozero needs a toolchain w/ C++,  gcc >= 4.7"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
package/protozero/protozero.hash new file +4 -0
new file mode 100644
index 0000000000..5453e01ecf
@@ -0,0 +1,4 @@
+# Locally calculated
+sha256  beffbdfab060854fd770178a8db9c028b5b6ee4a059a2fed82c46390a85f3f31  protozero-1.7.0.tar.gz
+sha256  1f4d477e3c2d74d8706c8f05437bd86804abe46853b1f233ce1549a4de76fa49  LICENSE.md
+sha256  0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594  LICENSE.from_folly
package/protozero/protozero.mk new file +17 -0
new file mode 100644
index 0000000000..e4ce1a4730
@@ -0,0 +1,17 @@
+################################################################################
+#
+# protozero
+#
+################################################################################
+
+PROTOZERO_VERSION = 1.7.0
+PROTOZERO_SITE = $(call github,mapbox,protozero,v$(PROTOZERO_VERSION))
+PROTOZERO_LICENSE = BSD-2-Clause, Apache-2.0
+PROTOZERO_LICENSE_FILES = LICENSE.md LICENSE.from_folly
+PROTOZERO_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_PROTOBUF),y)
+PROTOZERO_DEPENDENCIES += protobuf
+endif
+
+$(eval $(cmake-package))