aboutsummaryrefslogtreecommitdiff
path: root/ports/kubazip
diff options
context:
space:
mode:
authorras0219 <533828+ras0219@users.noreply.github.com>2020-09-09 20:40:15 -0700
committerGitHub <noreply@github.com>2020-09-09 20:40:15 -0700
commitf6df03b4a819bf78bc0cdf8b2369ffffc44cd894 (patch)
treeae3b16c8082f8202e9a01004e4b17cfdcfd52658 /ports/kubazip
parent32b6c3a134022db7b985ed5f7d1f2ff13a96a140 (diff)
downloadvcpkg-f6df03b4a819bf78bc0cdf8b2369ffffc44cd894.tar.gz
vcpkg-f6df03b4a819bf78bc0cdf8b2369ffffc44cd894.zip
[assimp][irrxml][kubazip][poly2tri][polyclipping] Extract vendored dependencies (#13264)
* [assimp] Fix -config.cmake files * [assimp] Fix linux build and provide backwards-compatible alias * [assimp][irrxml][kubazip][poly2tri][polyclipping] Extract vendored dependencies * [assimp] Use find_dependency(); add ZLIB dependency * [polyclipping] Do not suffix upstream binaries Co-authored-by: Robert Schumacher <roschuma@microsoft.com> Co-authored-by: Stefano Sinigardi <stesinigardi@hotmail.com>
Diffstat (limited to 'ports/kubazip')
-rw-r--r--ports/kubazip/CONTROL4
-rw-r--r--ports/kubazip/fix_targets.patch52
-rw-r--r--ports/kubazip/portfile.cmake22
3 files changed, 78 insertions, 0 deletions
diff --git a/ports/kubazip/CONTROL b/ports/kubazip/CONTROL
new file mode 100644
index 000000000..d19677ff4
--- /dev/null
+++ b/ports/kubazip/CONTROL
@@ -0,0 +1,4 @@
+Source: kubazip
+Version: 0.1.19
+Homepage: https://github.com/kuba--/zip
+Description: A portable, simple zip library written in C
diff --git a/ports/kubazip/fix_targets.patch b/ports/kubazip/fix_targets.patch
new file mode 100644
index 000000000..e5ffb8608
--- /dev/null
+++ b/ports/kubazip/fix_targets.patch
@@ -0,0 +1,52 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 55dfc77..f0182f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 3.4)
+
+-project(zip
++project(kubazip
+ LANGUAGES C
+ VERSION "0.1.19")
+ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+@@ -15,7 +15,7 @@ if (MSVC)
+ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
+ "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
+- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror -pedantic")
++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -pedantic")
+ endif (MSVC)
+
+ # zip
+@@ -37,7 +37,7 @@ endif()
+
+ target_include_directories(${PROJECT_NAME} PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+- $<INSTALL_INTERFACE:include>
++ $<INSTALL_INTERFACE:include/${PROJECT_NAME}>
+ )
+
+ # test
+@@ -52,7 +52,7 @@ endif()
+ # Installation (https://github.com/forexample/package-example) {
+
+ set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
+-set(INCLUDE_INSTALL_DIR "include")
++set(INCLUDE_INSTALL_DIR "include/${PROJECT_NAME}")
+
+ set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 04c2123..002cf5a 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.4)
+ set(test_out test.out)
+
+ add_executable(${test_out} test.c)
+-target_link_libraries(${test_out} zip)
++target_link_libraries(${test_out} kubazip)
+
+ add_test(NAME ${test_out} COMMAND ${test_out})
+
diff --git a/ports/kubazip/portfile.cmake b/ports/kubazip/portfile.cmake
new file mode 100644
index 000000000..ba2f488e0
--- /dev/null
+++ b/ports/kubazip/portfile.cmake
@@ -0,0 +1,22 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO kuba--/zip
+ REF 96924c94dabe362bbb1588aa70209e638e6fb35c
+ SHA512 bc3e9ecf39d54321314d09209f356a2491893591a016b1619abcdea8c1fb1fa8ba1f9858f4e758641df083ed237a2ec9f0af13e0f1d802502257644168ae8907
+ HEAD_REF master
+ PATCHES
+ fix_targets.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/kubazip)
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+file(INSTALL ${SOURCE_PATH}/UNLICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)