diff options
| -rw-r--r-- | ports/hdf5/CONTROL | 34 | ||||
| -rw-r--r-- | ports/hdf5/portfile.cmake | 91 | ||||
| -rw-r--r-- | ports/hdf5/vcpkg.json | 47 | ||||
| -rw-r--r-- | versions/baseline.json | 2 | ||||
| -rw-r--r-- | versions/h-/hdf5.json | 5 |
5 files changed, 132 insertions, 47 deletions
diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL deleted file mode 100644 index f1b8e2dd1..000000000 --- a/ports/hdf5/CONTROL +++ /dev/null @@ -1,34 +0,0 @@ -Source: hdf5 -Version: 1.12.0 -Port-Version: 1 -Homepage: https://www.hdfgroup.org/downloads/hdf5/ -Description: HDF5 is a data model, library, and file format for storing and managing data -Default-Features: szip, zlib -Supports: !uwp - -Feature: parallel -Description: parallel support for HDF5 -Build-Depends: mpi - -Feature: cpp -Description: Builds cpp lib - -Feature: tools -Description: Build hdf tools - -Feature: szip -Description: Build with szip -Build-Depends: szip - -Feature: zlib -Description: Build with zlib -Build-Depends: zlib - -Feature: fortran -Description: Build with fortran -Build-Depends: - -Feature: threadsafe -Description: thread safety for HDF5 -Build-Depends: pthreads - diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake index d15901b6b..48d4489ad 100644 --- a/ports/hdf5/portfile.cmake +++ b/ports/hdf5/portfile.cmake @@ -4,11 +4,11 @@ vcpkg_fail_port_install(ON_TARGET "UWP") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO HDFGroup/hdf5 + REPO HDFGroup/hdf5 REF hdf5-1_12_0 SHA512 d84df1ea72dc6fa038440a370e1b1ff523364474e7f214b967edc26d3191b2ef4fe1d9273c4a086a5945f1ad1ab6aa8dbcda495898e7967b2b73fd93dd5071e0 HEAD_REF develop - PATCHES + PATCHES hdf5_config.patch szip.patch ) @@ -30,10 +30,10 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS szip HDF5_ENABLE_SZIP_ENCODING zlib HDF5_ENABLE_Z_LIB_SUPPORT fortran HDF5_BUILD_FORTRAN - threadsafe HDF5_ENABLE_THREADSAFE + threadsafe HDF5_ENABLE_THREADSAFE ) -file(REMOVE ${SOURCE_PATH}/config/cmake_ext_mod/FindSZIP.cmake)#Outdated; does not find debug szip +file(REMOVE "${SOURCE_PATH}/config/cmake_ext_mod/FindSZIP.cmake")#Outdated; does not find debug szip if(FEATURES MATCHES "tools" AND VCPKG_CRT_LINKAGE STREQUAL "static") list(APPEND FEATURE_OPTIONS -DBUILD_STATIC_EXECS=ON) @@ -65,9 +65,76 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() vcpkg_fixup_cmake_targets() - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +set(debug_suffix debug) +if(VCPKG_TARGET_IS_WINDOWS) + set(debug_suffix D) +endif() +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5-1.12.0.pc") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5-1.12.0.pc" + "-lhdf5" + "-lhdf5_${debug_suffix}" + ) +endif() +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5_hl-1.12.0.pc") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5_hl-1.12.0.pc" + "-lhdf5_hl" + "-lhdf5_hl_${debug_suffix}" + ) +endif() +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5_cpp-1.12.0.pc") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5_cpp-1.12.0.pc" + "-lhdf5_cpp" + "-lhdf5_cpp_${debug_suffix}" + ) + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5_cpp-1.12.0.pc" + "Requires.private: hdf5" + "" + ) +endif() +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/hdf5_cpp-1.12.0.pc") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/hdf5_cpp-1.12.0.pc" + "Requires.private: hdf5" + "" + ) +endif() +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5_hl_cpp-1.12.0.pc") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5_hl_cpp-1.12.0.pc" + "-lhdf5_hl_cpp" + "-lhdf5_hl_cpp_${debug_suffix}" + ) +endif() +set(PKG_FILES hdf5 hdf5_hl hdf5_cpp hdf5_hl_cpp) +foreach(PC_FILE IN LISTS PKG_FILES) + set(SUBPATHS "/debug/lib/pkgconfig" "/lib/pkgconfig") + foreach(SUBPATH IN LISTS SUBPATHS) + if(EXISTS "${CURRENT_PACKAGES_DIR}${SUBPATH}/${PC_FILE}-1.12.0.pc") + file(RENAME "${CURRENT_PACKAGES_DIR}${SUBPATH}/${PC_FILE}-1.12.0.pc" "${CURRENT_PACKAGES_DIR}${SUBPATH}/${PC_FILE}.pc") + endif() + endforeach() +endforeach() +vcpkg_fixup_pkgconfig() +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/hdf5.pc") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/hdf5.pc" + "-loptimized -l\"\${prefix}/lib/zlib.lib\" -ldebug -l\"\${prefix}/debug/lib/zlibd.lib\"" + "-lzlib" + ) +endif() +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5.pc") + vcpkg_replace_string( + "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/hdf5.pc" + "-loptimized -l\"\${prefix}/lib/zlib.lib\" -ldebug -l\"\${prefix}/lib/zlibd.lib\"" + "-lzlibd" + ) +endif() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(READ "${CURRENT_PACKAGES_DIR}/share/hdf5/hdf5-config.cmake" contents) string(REPLACE [[${HDF5_PACKAGE_NAME}_TOOLS_DIR "${PACKAGE_PREFIX_DIR}/bin"]] [[${HDF5_PACKAGE_NAME}_TOOLS_DIR "${PACKAGE_PREFIX_DIR}/tools/hdf5"]] contents ${contents}) @@ -80,7 +147,7 @@ if(FEATURES MATCHES "tools") else() set(TOOL_SUFFIXES "-static${VCPKG_TARGET_EXECUTABLE_SUFFIX};${VCPKG_TARGET_EXECUTABLE_SUFFIX}") endif() - + foreach(tool IN LISTS TOOLS) foreach(suffix IN LISTS TOOL_SUFFIXES) if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}") @@ -93,12 +160,12 @@ if(FEATURES MATCHES "tools") endif() endforeach() endforeach() - vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() -file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/data/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright) -configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY) +file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/data/COPYING" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright") +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) diff --git a/ports/hdf5/vcpkg.json b/ports/hdf5/vcpkg.json new file mode 100644 index 000000000..bb8cc7bdc --- /dev/null +++ b/ports/hdf5/vcpkg.json @@ -0,0 +1,47 @@ +{ + "name": "hdf5", + "version": "1.12.0", + "port-version": 2, + "description": "HDF5 is a data model, library, and file format for storing and managing data", + "homepage": "https://www.hdfgroup.org/downloads/hdf5/", + "supports": "!uwp", + "default-features": [ + "szip", + "zlib" + ], + "features": { + "cpp": { + "description": "Builds cpp lib" + }, + "fortran": { + "description": "Build with fortran" + }, + "parallel": { + "description": "parallel support for HDF5", + "dependencies": [ + "mpi" + ] + }, + "szip": { + "description": "Build with szip", + "dependencies": [ + "szip" + ] + }, + "threadsafe": { + "description": "thread safety for HDF5", + "dependencies": [ + "pthreads" + ] + }, + "tools": { + "description": "Build hdf tools" + }, + "zlib": { + "description": "Build with zlib", + "dependencies": [ + "zlib" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index 78826cc42..ec23f5178 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2446,7 +2446,7 @@ }, "hdf5": { "baseline": "1.12.0", - "port-version": 1 + "port-version": 2 }, "healpix": { "baseline": "1.12.10", diff --git a/versions/h-/hdf5.json b/versions/h-/hdf5.json index f09fdc202..2bbc3d737 100644 --- a/versions/h-/hdf5.json +++ b/versions/h-/hdf5.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "6b0acb92d47724ab485e478e8f9e83067eea77be", + "version": "1.12.0", + "port-version": 2 + }, + { "git-tree": "702697dde6af133b36ea056ffb5d99f83d09a86d", "version-string": "1.12.0", "port-version": 1 |
