astro/libosmium: update 2.17.2 → 2.18.0

- Convert LIB_DEPENDS to BUILD_DEPENDS, as this is a header-only
  library and the actual usage of dependencies is optional and depends
  on the consumer
- Patch most linux-only #ifdefs to also include FreeBSD
This commit is contained in:
Dmitry Marakasov 2022-03-14 22:27:47 +03:00
parent d0fb1df569
commit 1c27e08172
4 changed files with 53 additions and 22 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= libosmium
PORTVERSION= 2.17.2
DISTVERSIONPREFIX= v
DISTVERSION= 2.18.0
CATEGORIES= astro geography devel
MAINTAINER= amdmi3@FreeBSD.org
@ -9,23 +9,22 @@ COMMENT= Fast and flexible C++ library for working with OpenStreetMap data
LICENSE= BSL
LICENSE_FILE= ${WRKSRC}/LICENSE
LIB_DEPENDS= libgdal.so:graphics/gdal \
libboost_regex.so:devel/boost-libs \
libgeos.so:graphics/geos \
libexpat.so:textproc/expat2
BUILD_DEPENDS= sparsehash>=0:devel/sparsehash \
${LOCALBASE}/include/protozero/version.hpp:devel/protozero
RUN_DEPENDS= ${LOCALBASE}/include/protozero/version.hpp:devel/protozero
BUILD_DEPENDS= boost-libs>=0:devel/boost-libs \
protozero>=0:devel/protozero \
gdal>=0:graphics/gdal \
protozero>=0:devel/protozero \
expat>=0:textproc/expat2 \
liblz4>=0:archivers/liblz4 \
geos>=0:graphics/geos
# proj>=0:graphics/proj
USES= cmake compiler:c++11-lib
USE_GITHUB= yes
GH_ACCOUNT= osmcode
CMAKE_ARGS= -DBUILD_EXAMPLES:BOOL=OFF
# if/when corresponding port appears in the tree, this will need to
# be turned into dependency
CMAKE_ARGS+= -DINSTALL_GDALCPP:BOOL=ON
CMAKE_ON= INSTALL_GDALCPP # until it appears as a port
CMAKE_ON+= BUILD_HEADERS
CMAKE_OFF= BUILD_EXAMPLES
CMAKE_OFF+= WITH_PROJ # the ports version is not supported
# although it builds tests the library itself is header-only
NO_ARCH= yes
@ -37,8 +36,14 @@ OPTIONS_DEFAULT= TEST
TEST_TEST_TARGET= test
TEST_CMAKE_BOOL= BUILD_TESTING
post-extract:
@${RM} -rf ${WRKSRC}/include/utf8*
post-patch:
@${FIND} ${WRKSRC} -type f \( -name "*.cpp" -o -name "*.hpp" \) \
-not -name "memory_mapping.hpp" \
-not -name "test_memory_mapping.cpp" \
-not -name "test_memory.cpp" \
-exec ${REINPLACE_CMD} \
-e 's,^#ifdef __linux__,#if defined(__linux__) || defined(__FreeBSD__),' \
-e 's,^#ifndef __linux__,#if !defined(__linux__) && !defined(__FreeBSD__),' {} \;
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1639744850
SHA256 (osmcode-libosmium-v2.17.2_GH0.tar.gz) = f30e37c28f37ca3857b8107a12e6d138a0719831eca52a836692909801c8b0bd
SIZE (osmcode-libosmium-v2.17.2_GH0.tar.gz) = 569488
TIMESTAMP = 1647270667
SHA256 (osmcode-libosmium-v2.18.0_GH0.tar.gz) = c05a3e95c9c811521ebad8637e90f43ab8fb053b310875acce741cc4c17d6f59
SIZE (osmcode-libosmium-v2.18.0_GH0.tar.gz) = 565862

View File

@ -0,0 +1,29 @@
--- include/osmium/thread/util.hpp.orig 2022-02-07 12:59:17 UTC
+++ include/osmium/thread/util.hpp
@@ -38,8 +38,10 @@ DEALINGS IN THE SOFTWARE.
#include <thread>
#include <utility>
-#ifdef __linux__
+#if defined(__linux__)
# include <sys/prctl.h>
+#elif defined(__FreeBSD__)
+# include <pthread.h>
#endif
namespace osmium {
@@ -72,9 +74,13 @@ namespace osmium {
/**
* Set name of current thread for debugging. This only works on Linux.
*/
-#ifdef __linux__
+#if defined(__linux__)
inline void set_thread_name(const char* name) noexcept {
prctl(PR_SET_NAME, name, 0, 0, 0);
+ }
+#elif defined(__FreeBSD__)
+ inline void set_thread_name(const char* name) noexcept {
+ pthread_setname_np(pthread_self(), name);
}
#else
inline void set_thread_name(const char*) noexcept {

View File

@ -19,7 +19,6 @@ include/osmium/area/problem_reporter_stream.hpp
include/osmium/area/stats.hpp
include/osmium/builder/attr.hpp
include/osmium/builder/builder.hpp
include/osmium/builder/builder_helper.hpp
include/osmium/builder/osm_object_builder.hpp
include/osmium/diff_handler.hpp
include/osmium/diff_iterator.hpp
@ -68,7 +67,6 @@ include/osmium/index/map/flex_mem.hpp
include/osmium/index/map/sparse_file_array.hpp
include/osmium/index/map/sparse_mem_array.hpp
include/osmium/index/map/sparse_mem_map.hpp
include/osmium/index/map/sparse_mem_table.hpp
include/osmium/index/map/sparse_mmap_array.hpp
include/osmium/index/multimap.hpp
include/osmium/index/multimap/all.hpp
@ -181,7 +179,6 @@ include/osmium/thread/function_wrapper.hpp
include/osmium/thread/pool.hpp
include/osmium/thread/queue.hpp
include/osmium/thread/util.hpp
include/osmium/util/cast.hpp
include/osmium/util/compatibility.hpp
include/osmium/util/config.hpp
include/osmium/util/delta.hpp