-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from conan-io/master
merge from main repository
- Loading branch information
Showing
42 changed files
with
671 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
versions: | ||
2.9.2: | ||
folder: 2.x.x | ||
2.11.0: | ||
folder: 2.x.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# This CMake file has been extracted from VCPKG and is under MIT license: | ||
# https://github.com/microsoft/vcpkg/blob/master/ports/minizip/CMakeLists.txt | ||
cmake_minimum_required(VERSION 3.8) | ||
project(minizip C) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
set(PROJECT_VERSION 1.2.11) | ||
set(PROJECT_VERSION_MAJOR 1) | ||
set(PROJECT_VERSION_MINOR 2) | ||
set(PROJECT_VERSION_PATCH 11) | ||
|
||
option(USE_BZIP2 "Build minizip with bzip2 support" ON) | ||
option(BUILD_TOOLS "Build minizip tool" OFF) | ||
|
||
if (MSVC AND WIN32 AND BUILD_SHARED_LIBS) | ||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
endif() | ||
|
||
set(MIN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/contrib/minizip") | ||
include_directories(${MIN_SRC} ${ZLIB_INCLUDE_DIRS}) | ||
|
||
set(SOURCE_FILES | ||
${MIN_SRC}/ioapi.c | ||
${MIN_SRC}/unzip.c | ||
${MIN_SRC}/zip.c | ||
${MIN_SRC}/mztools.c | ||
) | ||
if(WIN32) | ||
list(APPEND SOURCE_FILES ${MIN_SRC}/iowin32.c) | ||
endif() | ||
|
||
set(HEADER_FILES | ||
${MIN_SRC}/crypt.h | ||
${MIN_SRC}/ioapi.h | ||
${MIN_SRC}/unzip.h | ||
${MIN_SRC}/zip.h | ||
${MIN_SRC}/mztools.h | ||
) | ||
if(WIN32) | ||
list(APPEND HEADER_FILES ${MIN_SRC}/iowin32.h) | ||
endif() | ||
|
||
add_library(minizip ${SOURCE_FILES} ${HEADER_FILES}) | ||
target_link_libraries(minizip PUBLIC ${CONAN_LIBS}) | ||
target_compile_definitions(minizip PRIVATE -D_ZLIB_H) | ||
|
||
if(ENABLE_BZIP2) | ||
target_compile_definitions(minizip PRIVATE -DHAVE_BZIP2=1) | ||
endif() | ||
if(MSVC) | ||
target_compile_options(minizip PUBLIC /W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) | ||
endif() | ||
|
||
if (BUILD_TOOLS) | ||
add_executable(minizip_bin ${MIN_SRC}/minizip.c) | ||
add_executable(miniunz_bin ${MIN_SRC}/miniunz.c) | ||
|
||
target_link_libraries(minizip_bin minizip ${CONAN_LIBS}) | ||
target_link_libraries(miniunz_bin minizip ${CONAN_LIBS}) | ||
|
||
set_target_properties(minizip_bin PROPERTIES OUTPUT_NAME minizip) | ||
set_target_properties(miniunz_bin PROPERTIES OUTPUT_NAME miniunz) | ||
|
||
if(MSVC) | ||
target_compile_options(minizip_bin PUBLIC /W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) | ||
target_compile_options(miniunz_bin PUBLIC /W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) | ||
endif() | ||
|
||
install (TARGETS minizip_bin miniunz_bin | ||
RUNTIME DESTINATION bin) | ||
endif() | ||
|
||
install( | ||
TARGETS minizip | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib | ||
) | ||
|
||
install(FILES ${HEADER_FILES} DESTINATION include/minizip) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sources: | ||
"1.2.11": | ||
sha256: 629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff | ||
url: https://github.com/madler/zlib/archive/v1.2.11.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import os | ||
import shutil | ||
from conans import ConanFile, tools, CMake | ||
|
||
|
||
class MinizipConan(ConanFile): | ||
name = "minizip" | ||
version = "1.2.11" | ||
url = "https://github.com/conan-io/conan-center-index" | ||
homepage = "https://zlib.net" | ||
license = "Zlib" | ||
description = "An experimental package to read and write files in .zip format, written on top of zlib" | ||
topics = ("zip", "compression", "inflate") | ||
settings = "os", "arch", "compiler", "build_type" | ||
options = {"shared": [True, False], "fPIC": [True, False], "bzip2": [True, False], "tools": [True, False]} | ||
default_options = {"shared": False, "fPIC": True, "bzip2": True, "tools": False} | ||
exports_sources = ["CMakeLists.txt", "*.patch"] | ||
generators = "cmake", "cmake_find_package" | ||
|
||
@property | ||
def _source_subfolder(self): | ||
return "source_subfolder" | ||
|
||
def config_options(self): | ||
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
|
||
def configure(self): | ||
del self.settings.compiler.libcxx | ||
del self.settings.compiler.cppstd | ||
|
||
def requirements(self): | ||
self.requires("zlib/1.2.11") | ||
if self.options.bzip2: | ||
self.requires("bzip2/1.0.8") | ||
|
||
def source(self): | ||
tools.get(**self.conan_data["sources"][self.version]) | ||
os.rename("zlib-{}".format(self.version), self._source_subfolder) | ||
|
||
def _configure_cmake(self): | ||
cmake = CMake(self) | ||
cmake.definitions["ENABLE_BZIP2"] = self.options.bzip2 | ||
cmake.definitions["BUILD_TOOLS"] = self.options.tools | ||
cmake.configure(source_folder=self._source_subfolder) | ||
return cmake | ||
|
||
def build(self): | ||
tools.patch(patch_file="minizip.patch", base_path=self._source_subfolder) | ||
shutil.move("CMakeLists.txt", os.path.join(self._source_subfolder, 'CMakeLists.txt')) | ||
cmake = self._configure_cmake() | ||
cmake.build() | ||
|
||
def _extract_license(self): | ||
with tools.chdir(os.path.join(self.source_folder, self._source_subfolder)): | ||
tmp = tools.load("zlib.h") | ||
license_contents = tmp[2:tmp.find("*/", 1)] | ||
tools.save("LICENSE", license_contents) | ||
|
||
def package(self): | ||
self._extract_license() | ||
self.copy("LICENSE", src=self._source_subfolder, dst="licenses") | ||
cmake = self._configure_cmake() | ||
cmake.install() | ||
|
||
def package_info(self): | ||
self.cpp_info.libs = ["minizip"] | ||
self.cpp_info.includedirs = ["include", os.path.join("include", "minizip")] | ||
if self.options.bzip2: | ||
self.cpp_info.defines.append('HAVE_BZIP2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/contrib/minizip/unzip.c b/contrib/minizip/unzip.c | ||
index f12e3329..bfc05f77 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" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project(test_package C) | ||
|
||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
|
||
add_executable(test_package test_package.c) | ||
target_link_libraries(test_package ${CONAN_LIBS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from conans import ConanFile, CMake, tools | ||
|
||
|
||
class TestZlibConan(ConanFile): | ||
settings = "os", "compiler", "arch", "build_type" | ||
generators = "cmake" | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure() | ||
cmake.build() | ||
|
||
def test(self): | ||
if not tools.cross_building(self.settings): | ||
bin_path = os.path.join("bin", "test_package") | ||
self.run(bin_path, run_environment=True) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include <minizip/zip.h> | ||
#include <minizip/unzip.h> | ||
#ifdef _WIN32 | ||
#include <minizip/iowin32.h> | ||
#endif | ||
|
||
#include <minizip/crypt.h> | ||
#include <minizip/mztools.h> | ||
|
||
const char text[] = "Conveying or northward offending admitting perfectly my."; | ||
const char* zip_fname = "test_minizip.zip"; | ||
|
||
int main(int argc, char** argv) { | ||
zipFile zf = zipOpen64(zip_fname, APPEND_STATUS_CREATE); | ||
if (zf == NULL) { | ||
printf("Error in zipOpen64, fname: %s\n", zip_fname); | ||
exit(EXIT_FAILURE); | ||
} | ||
|
||
int res; | ||
zip_fileinfo zfi = {0}; | ||
res = zipOpenNewFileInZip64(zf, "fname.bin", &zfi, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_BEST_COMPRESSION, 0); | ||
if (res != ZIP_OK) { | ||
printf("Error in zipOpenNewFileInZip64, code: %d\n", res); | ||
exit(EXIT_FAILURE); | ||
} | ||
|
||
res = zipWriteInFileInZip(zf, text, sizeof(text)); | ||
if (res != ZIP_OK) { | ||
printf("Error in zipWriteInFileInZip, code: %d\n", res); | ||
exit(EXIT_FAILURE); | ||
} | ||
|
||
res = zipCloseFileInZip(zf); | ||
if (res != ZIP_OK) { | ||
printf("Error in zipCloseFileInZip, code: %d\n", res); | ||
exit(EXIT_FAILURE); | ||
} | ||
|
||
res = zipClose(zf, "Test MiniZip"); | ||
if(res != ZIP_OK) { | ||
printf("Error in zipClose, code: %d\n", res); | ||
exit(EXIT_FAILURE); | ||
} | ||
|
||
printf("ZIP file created, name: %s\n", zip_fname); | ||
|
||
return EXIT_SUCCESS; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
sources: | ||
"0.9.1": | ||
url: https://github.com/ericniebler/range-v3/archive/0.9.1.tar.gz | ||
sha256: 2b5b442d572b5978ea51c650adfaf0796f39f326404d09b83d846e04f571876b | ||
"0.10.0": | ||
url: https://github.com/ericniebler/range-v3/archive/0.10.0.tar.gz | ||
sha256: 5a1cd44e7315d0e8dcb1eee4df6802221456a9d1dbeac53da02ac7bd4ea150cd |
Oops, something went wrong.