aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzi-m <53815290+zi-m@users.noreply.github.com>2020-05-14 01:59:31 +0200
committerGitHub <noreply@github.com>2020-05-13 16:59:31 -0700
commit430a10ff3582a16b0f4c5cc8dddac245e9596702 (patch)
tree9323bf5e72e318347b4ef1015a22c45f5b69bda6
parent55be137d5ba6230f62aa7fb0994fda1728ce7fef (diff)
downloadvcpkg-430a10ff3582a16b0f4c5cc8dddac245e9596702.tar.gz
vcpkg-430a10ff3582a16b0f4c5cc8dddac245e9596702.zip
[h5py-lzf] Add new port (#10871)
* [h5py-lzf] Add new port * add 0001-disable-H5PLget_plugin-api.patch fix "error: static declaration of 'H5PLget_plugin_info' follows non-static declaration"
-rw-r--r--ports/h5py-lzf/0001-disable-H5PLget_plugin-api.patch16
-rw-r--r--ports/h5py-lzf/CMakeLists.txt11
-rw-r--r--ports/h5py-lzf/CONTROL5
-rw-r--r--ports/h5py-lzf/portfile.cmake34
4 files changed, 66 insertions, 0 deletions
diff --git a/ports/h5py-lzf/0001-disable-H5PLget_plugin-api.patch b/ports/h5py-lzf/0001-disable-H5PLget_plugin-api.patch
new file mode 100644
index 000000000..12f89845f
--- /dev/null
+++ b/ports/h5py-lzf/0001-disable-H5PLget_plugin-api.patch
@@ -0,0 +1,16 @@
+diff --git a/lzf/lzf_filter.c b/lzf/lzf_filter.c
+index 951b1e4c..b2fbffc1 100644
+--- a/lzf/lzf_filter.c
++++ b/lzf/lzf_filter.c
+@@ -93,9 +93,9 @@ static const H5Z_class_t filter_class = {
+
+ #include "H5PLextern.h"
+
+-H5PL_type_t H5PLget_plugin_type(void){ return H5PL_TYPE_FILTER; }
++//H5PL_type_t H5PLget_plugin_type(void){ return H5PL_TYPE_FILTER; }
+
+-const void *H5PLget_plugin_info(void){ return &filter_class; }
++//const void *H5PLget_plugin_info(void){ return &filter_class; }
+
+ #endif
+ #endif
diff --git a/ports/h5py-lzf/CMakeLists.txt b/ports/h5py-lzf/CMakeLists.txt
new file mode 100644
index 000000000..3ef3950c7
--- /dev/null
+++ b/ports/h5py-lzf/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 3.13)
+project(h5py-lzf)
+
+find_package(hdf5 CONFIG REQUIRED)
+
+add_library(h5py-lzf STATIC lzf_filter.c lzf/lzf_c.c lzf/lzf_d.c)
+target_include_directories(h5py-lzf PUBLIC $<INSTALL_INTERFACE:include>)
+target_link_libraries(h5py-lzf PRIVATE libzstd $<IF:${link_hdf5_SHARED},hdf5::hdf5-shared,hdf5::hdf5-static>)
+install(TARGETS h5py-lzf EXPORT h5py-lzf-config ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)
+install(EXPORT h5py-lzf-config DESTINATION share/cmake/h5py-lzf)
+install(FILES lzf_filter.h lzf/lzf.h DESTINATION include)
diff --git a/ports/h5py-lzf/CONTROL b/ports/h5py-lzf/CONTROL
new file mode 100644
index 000000000..3ef62f85a
--- /dev/null
+++ b/ports/h5py-lzf/CONTROL
@@ -0,0 +1,5 @@
+Source: h5py-lzf
+Version: 2019-12-04
+Build-Depends: hdf5
+Homepage: https://github.com/h5py/h5py/tree/master/lzf
+Description: The LZF filter is an alternative DEFLATE-style compressor for HDF5 datasets, using the free LZF library by Marc Alexander Lehmann.
diff --git a/ports/h5py-lzf/portfile.cmake b/ports/h5py-lzf/portfile.cmake
new file mode 100644
index 000000000..71b4709b8
--- /dev/null
+++ b/ports/h5py-lzf/portfile.cmake
@@ -0,0 +1,34 @@
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(link_hdf5_SHARED 0)
+else()
+ set(link_hdf5_SHARED 1)
+endif()
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO h5py/h5py
+ REF 81ba118ee66b97a94678e8f5675c4114649dfda4
+ SHA512 c789abdc563f8d2535f0a2ef5e233eb862281559a9cdc3ec560dd69b4d403b6f923f5390390da54851e1bfef1be8de7f80999c25a7f3ac4962ee0620179c6420
+ HEAD_REF master
+ PATCHES
+ 0001-disable-H5PLget_plugin-api.patch
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/lzf)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}/lzf
+ PREFER_NINJA
+ OPTIONS
+ -Dlink_hdf5_SHARED=${link_hdf5_SHARED}
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/${PORT})
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
+
+configure_file(${SOURCE_PATH}/lzf/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)