aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>2020-08-10 16:08:37 -0700
committerGitHub <noreply@github.com>2020-08-10 16:08:37 -0700
commit7ad0f085d7496a7cc00b3ee45224dc05ee70845e (patch)
tree7db5ce0dedd42865fe50b9079a2b44f169cb3c55
parentfa1823dcad96448230d30f01f35628b2e1feab08 (diff)
downloadvcpkg-7ad0f085d7496a7cc00b3ee45224dc05ee70845e.tar.gz
vcpkg-7ad0f085d7496a7cc00b3ee45224dc05ee70845e.zip
[netcdf-c] Fix dependency libmath (#12434)
* [netcdf-c] Add dependency embree3 * [netcdf-c] remove dependency embree3, change the search sequence * [netcdf-cxx4] Re-fix dependency hdf5 * Update ports/netcdf-c/CONTROL * [netcdf-c] Remove dependency embree
-rw-r--r--ports/netcdf-c/CONTROL4
-rw-r--r--ports/netcdf-c/fix-dependency-libmath.patch13
-rw-r--r--ports/netcdf-c/portfile.cmake1
-rw-r--r--ports/netcdf-c/usage2
-rw-r--r--ports/netcdf-cxx4/CONTROL1
-rw-r--r--ports/netcdf-cxx4/fix-dependecy-hdf5.patch43
-rw-r--r--ports/netcdf-cxx4/portfile.cmake4
7 files changed, 46 insertions, 22 deletions
diff --git a/ports/netcdf-c/CONTROL b/ports/netcdf-c/CONTROL
index 18010cb52..92d0439d9 100644
--- a/ports/netcdf-c/CONTROL
+++ b/ports/netcdf-c/CONTROL
@@ -1,6 +1,6 @@
Source: netcdf-c
Version: 4.7.3
-Port-Version: 3
-Build-Depends: hdf5, curl, embree3(linux|osx)
+Port-Version: 4
+Build-Depends: hdf5, curl
Homepage: https://github.com/Unidata/netcdf-c
Description: a set of self-describing, machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.
diff --git a/ports/netcdf-c/fix-dependency-libmath.patch b/ports/netcdf-c/fix-dependency-libmath.patch
new file mode 100644
index 000000000..0db00ccaf
--- /dev/null
+++ b/ports/netcdf-c/fix-dependency-libmath.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 35c694f..e2c03e5 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -839,7 +839,7 @@ ENDIF()
+
+ # Check for the math library so it can be explicitly linked.
+ IF(NOT WIN32)
+- FIND_LIBRARY(HAVE_LIBM NAMES math m libm)
++ FIND_LIBRARY(HAVE_LIBM NAMES m libm math)
+ MESSAGE(STATUS "Found Math library: ${HAVE_LIBM}")
+ IF(NOT HAVE_LIBM)
+ MESSAGE(FATAL_ERROR "Unable to find the math library.")
diff --git a/ports/netcdf-c/portfile.cmake b/ports/netcdf-c/portfile.cmake
index d1af9d9f1..4813aa5b8 100644
--- a/ports/netcdf-c/portfile.cmake
+++ b/ports/netcdf-c/portfile.cmake
@@ -9,6 +9,7 @@ vcpkg_from_github(
config-pkg-location.patch
use_targets.patch
mpi.patch
+ fix-dependency-libmath.patch
)
#Remove outdated find modules
diff --git a/ports/netcdf-c/usage b/ports/netcdf-c/usage
index 98824b337..681a20f8c 100644
--- a/ports/netcdf-c/usage
+++ b/ports/netcdf-c/usage
@@ -1,4 +1,4 @@
The package netcdf-c provides CMake targets:
find_package(netCDF CONFIG REQUIRED)
- target_link_libraries(main PRIVATE netcdf) \ No newline at end of file
+ target_link_libraries(main PRIVATE netcdf)
diff --git a/ports/netcdf-cxx4/CONTROL b/ports/netcdf-cxx4/CONTROL
index baf0147c6..b628a3825 100644
--- a/ports/netcdf-cxx4/CONTROL
+++ b/ports/netcdf-cxx4/CONTROL
@@ -1,5 +1,6 @@
Source: netcdf-cxx4
Version: 4.3.1
+Port-Version: 1
Build-Depends: hdf5, netcdf-c
Homepage: https://github.com/Unidata/netcdf-cxx4
Description: a set of machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.
diff --git a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch
index 5d289ec2e..73b9a0d01 100644
--- a/ports/netcdf-cxx4/fix-dependecy-hdf5.patch
+++ b/ports/netcdf-cxx4/fix-dependecy-hdf5.patch
@@ -1,32 +1,41 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 60c699d..6bd7822 100644
+index 60c699d..f06fcc0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -402,7 +402,7 @@ ELSE(MSVC)
- FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)
- ENDIF(MSVC)
-
--CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY)
-+set(HAVE_H5FREE_MEMORY ON)
- IF(NOT HAVE_H5FREE_MEMORY)
- MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.")
- SET(NC_HAS_DEF_VAR_FILTER "")
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 6a48709..79de128 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -399,7 +399,13 @@ IF(MSVC)
+@@ -395,14 +395,20 @@ ENDIF(NC_HAS_DEF_VAR_FILTER)
+ ###
+ # Find HDF5
+ ###
+-IF(MSVC)
++IF(0)
SET(SEARCH_PACKAGE_NAME ${HDF5_PACKAGE_NAME})
FIND_PACKAGE(HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS C HL NO_MODULES REQUIRED ${NC_HDF5_LINK_TYPE})
ELSE(MSVC)
- FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)
+ FIND_PACKAGE(hdf5 CONFIG REQUIRED)
+ set(HDF5_FOUND ${hdf5_FOUND})
-+ if (BUILD_SHARED_LIBS)
++ if (NOT HDF5_USE_STATIC_LIBRARIES)
+ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-shared hdf5::hdf5_hl-shared)
+ else()
+ set(HDF5_C_LIBRARY_hdf5 hdf5::hdf5-static hdf5::hdf5_hl-static)
+ endif()
ENDIF(MSVC)
- set(HAVE_H5FREE_MEMORY ON)
+-CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY)
++set(HAVE_H5FREE_MEMORY ON)
+ IF(NOT HAVE_H5FREE_MEMORY)
+ MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free. Please install a newer version of libhdf5 if you require plugin compression support.")
+ SET(NC_HAS_DEF_VAR_FILTER "")
+diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
+index 30a4a96..1809d29 100644
+--- a/plugins/CMakeLists.txt
++++ b/plugins/CMakeLists.txt
+@@ -23,7 +23,7 @@ SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES OUTPUT_NAME "bzip2")
+ SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES LIBRARY_OUTPUT_NAME "h5bzip2")
+ SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES ARCHIVE_OUTPUT_NAME "h5bzip2")
+ SET_TARGET_PROPERTIES(test_bzip2 PROPERTIES RUNTIME_OUTPUT_NAME "h5bzip2")
+-TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS})
++TARGET_LINK_LIBRARIES(test_bzip2 ${ALL_TLL_LIBS} ${HDF5_C_LIBRARY_hdf5})
+
+ ADD_LIBRARY(misc MODULE ${libmisc_SOURCES})
+ SET_TARGET_PROPERTIES(misc PROPERTIES LIBRARY_OUTPUT_NAME "misc")
diff --git a/ports/netcdf-cxx4/portfile.cmake b/ports/netcdf-cxx4/portfile.cmake
index d90ea7131..3efd8e3aa 100644
--- a/ports/netcdf-cxx4/portfile.cmake
+++ b/ports/netcdf-cxx4/portfile.cmake
@@ -1,6 +1,6 @@
-vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HDF5_USE_STATIC_LIBRARIES)
-set(HDF5_USE_STATIC_LIBRARIES ON)
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH