aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/boost-math
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/boost-math
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/boost-math')
-rw-r--r--vcpkg/ports/boost-math/build-old-libs.patch111
-rw-r--r--vcpkg/ports/boost-math/features.cmake10
-rw-r--r--vcpkg/ports/boost-math/opt-random.diff13
-rw-r--r--vcpkg/ports/boost-math/portfile.cmake19
-rw-r--r--vcpkg/ports/boost-math/vcpkg.json64
5 files changed, 217 insertions, 0 deletions
diff --git a/vcpkg/ports/boost-math/build-old-libs.patch b/vcpkg/ports/boost-math/build-old-libs.patch
new file mode 100644
index 0000000..9fb7881
--- /dev/null
+++ b/vcpkg/ports/boost-math/build-old-libs.patch
@@ -0,0 +1,111 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4e6c492..a910097 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -59,3 +59,106 @@ elseif(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ install(DIRECTORY "include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+
+ endif()
++
++option(BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS "" OFF)
++if(BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS)
++include(CheckCXXSourceCompiles)
++set(CMAKE_REQUIRED_LIBRARIES Boost::config)
++set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include")
++check_cxx_source_compiles("#include <${CMAKE_CURRENT_SOURCE_DIR}/config/has_long_double_support.cpp> \n int main() { return 0;}" BOOST_MATH_HAS_LONG_DOUBLE)
++unset(CMAKE_REQUIRED_LIBRARIES)
++unset(CMAKE_REQUIRED_INCLUDES)
++
++set(C99_SOURCES
++ acosh
++ asinh
++ atanh
++ cbrt
++ copysign
++ erfc
++ erf
++ expm1
++ fmax
++ fmin
++ fpclassify
++ hypot
++ lgamma
++ llround
++ log1p
++ lround
++ nextafter
++ nexttoward
++ round
++ tgamma
++ trunc
++)
++
++set(TR1_SOURCES
++ assoc_laguerre
++ assoc_legendre
++ beta
++ comp_ellint_1
++ comp_ellint_2
++ comp_ellint_3
++ cyl_bessel_i
++ cyl_bessel_j
++ cyl_bessel_k
++ cyl_neumann
++ ellint_1
++ ellint_2
++ ellint_3
++ expint
++ hermite
++ laguerre
++ legendre
++ riemann_zeta
++ sph_bessel
++ sph_legendre
++ sph_neumann
++)
++
++list(TRANSFORM C99_SOURCES PREPEND "src/tr1/" ) # OUTPUT_VARIABLE <output variable>])
++list(TRANSFORM TR1_SOURCES PREPEND "src/tr1/" )
++
++list(TRANSFORM C99_SOURCES APPEND "f.cpp" OUTPUT_VARIABLE C99_SOURCESf)
++list(TRANSFORM TR1_SOURCES APPEND "f.cpp" OUTPUT_VARIABLE TR1_SOURCESf)
++
++set(types "" f)
++
++if(BOOST_MATH_HAS_LONG_DOUBLE)
++ list(TRANSFORM C99_SOURCES APPEND "l.cpp" OUTPUT_VARIABLE C99_SOURCESl)
++ list(TRANSFORM TR1_SOURCES APPEND "l.cpp" OUTPUT_VARIABLE TR1_SOURCESl)
++ list(APPEND types l)
++endif()
++
++list(TRANSFORM C99_SOURCES APPEND ".cpp")
++list(TRANSFORM TR1_SOURCES APPEND ".cpp")
++
++foreach(type IN LISTS types)
++ add_library(boost_math_tr1${type} ${TR1_SOURCES${type}})
++ target_link_libraries(boost_math_tr1${type} PUBLIC Boost::config)
++ target_include_directories(boost_math_tr1${type} PRIVATE src/tr1)
++ target_include_directories(boost_math_tr1${type} PRIVATE include)
++ add_library(boost_math_c99${type} ${C99_SOURCES${type}})
++ target_link_libraries(boost_math_c99${type} PUBLIC Boost::config)
++ target_include_directories(boost_math_c99${type} PRIVATE src/tr1)
++ target_include_directories(boost_math_c99${type} PRIVATE include)
++ if(BUILD_SHARED_LIBS)
++ target_compile_definitions(boost_math_tr1${type} PUBLIC BOOST_MATH_TR1_DYN_LINK=1)
++ target_compile_definitions(boost_math_c99${type} PUBLIC BOOST_MATH_TR1_DYN_LINK=1)
++ if(MSVC)
++ target_compile_definitions(boost_math_tr1${type} PRIVATE "BOOST_SYMBOL_EXPORT=__declspec(dllexport)" BOOST_ALL_NO_LIB)
++ target_compile_definitions(boost_math_c99${type} PRIVATE "BOOST_SYMBOL_EXPORT=__declspec(dllexport)" BOOST_ALL_NO_LIB)
++ endif()
++ endif()
++ target_compile_features(boost_math_tr1${type} PUBLIC cxx_std_14)
++ target_compile_features(boost_math_c99${type} PUBLIC cxx_std_14)
++ if(DARWIN)
++ target_compile_definitions(boost_math_tr1${type} PRIVATE _DARWIN_C_SOURCE)
++ target_compile_definitions(boost_math_c99${type} PRIVATE _DARWIN_C_SOURCE)
++ endif()
++ boost_install_target(TARGET boost_math_tr1${type} VERSION ${BOOST_SUPERPROJECT_VERSION})
++ boost_install_target(TARGET boost_math_c99${type} VERSION ${BOOST_SUPERPROJECT_VERSION})
++endforeach()
++endif()
++
diff --git a/vcpkg/ports/boost-math/features.cmake b/vcpkg/ports/boost-math/features.cmake
new file mode 100644
index 0000000..c63efe8
--- /dev/null
+++ b/vcpkg/ports/boost-math/features.cmake
@@ -0,0 +1,10 @@
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS
+ FEATURE_OPTIONS
+ FEATURES
+ "legacy" BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS
+)
+
+if(NOT BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS)
+ set(Z_VCPKG_BOOST_FORCE_HEADER_ONLY ON)
+endif()
diff --git a/vcpkg/ports/boost-math/opt-random.diff b/vcpkg/ports/boost-math/opt-random.diff
new file mode 100644
index 0000000..db3e173
--- /dev/null
+++ b/vcpkg/ports/boost-math/opt-random.diff
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7965bd1..4e6c492 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,7 +38,7 @@ else()
+ Boost::integer
+ Boost::lexical_cast
+ Boost::predef
+- Boost::random
++ $<TARGET_NAME_IF_EXISTS:Boost::random>
+ Boost::static_assert
+ Boost::throw_exception
+ )
diff --git a/vcpkg/ports/boost-math/portfile.cmake b/vcpkg/ports/boost-math/portfile.cmake
new file mode 100644
index 0000000..76f44cf
--- /dev/null
+++ b/vcpkg/ports/boost-math/portfile.cmake
@@ -0,0 +1,19 @@
+# Automatically generated by scripts/boost/generate-ports.ps1
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO boostorg/math
+ REF boost-${VERSION}
+ SHA512 6f21b7aa18f2886dab7ad9c8c47a419a703a735e36a2fa2fbc36351fb9357214a8a1a12f9eca2ab22c92b869d4fa445075febc8630aef26b5176bd0cbc370294
+ HEAD_REF master
+ PATCHES
+ build-old-libs.patch
+ opt-random.diff
+)
+
+set(FEATURE_OPTIONS "")
+include("${CMAKE_CURRENT_LIST_DIR}/features.cmake")
+boost_configure_and_install(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${FEATURE_OPTIONS}
+)
diff --git a/vcpkg/ports/boost-math/vcpkg.json b/vcpkg/ports/boost-math/vcpkg.json
new file mode 100644
index 0000000..1b84f92
--- /dev/null
+++ b/vcpkg/ports/boost-math/vcpkg.json
@@ -0,0 +1,64 @@
+{
+ "$comment": "Automatically generated by scripts/boost/generate-ports.ps1",
+ "name": "boost-math",
+ "version": "1.89.0",
+ "description": "Boost math module",
+ "homepage": "https://www.boost.org/libs/math",
+ "license": "BSL-1.0",
+ "dependencies": [
+ {
+ "name": "boost-assert",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-cmake",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-concept-check",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-config",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-core",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-headers",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-integer",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-lexical-cast",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-predef",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-random",
+ "platform": "!uwp",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-static-assert",
+ "version>=": "1.89.0"
+ },
+ {
+ "name": "boost-throw-exception",
+ "version>=": "1.89.0"
+ }
+ ],
+ "features": {
+ "legacy": {
+ "description": "Build the legacy C99 and TR1 libraries"
+ }
+ }
+}