aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/suitesparse-cxsparse
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/suitesparse-cxsparse
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/suitesparse-cxsparse')
-rw-r--r--vcpkg/ports/suitesparse-cxsparse/001-detect-complex-support.patch14
-rw-r--r--vcpkg/ports/suitesparse-cxsparse/portfile.cmake38
-rw-r--r--vcpkg/ports/suitesparse-cxsparse/vcpkg.json19
3 files changed, 71 insertions, 0 deletions
diff --git a/vcpkg/ports/suitesparse-cxsparse/001-detect-complex-support.patch b/vcpkg/ports/suitesparse-cxsparse/001-detect-complex-support.patch
new file mode 100644
index 0000000..01279b7
--- /dev/null
+++ b/vcpkg/ports/suitesparse-cxsparse/001-detect-complex-support.patch
@@ -0,0 +1,14 @@
+Android API level 22 and earlier don't provide any complex-valued math functions in complex.h,
+which are required for complex data type support in CXSparse.
+
+--- a/CXSparse/CMakeLists.txt
++++ b/CXSparse/CMakeLists.txt
+@@ -45,7 +45,7 @@
+ # MS Visual Studio does not support the complex type for ANSI C11.
+ # FIXME: see GraphBLAS for how to use complex types in MS Visual Studio.
+
+-if ( MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") )
++if ( MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC" OR (CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_VERSION VERSION_LESS 23) )
+ option ( CXSPARSE_USE_COMPLEX "ON: complex data type enabled. OFF (default): complex data type disabled." OFF )
+ else ( )
+ option ( CXSPARSE_USE_COMPLEX "ON (default): complex data type enabled. OFF: complex data type disabled." ON )
diff --git a/vcpkg/ports/suitesparse-cxsparse/portfile.cmake b/vcpkg/ports/suitesparse-cxsparse/portfile.cmake
new file mode 100644
index 0000000..638e746
--- /dev/null
+++ b/vcpkg/ports/suitesparse-cxsparse/portfile.cmake
@@ -0,0 +1,38 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO DrTimothyAldenDavis/SuiteSparse
+ REF v7.8.3
+ SHA512 fc0fd0aaf55a6712a3b8ca23bf7536a31d52033e090370ebbf291f05d0e073c7dcfd991a80b037f54663f524804582b87af86522c2e4435091527f0d3c189244
+ HEAD_REF dev
+ PATCHES
+ 001-detect-complex-support.patch
+)
+
+set(PACKAGE_NAME CXSparse)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}/${PACKAGE_NAME}"
+ DISABLE_PARALLEL_CONFIGURE
+ OPTIONS
+ -DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
+ -DSUITESPARSE_USE_CUDA=OFF
+ -DSUITESPARSE_USE_STRICT=ON
+ -DSUITESPARSE_USE_FORTRAN=OFF
+ -DSUITESPARSE_DEMOS=OFF
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(
+ PACKAGE_NAME ${PACKAGE_NAME}
+ CONFIG_PATH lib/cmake/${PACKAGE_NAME}
+)
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST
+ "${SOURCE_PATH}/${PACKAGE_NAME}/Doc/License.txt"
+ "${SOURCE_PATH}/${PACKAGE_NAME}/Doc/lesser.txt"
+)
diff --git a/vcpkg/ports/suitesparse-cxsparse/vcpkg.json b/vcpkg/ports/suitesparse-cxsparse/vcpkg.json
new file mode 100644
index 0000000..d075bd9
--- /dev/null
+++ b/vcpkg/ports/suitesparse-cxsparse/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "$comment": "Use scripts/update_suitesparse.py to update all SuiteSparse ports",
+ "name": "suitesparse-cxsparse",
+ "version-semver": "4.4.1",
+ "description": "CXSparse: Software package for permuting a matrix into block upper triangular form in SuiteSparse",
+ "homepage": "https://people.engr.tamu.edu/davis/suitesparse.html",
+ "license": "LGPL-2.1-or-later",
+ "dependencies": [
+ "suitesparse-config",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}