mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-20 04:55:41 -04:00
Initial community commit
This commit is contained in:
29
vcpkg-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch
Normal file
29
vcpkg-ports/minizip/0001-remove-ifndef-NOUNCRYPT.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From a6fd3992d44053a523a67aa16f5ae88fecfb20e1 Mon Sep 17 00:00:00 2001
|
||||
From: Nicole Mazzuca <mazzucan@outlook.com>
|
||||
Date: Tue, 22 Sep 2020 14:09:53 -0700
|
||||
Subject: [PATCH 1/2] remove `#ifndef NOUNCRYPT`
|
||||
|
||||
enable decrypt support for password-encrypted ZIP files
|
||||
|
||||
---
|
||||
contrib/minizip/unzip.c | 4 ----
|
||||
1 file changed, 4 deletions(-)
|
||||
|
||||
diff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c
|
||||
index bcfb941..1895a0f 100644
|
||||
--- a/contrib/minizip/unzip.c
|
||||
+++ b/contrib/minizip/unzip.c
|
||||
@@ -68,10 +68,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
-#ifndef NOUNCRYPT
|
||||
- #define NOUNCRYPT
|
||||
-#endif
|
||||
-
|
||||
#include "zlib.h"
|
||||
#include "unzip.h"
|
||||
|
||||
--
|
||||
2.24.3 (Apple Git-128)
|
||||
|
29
vcpkg-ports/minizip/0002-add-declaration-for-mkdir.patch
Normal file
29
vcpkg-ports/minizip/0002-add-declaration-for-mkdir.patch
Normal file
@ -0,0 +1,29 @@
|
||||
From 6c38b6f544b55f9fc554f0fe22e2cbaddfaed7f8 Mon Sep 17 00:00:00 2001
|
||||
From: Nicole Mazzuca <mazzucan@outlook.com>
|
||||
Date: Tue, 22 Sep 2020 14:15:04 -0700
|
||||
Subject: [PATCH 2/2] add declaration for mkdir
|
||||
|
||||
It's invalid in C99 to implicitly declare mkdir
|
||||
|
||||
---
|
||||
contrib/minizip/miniunz.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/contrib/minizip/miniunz.c b/contrib/minizip/miniunz.c
|
||||
index 3d65401..5341af2 100644
|
||||
--- a/contrib/minizip/miniunz.c
|
||||
+++ b/contrib/minizip/miniunz.c
|
||||
@@ -12,6 +12,10 @@
|
||||
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
|
||||
*/
|
||||
|
||||
+#if !defined(_WIN32)
|
||||
+#include <sys/stat.h>
|
||||
+#endif
|
||||
+
|
||||
#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
#define __USE_FILE_OFFSET64
|
||||
--
|
||||
2.24.3 (Apple Git-128)
|
||||
|
49
vcpkg-ports/minizip/0003-no-io64.patch
Normal file
49
vcpkg-ports/minizip/0003-no-io64.patch
Normal file
@ -0,0 +1,49 @@
|
||||
diff --git a/contrib/minizip/ioapi.c b/contrib/minizip/ioapi.c
|
||||
index 7f5c191..d42e050 100644
|
||||
--- a/contrib/minizip/ioapi.c
|
||||
+++ b/contrib/minizip/ioapi.c
|
||||
@@ -17,8 +17,8 @@
|
||||
#if defined(__APPLE__) || defined(IOAPI_NO_64)
|
||||
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
|
||||
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
|
||||
-#define FTELLO_FUNC(stream) ftello(stream)
|
||||
-#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
|
||||
+#define FTELLO_FUNC(stream) ftell(stream)
|
||||
+#define FSEEKO_FUNC(stream, offset, origin) fseek(stream, offset, origin)
|
||||
#else
|
||||
#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
|
||||
#define FTELLO_FUNC(stream) ftello64(stream)
|
||||
diff --git a/contrib/minizip/miniunz.c b/contrib/minizip/miniunz.c
|
||||
index 3d65401..a1269ea 100644
|
||||
--- a/contrib/minizip/miniunz.c
|
||||
+++ b/contrib/minizip/miniunz.c
|
||||
@@ -33,9 +33,9 @@
|
||||
#define FTELLO_FUNC(stream) ftello(stream)
|
||||
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
|
||||
#else
|
||||
-#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
|
||||
-#define FTELLO_FUNC(stream) ftello64(stream)
|
||||
-#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
|
||||
+#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
|
||||
+#define FTELLO_FUNC(stream) ftell(stream)
|
||||
+#define FSEEKO_FUNC(stream, offset, origin) fseek(stream, offset, origin)
|
||||
#endif
|
||||
|
||||
|
||||
diff --git a/contrib/minizip/minizip.c b/contrib/minizip/minizip.c
|
||||
index 4288962..02267fb 100644
|
||||
--- a/contrib/minizip/minizip.c
|
||||
+++ b/contrib/minizip/minizip.c
|
||||
@@ -34,9 +34,9 @@
|
||||
#define FTELLO_FUNC(stream) ftello(stream)
|
||||
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
|
||||
#else
|
||||
-#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
|
||||
-#define FTELLO_FUNC(stream) ftello64(stream)
|
||||
-#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
|
||||
+#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
|
||||
+#define FTELLO_FUNC(stream) ftell(stream)
|
||||
+#define FSEEKO_FUNC(stream, offset, origin) fseek(stream, offset, origin)
|
||||
#endif
|
||||
|
||||
|
104
vcpkg-ports/minizip/CMakeLists.txt
Normal file
104
vcpkg-ports/minizip/CMakeLists.txt
Normal file
@ -0,0 +1,104 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(minizip VERSION 1.2.13 LANGUAGES C)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
set(MIN_SRC contrib/minizip)
|
||||
|
||||
include_directories(${MIN_SRC} ${ZLIB_INCLUDE_DIRS})
|
||||
|
||||
set(MINIZIP_LIBRARIES ZLIB::ZLIB)
|
||||
if(ENABLE_BZIP2)
|
||||
message(STATUS "Building with bzip2 support")
|
||||
find_package(BZip2)
|
||||
|
||||
include_directories(${BZIP2_INCLUDE_DIR})
|
||||
set(MINIZIP_LIBRARIES ${MINIZIP_LIBRARIES} ${BZIP2_LIBRARIES})
|
||||
else()
|
||||
message(STATUS "Building without bzip2 support")
|
||||
endif()
|
||||
|
||||
set(SRC
|
||||
${MIN_SRC}/ioapi.c
|
||||
${MIN_SRC}/unzip.c
|
||||
${MIN_SRC}/zip.c
|
||||
${MIN_SRC}/mztools.c
|
||||
)
|
||||
if(WIN32)
|
||||
list(APPEND SRC ${MIN_SRC}/iowin32.c)
|
||||
endif()
|
||||
|
||||
set(HEADERS
|
||||
${MIN_SRC}/crypt.h
|
||||
${MIN_SRC}/ioapi.h
|
||||
${MIN_SRC}/unzip.h
|
||||
${MIN_SRC}/zip.h
|
||||
${MIN_SRC}/mztools.h
|
||||
)
|
||||
if(WIN32)
|
||||
list(APPEND HEADERS ${MIN_SRC}/iowin32.h)
|
||||
endif()
|
||||
|
||||
add_library(minizip ${SRC})
|
||||
|
||||
target_link_libraries(minizip PRIVATE ZLIB::ZLIB)
|
||||
target_compile_definitions(minizip PRIVATE -D_ZLIB_H)
|
||||
|
||||
if(ENABLE_BZIP2)
|
||||
target_link_libraries(minizip PUBLIC ${BZIP2_LIBRARIES})
|
||||
target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1)
|
||||
endif()
|
||||
if(ANDROID)
|
||||
target_compile_definitions(minizip PRIVATE IOAPI_NO_64)
|
||||
endif()
|
||||
if(NOT DISABLE_INSTALL_TOOLS)
|
||||
add_executable(minizip_bin ${MIN_SRC}/minizip.c)
|
||||
add_executable(miniunz_bin ${MIN_SRC}/miniunz.c)
|
||||
|
||||
target_link_libraries(minizip_bin minizip ${MINIZIP_LIBRARIES})
|
||||
target_link_libraries(miniunz_bin minizip ${MINIZIP_LIBRARIES})
|
||||
|
||||
set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip)
|
||||
set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz)
|
||||
endif()
|
||||
|
||||
install(
|
||||
TARGETS minizip
|
||||
EXPORT minizipTargets
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file("${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/minizipConfig.cmake.in
|
||||
minizipConfig.cmake
|
||||
INSTALL_DESTINATION share/minizip)
|
||||
|
||||
install(FILES
|
||||
"${PROJECT_BINARY_DIR}/minizipConfig.cmake"
|
||||
"${PROJECT_BINARY_DIR}/minizipConfigVersion.cmake"
|
||||
DESTINATION share/minizip
|
||||
)
|
||||
|
||||
install(EXPORT minizipTargets
|
||||
NAMESPACE minizip::
|
||||
DESTINATION share/minizip
|
||||
)
|
||||
|
||||
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)
|
||||
endif()
|
12
vcpkg-ports/minizip/minizipConfig.cmake.in
Normal file
12
vcpkg-ports/minizip/minizipConfig.cmake.in
Normal file
@ -0,0 +1,12 @@
|
||||
#@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(ZLIB)
|
||||
|
||||
if (@ENABLE_BZIP2@)
|
||||
find_dependency(BZip2)
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
49
vcpkg-ports/minizip/portfile.cmake
Normal file
49
vcpkg-ports/minizip/portfile.cmake
Normal file
@ -0,0 +1,49 @@
|
||||
# When this port is updated, the minizip port should be updated at the same time
|
||||
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO madler/zlib
|
||||
REF v1.2.13
|
||||
SHA512 44b834fbfb50cca229209b8dbe1f96b258f19a49f5df23b80970b716371d856a4adf525edb4c6e0e645b180ea949cb90f5365a1d896160f297f56794dd888659
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
0001-remove-ifndef-NOUNCRYPT.patch
|
||||
0002-add-declaration-for-mkdir.patch
|
||||
0003-no-io64.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
bzip2 ENABLE_BZIP2
|
||||
)
|
||||
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${SOURCE_PATH}/cmake/minizipConfig.cmake.in" COPYONLY)
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" "${SOURCE_PATH}/CMakeLists.txt" COPYONLY)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
-DDISABLE_INSTALL_TOOLS=${VCPKG_TARGET_IS_IOS}
|
||||
OPTIONS_DEBUG
|
||||
-DDISABLE_INSTALL_HEADERS=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_cmake_config_fixup()
|
||||
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/minizip")
|
||||
|
||||
if ("bzip2" IN_LIST FEATURES)
|
||||
file(GLOB HEADERS "${CURRENT_PACKAGES_DIR}/include/minizip/*.h")
|
||||
foreach(HEADER ${HEADERS})
|
||||
file(READ "${HEADER}" _contents)
|
||||
string(REPLACE "#ifdef HAVE_BZIP2" "#if 1" _contents "${_contents}")
|
||||
file(WRITE "${HEADER}" "${_contents}")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
4
vcpkg-ports/minizip/usage
Normal file
4
vcpkg-ports/minizip/usage
Normal file
@ -0,0 +1,4 @@
|
||||
minizip provides CMake targets:
|
||||
|
||||
find_package(minizip CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE minizip::minizip)
|
27
vcpkg-ports/minizip/vcpkg.json
Normal file
27
vcpkg-ports/minizip/vcpkg.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "minizip",
|
||||
"version-semver": "1.2.13",
|
||||
"description": "Zip compression library",
|
||||
"homepage": "https://github.com/madler/zlib",
|
||||
"license": "Zlib",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
],
|
||||
"features": {
|
||||
"bzip2": {
|
||||
"description": "Support compression using bzip2 library",
|
||||
"dependencies": [
|
||||
"bzip2"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user