Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions ports/hdf5/pkgconfig-requires.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@ index 141ab44..66b7efa 100644
else ()
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT})
@@ -128,8 +129,10 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
@@ -134,6 +135,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
else()
get_target_property(SZIP_STATIC_LIBRARY szip-shared IMPORTED_LOCATION_${upper_build_type})
set(SZIP_STATIC_LIBRARY szip-static)
endif()
+ set(szip_PC_LIBS_PRIVATE "${SZIP_STATIC_LIBRARY}")
elseif (TARGET szip-static)
get_target_property(SZIP_STATIC_LIBRARY szip-static IMPORTED_LOCATION_${upper_build_type})
+ set(szip_PC_LIBS_PRIVATE "${SZIP_STATIC_LIBRARY}")
elseif (SZIP_FOUND)
set (H5_HAVE_FILTER_SZIP 1)
set (H5_HAVE_SZLIB_H 1)
else ()
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING})
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b75fdd2..a2e88fd 100644
--- a/CMakeLists.txt
Expand Down
33 changes: 14 additions & 19 deletions ports/hdf5/szip.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@ diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake
index d5f801e..141ab44 100644
--- a/CMakeFilters.cmake
+++ b/CMakeFilters.cmake
@@ -117,8 +117,20 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES})
endif ()
endif ()
+ else()
@@ -124,6 +124,16 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (H5_HAVE_LIBSZ 1)
set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR})
set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR})
+ elseif(1)
+ find_package(szip CONFIG REQUIRED)
endif ()
- if (SZIP_FOUND)
+ string(TOUPPER ${CMAKE_BUILD_TYPE} upper_build_type)
+ # SZIP_STATIC_LIBRARY will be used in cmake and pkgconfig, so it must be a absolute path
+ if (TARGET szip-shared)
+ if (WIN32)
+ get_target_property(SZIP_STATIC_LIBRARY szip-shared IMPORTED_IMPLIB_${upper_build_type})
+ set(SZIP_INCLUDE_DIRS "")
+ # SZIP_STATIC_LIBRARY will be used in linking, in cmake and in pkgconfig,
+ # but the actual linkage doesn't matter.
+ if (TARGET szip-shared)
+ set(SZIP_STATIC_LIBRARY szip-shared)
+ else()
+ get_target_property(SZIP_STATIC_LIBRARY szip-shared IMPORTED_LOCATION_${upper_build_type})
+ set(SZIP_STATIC_LIBRARY szip-static)
+ endif()
+ elseif (TARGET szip-static)
+ get_target_property(SZIP_STATIC_LIBRARY szip-static IMPORTED_LOCATION_${upper_build_type})
+ elseif (SZIP_FOUND)
set (H5_HAVE_FILTER_SZIP 1)
set (H5_HAVE_SZLIB_H 1)
set (H5_HAVE_LIBSZ 1)
else ()
if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ")
EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING})
1 change: 1 addition & 0 deletions ports/hdf5/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "hdf5",
"version": "1.12.1",
"port-version": 1,
"description": "HDF5 is a data model, library, and file format for storing and managing data",
"homepage": "https://www.hdfgroup.org/downloads/hdf5/",
"supports": "!uwp",
Expand Down
4 changes: 2 additions & 2 deletions ports/netcdf-c/fix-dependency-libmath.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd7c4f8..03b7ccf 100644
index c36908b..390ac0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -866,7 +866,7 @@ ENDIF()
@@ -944,7 +944,7 @@ OPTION(ENABLE_BYTERANGE "Enable byte-range access to remote datasets.." OFF)

# Check for the math library so it can be explicitly linked.
IF(NOT WIN32)
Expand Down
34 changes: 34 additions & 0 deletions ports/netcdf-c/fix-dependency-libzip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b93a141..c3763a7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -957,7 +957,14 @@ OPTION(ENABLE_DAP_REMOTE_TESTS "Enable DAP remote tests." ON)
SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test")

# See if we have libzip
-FIND_PACKAGE(Zip)
+if(ENABLE_NCZARR_ZIP)
+ find_package(libzip CONFIG REQUIRED)
+ set(Zip_LIBRARIES libzip::zip)
+ set(Zip_FOUND TRUE)
+else()
+ set(Zip_LIBRARIES "")
+ set(Zip_FOUND FALSE)
+endif()

