From 7c3f56b542c4b7c7c8d7858a257d4deeb0530c92 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Fri, 21 Jul 2017 22:00:32 -0700 Subject: [minizip] init required by #1369 --- ports/minizip/CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++ ports/minizip/CONTROL | 4 ++++ ports/minizip/portfile.cmake | 26 +++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 ports/minizip/CMakeLists.txt create mode 100644 ports/minizip/CONTROL create mode 100644 ports/minizip/portfile.cmake diff --git a/ports/minizip/CMakeLists.txt b/ports/minizip/CMakeLists.txt new file mode 100644 index 000000000..b42d6f576 --- /dev/null +++ b/ports/minizip/CMakeLists.txt @@ -0,0 +1,50 @@ +cmake_minimum_required(VERSION 3.8) +project(minizip C CXX) + +if(MSVC) + add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) +endif() + +find_package(ZLIB REQUIRED) + +find_package(Bzip2 REQUIRED) + +set(MIN_SRC contrib/minizip) + +include_directories(${MIN_SRC} ${ZLIB_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR}) + +set(SRC + ${MIN_SRC}/ioapi.c + ${MIN_SRC}/iowin32.c + ${MIN_SRC}/unzip.c + ${MIN_SRC}/zip.c +) +set(HEADERS + ${MIN_SRC}/ioapi.h + ${MIN_SRC}/iowin32.h + ${MIN_SRC}/unzip.h + ${MIN_SRC}/zip.h +) +if(BUILD_SHARED_LIBS) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +endif() + +add_library(minizip ${SRC}) + +target_link_libraries(minizip PRIVATE ZLIB::ZLIB) +target_compile_definitions(minizip PRIVATE -D_ZLIB_H) + +target_link_libraries(minizip PRIVATE ${BZIP2_LIBRARIES}) +target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1) + +install( + TARGETS minizip + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) + + +if(NOT DISABLE_INSTALL_HEADERS) + install(FILES ${HEADERS} DESTINATION include/minizip) +endif() diff --git a/ports/minizip/CONTROL b/ports/minizip/CONTROL new file mode 100644 index 000000000..e4a5daee2 --- /dev/null +++ b/ports/minizip/CONTROL @@ -0,0 +1,4 @@ +Source: minizip +Version: 1.2.11 +Description: +Build-Depends: bzip2, zlib diff --git a/ports/minizip/portfile.cmake b/ports/minizip/portfile.cmake new file mode 100644 index 000000000..c1c04f211 --- /dev/null +++ b/ports/minizip/portfile.cmake @@ -0,0 +1,26 @@ +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + message(FATAL_ERROR "WindowsStore not supported") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO madler/zlib + REF v1.2.11 + SHA512 104c62ed1228b5f1199bc037081861576900eb0697a226cafa62a35c4c890b5cb46622e399f9aad82ee5dfb475bae26ae75e2bd6da3d261361b1c8b996970faf + HEAD_REF master +) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON +) + +vcpkg_install_cmake() +vcpkg_copy_pdbs() + +file(INSTALL ${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/minizip RENAME copyright) -- cgit v1.2.3 From 21b2afb9d7c0a8a1d273a380ea179798343bbaa6 Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Sun, 23 Jul 2017 10:57:20 -0700 Subject: [minizip] include mztools --- ports/minizip/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/minizip/CMakeLists.txt b/ports/minizip/CMakeLists.txt index b42d6f576..11d08a3c8 100644 --- a/ports/minizip/CMakeLists.txt +++ b/ports/minizip/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(minizip C CXX) +project(minizip C) if(MSVC) add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) @@ -18,12 +18,15 @@ set(SRC ${MIN_SRC}/iowin32.c ${MIN_SRC}/unzip.c ${MIN_SRC}/zip.c + ${MIN_SRC}/mz.c + ${MIN_SRC}/mztools.c ) set(HEADERS ${MIN_SRC}/ioapi.h ${MIN_SRC}/iowin32.h ${MIN_SRC}/unzip.h ${MIN_SRC}/zip.h + ${MIN_SRC}/mztools.h ) if(BUILD_SHARED_LIBS) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -- cgit v1.2.3 From a3f0d84839caa64c500ceda8095b8da42cd4359a Mon Sep 17 00:00:00 2001 From: atkawa7 Date: Sun, 23 Jul 2017 11:46:49 -0700 Subject: [minizip] fix linker issues --- ports/minizip/CMakeLists.txt | 19 ++++++++++++++++++- ports/minizip/portfile.cmake | 4 +++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ports/minizip/CMakeLists.txt b/ports/minizip/CMakeLists.txt index 11d08a3c8..caf2b856d 100644 --- a/ports/minizip/CMakeLists.txt +++ b/ports/minizip/CMakeLists.txt @@ -18,7 +18,7 @@ set(SRC ${MIN_SRC}/iowin32.c ${MIN_SRC}/unzip.c ${MIN_SRC}/zip.c - ${MIN_SRC}/mz.c + ${MIN_SRC}/unzip.c ${MIN_SRC}/mztools.c ) set(HEADERS @@ -26,6 +26,7 @@ set(HEADERS ${MIN_SRC}/iowin32.h ${MIN_SRC}/unzip.h ${MIN_SRC}/zip.h + ${MIN_SRC}/unzip.h ${MIN_SRC}/mztools.h ) if(BUILD_SHARED_LIBS) @@ -40,6 +41,16 @@ target_compile_definitions(minizip PRIVATE -D_ZLIB_H) target_link_libraries(minizip PRIVATE ${BZIP2_LIBRARIES}) target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1) +add_executable(minizip_bin ${MIN_SRC}/minizip.c) +add_executable(miniunz_bin ${MIN_SRC}/miniunz.c) + +target_link_libraries(minizip_bin minizip ${BZIP2_LIBRARIES} ZLIB::ZLIB) +target_link_libraries(miniunz_bin minizip ${BZIP2_LIBRARIES} ZLIB::ZLIB) + +set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip) +set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz) + + install( TARGETS minizip RUNTIME DESTINATION bin @@ -47,6 +58,12 @@ install( ARCHIVE DESTINATION lib ) +if(NOT DISABLE_INSTALL_TOOLS) + install ( + TARGETS minizip_bin miniunz_bin + RUNTIME DESTINATION tools/minizip + ) +endif() if(NOT DISABLE_INSTALL_HEADERS) install(FILES ${HEADERS} DESTINATION include/minizip) diff --git a/ports/minizip/portfile.cmake b/ports/minizip/portfile.cmake index c1c04f211..c0ed49486 100644 --- a/ports/minizip/portfile.cmake +++ b/ports/minizip/portfile.cmake @@ -17,10 +17,12 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON + OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON -DDISABLE_INSTALL_TOOLS=ON ) vcpkg_install_cmake() vcpkg_copy_pdbs() +vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/minizip) + file(INSTALL ${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/minizip RENAME copyright) -- cgit v1.2.3