From 2db3e48cce0d9061d0fd1774cb688cbf6e839e25 Mon Sep 17 00:00:00 2001 From: talregev Date: Fri, 7 Feb 2025 05:27:48 +0200 Subject: [PATCH] [octave] add features (#43540) --- ports/octave/dep_pc_names.patch | 14 ++++ ports/octave/portfile.cmake | 120 +++++++++++++++++++++++++++---- ports/octave/vcpkg.json | 123 +++++++++++++++++++++++++++++++- versions/baseline.json | 2 +- versions/o-/octave.json | 5 ++ 5 files changed, 246 insertions(+), 18 deletions(-) create mode 100644 ports/octave/dep_pc_names.patch diff --git a/ports/octave/dep_pc_names.patch b/ports/octave/dep_pc_names.patch new file mode 100644 index 00000000000000..ddf85dc0cd3db8 --- /dev/null +++ b/ports/octave/dep_pc_names.patch @@ -0,0 +1,14 @@ +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -1520,9 +1520,9 @@ + ### Check for BZIP2 library. + + OCTAVE_CHECK_LIB(bz2, BZIP2, + [BZIP2 library not found. Octave will not be able to compress or decompress bzip2 files.], +- [bzlib.h], [BZ2_bzCompressInit]) ++ [bzlib.h], [BZ2_bzCompressInit],[],[],[],[bzip2]) + + ### Check for HDF5 library. + + save_CPPFLAGS="$CPPFLAGS" diff --git a/ports/octave/portfile.cmake b/ports/octave/portfile.cmake index 36af522ee181bd..08b0e25440924b 100644 --- a/ports/octave/portfile.cmake +++ b/ports/octave/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_extract_source_archive( ARCHIVE "${ARCHIVE}" PATCHES run-mk-ops.diff + dep_pc_names.patch ) include(vcpkg_find_fortran) @@ -36,6 +37,96 @@ if(VCPKG_HOST_IS_OSX) message("${PORT} currently requires the following programs from the system package manager:\n gsed\n\nIt can be installed with brew gnu-sed") endif() +if("bz2" IN_LIST FEATURES) + set(BZ2_OPTION "yes") +else() + set(BZ2_OPTION "no") +endif() + +set(SUITESPARSECONFIG_OPTION "no") + +if("amd" IN_LIST FEATURES) + set(AMD_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(AMD_OPTION "no") +endif() + +if("camd" IN_LIST FEATURES) + set(CAMD_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(CAMD_OPTION "no") +endif() + +if("ccolamd" IN_LIST FEATURES) + set(CCOLAMD_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(CCOLAMD_OPTION "no") +endif() + +if("cholmod" IN_LIST FEATURES) + set(CHOLMOD_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(CHOLMOD_OPTION "no") +endif() + +if("colamd" IN_LIST FEATURES) + set(COLAMD_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(COLAMD_OPTION "no") +endif() + +if("cxsparse" IN_LIST FEATURES) + set(CXSPARSE_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(CXSPARSE_OPTION "no") +endif() + +if("klu" IN_LIST FEATURES) + set(KLU_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(KLU_OPTION "no") +endif() + +if("umfpack" IN_LIST FEATURES) + set(UMFPACK_OPTION "yes") + set(SUITESPARSECONFIG_OPTION "yes") +else() + set(UMFPACK_OPTION "no") +endif() + +if("hdf5" IN_LIST FEATURES) + set(HDF5_OPTION "yes") +else() + set(HDF5_OPTION "no") +endif() + +if("fltk" IN_LIST FEATURES) + set(FLTK_OPTION "yes") +else() + set(FLTK_OPTION "no") +endif() + +if("fontconfig" IN_LIST FEATURES) + set(FONTCONFIG_OPTION "yes") +else() + set(FONTCONFIG_OPTION "no") +endif() + +if("freetype" IN_LIST FEATURES) + set(FREETYPE_OPTION "yes") +else() + set(FREETYPE_OPTION "no") +endif() + +vcpkg_add_to_path("${CURRENT_INSTALLED_DIR}/tools/fltk") + vcpkg_configure_make( SOURCE_PATH "${SOURCE_PATH}" AUTOCONFIG @@ -45,24 +136,23 @@ vcpkg_configure_make( --disable-hg-id --enable-lib-visibility-flags --enable-relocate-all - --with-amd=no + --with-amd=${AMD_OPTION} --with-arpack=no - --with-bz2=no - --with-camd=no - --with-ccolamd=no - --with-cholmod=no - --with-colamd=no - --with-cxsparse=no + --with-bz2=${BZ2_OPTION} + --with-camd=${CAMD_OPTION} + --with-ccolamd=${CCOLAMD_OPTION} + --with-cholmod=${CHOLMOD_OPTION} + --with-colamd=${COLAMD_OPTION} + --with-cxsparse=${CXSPARSE_OPTION} --with-curl=no - --with-cxsparse=no --with-fftw3 # yes --with-fftw3f # yes - --with-fltk=no - --with-fontconfig=no - --with-freetype=no + --with-fltk=${FLTK_OPTION} + --with-fontconfig=${FONTCONFIG_OPTION} + --with-freetype=${FREETYPE_OPTION} --with-glpk # yes - --with-hdf5=no - --with-klu=no + --with-hdf5=${HDF5_OPTION} + --with-klu=${KLU_OPTION} --with-magick=no --with-opengl # yes --with-portaudio=no @@ -73,10 +163,10 @@ vcpkg_configure_make( --with-qt=no --with-sndfile # yes --with-spqr=no - --with-suitesparseconfig=no + --with-suitesparseconfig=${SUITESPARSECONFIG_OPTION} --with-sundials_ida=no --with-sundials_nvecserial=no - --with-umfpack=no + --with-umfpack=${UMFPACK_OPTION} --with-z # yes ) vcpkg_install_make() diff --git a/ports/octave/vcpkg.json b/ports/octave/vcpkg.json index b97401ce7b8b2b..36c4d66e2832a3 100644 --- a/ports/octave/vcpkg.json +++ b/ports/octave/vcpkg.json @@ -1,7 +1,7 @@ { "name": "octave", "version": "9.3.0", - "port-version": 1, + "port-version": 2, "description": "High-level interpreted language, primarily intended for numerical computations.", "homepage": "https://octave.org/", "documentation": "https://docs.octave.org/latest/", @@ -17,5 +17,124 @@ "pcre2", "readline", "zlib" - ] + ], + "features": { + "amd": { + "description": "suitesparse-amd support", + "dependencies": [ + { + "name": "suitesparse-amd", + "default-features": false + } + ] + }, + "bz2": { + "description": "bzip2 support", + "dependencies": [ + { + "name": "bzip2", + "default-features": false + } + ] + }, + "camd": { + "description": "suitesparse-camd support", + "dependencies": [ + { + "name": "suitesparse-camd", + "default-features": false + } + ] + }, + "ccolamd": { + "description": "suitesparse-ccolamd support", + "dependencies": [ + { + "name": "suitesparse-ccolamd", + "default-features": false + } + ] + }, + "cholmod": { + "description": "suitesparse-cholmod support", + "dependencies": [ + { + "name": "suitesparse-cholmod", + "default-features": false + } + ] + }, + "colamd": { + "description": "suitesparse-colamd support", + "dependencies": [ + { + "name": "suitesparse-colamd", + "default-features": false + } + ] + }, + "cxsparse": { + "description": "suitesparse-cxsparse support", + "dependencies": [ + { + "name": "suitesparse-cxsparse", + "default-features": false + } + ] + }, + "fltk": { + "description": "fltk support", + "dependencies": [ + { + "name": "fltk", + "default-features": false + } + ] + }, + "fontconfig": { + "description": "fontconfig support", + "dependencies": [ + { + "name": "fontconfig", + "default-features": false + } + ] + }, + "freetype": { + "description": "freetype support", + "dependencies": [ + { + "name": "freetype", + "default-features": false + } + ] + }, + "hdf5": { + "description": "hdf5 support", + "dependencies": [ + { + "name": "hdf5", + "default-features": false + } + ] + }, + "klu": { + "description": "suitesparse-klu support", + "dependencies": [ + { + "name": "suitesparse-klu", + "default-features": false + } + ] + }, + "umfpack": { + "description": "suitesparse-umfpack support", + "dependencies": [ + { + "name": "suitesparse-umfpack", + "default-features": false + } + ] + } + } } diff --git a/versions/baseline.json b/versions/baseline.json index 6356e161eb9821..c859e9ee2feb86 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6562,7 +6562,7 @@ }, "octave": { "baseline": "9.3.0", - "port-version": 1 + "port-version": 2 }, "octomap": { "baseline": "1.10.0", diff --git a/versions/o-/octave.json b/versions/o-/octave.json index bb298cd6118fab..0dd80e166e1e17 100644 --- a/versions/o-/octave.json +++ b/versions/o-/octave.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "802b30081c9cc3102f4bc8badc74ce173d21bb0f", + "version": "9.3.0", + "port-version": 2 + }, { "git-tree": "cc528d9865bd5b487ad0b152cdedc809b64e497f", "version": "9.3.0",