# Define a test flag for have curl library
IF(Zip_FOUND)
diff --git a/netCDFConfig.cmake.in b/netCDFConfig.cmake.in
index b3be259..72b4b25 100644
--- a/netCDFConfig.cmake.in
+++ b/netCDFConfig.cmake.in
@@ -15,6 +15,9 @@ set(netCDF_LIBRARIES netCDF::netcdf)
include(CMakeFindDependencyMacro)
find_dependency(HDF5 CONFIG)
find_dependency(CURL CONFIG)
+if(@ENABLE_NCZARR_ZIP@)
+ find_dependency(libzip CONFIG)
+endif()
include("${CMAKE_CURRENT_LIST_DIR}/netCDFTargets.cmake")

# Compiling Options
6 changes: 3 additions & 3 deletions ports/netcdf-c/fix-dependency-zlib.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
index 5b578f7..0731460 100644
index be72612..5e1692f 100644
--- a/liblib/CMakeLists.txt
+++ b/liblib/CMakeLists.txt
@@ -58,7 +58,7 @@ ENDIF()
@@ -67,7 +67,7 @@ ENDIF()

SET(TLL_LIBS "")

-SET(TLL_LIBS ${TLL_LIBS} ${HAVE_LIBM} ZLIB::ZLIB)
-SET(TLL_LIBS ${TLL_LIBS} ${HAVE_LIBM} ${ZLIB_LIBRARY})
+SET(TLL_LIBS ${TLL_LIBS} ${HAVE_LIBM})

# Add extra dependencies specified via NC_EXTRA_DEPS
Expand Down
10 changes: 5 additions & 5 deletions ports/netcdf-c/fix-linkage-error.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/liblib/CMakeLists.txt b/liblib/CMakeLists.txt
index 8aeeab7..5b578f7 100644
index 9e126ec..1363d35 100644
--- a/liblib/CMakeLists.txt
+++ b/liblib/CMakeLists.txt
@@ -70,8 +70,14 @@ ENDIF()
IF(USE_HDF5 OR USE_NETCDF4)
@@ -79,8 +79,14 @@ ENDIF()
IF(USE_HDF5)
if(TARGET hdf5::hdf5-shared)
SET(TLL_LIBS ${TLL_LIBS} hdf5::hdf5-shared hdf5::hdf5_hl-shared)
+ if(USE_PARALLEL)
Expand All @@ -15,5 +15,5 @@ index 8aeeab7..5b578f7 100644
+ list(APPEND TLL_LIBS ${MPI_C_LIBRARIES})
+ endif()
endif()
ENDIF()

