diff --git a/ports/boost-config/portfile.cmake b/ports/boost-config/portfile.cmake index 2fdbf55046404a..c32b1dcb7e1e66 100644 --- a/ports/boost-config/portfile.cmake +++ b/ports/boost-config/portfile.cmake @@ -6,8 +6,7 @@ vcpkg_from_github( REF boost-1.77.0 SHA512 c6df16825b7bb27412667e00b6b6cdecbf56ee0707aa1df3505637c7de5c39c87335fabd7cd4361b29625d71c7664e6af865fc271ad0b3e70cc8872825f6155e HEAD_REF master - PATCHES - fix-emscripten-compilation.patch + PATCHES fix-emscripten-compilation.patch ) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) diff --git a/ports/boost-config/vcpkg.json b/ports/boost-config/vcpkg.json index fd0c8713af6a25..3b56236a548af7 100644 --- a/ports/boost-config/vcpkg.json +++ b/ports/boost-config/vcpkg.json @@ -1,7 +1,7 @@ { "name": "boost-config", "version": "1.77.0", - "port-version": 1, + "port-version": 2, "description": "Boost config module", "homepage": "https://github.com/boostorg/config", "dependencies": [ diff --git a/ports/boost-iostreams/b2-options.cmake b/ports/boost-iostreams/b2-options.cmake index 5a10a4ae1ea87a..1271c81305a7aa 100644 --- a/ports/boost-iostreams/b2-options.cmake +++ b/ports/boost-iostreams/b2-options.cmake @@ -1,30 +1,86 @@ -list(APPEND B2_OPTIONS - -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}/include" - -sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}/include" - -sLZMA_INCLUDE="${CURRENT_INSTALLED_DIR}/include" - -sZSTD_INCLUDE="${CURRENT_INSTALLED_DIR}/include" -) - if(CMAKE_BUILD_TYPE STREQUAL "Release") - set(lib_suffix lib) + set(lib_path_suffix lib) +else() + set(lib_path_suffix debug/lib) +endif() + +if("bzip2" IN_LIST FEATURES) + list(APPEND B2_OPTIONS + -sBZIP2_INCLUDE="${CURRENT_INSTALLED_DIR}/include" + ) + # Overwride debug library name + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + list(APPEND B2_OPTIONS + -sBZIP2_NAME=bz2d + ) + endif() + list(APPEND B2_OPTIONS + -sBZIP2_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}" + ) +else() + list(APPEND B2_OPTIONS + -sNO_BZIP2=1 + ) +endif() + +if("lzma" IN_LIST FEATURES) + list(APPEND B2_OPTIONS + -sLZMA_INCLUDE="${CURRENT_INSTALLED_DIR}/include" + ) + # Overwride debug library name + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + list(APPEND B2_OPTIONS + -sLZMA_NAME=lzmad + ) + endif() + list(APPEND B2_OPTIONS + -sLZMA_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}" + ) else() - set(lib_suffix debug/lib) - if(WIN32) - set(ZLIB_NAME zlibd) - else() - set(ZLIB_NAME z) + list(APPEND B2_OPTIONS + -sNO_LZMA=1 + ) +endif() + +if("zlib" IN_LIST FEATURES) + list(APPEND B2_OPTIONS + -sZLIB_INCLUDE="${CURRENT_INSTALLED_DIR}/include" + ) + # Overwride debug library name + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + if(WIN32) + set(ZLIB_NAME zlibd) + else() + set(ZLIB_NAME z) + endif() + list(APPEND B2_OPTIONS + -sZLIB_NAME=${ZLIB_NAME} + ) endif() list(APPEND B2_OPTIONS - -sZLIB_NAME=${ZLIB_NAME} - -sBZIP2_NAME=bz2d - -sLZMA_NAME=lzmad - -sZSTD_BINARY=zstdd + -sZLIB_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}" + ) +else() + list(APPEND B2_OPTIONS + -sNO_ZLIB=1 ) endif() -list(APPEND B2_OPTIONS - -sZLIB_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}" - -sBZIP2_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}" - -sLZMA_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}" - -sZSTD_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_suffix}" -) +if("zstd" IN_LIST FEATURES) + list(APPEND B2_OPTIONS + -sZSTD_INCLUDE="${CURRENT_INSTALLED_DIR}/include" + ) + # Overwride debug library name + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + list(APPEND B2_OPTIONS + -sZSTD_NAME=zstdd + ) + endif() + list(APPEND B2_OPTIONS + -sZSTD_LIBRARY_PATH="${CURRENT_INSTALLED_DIR}/${lib_path_suffix}" + ) +else() + list(APPEND B2_OPTIONS + -sNO_ZSTD=1 + ) +endif() \ No newline at end of file diff --git a/ports/boost-iostreams/vcpkg.json b/ports/boost-iostreams/vcpkg.json index 6077718372062f..4d694c8178d40d 100644 --- a/ports/boost-iostreams/vcpkg.json +++ b/ports/boost-iostreams/vcpkg.json @@ -1,6 +1,7 @@ { "name": "boost-iostreams", "version": "1.77.0", + "port-version": 1, "description": "Boost iostreams module", "homepage": "https://github.com/boostorg/iostreams", "supports": "!uwp", @@ -32,13 +33,41 @@ "boost-type-traits", "boost-utility", "boost-vcpkg-helpers", - "bzip2", - "liblzma", { "name": "vcpkg-cmake", "host": true - }, + } + ], + "default-features": [ + "bzip2", + "lzma", "zlib", "zstd" - ] + ], + "features": { + "bzip2": { + "description": "Support bzip2 filters", + "dependencies": [ + "bzip2" + ] + }, + "lzma": { + "description": "Support LZMA/xz filters", + "dependencies": [ + "liblzma" + ] + }, + "zlib": { + "description": "Support zlib filters", + "dependencies": [ + "zlib" + ] + }, + "zstd": { + "description": "Support zstd filters", + "dependencies": [ + "zstd" + ] + } + } } diff --git a/ports/boost-modular-build-helper/CMakeLists.txt b/ports/boost-modular-build-helper/CMakeLists.txt index 8b2f5910a56044..f4a0f90530dcdb 100644 --- a/ports/boost-modular-build-helper/CMakeLists.txt +++ b/ports/boost-modular-build-helper/CMakeLists.txt @@ -1,17 +1,14 @@ cmake_minimum_required(VERSION 3.9) project(boost CXX) -set(B2_OPTIONS) +# The following variables are used in user-config.jam file +set(USER_CONFIG_TOOLSET) +set(USER_CONFIG_TOOLSET_VERSION) +set(USER_CONFIG_TOOLSET_INVOCATION_COMMAND) +set(USER_CONFIG_TOOLSET_OPTIONS) +set(USER_CONFIG_EXTRA_LINES) -if(MSVC) - if(MSVC_VERSION LESS 1900) - math(EXPR BOOST_MSVC_VERSION "${MSVC_VERSION} / 10 - 60") - else() - math(EXPR BOOST_MSVC_VERSION "${MSVC_VERSION} / 10 - 50") - endif() -else() - set(VCPKG_PLATFORM_TOOLSET external) -endif() +set(B2_OPTIONS) #### Handle ICU if(WIN32) @@ -24,10 +21,8 @@ endif() # Add build type specific options if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") list(APPEND B2_OPTIONS runtime-link=shared) - set(LIB_RUNTIME_LINK "shared") else() list(APPEND B2_OPTIONS runtime-link=static) - set(LIB_RUNTIME_LINK "static") endif() if(BUILD_SHARED_LIBS) @@ -56,31 +51,28 @@ if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" AND WIN32) list(APPEND B2_OPTIONS "asmflags=/safeseh") endif() -file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/nothing.bat" NOTHING_BAT) - if(MSVC) - set(B2_TOOLSET msvc) + set(USER_CONFIG_TOOLSET msvc) + if(MSVC_VERSION LESS 1900) + math(EXPR USER_CONFIG_TOOLSET_VERSION "${MSVC_VERSION} / 10 - 60") + else() + math(EXPR USER_CONFIG_TOOLSET_VERSION "${MSVC_VERSION} / 10 - 50") + endif() list(APPEND B2_OPTIONS target-os=windows) elseif(APPLE) - set(B2_TOOLSET clang) + set(USER_CONFIG_TOOLSET clang) list(APPEND B2_OPTIONS target-os=darwin) elseif(WIN32) - set(B2_TOOLSET gcc) + set(USER_CONFIG_TOOLSET gcc) list(APPEND B2_OPTIONS target-os=windows) elseif(ANDROID) - set(B2_TOOLSET gcc) + set(USER_CONFIG_TOOLSET gcc) list(APPEND B2_OPTIONS target-os=android) else() - set(B2_TOOLSET gcc) + set(USER_CONFIG_TOOLSET gcc) list(APPEND B2_OPTIONS target-os=linux) endif() -if(WIN32) - list(APPEND B2_OPTIONS threadapi=win32) -else() - list(APPEND B2_OPTIONS threadapi=pthread) -endif() - # Properly handle compiler and linker flags passed by VCPKG if(CMAKE_BUILD_TYPE STREQUAL "Release") set(CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}") @@ -122,9 +114,12 @@ if(APPLE) endforeach() endif() +string(REGEX REPLACE "[ \t\r\n]+" " " CXXFLAGS "${CXXFLAGS}") string(STRIP "${CXXFLAGS}" CXXFLAGS) -string(STRIP "${CFLAGS}" CFLAGS) -string(STRIP "${LDFLAGS}" LDFLAGS) +string(REGEX REPLACE "[ \t\r\n]+" " " CFLAGS "${CFLAGS}") +string(STRIP "${CFLAGS}" CFLAGS) +string(REGEX REPLACE "[ \t\r\n]+" " " LDFLAGS "${LDFLAGS}") +string(STRIP "${LDFLAGS}" LDFLAGS) if(NOT CXXFLAGS STREQUAL "") string(REPLACE " " " " CXXFLAGS "${CXXFLAGS}") @@ -187,6 +182,39 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") list(APPEND B2_OPTIONS linkflags=WindowsApp.lib) endif() +set(USER_CONFIG_TOOLSET_INVOCATION_COMMAND "\"${CMAKE_CXX_COMPILER}\"") + +if(USER_CONFIG_TOOLSET STREQUAL "msvc") + file(TO_CMAKE_PATH "${CMAKE_CURRENT_LIST_DIR}/nothing.bat" NOTHING_BAT) + string(APPEND USER_CONFIG_TOOLSET_OPTIONS + " \"${NOTHING_BAT}\"\n" + " ${CXXFLAGS}\n" + " ${CFLAGS}\n" + " ${LDFLAGS}\n" + ) +else() + string(APPEND USER_CONFIG_TOOLSET_OPTIONS + " \"${CMAKE_RANLIB}\"\n" + " \"${CMAKE_AR}\"\n" + " ${CXXFLAGS}\n" + " ${CFLAGS}\n" + " ${LDFLAGS}\n" + ) +endif() + +if(WIN32 AND NOT USER_CONFIG_TOOLSET STREQUAL "msvc") + # MINGW here causes b2 to not run cygpath + string(APPEND USER_CONFIG_TOOLSET_OPTIONS + " mingw\n" + ) +endif() + +if(WIN32) + list(APPEND B2_OPTIONS threadapi=win32) +else() + list(APPEND B2_OPTIONS threadapi=pthread) +endif() + if(CMAKE_BUILD_TYPE STREQUAL "Release") list(APPEND B2_OPTIONS variant=release) else() @@ -197,23 +225,23 @@ if(NOT WIN32) list(APPEND B2_OPTIONS "--layout=system") endif() +include(ProcessorCount) +ProcessorCount(NUMBER_OF_PROCESSORS) +if(NOT NUMBER_OF_PROCESSORS) + set(NUMBER_OF_PROCESSORS 1) +endif() + # Include port specific CMake fragment if(DEFINED BOOST_CMAKE_FRAGMENT) message(STATUS "Including ${BOOST_CMAKE_FRAGMENT}") include(${BOOST_CMAKE_FRAGMENT}) endif() -configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam ${CMAKE_CURRENT_BINARY_DIR}/user-config.jam @ONLY) - -include(ProcessorCount) -ProcessorCount(NUMBER_OF_PROCESSORS) -if(NOT NUMBER_OF_PROCESSORS) - set(NUMBER_OF_PROCESSORS 1) -endif() +configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam.in ${CMAKE_CURRENT_BINARY_DIR}/user-config.jam @ONLY) add_custom_target(boost ALL COMMAND "${B2_EXE}" - toolset=${B2_TOOLSET} + toolset=${USER_CONFIG_TOOLSET} --user-config=${CMAKE_CURRENT_BINARY_DIR}/user-config.jam --stagedir=${CMAKE_CURRENT_BINARY_DIR}/stage --build-dir=${CMAKE_CURRENT_BINARY_DIR} @@ -235,6 +263,7 @@ add_custom_target(boost ALL --hash -q debug-symbols=on + # Enable debugging level 2. -d +2 threading=multi diff --git a/ports/boost-modular-build-helper/Jamroot.jam b/ports/boost-modular-build-helper/Jamroot.jam.in similarity index 96% rename from ports/boost-modular-build-helper/Jamroot.jam rename to ports/boost-modular-build-helper/Jamroot.jam.in index 2a70c7ebdda985..6094cc8d1ccf89 100644 --- a/ports/boost-modular-build-helper/Jamroot.jam +++ b/ports/boost-modular-build-helper/Jamroot.jam.in @@ -1,5 +1,5 @@ -constant BOOST_VERSION : 1.77.0 ; -constant BOOST_VERSION_ABI_TAG : 1_77 ; +constant BOOST_VERSION : @BOOST_VERSION@ ; +constant BOOST_VERSION_ABI_TAG : @BOOST_VERSION_ABI_TAG@ ; constant BOOST_JAMROOT_MODULE : $(__name__) ; import boostcpp ; diff --git a/ports/boost-modular-build-helper/boost-modular-build.cmake b/ports/boost-modular-build-helper/boost-modular-build.cmake index e4a4fd9f35c2b6..4e7dfb4563c97e 100644 --- a/ports/boost-modular-build-helper/boost-modular-build.cmake +++ b/ports/boost-modular-build-helper/boost-modular-build.cmake @@ -1,6 +1,14 @@ get_filename_component(BOOST_BUILD_INSTALLED_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) get_filename_component(BOOST_BUILD_INSTALLED_DIR "${BOOST_BUILD_INSTALLED_DIR}" DIRECTORY) +set(BOOST_VERSION 1.77.0) +string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)" BOOST_VERSION_MATCH "${BOOST_VERSION}") +if("${CMAKE_MATCH_3}" GREATER 0) + set(BOOST_VERSION_ABI_TAG "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}_${CMAKE_MATCH_3}") +else() + set(BOOST_VERSION_ABI_TAG "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") +endif() + function(boost_modular_build) cmake_parse_arguments(_bm "" "SOURCE_PATH;BOOST_CMAKE_FRAGMENT" "" ${ARGN}) @@ -8,9 +16,10 @@ function(boost_modular_build) message(FATAL_ERROR "SOURCE_PATH is a required argument to boost_modular_build.") endif() - # Next CMake variables may be overridden in the file specified in ${_bm_BOOST_CMAKE_FRAGMENT} - set(B2_REQUIREMENTS) # this variable is used in the Jamroot.jam + # The following variables are used in the Jamroot.jam + set(B2_REQUIREMENTS) + # Some CMake variables may be overridden in the file specified in ${_bm_BOOST_CMAKE_FRAGMENT} if(DEFINED _bm_BOOST_CMAKE_FRAGMENT) message(STATUS "Including ${_bm_BOOST_CMAKE_FRAGMENT}") include(${_bm_BOOST_CMAKE_FRAGMENT}) @@ -28,13 +37,13 @@ function(boost_modular_build) if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set(BOOST_LIB_PREFIX) - if(VCPKG_PLATFORM_TOOLSET MATCHES "v14.") - set(BOOST_LIB_RELEASE_SUFFIX -vc140-mt.lib) - set(BOOST_LIB_DEBUG_SUFFIX -vc140-mt-gd.lib) - elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v120") - set(BOOST_LIB_RELEASE_SUFFIX -vc120-mt.lib) - set(BOOST_LIB_DEBUG_SUFFIX -vc120-mt-gd.lib) - endif() + if(VCPKG_PLATFORM_TOOLSET MATCHES "v14.") + set(BOOST_LIB_RELEASE_SUFFIX -vc140-mt.lib) + set(BOOST_LIB_DEBUG_SUFFIX -vc140-mt-gd.lib) + elseif(VCPKG_PLATFORM_TOOLSET MATCHES "v120") + set(BOOST_LIB_RELEASE_SUFFIX -vc120-mt.lib) + set(BOOST_LIB_DEBUG_SUFFIX -vc120-mt-gd.lib) + endif() else() set(BOOST_LIB_PREFIX lib) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") @@ -70,7 +79,7 @@ function(boost_modular_build) file(WRITE "${_jamfile}" "${_contents}") endif() - configure_file(${BOOST_BUILD_INSTALLED_DIR}/share/boost-build/Jamroot.jam ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) + configure_file(${BOOST_BUILD_INSTALLED_DIR}/share/boost-build/Jamroot.jam.in ${_bm_SOURCE_PATH}/Jamroot.jam @ONLY) set(configure_options) if(_bm_BOOST_CMAKE_FRAGMENT) @@ -112,7 +121,7 @@ function(boost_modular_build) string(REPLACE "-x64-" "-" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake 3.10 and earlier to locate the binaries string(REPLACE "-a32-" "-" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake 3.10 and earlier to locate the binaries string(REPLACE "-a64-" "-" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake 3.10 and earlier to locate the binaries - string(REPLACE "-1_77" "" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake > 3.10 to locate the binaries + string(REPLACE "-${BOOST_VERSION_ABI_TAG}" "" NEW_FILENAME ${NEW_FILENAME}) # To enable CMake > 3.10 to locate the binaries if("${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}" STREQUAL "${DIRECTORY_OF_LIB_FILE}/${OLD_FILENAME}") # nothing to do elseif(EXISTS ${DIRECTORY_OF_LIB_FILE}/${NEW_FILENAME}) diff --git a/ports/boost-modular-build-helper/portfile.cmake b/ports/boost-modular-build-helper/portfile.cmake index 8224bb9575579a..3caa70b6c2a05c 100644 --- a/ports/boost-modular-build-helper/portfile.cmake +++ b/ports/boost-modular-build-helper/portfile.cmake @@ -3,11 +3,11 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) file( COPY ${CMAKE_CURRENT_LIST_DIR}/boost-modular-build.cmake - ${CMAKE_CURRENT_LIST_DIR}/Jamroot.jam - ${CMAKE_CURRENT_LIST_DIR}/nothing.bat - ${CMAKE_CURRENT_LIST_DIR}/user-config.jam ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_LIST_DIR}/Jamroot.jam.in + ${CMAKE_CURRENT_LIST_DIR}/nothing.bat ${CMAKE_CURRENT_LIST_DIR}/usage + ${CMAKE_CURRENT_LIST_DIR}/user-config.jam.in DESTINATION ${CURRENT_PACKAGES_DIR}/share/boost-build ) \ No newline at end of file diff --git a/ports/boost-modular-build-helper/user-config.jam b/ports/boost-modular-build-helper/user-config.jam.in similarity index 69% rename from ports/boost-modular-build-helper/user-config.jam rename to ports/boost-modular-build-helper/user-config.jam.in index aabe51b01036d4..fbd6f8d36e5e0b 100644 --- a/ports/boost-modular-build-helper/user-config.jam +++ b/ports/boost-modular-build-helper/user-config.jam.in @@ -1,36 +1,11 @@ import toolset ; -if "@VCPKG_PLATFORM_TOOLSET@" != "external" -{ - using msvc : @BOOST_MSVC_VERSION@ : cl.exe - : - "@NOTHING_BAT@" - @CXXFLAGS@ - @CFLAGS@ - @LDFLAGS@ - ; -} -else -{ - using @B2_TOOLSET@ : : @CMAKE_CXX_COMPILER@ - : - @CMAKE_RANLIB@ - @CMAKE_AR@ - @CXXFLAGS@ - @CFLAGS@ - @LDFLAGS@ - # MINGW here causes b2 to not run cygpath - mingw - ; -} +using @USER_CONFIG_TOOLSET@ : @USER_CONFIG_TOOLSET_VERSION@ : @USER_CONFIG_TOOLSET_INVOCATION_COMMAND@ + : +@USER_CONFIG_TOOLSET_OPTIONS@ + ; -if "@PORT@" = "boost-python" -{ - using python : @VCPKG_PYTHON3_VERSION@ : : "@VCPKG_PYTHON3_INCLUDE@" : "@VCPKG_PYTHON3_LIBS_RELEASE@" ; - using python : @VCPKG_PYTHON3_VERSION@ : : "@VCPKG_PYTHON3_INCLUDE@" : "@VCPKG_PYTHON3_LIBS_DEBUG@" : on ; - using python : @VCPKG_PYTHON2_VERSION@ : : "@VCPKG_PYTHON2_INCLUDE@" : "@VCPKG_PYTHON2_LIBS_RELEASE@" ; - using python : @VCPKG_PYTHON2_VERSION@ : : "@VCPKG_PYTHON2_INCLUDE@" : "@VCPKG_PYTHON2_LIBS_DEBUG@" : on ; -} +@USER_CONFIG_EXTRA_LINES@ if "@PORT@" = "boost-mpi" || "@PORT@" = "boost-graph-parallel" { @@ -42,7 +17,7 @@ if "@PORT@" = "boost-mpi" || "@PORT@" = "boost-graph-parallel" project user-config : ; -if "@VCPKG_PLATFORM_TOOLSET@" != "external" +if "@USER_CONFIG_TOOLSET@" = "msvc" { lib advapi32 ; diff --git a/ports/boost-modular-build-helper/vcpkg.json b/ports/boost-modular-build-helper/vcpkg.json index 63251aa3c46d47..e81e9a0fce0b15 100644 --- a/ports/boost-modular-build-helper/vcpkg.json +++ b/ports/boost-modular-build-helper/vcpkg.json @@ -1,6 +1,7 @@ { "name": "boost-modular-build-helper", "version": "1.77.0", + "port-version": 1, "description": "Internal vcpkg port used to build Boost libraries", "dependencies": [ "boost-uninstall" diff --git a/ports/boost-odeint/vcpkg.json b/ports/boost-odeint/vcpkg.json index 618b34f68ba550..ffab599347768e 100644 --- a/ports/boost-odeint/vcpkg.json +++ b/ports/boost-odeint/vcpkg.json @@ -1,6 +1,7 @@ { "name": "boost-odeint", "version": "1.77.0", + "port-version": 1, "description": "Boost odeint module", "homepage": "https://github.com/boostorg/odeint", "dependencies": [ @@ -14,10 +15,6 @@ "boost-fusion", "boost-iterator", "boost-math", - { - "name": "boost-mpi", - "platform": "!uwp" - }, "boost-mpl", "boost-multi-array", "boost-preprocessor", @@ -29,5 +26,13 @@ "boost-units", "boost-utility", "boost-vcpkg-helpers" - ] + ], + "features": { + "mpi": { + "description": "Support parallelization with MPI", + "dependencies": [ + "boost-mpi" + ] + } + } } diff --git a/ports/boost-process/portfile.cmake b/ports/boost-process/portfile.cmake index 262e9f07d02687..efb0a5f91f6e1d 100644 --- a/ports/boost-process/portfile.cmake +++ b/ports/boost-process/portfile.cmake @@ -6,8 +6,7 @@ vcpkg_from_github( REF boost-1.77.0 SHA512 00eb27f702f092a20fdf1669b8c9c993b751971592d0bc5aa50b02d99d985a75361621b624aa51eb550c9e7905e15877168ae9d0feb1957fc85f99c264b152fd HEAD_REF master - PATCHES - fix_include.patch + PATCHES fix_include.patch ) include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake) diff --git a/ports/boost-process/vcpkg.json b/ports/boost-process/vcpkg.json index 904e902383c8b4..84dd98d52064f7 100644 --- a/ports/boost-process/vcpkg.json +++ b/ports/boost-process/vcpkg.json @@ -1,7 +1,7 @@ { "name": "boost-process", "version": "1.77.0", - "port-version": 1, + "port-version": 2, "description": "Boost process module", "homepage": "https://github.com/boostorg/process", "supports": "!emscripten", diff --git a/ports/boost-python/b2-options.cmake b/ports/boost-python/b2-options.cmake index 3713424ed64706..f9f2e0f6ae7f8c 100644 --- a/ports/boost-python/b2-options.cmake +++ b/ports/boost-python/b2-options.cmake @@ -1,28 +1,38 @@ -set(BUILD_PYTHON_VERSIONS) +set(build_python_versions) if("python2" IN_LIST FEATURES) # Find Python2 libraries. Can't use find_package here, but we already know where everything is - file(GLOB VCPKG_PYTHON2_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python2.*") - set(VCPKG_PYTHON2_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib") - set(VCPKG_PYTHON2_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib") - string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON2_VERSION "${VCPKG_PYTHON2_INCLUDE}") - list(APPEND BUILD_PYTHON_VERSIONS "${VCPKG_PYTHON2_VERSION}") + file(GLOB python2_include_dir "${CURRENT_INSTALLED_DIR}/include/python2.*") + string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" python2_version "${python2_include_dir}") + + string(APPEND USER_CONFIG_EXTRA_LINES + "using python : ${python2_version} : : \"${python2_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/lib\" ;\n" + "using python : ${python2_version} : : \"${python2_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/debug/lib\" : on ;\n") + list(APPEND build_python_versions "${python2_version}") endif() -# Find Python3 libraries. Can't use find_package here, but we already know where everything is -file(GLOB VCPKG_PYTHON3_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python3.*") -set(VCPKG_PYTHON3_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib") -set(VCPKG_PYTHON3_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib") -string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON3_VERSION "${VCPKG_PYTHON3_INCLUDE}") -list(APPEND BUILD_PYTHON_VERSIONS "${VCPKG_PYTHON3_VERSION}") +if("python3" IN_LIST FEATURES) + # Find Python3 libraries. Can't use find_package here, but we already know where everything is + file(GLOB python3_include_dir "${CURRENT_INSTALLED_DIR}/include/python3.*") + string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" python3_version "${python3_include_dir}") -string(REPLACE ";" "," BUILD_PYTHON_VERSIONS "${BUILD_PYTHON_VERSIONS}") + string(APPEND USER_CONFIG_EXTRA_LINES + "using python : ${python3_version} : : \"${python3_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/lib\" ;\n" + "using python : ${python3_version} : : \"${python3_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/debug/lib\" : on ;\n") + list(APPEND build_python_versions "${python3_version}") +endif() +if(NOT build_python_versions) + message(FATAL_ERROR "Boost.Python requires at least one Python specified as a feature.") +endif() + +string(REPLACE ";" "," build_python_versions "${build_python_versions}") list(APPEND B2_OPTIONS - python=${BUILD_PYTHON_VERSIONS} + python=${build_python_versions} ) -if(VCPKG_CXX_FLAGS_DEBUG MATCHES "BOOST_DEBUG_PYTHON") - list(APPEND B2_OPTIONS_DBG + +if(CMAKE_CXX_FLAGS_DEBUG MATCHES "BOOST_DEBUG_PYTHON" AND CMAKE_BUILD_TYPE STREQUAL "Debug") + list(APPEND B2_OPTIONS python-debugging=on ) endif() diff --git a/ports/boost-python/vcpkg.json b/ports/boost-python/vcpkg.json index 0ba6de705c49f2..51d50389b48ffb 100644 --- a/ports/boost-python/vcpkg.json +++ b/ports/boost-python/vcpkg.json @@ -1,6 +1,7 @@ { "name": "boost-python", "version": "1.77.0", + "port-version": 1, "description": "Boost python module", "homepage": "https://github.com/boostorg/python", "supports": "!uwp & !(arm & windows) & !emscripten", @@ -35,18 +36,26 @@ "boost-type-traits", "boost-utility", "boost-vcpkg-helpers", - "python3", { "name": "vcpkg-cmake", "host": true } ], + "default-features": [ + "python3" + ], "features": { "python2": { "description": "Build with Python2 support", "dependencies": [ "python2" ] + }, + "python3": { + "description": "Build with Python3 support", + "dependencies": [ + "python3" + ] } } } diff --git a/ports/boost/vcpkg.json b/ports/boost/vcpkg.json index cf925fe92c1ca8..679f1b7528ba16 100644 --- a/ports/boost/vcpkg.json +++ b/ports/boost/vcpkg.json @@ -1,6 +1,7 @@ { "name": "boost", "version": "1.77.0", + "port-version": 1, "description": "Peer-reviewed portable C++ source libraries", "homepage": "https://boost.org", "dependencies": [ @@ -73,10 +74,6 @@ "boost-geometry", "boost-gil", "boost-graph", - { - "name": "boost-graph-parallel", - "platform": "!uwp" - }, "boost-hana", "boost-heap", "boost-histogram", @@ -112,10 +109,6 @@ "boost-metaparse", "boost-move", "boost-mp11", - { - "name": "boost-mpi", - "platform": "!uwp" - }, "boost-mpl", "boost-msm", "boost-multi-array", diff --git a/scripts/boost/generate-ports.ps1 b/scripts/boost/generate-ports.ps1 index e7d258d509ac13..902d8644951e55 100644 --- a/scripts/boost/generate-ports.ps1 +++ b/scripts/boost/generate-ports.ps1 @@ -23,10 +23,25 @@ else { # Clear this array when moving to a new boost version $portVersions = @{ - #e.g. "boost-asio" = 1; + #e.g. "boost-asio" = 1; + "boost" = 1; + "boost-config" = 2; + "boost-iostreams" = 1; + "boost-modular-build-helper" = 1; + "boost-odeint" = 1; + "boost-python" = 1; + "boost-process" = 2; } $portData = @{ + "boost" = @{ + "features" = @{ + "mpi" = @{ + "description" = "Build with MPI support"; + "dependencies" = @("boost-mpi", "boost-graph-parallel"); + } + } + }; "boost-asio" = @{ "dependencies" = @("openssl"); "supports" = "!emscripten" @@ -35,8 +50,26 @@ $portData = @{ "boost-fiber" = @{ "supports" = "!osx&!uwp&!arm&!emscripten" }; "boost-filesystem" = @{ "supports" = "!uwp" }; "boost-iostreams" = @{ - "dependencies" = @("zlib", "bzip2", "liblzma", "zstd"); - "supports" = "!uwp"; + "default-features" = @("bzip2", "lzma", "zlib", "zstd"); + "supports" = "!uwp"; + "features" = @{ + "bzip2" = @{ + "dependencies" = @("bzip2"); + "description" = "Support bzip2 filters" + }; + "lzma" = @{ + "dependencies" = @("liblzma"); + "description" = "Support LZMA/xz filters" + }; + "zlib" = @{ + "dependencies" = @("zlib"); + "description" = "Support zlib filters" + }; + "zstd" = @{ + "dependencies" = @("zstd"); + "description" = "Support zstd filters" + }; + }; }; "boost-context" = @{ "supports" = "!uwp&!emscripten" }; "boost-stacktrace" = @{ "supports" = "!uwp" }; @@ -46,12 +79,12 @@ $portData = @{ "boost-wave" = @{ "supports" = "!uwp" }; "boost-log" = @{ "supports" = "!uwp&!emscripten" }; "boost-locale" = @{ - "dependencies" = @(@{ name = "libiconv"; platform = "!uwp&!windows&!mingw" }); + "dependencies" = @(@{ "name" = "libiconv"; "platform" = "!uwp&!windows&!mingw" }); "supports" = "!uwp"; "features" = @{ - icu = @{ - dependencies = @("icu") - description = "ICU backend for Boost.Locale" + "icu" = @{ + "dependencies" = @("icu"); + "description" = "ICU backend for Boost.Locale" } } }; @@ -63,23 +96,35 @@ $portData = @{ "dependencies" = @("mpi"); "supports" = "!uwp"; }; + "boost-odeint" = @{ + "features" = @{ + "mpi" = @{ + "dependencies" = @("boost-mpi"); + "description" = "Support parallelization with MPI" + } + } + }; "boost-parameter-python" = @{ "supports" = "!emscripten" }; "boost-process" = @{ "supports" = "!emscripten" }; "boost-python" = @{ - "dependencies" = @("python3"); - "supports" = "!uwp&!(arm&windows)&!emscripten"; - "features" = @{ - python2 = @{ - dependencies = @("python2") - description = "Build with Python2 support" + "default-features" = @("python3"); + "supports" = "!uwp&!(arm&windows)&!emscripten"; + "features" = @{ + "python2" = @{ + "dependencies" = @("python2"); + "description" = "Build with Python2 support" + }; + "python3" = @{ + "dependencies" = @("python3"); + "description" = "Build with Python3 support" } } }; "boost-regex" = @{ "features" = @{ - icu = @{ - dependencies = @("icu") - description = "ICU backend for Boost.Regex" + "icu" = @{ + "dependencies" = @("icu"); + "description" = "ICU backend for Boost.Regex" } } } @@ -104,36 +149,47 @@ function GeneratePortDependency() { $portName } } + function GeneratePortManifest() { param ( - [string]$Library, [string]$PortName, [string]$Homepage, [string]$Description, - $Dependencies = @(), - $Features = @() + $Dependencies = @() ) - if ([string]::IsNullOrEmpty($PortName)) { - $PortName = GeneratePortName $Library - } $manifest = @{ - name = $PortName - "version" = $version - homepage = $Homepage - description = $Description - } - if ($portVersions.Contains($PortName)) { - $manifest["port-version"] = $portVersions[$PortName] + "name" = $PortName + "version" = $version + "homepage" = $Homepage + "description" = $Description } if ($portData.Contains($PortName)) { $manifest += $portData[$PortName] } + if ($portVersions.Contains($PortName)) { + $manifest["port-version"] = $portVersions[$PortName] + } if ($Dependencies.Count -gt 0) { $manifest["dependencies"] += $Dependencies } - if ($Features.Count -gt 0) { - $manifest["features"] += $Features + # Remove from the dependencies the ports that are included in the feature dependencies + if ($manifest.Contains('features') -and $manifest.Contains('dependencies')) { + foreach ($feature in $manifest.features.Keys) { + $feature_dependencies = $manifest.features.$feature["dependencies"] + foreach ($dependency in $feature_dependencies) { + if ($dependency.Contains("name")) { + $dep_name = $dependency.name + } + else { + $dep_name = $dependency + } + $manifest["dependencies"] = $manifest["dependencies"] ` + | Where-Object { $_ -notmatch "$dep_name" } ` + | Where-Object { $_.name -notmatch "$dep_name" } + } + } } + $manifest | ConvertTo-Json -Depth 10 -Compress ` | Out-File -Encoding UTF8 "$portsDir/$PortName/vcpkg.json" & $vcpkg format-manifest "$portsDir/$PortName/vcpkg.json" @@ -153,8 +209,7 @@ function GeneratePort() { # Generate vcpkg.json GeneratePortManifest ` - -Library $Library ` - -PortName $PortName ` + -PortName $portName ` -Homepage "https://github.com/boostorg/$Library" ` -Description "Boost $Library module" ` -Dependencies $Dependencies @@ -197,7 +252,7 @@ function GeneratePort() { ) if (Test-Path "$scriptsDir/post-source-stubs/$Library.cmake") { - $portfileLines += @(get-content "$scriptsDir/post-source-stubs/$Library.cmake") + $portfileLines += @(Get-Content "$scriptsDir/post-source-stubs/$Library.cmake") } if ($NeedsBuild) { @@ -242,7 +297,7 @@ function GeneratePort() { ) if (Test-Path "$scriptsDir/post-build-stubs/$Library.cmake") { - $portfileLines += @(get-content "$scriptsDir/post-build-stubs/$Library.cmake") + $portfileLines += @(Get-Content "$scriptsDir/post-build-stubs/$Library.cmake") } $portfileLines += @("") @@ -310,7 +365,7 @@ foreach ($library in $libraries) { if ($hash -is [Object[]]) { $hash = $hash[1] } - + $unpacked = "$scriptsDir/libs/$library-boost-$version" if (!(Test-Path $unpacked)) { "Unpacking boost/$library..." @@ -481,27 +536,17 @@ foreach ($library in $libraries) { if ($updateServicePorts) { # Generate manifest file for master boost port which depends on each individual library - # mpi and graph-parallel are excluded due to they having a dependency on msmpi/openmpi - $boostPortDependencies = $boostPortDependencies | Where-Object { $_ -notmatch "boost-mpi|boost-graph-parallel" } - $boostPortFeatures = @( - @{ - name = "mpi" - description = "Build with MPI support" - dependencies = @("boost-mpi", "boost-graph-parallel") - } - ) GeneratePortManifest ` -PortName "boost" ` -Homepage "https://boost.org" ` -Description "Peer-reviewed portable C++ source libraries" ` - -Dependencies $boostPortDependencies ` - -Features $boostPortFeatures + -Dependencies $boostPortDependencies Set-Content -LiteralPath "$portsDir/boost/portfile.cmake" ` -Value "set(VCPKG_POLICY_EMPTY_PACKAGE enabled)`n" ` -Encoding UTF8 ` -NoNewline - + # Generate manifest files for boost-uninstall GeneratePortManifest ` -PortName "boost-uninstall" ` @@ -519,4 +564,7 @@ if ($updateServicePorts) { -Description "Internal vcpkg port used to build Boost libraries" ` -Dependencies @("boost-uninstall") + # Update Boost version in boost-modular-build.cmake + $boost_modular_build = "$portsDir/boost-modular-build-helper/boost-modular-build.cmake" + (Get-Content -LiteralPath "$boost_modular_build") -replace "set\(BOOST_VERSION ([0-9\.]+)\)", "set(BOOST_VERSION $version)" | Set-Content -LiteralPath "$boost_modular_build" } diff --git a/versions/b-/boost-config.json b/versions/b-/boost-config.json index 920bf11882a50f..9b10718d98adf8 100644 --- a/versions/b-/boost-config.json +++ b/versions/b-/boost-config.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0f7b70c02bfb43bbdc8f62bd49c8a5339a65f48c", + "version": "1.77.0", + "port-version": 2 + }, { "git-tree": "6aa6932068c1fbc812d545502f60c3a7cef80dde", "version": "1.77.0", diff --git a/versions/b-/boost-iostreams.json b/versions/b-/boost-iostreams.json index 9a6380b1ddee38..490d00e1bc1cc8 100644 --- a/versions/b-/boost-iostreams.json +++ b/versions/b-/boost-iostreams.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "286c74896c6f2a6057bfbce333304f279bb38aac", + "version": "1.77.0", + "port-version": 1 + }, { "git-tree": "9ff4027cebb3423a41814a8c2da942ea959b17ad", "version": "1.77.0", diff --git a/versions/b-/boost-modular-build-helper.json b/versions/b-/boost-modular-build-helper.json index 6d8bd59a618190..867e62be31815b 100644 --- a/versions/b-/boost-modular-build-helper.json +++ b/versions/b-/boost-modular-build-helper.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c076291c3d44f7cea167e469748ead6270e1c424", + "version": "1.77.0", + "port-version": 1 + }, { "git-tree": "b14ac826c44c030a65af10732269f379b856f76f", "version": "1.77.0", diff --git a/versions/b-/boost-odeint.json b/versions/b-/boost-odeint.json index 17884143b5d86e..f4aa9284bc088f 100644 --- a/versions/b-/boost-odeint.json +++ b/versions/b-/boost-odeint.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "effd1406c513ca8f20a1e2b6de0cd299be92d74e", + "version": "1.77.0", + "port-version": 1 + }, { "git-tree": "9ef1ae6d236984a5cdb1cb5dbc76067648461231", "version": "1.77.0", diff --git a/versions/b-/boost-process.json b/versions/b-/boost-process.json index d30c66c9ebcbca..342aecc27a7cc8 100644 --- a/versions/b-/boost-process.json +++ b/versions/b-/boost-process.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0e476269a7091861c1db7379d4e925df6d184044", + "version": "1.77.0", + "port-version": 2 + }, { "git-tree": "e70acbb855538f95200b341b1cf26d9c1dc6e6cd", "version": "1.77.0", diff --git a/versions/b-/boost-python.json b/versions/b-/boost-python.json index d58ad4b7d66b0f..da1303cc4fd1fe 100644 --- a/versions/b-/boost-python.json +++ b/versions/b-/boost-python.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "879991d36cfdcdb57b176b9dac08b55c3c69a9a1", + "version": "1.77.0", + "port-version": 1 + }, { "git-tree": "9f6fba6abc29e2084469c11ba2f2f1f745b08137", "version": "1.77.0", diff --git a/versions/b-/boost.json b/versions/b-/boost.json index 50252e7391bec0..4fef045312ef73 100644 --- a/versions/b-/boost.json +++ b/versions/b-/boost.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5fe225d8d76e70968014f7ddab050d7e520709e6", + "version": "1.77.0", + "port-version": 1 + }, { "git-tree": "c2e18442532ea17f03c775323f53a3b03ade0b6d", "version": "1.77.0", diff --git a/versions/baseline.json b/versions/baseline.json index 074755bb4afb30..4634582c98ab1f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -502,7 +502,7 @@ }, "boost": { "baseline": "1.77.0", - "port-version": 0 + "port-version": 1 }, "boost-accumulators": { "baseline": "1.77.0", @@ -582,7 +582,7 @@ }, "boost-config": { "baseline": "1.77.0", - "port-version": 1 + "port-version": 2 }, "boost-container": { "baseline": "1.77.0", @@ -750,7 +750,7 @@ }, "boost-iostreams": { "baseline": "1.77.0", - "port-version": 0 + "port-version": 1 }, "boost-iterator": { "baseline": "1.77.0", @@ -806,7 +806,7 @@ }, "boost-modular-build-helper": { "baseline": "1.77.0", - "port-version": 0 + "port-version": 1 }, "boost-move": { "baseline": "1.77.0", @@ -850,7 +850,7 @@ }, "boost-odeint": { "baseline": "1.77.0", - "port-version": 0 + "port-version": 1 }, "boost-optional": { "baseline": "1.77.0", @@ -898,7 +898,7 @@ }, "boost-process": { "baseline": "1.77.0", - "port-version": 1 + "port-version": 2 }, "boost-program-options": { "baseline": "1.77.0", @@ -926,7 +926,7 @@ }, "boost-python": { "baseline": "1.77.0", - "port-version": 0 + "port-version": 1 }, "boost-qvm": { "baseline": "1.77.0",