aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/salome-medcoupling
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/salome-medcoupling
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/salome-medcoupling')
-rw-r--r--vcpkg/ports/salome-medcoupling/fix-missing-symbols.patch13
-rw-r--r--vcpkg/ports/salome-medcoupling/portfile.cmake75
-rw-r--r--vcpkg/ports/salome-medcoupling/vcpkg.json31
-rw-r--r--vcpkg/ports/salome-medcoupling/win.patch18
4 files changed, 137 insertions, 0 deletions
diff --git a/vcpkg/ports/salome-medcoupling/fix-missing-symbols.patch b/vcpkg/ports/salome-medcoupling/fix-missing-symbols.patch
new file mode 100644
index 0000000..88a061f
--- /dev/null
+++ b/vcpkg/ports/salome-medcoupling/fix-missing-symbols.patch
@@ -0,0 +1,13 @@
+diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx
+index 60d040806..8cb6748d2 100644
+--- a/src/MEDCoupling/MEDCouplingMemArray.cxx
++++ b/src/MEDCoupling/MEDCouplingMemArray.cxx
+@@ -44,6 +44,8 @@ using namespace MEDCoupling;
+
+ template class MEDCOUPLING_EXPORT MEDCoupling::MemArray<mcIdType>;
+ template class MEDCOUPLING_EXPORT MEDCoupling::MemArray<double>;
++template class MEDCOUPLING_EXPORT MEDCoupling::MemArray<Int32>;
++template class MEDCOUPLING_EXPORT MEDCoupling::MemArray<Int64>;
+ template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplate<mcIdType>;
+ template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplate<double>;
+ template class MEDCOUPLING_EXPORT MEDCoupling::DataArrayTemplateClassic<Int32>;
diff --git a/vcpkg/ports/salome-medcoupling/portfile.cmake b/vcpkg/ports/salome-medcoupling/portfile.cmake
new file mode 100644
index 0000000..2e031f1
--- /dev/null
+++ b/vcpkg/ports/salome-medcoupling/portfile.cmake
@@ -0,0 +1,75 @@
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+ # Fixing static builds requires fixing/removing _declspec(dllexport|dllimport)
+ # in the EXPORTS macros.
+endif()
+
+string(REPLACE "." "_" UNDERSCORE_VERSION "${VERSION}")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO SalomePlatform/medcoupling
+ REF "V${UNDERSCORE_VERSION}"
+ SHA512 576b10daf58830e934a3f9d06abc63a22be76b995b2c2f2d1ab0bf16a76f3ba90f583eab06be2d665874cb433f8c990b7a7fd6724f69a5a3f9a5c20c775407cd
+ HEAD_REF master
+ PATCHES
+ win.patch
+ fix-missing-symbols.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MEDCOUPLING_BUILD_STATIC)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DCONFIGURATION_ROOT_DIR=${SALOME_CONFIGURATION_ROOT_DIR}"
+ -DMEDCOUPLING_BUILD_TESTS=OFF
+ -DMEDCOUPLING_BUILD_PY_TESTS=OFF
+ -DMEDCOUPLING_BUILD_DOC=OFF
+ -DMEDCOUPLING_BUILD_STATIC=${MEDCOUPLING_BUILD_STATIC}
+ -DMEDCOUPLING_ENABLE_PYTHON=OFF
+ -DMEDCOUPLING_ENABLE_RENUMBER=OFF
+ -DMEDCOUPLING_METIS_V5=ON
+ -DMETIS_LIBRARIES=metis # this is a target
+ -DSCOTCH_LIBRARIES=SCOTCH::scotch
+)
+
+vcpkg_cmake_install()
+
+file(GLOB dll_files "${CURRENT_PACKAGES_DIR}/lib/*.dll")
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
+foreach(dll_file IN LISTS dll_files)
+ string(REPLACE "/lib/" "/bin/" new_loc "${dll_file}")
+ file(RENAME "${dll_file}" "${new_loc}")
+endforeach()
+
+if(NOT VCPKG_BUILD_TYPE)
+ file(GLOB dll_files "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
+ foreach(dll_file IN LISTS dll_files)
+ string(REPLACE "/lib/" "/bin/" new_loc "${dll_file}")
+ file(RENAME "${dll_file}" "${new_loc}")
+ endforeach()
+endif()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME MEDCoupling CONFIG_PATH "cmake_files")
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(file "${CURRENT_PACKAGES_DIR}/share/MEDCoupling/MEDCouplingTargets-release.cmake")
+ file(READ "${file}" contents)
+ string(REGEX REPLACE "/lib/([^.]+)\\.dll" "/bin/\\1.dll" contents "${contents}")
+ file(WRITE "${file}" "${contents}")
+
+ if(NOT VCPKG_BUILD_TYPE)
+ set(file "${CURRENT_PACKAGES_DIR}/share/MEDCoupling/MEDCouplingTargets-debug.cmake")
+ file(READ "${file}" contents)
+ string(REGEX REPLACE "/lib/([^.]+)\\.dll" "/bin/\\1.dll" contents "${contents}")
+ file(WRITE "${file}" "${contents}")
+ endif()
+endif()
+
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/MEDCoupling/MEDCouplingConfig.cmake" "/cmake_files" "/share/MEDCoupling")
+vcpkg_copy_tools(TOOL_NAMES medpartitioner AUTO_CLEAN)
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share")
diff --git a/vcpkg/ports/salome-medcoupling/vcpkg.json b/vcpkg/ports/salome-medcoupling/vcpkg.json
new file mode 100644
index 0000000..9a200cb
--- /dev/null
+++ b/vcpkg/ports/salome-medcoupling/vcpkg.json
@@ -0,0 +1,31 @@
+{
+ "name": "salome-medcoupling",
+ "version": "9.10.0",
+ "port-version": 1,
+ "description": "salome-medcoupling is a part of SALOME platform to manipulate meshes and fields in memory, and use salome-med format for files.",
+ "homepage": "https://www.salome-platform.org",
+ "license": "GPL-2.0-or-later",
+ "supports": "!(windows & static)",
+ "dependencies": [
+ "boost-chrono",
+ "boost-date-time",
+ "boost-filesystem",
+ "boost-regex",
+ "boost-serialization",
+ "boost-system",
+ "boost-thread",
+ "libxml2",
+ "metis",
+ "salome-configuration",
+ "salome-med-fichier",
+ "scotch",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}
diff --git a/vcpkg/ports/salome-medcoupling/win.patch b/vcpkg/ports/salome-medcoupling/win.patch
new file mode 100644
index 0000000..25c1104
--- /dev/null
+++ b/vcpkg/ports/salome-medcoupling/win.patch
@@ -0,0 +1,18 @@
+diff --git a/src/MEDPartitioner/CMakeLists.txt b/src/MEDPartitioner/CMakeLists.txt
+index e088a0ed4..048505267 100644
+--- a/src/MEDPartitioner/CMakeLists.txt
++++ b/src/MEDPartitioner/CMakeLists.txt
+@@ -114,8 +114,12 @@ SET(medpartitionercpp_LDFLAGS
+ interpkernel
+ medcouplingcpp
+ medloader
+- -lpthread
+ )
++
++if(NOT WIN32)
++ list(APPEND medpartitionercpp_LDFLAGS -lpthread)
++endif()
++
+ IF(MEDCOUPLING_PARTITIONER_PARMETIS)
+ SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ParMetisGraph.hxx)
+ SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ParMetisGraph.cxx MEDPARTITIONER_MetisGraph.cxx)