elseif(0)
IF(NOT MSVC)
4 changes: 2 additions & 2 deletions ports/netcdf-c/fix-manpage-msys.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt
index 65a3f87..30a008d 100644
index 4583733..20ce3bf 100644
--- a/libsrc/CMakeLists.txt
+++ b/libsrc/CMakeLists.txt
@@ -61,7 +61,7 @@ IF(HAVE_M4)
@@ -64,7 +64,7 @@ IF(HAVE_M4)
IF(NOT MSVC)
ADD_CUSTOM_TARGET(manpage ALL

Expand Down
5 changes: 3 additions & 2 deletions ports/netcdf-c/fix-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57d2d4b..3de6f8c 100644
index 390ac0a..4bcd909 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1892,6 +1892,20 @@ LIST(REMOVE_DUPLICATES LINKFLAGS)
@@ -2100,6 +2100,21 @@ STRING(REPLACE ";" " " LINKFLAGS "${LINKFLAGS}")
SET(LIBS ${NC_LIBS})
SET(NC_LIBS "-lnetcdf")

Expand All @@ -17,6 +17,7 @@ index 57d2d4b..3de6f8c 100644
+replace_pkgconfig_module("-lhdf5_hl" "hdf5_hl")
+replace_pkgconfig_module("-lhdf5" "hdf5")
+replace_pkgconfig_module("-lmpi" "ompi-c")
+replace_pkgconfig_module("-lzip" "libzip")
+replace_pkgconfig_module("-lCURL[^ ]*" "libcurl")
+replace_pkgconfig_module("-lZLIB[^ ]*" "zlib")
+
Expand Down
4 changes: 2 additions & 2 deletions ports/netcdf-c/no-install-deps.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd7c4f8..95fb01c 100644
index 6b39f0e..507eb4c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1830,7 +1830,7 @@ ADD_SUBDIRECTORY(docs)
@@ -2028,7 +2028,7 @@ ADD_SUBDIRECTORY(docs)
# install them in the binary dir. Grab all of the .libs, put them
# in the libdir.
##
Expand Down
47 changes: 35 additions & 12 deletions ports/netcdf-c/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,40 +1,63 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Unidata/netcdf-c
REF 26fba54a58fa02af92d84441ed90b417c1d08161 # v4.7.4
SHA512 7144374b5bd3574ea422de07ffb30fecc4e5f560f9b46f62762cc0cce511dd33068b8df9244fe94ae3cc7b3a9bb9fe398c7e67c3e5ac2109768e5a9b984f24fb
REF cd6173f472b778fa0e558982c59f7183aa5b8e47 # v4.8.1
SHA512 e965b9c865f31abcd0ae045cb709a41710e72bcf5bd237972cd62688f0f099f1b12be316a448d22315b1c73eb99fae3ea38072e9a3646a4f70ba42507d82f537
HEAD_REF master
PATCHES
no-install-deps.patch
fix-dependency-zlib.patch
use_targets.patch
fix-dependency-libmath.patch
fix-linkage-error.patch
fix-pkgconfig.patch
fix-dependency-zlib.patch
fix-manpage-msys.patch
fix-dependency-libzip.patch
)

#Remove outdated find modules
file(REMOVE "${SOURCE_PATH}/cmake/modules/FindSZIP.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/modules/FindZLIB.cmake")
file(REMOVE "${SOURCE_PATH}/cmake/modules/windows/FindHDF5.cmake")

if(VCPKG_CRT_LINKAGE STREQUAL "static")
set(NC_USE_STATIC_CRT ON)
if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
set(CRT_OPTION "")
elseif(VCPKG_CRT_LINKAGE STREQUAL "static")
set(CRT_OPTION -DNC_USE_STATIC_CRT=ON)
else()
set(NC_USE_STATIC_CRT OFF)
set(CRT_OPTION -DNC_USE_STATIC_CRT=OFF)
endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
dap ENABLE_DAP
netcdf-4 ENABLE_NETCDF_4
netcdf-4 USE_HDF5
hdf5 ENABLE_HDF5
nczarr ENABLE_NCZARR
nczarr-zip ENABLE_NCZARR_ZIP
tools BUILD_UTILITIES
INVERTED_FEATURES
dap CMAKE_DISABLE_FIND_PACKAGE_CURL
netcdf-4 CMAKE_DISABLE_FIND_PACKAGE_HDF5
)
)

if(NOT ENABLE_DAP AND NOT ENABLE_NCZARR)
list(APPEND FEATURE_OPTIONS "-DCMAKE_DISABLE_FIND_PACKAGE_CURL=ON")
endif()

if(ENABLE_HDF5)
Comment thread
JackBoosY marked this conversation as resolved.
# Fix hdf5 szip support detection for static linkage.
x_vcpkg_pkgconfig_get_modules(
PREFIX HDF5
MODULES hdf5
LIBRARIES
)
if(HDF5_LIBRARIES_RELEASE MATCHES "szip")
list(APPEND FEATURE_OPTIONS "-DUSE_SZIP=ON")
endif()
endif()

if(VCPKG_TARGET_IS_UWP)
set(ENV{CFLAGS} "$ENV{CFLAGS} /wd4996 /wd4703")
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} /wd4996 /wd4703")
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
Expand All @@ -46,7 +69,7 @@ vcpkg_cmake_configure(
-DENABLE_FILTER_TESTING=OFF
-DENABLE_DAP_REMOTE_TESTS=OFF
-DDISABLE_INSTALL_DEPENDENCIES=ON
-DNC_USE_STATIC_CRT=${NC_USE_STATIC_CRT}
${CRT_OPTION}
${FEATURE_OPTIONS}
)

Expand Down
Loading