From b361950b5aaec61f9d1f48dcc2e36b7630e7437e Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 23 May 2024 03:15:41 +0200 Subject: [PATCH] [boost-container] Fix deps and emscripten (#38806) Fixes #38679. ([No longer uses Boost::static_assert.](https://www.boost.org/doc/libs/1_85_0/doc/html/container/release_notes.html#container.release_notes.release_notes_boost_1_85_00)) Fixes #38469. (Needs threads, so [emscripten needs to use `-pthread`](https://emscripten.org/docs/porting/pthreads.html#compiling-with-pthreads-enabled).) Change homepage link to something more useful. The update to the generator script and the other ports will be in a separate PR. --- ports/boost-container/no-static-assert.diff | 12 ++++++++++++ ports/boost-container/portfile.cmake | 3 +++ ports/boost-container/posix-threads.diff | 21 +++++++++++++++++++++ ports/boost-container/vcpkg.json | 3 ++- scripts/boost/generate-ports.ps1 | 1 + versions/b-/boost-container.json | 5 +++++ versions/baseline.json | 2 +- 7 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 ports/boost-container/no-static-assert.diff create mode 100644 ports/boost-container/posix-threads.diff diff --git a/ports/boost-container/no-static-assert.diff b/ports/boost-container/no-static-assert.diff new file mode 100644 index 0000000000..cb9c0be8d0 --- /dev/null +++ b/ports/boost-container/no-static-assert.diff @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 78acbe2..01e97c5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,7 +26,6 @@ target_link_libraries(boost_container + Boost::config + Boost::intrusive + Boost::move +- Boost::static_assert + ) + + target_compile_definitions(boost_container diff --git a/ports/boost-container/portfile.cmake b/ports/boost-container/portfile.cmake index 15a263b428..e3642dec70 100644 --- a/ports/boost-container/portfile.cmake +++ b/ports/boost-container/portfile.cmake @@ -6,6 +6,9 @@ vcpkg_from_github( REF boost-${VERSION} SHA512 7b287d5739abdbe08a8a0cb150e513c4feff43731ad923b115aa50d07200586c9b526eb144e7e3f1f191e6ba290032512b216d01cba5178173a3501f6cb37c39 HEAD_REF master + PATCHES + no-static-assert.diff + posix-threads.diff ) set(FEATURE_OPTIONS "") diff --git a/ports/boost-container/posix-threads.diff b/ports/boost-container/posix-threads.diff new file mode 100644 index 0000000000..ee82a2e1f6 --- /dev/null +++ b/ports/boost-container/posix-threads.diff @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 01e97c5..faf17d4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,6 +15,16 @@ add_library(boost_container + src/synchronized_pool_resource.cpp + src/unsynchronized_pool_resource.cpp + ) ++if(NOT WIN32) ++ set(THREADS_PREFER_PTHREAD_FLAG 1) ++ find_package(Threads REQUIRED) ++ target_link_libraries(boost_container PUBLIC Threads::Threads) ++ if(EMSCRIPTEN) ++ # Boost config needs `-pthread` to see `_POSIX_THREADS`, ++ # but FindTheads.cmake finishes with `CMAKE_HAVE_LIBC_PTHREAD`. ++ target_compile_options(boost_container PUBLIC -pthread) ++ endif() ++endif() + + add_library(Boost::container ALIAS boost_container) + diff --git a/ports/boost-container/vcpkg.json b/ports/boost-container/vcpkg.json index 264f40baf8..08d638f985 100644 --- a/ports/boost-container/vcpkg.json +++ b/ports/boost-container/vcpkg.json @@ -2,8 +2,9 @@ "$comment": "Automatically generated by scripts/boost/generate-ports.ps1", "name": "boost-container", "version": "1.85.0", + "port-version": 1, "description": "Boost container module", - "homepage": "https://github.com/boostorg/container", + "homepage": "https://www.boost.org/libs/container", "license": "BSL-1.0", "dependencies": [ { diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index ee503a25c9..ec53ed8ec1 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -28,6 +28,7 @@ $semverVersion = ($version -replace "(\d+(\.\d+){1,3}).*", "`$1") # Clear this array when moving to a new boost version $defaultPortVersion = 0 $portVersions = @{ + 'boost-container' = 1; } function Get-PortVersion { diff --git a/versions/b-/boost-container.json b/versions/b-/boost-container.json index 7282bf9ff7..ee8757b25f 100644 --- a/versions/b-/boost-container.json +++ b/versions/b-/boost-container.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b304461cda37cd06d1097cc5135c3eb178eb5036", + "version": "1.85.0", + "port-version": 1 + }, { "git-tree": "1261ff9673aab60f032284e51aa4400a1fa88a6a", "version": "1.85.0", diff --git a/versions/baseline.json b/versions/baseline.json index f1a409bcac..8a707dec34 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -810,7 +810,7 @@ }, "boost-container": { "baseline": "1.85.0", - "port-version": 0 + "port-version": 1 }, "boost-container-hash": { "baseline": "1.85.0",