aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2020-03-29 03:41:08 +0200
committerGitHub <noreply@github.com>2020-03-28 18:41:08 -0700
commitb79f7675aaa82eb6c5a96ae764fb1ce379a9d5d6 (patch)
treecbc0e7cdf34d0f4deb5a0888a09d45e1d41c5b1e
parentf933c30226de5ed5616f4174eed5c6d192646bda (diff)
downloadvcpkg-b79f7675aaa82eb6c5a96ae764fb1ce379a9d5d6.tar.gz
vcpkg-b79f7675aaa82eb6c5a96ae764fb1ce379a9d5d6.zip
[hdf5] add tools and fortran feature (#9864)
* [hdf5] add tools and fortran feature * change fortran feature to state requirements
-rw-r--r--ports/hdf5/CONTROL10
-rw-r--r--ports/hdf5/export-private.patch15
-rw-r--r--ports/hdf5/hdf5_config.patch2
-rw-r--r--ports/hdf5/portfile.cmake57
-rw-r--r--ports/hdf5/static-targets.patch37
5 files changed, 109 insertions, 12 deletions
diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL
index 6a74b2da9..158199126 100644
--- a/ports/hdf5/CONTROL
+++ b/ports/hdf5/CONTROL
@@ -1,5 +1,5 @@
Source: hdf5
-Version: 1.10.5-10
+Version: 1.10.5-12
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
@@ -12,6 +12,9 @@ Build-Depends: mpi
Feature: cpp
Description: Builds cpp lib
+Feature: tools
+Description: Build hdf tools
+
Feature: szip
Description: Build with szip
Build-Depends: szip
@@ -19,3 +22,8 @@ Build-Depends: szip
Feature: zlib
Description: Build with zlib
Build-Depends: zlib
+
+Feature: fortran
+Description: Build with fortran
+Build-Depends:
+
diff --git a/ports/hdf5/export-private.patch b/ports/hdf5/export-private.patch
new file mode 100644
index 000000000..9dd877846
--- /dev/null
+++ b/ports/hdf5/export-private.patch
@@ -0,0 +1,15 @@
+diff --git a/hdf5-1.10.5/hl/src/H5LDprivate.h b/hdf5-1.10.5/hl/src/H5LDprivate.h
+index b52928b53..5f02ea781 100644
+--- a/hdf5-1.10.5/hl/src/H5LDprivate.h
++++ b/hdf5-1.10.5/hl/src/H5LDprivate.h
+@@ -40,8 +40,8 @@ typedef struct H5LD_memb_t {
+ * #2: these two routines are too specific to be made as public routines
+ * Decide to do #3 at this point of time after some discussion.
+ */
+-void H5LD_clean_vector(H5LD_memb_t *listv[]);
+-int H5LD_construct_vector(char *fields, H5LD_memb_t *listv[], hid_t par_tid);
++H5_HLDLL void H5LD_clean_vector(H5LD_memb_t *listv[]);
++H5_HLDLL int H5LD_construct_vector(char *fields, H5LD_memb_t *listv[], hid_t par_tid);
+
+ #endif /* end _H5LDprivate_H */
+
diff --git a/ports/hdf5/hdf5_config.patch b/ports/hdf5/hdf5_config.patch
index c9966b30f..2b44a5320 100644
--- a/ports/hdf5/hdf5_config.patch
+++ b/ports/hdf5/hdf5_config.patch
@@ -8,7 +8,7 @@ index 3bd9e1d..7f6699c 100644
if (NOT TARGET "@HDF5_PACKAGE@")
- if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "zlib")
- include (@PACKAGE_SHARE_INSTALL_DIR@/@ZLIB_PACKAGE_NAME@/@ZLIB_PACKAGE_NAME@@HDF_PACKAGE_EXT@-targets.cmake)
-+ if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND NOT TARGET "zlib")
++ if (${HDF5_PACKAGE_NAME}_ENABLE_Z_LIB_SUPPORT AND NOT TARGET ZLIB::ZLIB)
+ find_package(ZLIB REQUIRED)
endif ()
- if (${HDF5_PACKAGE_NAME}_ENABLE_SZIP_SUPPORT AND ${HDF5_PACKAGE_NAME}_PACKAGE_EXTLIBS AND NOT TARGET "szip")
diff --git a/ports/hdf5/portfile.cmake b/ports/hdf5/portfile.cmake
index d2b3a0c15..cf5270c1a 100644
--- a/ports/hdf5/portfile.cmake
+++ b/ports/hdf5/portfile.cmake
@@ -11,24 +11,37 @@ vcpkg_extract_source_archive_ex(
ARCHIVE ${ARCHIVE}
REF hdf5
PATCHES
- hdf5_config.patch
- fix-generate.patch
+ hdf5_config.patch
+ fix-generate.patch # removes the build of static targets in shared builds
+ static-targets.patch # maps the internal static tagets to the shared targets if building as a dynamic library
+ export-private.patch # exports two additional functions in shared builds to make hl/tools/h5watch build in shared builds.
)
if ("parallel" IN_LIST FEATURES AND "cpp" IN_LIST FEATURES)
message(FATAL_ERROR "Feature Parallel and C++ options are mutually exclusive.")
endif()
+if ("fortran" IN_LIST FEATURE)
+ message(WARNING "Fortran is not yet official supported within VCPKG. Build will most likly fail if ninja 1.10 and a Fortran compiler are not available.")
+endif()
+
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
- FEATURES
+ FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used
parallel HDF5_ENABLE_PARALLEL
+ tools HDF5_BUILD_TOOLS
cpp HDF5_BUILD_CPP_LIB
szip HDF5_ENABLE_SZIP_SUPPORT
szip HDF5_ENABLE_SZIP_ENCODING
zlib HDF5_ENABLE_Z_LIB_SUPPORT
+ fortran HDF5_BUILD_FORTRAN
)
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)
+endif()
+
find_library(SZIP_RELEASE NAMES libsz libszip szip sz PATHS "${CURRENT_INSTALLED_DIR}/lib" NO_DEFAULT_PATH)
find_library(SZIP_DEBUG NAMES libsz libszip szip sz libsz_D libszip_D szip_D sz_D szip_debug PATHS "${CURRENT_INSTALLED_DIR}/debug/lib" NO_DEFAULT_PATH)
@@ -40,7 +53,6 @@ vcpkg_configure_cmake(
${FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
-DHDF5_BUILD_EXAMPLES=OFF
- -DHDF5_BUILD_TOOLS=OFF
-DHDF5_INSTALL_DATA_DIR=share/hdf5/data
-DHDF5_INSTALL_CMAKE_DIR=share
"-DSZIP_LIBRARY_DEBUG:PATH=${SZIP_DEBUG}"
@@ -48,18 +60,43 @@ vcpkg_configure_cmake(
)
vcpkg_install_cmake()
+
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets()
-#Linux build create additional scripts here. I dont know what they are doing so I am deleting them and hope for the best
-if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
-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})
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/hdf5/hdf5-config.cmake" ${contents})
-file(RENAME ${CURRENT_PACKAGES_DIR}/share/${PORT}/data/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright)
+if(FEATURES MATCHES "tools")
+ set(TOOLS h5cc h5hlcc h5c++ h5hlc++ h5copy h5diff h5dump h5ls h5stat gif2h5 h52gif h5clear h5debug h5format_convert h5jam h5unjam h5ls h5mkgrp h5repack h5repart h5watch ph5diff h5import)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ set(TOOL_SUFFIXES "-shared${VCPKG_TARGET_EXECUTABLE_SUFFIX};${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
+ 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}")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${suffix}")
+ endif()
+ if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
+ file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/${tool}${suffix}")
+ endif()
+ endforeach()
+ endforeach()
+ 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)
+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)
diff --git a/ports/hdf5/static-targets.patch b/ports/hdf5/static-targets.patch
new file mode 100644
index 000000000..3e3dfb181
--- /dev/null
+++ b/ports/hdf5/static-targets.patch
@@ -0,0 +1,37 @@
+diff --git a/hdf5-1.10.5/CMakeLists.txt b/hdf5-1.10.5/CMakeLists.txt
+index 6ca2f5c54..f7a4db9e5 100644
+--- a/hdf5-1.10.5/CMakeLists.txt
++++ b/hdf5-1.10.5/CMakeLists.txt
+@@ -150,6 +150,7 @@ set (HDF5_JAVA_TEST_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_JAVA_TEST_LIB
+ #-----------------------------------------------------------------------------
+ # Set the target names of all the libraries
+ #-----------------------------------------------------------------------------
++if(NOT BUILD_SHARED_LIBS)
+ set (HDF5_LIB_TARGET "${HDF5_LIB_CORENAME}-static")
+ set (HDF5_TEST_LIB_TARGET "${HDF5_TEST_LIB_CORENAME}-static")
+ set (HDF5_CPP_LIB_TARGET "${HDF5_CPP_LIB_CORENAME}-static")
+@@ -162,9 +163,24 @@ set (HDF5_F90_TEST_LIB_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-static")
+ set (HDF5_F90_C_TEST_LIB_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-static")
+ set (HDF5_HL_F90_LIB_TARGET "${HDF5_HL_F90_LIB_CORENAME}-static")
+ set (HDF5_HL_F90_C_LIB_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-static")
++else()
++set (HDF5_LIB_TARGET "${HDF5_LIB_CORENAME}-shared")
++set (HDF5_TEST_LIB_TARGET "${HDF5_TEST_LIB_CORENAME}-shared")
++set (HDF5_CPP_LIB_TARGET "${HDF5_CPP_LIB_CORENAME}-shared")
++set (HDF5_HL_LIB_TARGET "${HDF5_HL_LIB_CORENAME}-shared")
++set (HDF5_HL_CPP_LIB_TARGET "${HDF5_HL_CPP_LIB_CORENAME}-shared")
++set (HDF5_TOOLS_LIB_TARGET "${HDF5_TOOLS_LIB_CORENAME}-shared")
++set (HDF5_F90_LIB_TARGET "${HDF5_F90_LIB_CORENAME}-shared")
++set (HDF5_F90_C_LIB_TARGET "${HDF5_F90_C_LIB_CORENAME}-shared")
++set (HDF5_F90_TEST_LIB_TARGET "${HDF5_F90_TEST_LIB_CORENAME}-shared")
++set (HDF5_F90_C_TEST_LIB_TARGET "${HDF5_F90_C_TEST_LIB_CORENAME}-shared")
++set (HDF5_HL_F90_LIB_TARGET "${HDF5_HL_F90_LIB_CORENAME}-shared")
++set (HDF5_HL_F90_C_LIB_TARGET "${HDF5_HL_F90_C_LIB_CORENAME}-shared")
++endif()
+ set (HDF5_JAVA_JNI_LIB_TARGET "${HDF5_JAVA_JNI_LIB_CORENAME}")
+ set (HDF5_JAVA_HDF5_LIB_TARGET "${HDF5_JAVA_HDF5_LIB_CORENAME}")
+ set (HDF5_JAVA_TEST_LIB_TARGET "${HDF5_JAVA_TEST_LIB_CORENAME}")
++
+ set (HDF5_LIBSH_TARGET "${HDF5_LIB_CORENAME}-shared")
+ set (HDF5_TEST_LIBSH_TARGET "${HDF5_TEST_LIB_CORENAME}-shared")
+ set (HDF5_CPP_LIBSH_TARGET "${HDF5_CPP_LIB_CORENAME}-shared")