From 7e3008dbbb6b6b0ea7b8fa035ca01344c2ec365c Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Wed, 13 Nov 2019 19:40:35 -0300 Subject: [PATCH 01/41] Add Range v3 Signed-off-by: Uilian Ries --- recipes/range-v3/all/CMakeLists.txt | 7 ++++ recipes/range-v3/all/conandata.yml | 4 ++ recipes/range-v3/all/conanfile.py | 38 +++++++++++++++++++ .../range-v3/all/test_package/CMakeLists.txt | 11 ++++++ .../range-v3/all/test_package/conanfile.py | 17 +++++++++ .../all/test_package/test_package.cpp | 32 ++++++++++++++++ recipes/range-v3/config.yml | 3 ++ 7 files changed, 112 insertions(+) create mode 100644 recipes/range-v3/all/CMakeLists.txt create mode 100644 recipes/range-v3/all/conandata.yml create mode 100644 recipes/range-v3/all/conanfile.py create mode 100644 recipes/range-v3/all/test_package/CMakeLists.txt create mode 100644 recipes/range-v3/all/test_package/conanfile.py create mode 100644 recipes/range-v3/all/test_package/test_package.cpp create mode 100644 recipes/range-v3/config.yml diff --git a/recipes/range-v3/all/CMakeLists.txt b/recipes/range-v3/all/CMakeLists.txt new file mode 100644 index 0000000000000..a96e179310685 --- /dev/null +++ b/recipes/range-v3/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.12) +project(cmake_wrapper) + +include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/range-v3/all/conandata.yml b/recipes/range-v3/all/conandata.yml new file mode 100644 index 0000000000000..20c844ed75493 --- /dev/null +++ b/recipes/range-v3/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "0.9.1": + url: https://github.com/ericniebler/range-v3/archive/0.9.1.tar.gz + sha256: 2b5b442d572b5978ea51c650adfaf0796f39f326404d09b83d846e04f571876b diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py new file mode 100644 index 0000000000000..101439925e111 --- /dev/null +++ b/recipes/range-v3/all/conanfile.py @@ -0,0 +1,38 @@ +import os +from conans import ConanFile, CMake, tools + +class Rangev3Conan(ConanFile): + name = "range-v3" + license = "BSL-1.0" + homepage = "https://github.com/ericniebler/range-v3" + url = "https://github.com/conan-io/conan-center-index" + description = "Experimental range library for C++11/14/17" + topics = ("range", "range-library", "proposal", "iterator") + exports_sources = "CMakeLists.txt" + generators = "cmake" + no_copy_source = True + + @property + def _source_subfolder(self): + return os.path.join(self.source_folder, "source_subfolder") + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_folder = self.name + "-" + self.version + os.rename(extracted_folder, self._source_subfolder) + + def _configure_cmake(self): + cmake = CMake(self) + cmake.definitions["RANGE_V3_TESTS"] = "OFF" + cmake.definitions["RANGE_V3_EXAMPLES"] = "OFF" + cmake.definitions["RANGE_V3_PERF"] = "OFF" + cmake.definitions["RANGE_V3_DOCS"] = "OFF" + cmake.definitions["RANGE_V3_HEADER_CHECKS"] = "OFF" + cmake.configure() + return cmake + + def package(self): + self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) diff --git a/recipes/range-v3/all/test_package/CMakeLists.txt b/recipes/range-v3/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..6f505664bfc72 --- /dev/null +++ b/recipes/range-v3/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.5) +project(test_package) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET test_package PROPERTY CXX_STANDARD 14) diff --git a/recipes/range-v3/all/test_package/conanfile.py b/recipes/range-v3/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/range-v3/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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) diff --git a/recipes/range-v3/all/test_package/test_package.cpp b/recipes/range-v3/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..7d3515b640c89 --- /dev/null +++ b/recipes/range-v3/all/test_package/test_package.cpp @@ -0,0 +1,32 @@ +#include +#include + +using namespace ranges; + +// A range that iterates over all the characters in a +// null-terminated string. +class c_string_range + : public view_facade +{ + friend range_access; + char const * sz_; + char const & read() const { return *sz_; } + bool equal(default_sentinel_t) const { return *sz_ == '\0'; } + void next() { ++sz_; } +public: + c_string_range() = default; + explicit c_string_range(char const *sz) : sz_(sz) + { + assert(sz != nullptr); + } +}; + +int main() +{ + c_string_range r("hello world"); + // Iterate over all the characters and print them out + ranges::for_each(r, [](char ch){ + std::cout << ch << ' '; + }); + // prints: h e l l o w o r l d +} \ No newline at end of file diff --git a/recipes/range-v3/config.yml b/recipes/range-v3/config.yml new file mode 100644 index 0000000000000..6895ae8f05494 --- /dev/null +++ b/recipes/range-v3/config.yml @@ -0,0 +1,3 @@ +versions: + "0.9.1": + folder: all From 38e9a479bb1a83633ddc407c38a5dff1694a144c Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 18 Nov 2019 14:08:24 -0300 Subject: [PATCH 02/41] ranges-v3 uses cmake_find_package Signed-off-by: Uilian Ries --- recipes/range-v3/all/test_package/CMakeLists.txt | 5 ++--- recipes/range-v3/all/test_package/conanfile.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/recipes/range-v3/all/test_package/CMakeLists.txt b/recipes/range-v3/all/test_package/CMakeLists.txt index 6f505664bfc72..7dcf1ac9d5af6 100644 --- a/recipes/range-v3/all/test_package/CMakeLists.txt +++ b/recipes/range-v3/all/test_package/CMakeLists.txt @@ -3,9 +3,8 @@ project(test_package) set(CMAKE_VERBOSE_MAKEFILE TRUE) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() +find_package(range-v3) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +target_link_libraries(${PROJECT_NAME} range-v3::range-v3) set_property(TARGET test_package PROPERTY CXX_STANDARD 14) diff --git a/recipes/range-v3/all/test_package/conanfile.py b/recipes/range-v3/all/test_package/conanfile.py index bd7165a553cf4..4e5cabef40600 100644 --- a/recipes/range-v3/all/test_package/conanfile.py +++ b/recipes/range-v3/all/test_package/conanfile.py @@ -4,7 +4,7 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake" + generators = "cmake_find_package" def build(self): cmake = CMake(self) @@ -13,5 +13,4 @@ def build(self): 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) + self.run("test_package", run_environment=True) From 7fed936f3dc057a3e051075fe7755250311a44fe Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 6 Dec 2019 16:37:28 -0300 Subject: [PATCH 03/41] Add minizip 1.2.11 Signed-off-by: Uilian Ries --- recipes/minizip/1.2.11/CMakeLists.txt | 9 + recipes/minizip/1.2.11/CMakeLists_minizip.txt | 50 + recipes/minizip/1.2.11/conandata.yml | 4 + recipes/minizip/1.2.11/conanfile.py | 68 ++ recipes/minizip/1.2.11/minizip.patch | 958 ++++++++++++++++++ .../1.2.11/test_package/CMakeLists.txt | 8 + .../minizip/1.2.11/test_package/conanfile.py | 18 + .../1.2.11/test_package/test_package.c | 258 +++++ 8 files changed, 1373 insertions(+) create mode 100644 recipes/minizip/1.2.11/CMakeLists.txt create mode 100644 recipes/minizip/1.2.11/CMakeLists_minizip.txt create mode 100644 recipes/minizip/1.2.11/conandata.yml create mode 100644 recipes/minizip/1.2.11/conanfile.py create mode 100644 recipes/minizip/1.2.11/minizip.patch create mode 100644 recipes/minizip/1.2.11/test_package/CMakeLists.txt create mode 100644 recipes/minizip/1.2.11/test_package/conanfile.py create mode 100644 recipes/minizip/1.2.11/test_package/test_package.c diff --git a/recipes/minizip/1.2.11/CMakeLists.txt b/recipes/minizip/1.2.11/CMakeLists.txt new file mode 100644 index 0000000000000..9ca0774a41f3a --- /dev/null +++ b/recipes/minizip/1.2.11/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8) +project(conanzlib) + +message(STATUS "Conan CMake Wrapper") +include(conanbuildinfo.cmake) +conan_basic_setup() + +include_directories(${CMAKE_SOURCE_DIR}/source_subfolder) +add_subdirectory("source_subfolder") diff --git a/recipes/minizip/1.2.11/CMakeLists_minizip.txt b/recipes/minizip/1.2.11/CMakeLists_minizip.txt new file mode 100644 index 0000000000000..d43dbdc3f8b6b --- /dev/null +++ b/recipes/minizip/1.2.11/CMakeLists_minizip.txt @@ -0,0 +1,50 @@ +cmake_minimum_required(VERSION 2.8) +#project(minizip) + +include(../../../conanbuildinfo.cmake) +conan_basic_setup() + +set(SOURCES ioapi.c mztools.c unzip.c zip.c) +set(HEADERS crypt.h ioapi.h mztools.h unzip.h zip.h minizip_extern.h) + +if(WIN32) + set(SOURCES ${SOURCES} iowin32.c) + set(HEADERS ${HEADERS} iowin32.h) + + if(BUILD_SHARED_LIBS) + set(SOURCES ${SOURCES} minizip1.rc) + endif() +endif() + +add_library(minizip ${SOURCES} ${HEADERS}) +target_include_directories(minizip PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/../.. + ${CMAKE_CURRENT_SOURCE_DIR}/../../_build + ${CMAKE_CURRENT_SOURCE_DIR}/../../_build/source_subfolder) + +find_library(ZLIB_LIBRARY NAMES z zlib zlibd zlibstatic zlibstaticd PATHS + ${CMAKE_CURRENT_SOURCE_DIR}/../../_build + ${CMAKE_CURRENT_SOURCE_DIR}/../../_build/lib) + +target_link_libraries(minizip PRIVATE ${ZLIB_LIBRARY}) +target_compile_definitions(minizip PRIVATE MINIZIP_BUILDING) +if(BUILD_SHARED_LIBS) + set_target_properties(minizip PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH True) + target_compile_definitions(minizip PRIVATE MINIZIP_DLL ZLIB_DLL) + + if(WIN32) + set_target_properties(minizip PROPERTIES SUFFIX "1.dll") + endif() +endif() + +set_target_properties(minizip PROPERTIES PUBLIC_HEADER "${HEADERS}") +set_target_properties(minizip PROPERTIES SOVERSION 1) +set_target_properties(minizip PROPERTIES VERSION "1.1.0") + +install(TARGETS minizip + ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" + RUNTIME DESTINATION "bin" + PUBLIC_HEADER DESTINATION "include" + COMPONENT library +) diff --git a/recipes/minizip/1.2.11/conandata.yml b/recipes/minizip/1.2.11/conandata.yml new file mode 100644 index 0000000000000..b78fc6385ddd8 --- /dev/null +++ b/recipes/minizip/1.2.11/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.2.11": + sha256: 629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff + url: https://github.com/madler/zlib/archive/v1.2.11.tar.gz diff --git a/recipes/minizip/1.2.11/conanfile.py b/recipes/minizip/1.2.11/conanfile.py new file mode 100644 index 0000000000000..baa0e206b6a3c --- /dev/null +++ b/recipes/minizip/1.2.11/conanfile.py @@ -0,0 +1,68 @@ +import os +from conans import ConanFile, tools, CMake +from conans.errors import ConanException + + +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]} + default_options = {"shared": False, "fPIC": True} + exports_sources = ["CMakeLists.txt", "CMakeLists_minizip.txt", "minizip.patch"] + requires = ("zlib/1.2.11") + generators = "cmake" + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _minizip_folder(self): + return os.path.join(self._source_subfolder, 'contrib', 'minizip') + + 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 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.configure(source_folder=self._minizip_folder) + return cmake + + def build(self): + tools.patch(patch_file="minizip.patch", base_path=self._source_subfolder) + os.rename("CMakeLists_minizip.txt", os.path.join(self._minizip_folder, '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"] + if self.options.shared and self.settings.os == "Windows": + self.cpp_info.defines.append('MINIZIP_DLL') + diff --git a/recipes/minizip/1.2.11/minizip.patch b/recipes/minizip/1.2.11/minizip.patch new file mode 100644 index 0000000000000..582818b31ca6d --- /dev/null +++ b/recipes/minizip/1.2.11/minizip.patch @@ -0,0 +1,958 @@ +diff --git a/src/contrib/minizip/minizip1.rc b_/contrib/minizip/minizip1.rc +new file mode 100644 +index 0000000..1c07357 +--- /dev/null ++++ b/contrib/minizip/minizip1.rc +@@ -0,0 +1,39 @@ ++#include ++ ++#ifdef GCC_WINDRES ++VS_VERSION_INFO VERSIONINFO ++#else ++VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE ++#endif ++ FILEVERSION 1,1,0,0 ++ PRODUCTVERSION 1,1,0,0 ++ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK ++#ifdef _DEBUG ++ FILEFLAGS 1 ++#else ++ FILEFLAGS 0 ++#endif ++ FILEOS VOS__WINDOWS32 ++ FILETYPE VFT_DLL ++ FILESUBTYPE 0 // not used ++BEGIN ++ BLOCK "StringFileInfo" ++ BEGIN ++ BLOCK "040904E4" ++ //language ID = U.S. English, char set = Windows, Multilingual ++ BEGIN ++ VALUE "FileDescription", "MiniZip - Zip and UnZip additionnal library for zlib\0" ++ VALUE "FileVersion", "1.1.0\0" ++ VALUE "InternalName", "minizip1.dll\0" ++ VALUE "LegalCopyright", "(C) 1998-2010 Gilles Vollant & Mathias Svensson\0" ++ VALUE "OriginalFilename", "minizip1.dll\0" ++ VALUE "ProductName", "minizip\0" ++ VALUE "ProductVersion", "1.1.0\0" ++ VALUE "Comments", "For more information visit http://www.winimage.com/zLibDll/minizip.html/\0" ++ END ++ END ++ BLOCK "VarFileInfo" ++ BEGIN ++ VALUE "Translation", 0x0409, 1252 ++ END ++END +diff --git a/src/contrib/minizip/minizip_extern.h b_/contrib/minizip/minizip_extern.h +new file mode 100644 +index 0000000..9202d7f +--- /dev/null ++++ b/contrib/minizip/minizip_extern.h +@@ -0,0 +1,21 @@ ++/* ++MiniZip DLL import/export ++Dmitriy Vetutnev, ODANT 2017 ++*/ ++ ++#ifndef MINIZIP_EXTERN_H ++#define MINIZIP_EXTERN_H ++ ++#if defined(_WIN32) && defined(MINIZIP_DLL) ++ #if defined(MINIZIP_BUILDING) ++ #define MINIZIP_EXTERN __declspec(dllexport) ++ #else ++ #define MINIZIP_EXTERN __declspec(dllimport) ++ #endif ++#endif ++ ++#ifndef MINIZIP_EXTERN ++ #define MINIZIP_EXTERN extern ++#endif ++ ++#endif /* MINIZIP_EXTERN_H */ +diff --git a/src/contrib/minizip/mztools.c b/contrib/minizip/mztools.c +index 96891c2..7d50c9b 100644 +--- a/src/contrib/minizip/mztools.c ++++ b/contrib/minizip/mztools.c +@@ -27,7 +27,7 @@ + WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ + } while(0) + +-extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) ++MINIZIP_EXTERN int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) + const char* file; + const char* fileOut; + const char* fileOutTmp; +diff --git a/src/contrib/minizip/mztools.h b/contrib/minizip/mztools.h +index a49a426..b76eece 100644 +--- a/src/contrib/minizip/mztools.h ++++ b/contrib/minizip/mztools.h +@@ -22,7 +22,7 @@ extern "C" { + fileOut: output file after recovery + fileOutTmp: temporary file name used for recovery + */ +-extern int ZEXPORT unzRepair(const char* file, ++MINIZIP_EXTERN int ZEXPORT unzRepair(const char* file, + const char* fileOut, + const char* fileOutTmp, + uLong* nRecovered, +diff --git a/src/contrib/minizip/unzip.c b/contrib/minizip/unzip.c +index bcfb941..2397db6 100644 +--- a/src/contrib/minizip/unzip.c ++++ b/contrib/minizip/unzip.c +@@ -387,7 +387,7 @@ local int strcmpcasenosensitive_internal (const char* fileName1, const char* fil + (like 1 on Unix, 2 on Windows) + + */ +-extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, ++MINIZIP_EXTERN int ZEXPORT unzStringFileNameCompare (const char* fileName1, + const char* fileName2, + int iCaseSensitivity) + +@@ -762,7 +762,7 @@ local unzFile unzOpenInternal (const void *path, + } + + +-extern unzFile ZEXPORT unzOpen2 (const char *path, ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen2 (const char *path, + zlib_filefunc_def* pzlib_filefunc32_def) + { + if (pzlib_filefunc32_def != NULL) +@@ -775,7 +775,7 @@ extern unzFile ZEXPORT unzOpen2 (const char *path, + return unzOpenInternal(path, NULL, 0); + } + +-extern unzFile ZEXPORT unzOpen2_64 (const void *path, ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen2_64 (const void *path, + zlib_filefunc64_def* pzlib_filefunc_def) + { + if (pzlib_filefunc_def != NULL) +@@ -790,12 +790,12 @@ extern unzFile ZEXPORT unzOpen2_64 (const void *path, + return unzOpenInternal(path, NULL, 1); + } + +-extern unzFile ZEXPORT unzOpen (const char *path) ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen (const char *path) + { + return unzOpenInternal(path, NULL, 0); + } + +-extern unzFile ZEXPORT unzOpen64 (const void *path) ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen64 (const void *path) + { + return unzOpenInternal(path, NULL, 1); + } +@@ -805,7 +805,7 @@ extern unzFile ZEXPORT unzOpen64 (const void *path) + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzCloseCurrentFile before call unzClose. + return UNZ_OK if there is no problem. */ +-extern int ZEXPORT unzClose (unzFile file) ++MINIZIP_EXTERN int ZEXPORT unzClose (unzFile file) + { + unz64_s* s; + if (file==NULL) +@@ -825,7 +825,7 @@ extern int ZEXPORT unzClose (unzFile file) + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +-extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) ++MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) + { + unz64_s* s; + if (file==NULL) +@@ -835,7 +835,7 @@ extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_ + return UNZ_OK; + } + +-extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) ++MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) + { + unz64_s* s; + if (file==NULL) +@@ -1121,7 +1121,7 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file, + No preparation of the structure is needed + return UNZ_OK if there is no problem. + */ +-extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, + unz_file_info64 * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, +@@ -1133,7 +1133,7 @@ extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, + szComment,commentBufferSize); + } + +-extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo (unzFile file, + unz_file_info * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, +@@ -1175,7 +1175,7 @@ extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem + */ +-extern int ZEXPORT unzGoToFirstFile (unzFile file) ++MINIZIP_EXTERN int ZEXPORT unzGoToFirstFile (unzFile file) + { + int err=UNZ_OK; + unz64_s* s; +@@ -1196,7 +1196,7 @@ extern int ZEXPORT unzGoToFirstFile (unzFile file) + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. + */ +-extern int ZEXPORT unzGoToNextFile (unzFile file) ++MINIZIP_EXTERN int ZEXPORT unzGoToNextFile (unzFile file) + { + unz64_s* s; + int err; +@@ -1229,7 +1229,7 @@ extern int ZEXPORT unzGoToNextFile (unzFile file) + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found + */ +-extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) ++MINIZIP_EXTERN int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) + { + unz64_s* s; + int err; +@@ -1305,7 +1305,7 @@ typedef struct unz_file_pos_s + } unz_file_pos; + */ + +-extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) ++MINIZIP_EXTERN int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) + { + unz64_s* s; + +@@ -1321,7 +1321,7 @@ extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) + return UNZ_OK; + } + +-extern int ZEXPORT unzGetFilePos( ++MINIZIP_EXTERN int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos) + { +@@ -1335,7 +1335,7 @@ extern int ZEXPORT unzGetFilePos( + return err; + } + +-extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) ++MINIZIP_EXTERN int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) + { + unz64_s* s; + int err; +@@ -1357,7 +1357,7 @@ extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos + return err; + } + +-extern int ZEXPORT unzGoToFilePos( ++MINIZIP_EXTERN int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos) + { +@@ -1469,7 +1469,7 @@ local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVa + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. + */ +-extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, + int* level, int raw, const char* password) + { + int err=UNZ_OK; +@@ -1638,24 +1638,24 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, + return UNZ_OK; + } + +-extern int ZEXPORT unzOpenCurrentFile (unzFile file) ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile (unzFile file) + { + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); + } + +-extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) + { + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); + } + +-extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) + { + return unzOpenCurrentFile3(file, method, level, raw, NULL); + } + + /** Addition for GDAL : START */ + +-extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) ++MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) + { + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; +@@ -1681,7 +1681,7 @@ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) + */ +-extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) ++MINIZIP_EXTERN int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) + { + int err=UNZ_OK; + uInt iRead = 0; +@@ -1886,7 +1886,7 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) + /* + Give the current position in uncompressed data + */ +-extern z_off_t ZEXPORT unztell (unzFile file) ++MINIZIP_EXTERN z_off_t ZEXPORT unztell (unzFile file) + { + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; +@@ -1901,7 +1901,7 @@ extern z_off_t ZEXPORT unztell (unzFile file) + return (z_off_t)pfile_in_zip_read_info->stream.total_out; + } + +-extern ZPOS64_T ZEXPORT unztell64 (unzFile file) ++MINIZIP_EXTERN ZPOS64_T ZEXPORT unztell64 (unzFile file) + { + + unz64_s* s; +@@ -1921,7 +1921,7 @@ extern ZPOS64_T ZEXPORT unztell64 (unzFile file) + /* + return 1 if the end of file was reached, 0 elsewhere + */ +-extern int ZEXPORT unzeof (unzFile file) ++MINIZIP_EXTERN int ZEXPORT unzeof (unzFile file) + { + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; +@@ -1953,7 +1953,7 @@ more info in the local-header version than in the central-header) + the return value is the number of bytes copied in buf, or (if <0) + the error code + */ +-extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) ++MINIZIP_EXTERN int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) + { + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; +@@ -2001,7 +2001,7 @@ extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good + */ +-extern int ZEXPORT unzCloseCurrentFile (unzFile file) ++MINIZIP_EXTERN int ZEXPORT unzCloseCurrentFile (unzFile file) + { + int err=UNZ_OK; + +@@ -2048,7 +2048,7 @@ extern int ZEXPORT unzCloseCurrentFile (unzFile file) + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 + */ +-extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) ++MINIZIP_EXTERN int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) + { + unz64_s* s; + uLong uReadThis ; +@@ -2076,7 +2076,7 @@ extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uS + } + + /* Additions by RX '2004 */ +-extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) ++MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) + { + unz64_s* s; + +@@ -2091,7 +2091,7 @@ extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) + return s->pos_in_central_dir; + } + +-extern uLong ZEXPORT unzGetOffset (unzFile file) ++MINIZIP_EXTERN uLong ZEXPORT unzGetOffset (unzFile file) + { + ZPOS64_T offset64; + +@@ -2101,7 +2101,7 @@ extern uLong ZEXPORT unzGetOffset (unzFile file) + return (uLong)offset64; + } + +-extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) ++MINIZIP_EXTERN int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) + { + unz64_s* s; + int err; +@@ -2119,7 +2119,7 @@ extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) + return err; + } + +-extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) ++MINIZIP_EXTERN int ZEXPORT unzSetOffset (unzFile file, uLong pos) + { + return unzSetOffset64(file,pos); + } +diff --git a/src/contrib/minizip/unzip.h b/contrib/minizip/unzip.h +index 2104e39..35bb602 100644 +--- a/src/contrib/minizip/unzip.h ++++ b/contrib/minizip/unzip.h +@@ -61,6 +61,8 @@ extern "C" { + + #define Z_BZIP2ED 12 + ++#include "minizip_extern.h" ++ + #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) + /* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +@@ -150,7 +152,7 @@ typedef struct unz_file_info_s + tm_unz tmu_date; + } unz_file_info; + +-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, ++MINIZIP_EXTERN int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); + /* +@@ -163,8 +165,8 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + */ + + +-extern unzFile ZEXPORT unzOpen OF((const char *path)); +-extern unzFile ZEXPORT unzOpen64 OF((const void *path)); ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen OF((const char *path)); ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen64 OF((const void *path)); + /* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer +@@ -181,31 +183,31 @@ extern unzFile ZEXPORT unzOpen64 OF((const void *path)); + */ + + +-extern unzFile ZEXPORT unzOpen2 OF((const char *path, ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); + /* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) + */ + +-extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, ++MINIZIP_EXTERN unzFile ZEXPORT unzOpen2_64 OF((const void *path, + zlib_filefunc64_def* pzlib_filefunc_def)); + /* + Open a Zip file, like unz64Open, but provide a set of file low level API + for read/write the zip file (see ioapi.h) + */ + +-extern int ZEXPORT unzClose OF((unzFile file)); ++MINIZIP_EXTERN int ZEXPORT unzClose OF((unzFile file)); + /* + Close a ZipFile opened with unzOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzCloseCurrentFile before call unzClose. + return UNZ_OK if there is no problem. */ + +-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); + +-extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, + unz_global_info64 *pglobal_info)); + /* + Write info about the ZipFile in the *pglobal_info structure. +@@ -213,7 +215,7 @@ extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, + return UNZ_OK if there is no problem. */ + + +-extern int ZEXPORT unzGetGlobalComment OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); + /* +@@ -226,20 +228,20 @@ extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + /***************************************************************************/ + /* Unzip package allow you browse the directory of the zipfile */ + +-extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); ++MINIZIP_EXTERN int ZEXPORT unzGoToFirstFile OF((unzFile file)); + /* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem + */ + +-extern int ZEXPORT unzGoToNextFile OF((unzFile file)); ++MINIZIP_EXTERN int ZEXPORT unzGoToNextFile OF((unzFile file)); + /* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. + */ + +-extern int ZEXPORT unzLocateFile OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); + /* +@@ -261,11 +263,11 @@ typedef struct unz_file_pos_s + uLong num_of_file; /* # of file */ + } unz_file_pos; + +-extern int ZEXPORT unzGetFilePos( ++MINIZIP_EXTERN int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +-extern int ZEXPORT unzGoToFilePos( ++MINIZIP_EXTERN int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +@@ -275,17 +277,17 @@ typedef struct unz64_file_pos_s + ZPOS64_T num_of_file; /* # of file */ + } unz64_file_pos; + +-extern int ZEXPORT unzGetFilePos64( ++MINIZIP_EXTERN int ZEXPORT unzGetFilePos64( + unzFile file, + unz64_file_pos* file_pos); + +-extern int ZEXPORT unzGoToFilePos64( ++MINIZIP_EXTERN int ZEXPORT unzGoToFilePos64( + unzFile file, + const unz64_file_pos* file_pos); + + /* ****************************************** */ + +-extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize, +@@ -294,7 +296,7 @@ extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, + char *szComment, + uLong commentBufferSize)); + +-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, +@@ -318,7 +320,7 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + + /** Addition for GDAL : START */ + +-extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); ++MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); + + /** Addition for GDAL : END */ + +@@ -328,13 +330,13 @@ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); + from it, and close it (you can close it before reading all the file) + */ + +-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile OF((unzFile file)); + /* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. + */ + +-extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); + /* + Open for reading data the current file in the zipfile. +@@ -342,7 +344,7 @@ extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + If there is no error, the return value is UNZ_OK. + */ + +-extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +@@ -355,7 +357,7 @@ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + but you CANNOT set method parameter as NULL + */ + +-extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, +@@ -370,13 +372,13 @@ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + */ + + +-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); ++MINIZIP_EXTERN int ZEXPORT unzCloseCurrentFile OF((unzFile file)); + /* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good + */ + +-extern int ZEXPORT unzReadCurrentFile OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); + /* +@@ -390,19 +392,19 @@ extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + (UNZ_ERRNO for IO error, or zLib error for uncompress error) + */ + +-extern z_off_t ZEXPORT unztell OF((unzFile file)); ++MINIZIP_EXTERN z_off_t ZEXPORT unztell OF((unzFile file)); + +-extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); ++MINIZIP_EXTERN ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); + /* + Give the current position in uncompressed data + */ + +-extern int ZEXPORT unzeof OF((unzFile file)); ++MINIZIP_EXTERN int ZEXPORT unzeof OF((unzFile file)); + /* + return 1 if the end of file was reached, 0 elsewhere + */ + +-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, ++MINIZIP_EXTERN int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); + /* +@@ -421,12 +423,12 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + /***************************************************************************/ + + /* Get the current file offset */ +-extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); +-extern uLong ZEXPORT unzGetOffset (unzFile file); ++MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); ++MINIZIP_EXTERN uLong ZEXPORT unzGetOffset (unzFile file); + + /* Set the current file offset */ +-extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); +-extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); ++MINIZIP_EXTERN int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); ++MINIZIP_EXTERN int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +diff --git a/src/contrib/minizip/zip.c b/contrib/minizip/zip.c +index 44e88a9..2acd02c 100644 +--- a/src/contrib/minizip/zip.c ++++ b/contrib/minizip/zip.c +@@ -846,7 +846,7 @@ int LoadCentralDirectoryRecord(zip64_internal* pziinit) + + + /************************************************************/ +-extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) + { + zip64_internal ziinit; + zip64_internal* zi; +@@ -917,7 +917,7 @@ extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* gl + } + } + +-extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) + { + if (pzlib_filefunc32_def != NULL) + { +@@ -929,7 +929,7 @@ extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* gl + return zipOpen3(pathname, append, globalcomment, NULL); + } + +-extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) + { + if (pzlib_filefunc_def != NULL) + { +@@ -945,12 +945,12 @@ extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* + + + +-extern zipFile ZEXPORT zipOpen (const char* pathname, int append) ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen (const char* pathname, int append) + { + return zipOpen3((const void*)pathname,append,NULL,NULL); + } + +-extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append) ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen64 (const void* pathname, int append) + { + return zipOpen3(pathname,append,NULL,NULL); + } +@@ -1052,7 +1052,7 @@ int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_ex + It is not done here because then we need to realloc a new buffer since parameters are 'const' and I want to minimize + unnecessary allocations. + */ +-extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, +@@ -1262,7 +1262,7 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, + return err; + } + +-extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, +@@ -1278,7 +1278,7 @@ extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, con + password, crcForCrypting, versionMadeBy, flagBase, 0); + } + +-extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, +@@ -1293,7 +1293,7 @@ extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, con + password, crcForCrypting, VERSIONMADEBY, 0, 0); + } + +-extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, +@@ -1308,7 +1308,7 @@ extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, c + password, crcForCrypting, VERSIONMADEBY, 0, zip64); + } + +-extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw) +@@ -1321,7 +1321,7 @@ extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, cons + NULL, 0, VERSIONMADEBY, 0, 0); + } + +-extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void* extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int raw, int zip64) +@@ -1334,7 +1334,7 @@ extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, c + NULL, 0, VERSIONMADEBY, 0, zip64); + } + +-extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level, int zip64) +@@ -1347,7 +1347,7 @@ extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, co + NULL, 0, VERSIONMADEBY, 0, zip64); + } + +-extern int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, + const void* extrafield_local, uInt size_extrafield_local, + const void*extrafield_global, uInt size_extrafield_global, + const char* comment, int method, int level) +@@ -1399,7 +1399,7 @@ local int zip64FlushWriteBuffer(zip64_internal* zi) + return err; + } + +-extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) ++MINIZIP_EXTERN int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) + { + zip64_internal* zi; + int err=ZIP_OK; +@@ -1506,12 +1506,12 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in + return err; + } + +-extern int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) ++MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) + { + return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32); + } + +-extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) ++MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) + { + zip64_internal* zi; + ZPOS64_T compressed_size; +@@ -1747,7 +1747,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s + return err; + } + +-extern int ZEXPORT zipCloseFileInZip (zipFile file) ++MINIZIP_EXTERN int ZEXPORT zipCloseFileInZip (zipFile file) + { + return zipCloseFileInZipRaw (file,0,0); + } +@@ -1879,7 +1879,7 @@ int Write_GlobalComment(zip64_internal* zi, const char* global_comment) + return err; + } + +-extern int ZEXPORT zipClose (zipFile file, const char* global_comment) ++MINIZIP_EXTERN int ZEXPORT zipClose (zipFile file, const char* global_comment) + { + zip64_internal* zi; + int err = 0; +@@ -1948,7 +1948,7 @@ extern int ZEXPORT zipClose (zipFile file, const char* global_comment) + return err; + } + +-extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) ++MINIZIP_EXTERN int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) + { + char* p = pData; + int size = 0; +diff --git a/src/contrib/minizip/zip.h b/contrib/minizip/zip.h +index 8aaebb6..f6821f4 100644 +--- a/src/contrib/minizip/zip.h ++++ b/contrib/minizip/zip.h +@@ -60,6 +60,8 @@ extern "C" { + + #define Z_BZIP2ED 12 + ++#include "minizip_extern.h" ++ + #if defined(STRICTZIP) || defined(STRICTZIPUNZIP) + /* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +@@ -113,8 +115,8 @@ typedef const char* zipcharpc; + #define APPEND_STATUS_CREATEAFTER (1) + #define APPEND_STATUS_ADDINZIP (2) + +-extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); +-extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); + /* + Create a zipfile. + pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on +@@ -134,17 +136,17 @@ extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); + Of couse, you can use RAW reading and writing to copy the file you did not want delte + */ + +-extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen2 OF((const char *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc_def* pzlib_filefunc_def)); + +-extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, ++MINIZIP_EXTERN zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, + int append, + zipcharpc* globalcomment, + zlib_filefunc64_def* pzlib_filefunc_def)); + +-extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -155,7 +157,7 @@ extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, + int method, + int level)); + +-extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -184,7 +186,7 @@ extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, + */ + + +-extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -197,7 +199,7 @@ extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, + int raw)); + + +-extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -213,7 +215,7 @@ extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, + Same than zipOpenNewFileInZip, except if raw=1, we write raw file + */ + +-extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -230,7 +232,7 @@ extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, + const char* password, + uLong crcForCrypting)); + +-extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -256,7 +258,7 @@ extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, + crcForCrypting : crc of file to compress (needed for crypting) + */ + +-extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -277,7 +279,7 @@ extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, + )); + + +-extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, + const char* filename, + const zip_fileinfo* zipfi, + const void* extrafield_local, +@@ -304,23 +306,23 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, + */ + + +-extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipWriteInFileInZip OF((zipFile file, + const void* buf, + unsigned len)); + /* + Write data in the zipfile + */ + +-extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); ++MINIZIP_EXTERN int ZEXPORT zipCloseFileInZip OF((zipFile file)); + /* + Close the current file in the zipfile + */ + +-extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, + uLong uncompressed_size, + uLong crc32)); + +-extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, + ZPOS64_T uncompressed_size, + uLong crc32)); + +@@ -330,14 +332,14 @@ extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, + uncompressed_size and crc32 are value for the uncompressed size + */ + +-extern int ZEXPORT zipClose OF((zipFile file, ++MINIZIP_EXTERN int ZEXPORT zipClose OF((zipFile file, + const char* global_comment)); + /* + Close the zipfile + */ + + +-extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); ++MINIZIP_EXTERN int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); + /* + zipRemoveExtraInfoBlock - Added by Mathias Svensson + diff --git a/recipes/minizip/1.2.11/test_package/CMakeLists.txt b/recipes/minizip/1.2.11/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..09de6a3c30cba --- /dev/null +++ b/recipes/minizip/1.2.11/test_package/CMakeLists.txt @@ -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}) diff --git a/recipes/minizip/1.2.11/test_package/conanfile.py b/recipes/minizip/1.2.11/test_package/conanfile.py new file mode 100644 index 0000000000000..4d75291c652bc --- /dev/null +++ b/recipes/minizip/1.2.11/test_package/conanfile.py @@ -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) + diff --git a/recipes/minizip/1.2.11/test_package/test_package.c b/recipes/minizip/1.2.11/test_package/test_package.c new file mode 100644 index 0000000000000..3f3ecff720ccd --- /dev/null +++ b/recipes/minizip/1.2.11/test_package/test_package.c @@ -0,0 +1,258 @@ +#include +#include +#include + +#include +#include +#ifdef _WIN32 + #include +#endif + +#include +#include + +const char text[] = "" +"Conveying or northward offending admitting perfectly my. Colonel gravity get thought fat smiling add but. Wonder twenty hunted and put income set desire expect. Am cottage calling my is mistake cousins talking up. Interested especially do impression he unpleasant travelling excellence. All few our knew time done draw ask.\n" +"\n" +"Village did removed enjoyed explain nor ham saw calling talking. Securing as informed declared or margaret. Joy horrible moreover man feelings own shy. Request norland neither mistake for yet. Between the for morning assured country believe. On even feet time have an no at. Relation so in confined smallest children unpacked delicate. Why sir end believe uncivil respect. Always get adieus nature day course for common. My little garret repair to desire he esteem.\n" +"" +"As it so contrasted oh estimating instrument. Size like body some one had. Are conduct viewing boy minutes warrant expense. Tolerably behaviour may admitting daughters offending her ask own. Praise effect wishes change way and any wanted. Lively use looked latter regard had. Do he it part more last in. Merits ye if mr narrow points. Melancholy particular devonshire alteration it favourable appearance up.\n" +"" +"Extremity direction existence as dashwoods do up. Securing marianne led welcomed offended but offering six raptures. Conveying concluded newspaper rapturous oh at. Two indeed suffer saw beyond far former mrs remain. Occasional continuing possession we insensible an sentiments as is. Law but reasonably motionless principles she. Has six worse downs far blush rooms above stood.\n" +"" +"Comfort reached gay perhaps chamber his six detract besides add. Moonlight newspaper up he it enjoyment agreeable depending. Timed voice share led his widen noisy young. On weddings believed laughing although material do exercise of. Up attempt offered ye civilly so sitting to. She new course get living within elinor joy. She her rapturous suffering concealed.\n" +"" +"Neat own nor she said see walk. And charm add green you these. Sang busy in this drew ye fine. At greater prepare musical so attacks as on distant. Improving age our her cordially intention. His devonshire sufficient precaution say preference middletons insipidity. Since might water hence the her worse. Concluded it offending dejection do earnestly as me direction. Nature played thirty all him.\n" +"" +"Mr do raising article general norland my hastily. Its companions say uncommonly pianoforte favourable. Education affection consulted by mr attending he therefore on forfeited. High way more far feet kind evil play led. Sometimes furnished collected add for resources attention. Norland an by minuter enquire it general on towards forming. Adapted mrs totally company two yet conduct men.\n" +"" +"An sincerity so extremity he additions. Her yet there truth merit. Mrs all projecting favourable now unpleasing. Son law garden chatty temper. Oh children provided to mr elegance marriage strongly. Off can admiration prosperous now devonshire diminution law.\n" +"" +"He share of first to worse. Weddings and any opinions suitable smallest nay. My he houses or months settle remove ladies appear. Engrossed suffering supposing he recommend do eagerness. Commanded no of depending extremity recommend attention tolerably. Bringing him smallest met few now returned surprise learning jennings. Objection delivered eagerness he exquisite at do in. Warmly up he nearer mr merely me.\n" +"" +"Yet remarkably appearance get him his projection. Diverted endeavor bed peculiar men the not desirous. Acuteness abilities ask can offending furnished fulfilled sex. Warrant fifteen exposed ye at mistake. Blush since so in noisy still built up an again. As young ye hopes no he place means. Partiality diminution gay yet entreaties admiration. In mr it he mention perhaps attempt pointed suppose. Unknown ye chamber of warrant of norland arrived.\n" +""; + +const char* zip_fname = "test_minizip.zip"; + +int print_zip_info(unzFile); +void Display64BitsSize(ZPOS64_T, int); + +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); + + /* unZip */ + printf("---------- Test unZIP ----------\n"); + + unzFile unzf = unzOpen64(zip_fname); + if (unzf == NULL) { + printf("Error in unzOpen64, fname: %s\n", zip_fname); + exit(EXIT_FAILURE); + } + + res = print_zip_info(unzf); + if (res != UNZ_OK) { + printf("Read ZIP info error, code: %d\n", res); + exit(EXIT_FAILURE); + } + + res = unzGoToFirstFile(unzf); + if (res != UNZ_OK) { + printf("Error in unzGoToFirstFile, code: %d\n", res); + exit(EXIT_FAILURE); + } + + unz_file_info64 unz_fi = {0}; + res = unzGetCurrentFileInfo64(unzf, &unz_fi, NULL, 0, NULL, 0, NULL, 0); + if (res != UNZ_OK) { + printf("Error in unzGetCurrentFileInfo64, code: %d\n", res); + exit(EXIT_FAILURE); + } + + /* Compare size */ + if (unz_fi.uncompressed_size != (ZPOS64_T) sizeof(text)) { + printf("Error in Zip, failed compare size. In Zip => %llu, source size => %llu\n", unz_fi.uncompressed_size, (ZPOS64_T) sizeof(text)); + exit(EXIT_FAILURE); + } + + res = unzOpenCurrentFile(unzf); + if (res != UNZ_OK) { + printf("Error in unzOpenCurrentFile, code: %d\n", res); + exit(EXIT_FAILURE); + } + + char* read_data = calloc(1, sizeof(text)); + if (read_data == NULL) { + printf("Can`t allocate read buffer\n"); + exit(EXIT_FAILURE); + } + + res = unzReadCurrentFile(unzf, read_data, sizeof(text)); + if (res < 0) { + printf("Error in unzReadCurrentFile, code: %d\n", res); + exit(EXIT_FAILURE); + } + + if (memcmp(text, read_data, sizeof(text)) != 0) { + printf("Error in zip, source and uncompressed data not equal.\n"); + exit(EXIT_FAILURE); + } + + res = unzClose(unzf); + if (res != UNZ_OK) { + printf("Error in unzClose, code: %d\n", res); + exit(EXIT_FAILURE); + } + + printf("Zip / Unzip OK\n"); + free(read_data); + return EXIT_SUCCESS; +} + +int print_zip_info(unzFile unzf) { + char comment[256] = {0}; + int res; + res = unzGetGlobalComment(unzf, comment, sizeof(comment)); + if (res < 0) { + printf("Error in unzGetGlobalComment, code: %d\n", res); + return res; + } + printf("unZIP. Global comment => %s\n", comment); + + res = unzGoToFirstFile(unzf); + if (res != UNZ_OK) { + printf("Error in unzGoToFirstFile, code: %d\n", res); + return res; + } + + unz_global_info64 gi = {0}; + res = unzGetGlobalInfo64(unzf, &gi); + if (res != UNZ_OK) { + printf("Error in unzGetGlobalInfo64, code: %d\n", res); + return res; + } + printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); + printf(" ------ ------ ---- ----- ---- ---- ------ ----\n"); + + for (uLong i = 0; i < gi.number_entry; i++) { + unz_file_info64 file_info = {0}; + char fname_inzip[256] = {0}; + res = unzGetCurrentFileInfo64(unzf, &file_info, fname_inzip, sizeof(fname_inzip), NULL, 0, NULL, 0); + if (res != UNZ_OK) { + printf("Error in unzGetCurrentFileInfo64, code: %d\n", res); + return res; + } + + uLong ratio = 0; + if (file_info.uncompressed_size>0) { + ratio = (uLong) ((file_info.compressed_size*100) / file_info.uncompressed_size); + } + + char crypt = ' '; + if ((file_info.flag & 1) != 0) { + char crypt = '*'; + } + + const char* str_method = NULL; + if (file_info.compression_method==0) { + str_method = "Stored"; + } else if (file_info.compression_method == Z_DEFLATED) { + uInt iLevel=(uInt) ((file_info.flag & 0x6) / 2); + if (iLevel == 0) { + str_method = "Defl:N"; + } else if (iLevel == 1) { + str_method = "Defl:X"; + } else if ((iLevel == 2) || (iLevel == 3)) { + str_method="Defl:F"; /* 2:fast , 3 : extra fast*/ + } + } else if (file_info.compression_method==Z_BZIP2ED) { + str_method="BZip2 "; + } else { + str_method="Unkn. "; + } + + Display64BitsSize(file_info.uncompressed_size, 7); + printf(" %6s%c", str_method, crypt); + Display64BitsSize(file_info.compressed_size, 7); + printf(" %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n", + ratio, + (uLong) file_info.tmu_date.tm_mon + 1, + (uLong) file_info.tmu_date.tm_mday, + (uLong) file_info.tmu_date.tm_year - 1900, + (uLong) file_info.tmu_date.tm_hour, + (uLong) file_info.tmu_date.tm_min, + (uLong) file_info.crc, + fname_inzip + ); + if ((i + 1) < gi.number_entry) { + res = unzGoToNextFile(unzf); + if (res != UNZ_OK) { + printf("Error in unzGoToNextFile, code: %d\n", res); + return res; + } + } + } + + return UNZ_OK; +} + +void Display64BitsSize(ZPOS64_T n, int size_char) { + /* to avoid compatibility problem , we do here the conversion */ + char number[21] = {0}; + int offset = 19; + int pos_string = 19; + number[20] = 0; + + for (;;) { + number[offset] = (char) ((n % 10) + '0'); + if (number[offset] != '0') { + pos_string = offset; + } + n /= 10; + if (offset == 0) { + break; + } + offset--; + } + + int size_display_string = 19 - pos_string; + while (size_char > size_display_string) { + size_char--; + printf(" "); + } + + printf("%s", &number[pos_string]); +} + From 48f47c8756e57b825801a9d4f4f26dcab93dc676 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 9 Dec 2019 17:22:04 -0300 Subject: [PATCH 04/41] Fiz minizip shared opt on Windows Signed-off-by: Uilian Ries --- recipes/minizip/1.2.11/CMakeLists.txt | 4 ++-- recipes/minizip/1.2.11/CMakeLists_minizip.txt | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/recipes/minizip/1.2.11/CMakeLists.txt b/recipes/minizip/1.2.11/CMakeLists.txt index 9ca0774a41f3a..70dcc8fa1b5d7 100644 --- a/recipes/minizip/1.2.11/CMakeLists.txt +++ b/recipes/minizip/1.2.11/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8) -project(conanzlib) +project(cmakeconanwrapper) -message(STATUS "Conan CMake Wrapper") +set(CMAKE_VERBOSE_MAKEFILE ON) include(conanbuildinfo.cmake) conan_basic_setup() diff --git a/recipes/minizip/1.2.11/CMakeLists_minizip.txt b/recipes/minizip/1.2.11/CMakeLists_minizip.txt index d43dbdc3f8b6b..97c295794584f 100644 --- a/recipes/minizip/1.2.11/CMakeLists_minizip.txt +++ b/recipes/minizip/1.2.11/CMakeLists_minizip.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.8) -#project(minizip) +project(minizip) -include(../../../conanbuildinfo.cmake) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() set(SOURCES ioapi.c mztools.c unzip.c zip.c) @@ -22,11 +22,7 @@ target_include_directories(minizip PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../_build ${CMAKE_CURRENT_SOURCE_DIR}/../../_build/source_subfolder) -find_library(ZLIB_LIBRARY NAMES z zlib zlibd zlibstatic zlibstaticd PATHS - ${CMAKE_CURRENT_SOURCE_DIR}/../../_build - ${CMAKE_CURRENT_SOURCE_DIR}/../../_build/lib) - -target_link_libraries(minizip PRIVATE ${ZLIB_LIBRARY}) +target_link_libraries(minizip PRIVATE ${CONAN_LIBS}) target_compile_definitions(minizip PRIVATE MINIZIP_BUILDING) if(BUILD_SHARED_LIBS) set_target_properties(minizip PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH True) From ae262ef7e4090d175f9b5471db21c58a09434c1b Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 10 Dec 2019 12:44:56 +0100 Subject: [PATCH 05/41] openjpeg: fix pkg_config file name --- recipes/openjpeg/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/openjpeg/all/conanfile.py b/recipes/openjpeg/all/conanfile.py index 981204e5439e7..cde84f9ca0fe5 100644 --- a/recipes/openjpeg/all/conanfile.py +++ b/recipes/openjpeg/all/conanfile.py @@ -109,3 +109,4 @@ def package_info(self): if self.settings.os == "Linux": self.cpp_info.libs.append("pthread") self.cpp_info.name = 'OpenJPEG' + self.cpp_info.names['pkg_config'] = 'libopenjp2' From bda0870f319c68f1ee1db9e455a6f186bbf82fa9 Mon Sep 17 00:00:00 2001 From: Alexandr Timofeev Date: Mon, 16 Dec 2019 23:00:23 +0300 Subject: [PATCH 06/41] Fix builddirs on Windows to pass the check --- recipes/catch2/2.x.x/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py index d96043d593306..21a28de1bb774 100644 --- a/recipes/catch2/2.x.x/conanfile.py +++ b/recipes/catch2/2.x.x/conanfile.py @@ -50,4 +50,6 @@ def package_id(self): self.info.header_only() def package_info(self): - self.cpp_info.builddirs = [os.path.join("lib", "cmake", "Catch2")] + self.cpp_info.builddirs = [ + os.path.join("lib", "cmake", "Catch2").replace("\\", "/") + ] From c55050bc4b81204d8799c494fdcba075b87ad7fb Mon Sep 17 00:00:00 2001 From: Alexandr Timofeev Date: Mon, 16 Dec 2019 23:00:39 +0300 Subject: [PATCH 07/41] Add catch2/2.11.0 --- recipes/catch2/2.x.x/conandata.yml | 3 +++ recipes/catch2/config.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/recipes/catch2/2.x.x/conandata.yml b/recipes/catch2/2.x.x/conandata.yml index a5b9f89c040f7..da6196f593d58 100644 --- a/recipes/catch2/2.x.x/conandata.yml +++ b/recipes/catch2/2.x.x/conandata.yml @@ -2,3 +2,6 @@ sources: 2.9.2: url: https://github.com/catchorg/Catch2/archive/v2.9.2.tar.gz sha256: 54BEA6D80A388A80F895CD0E2343FCA72B0D9093A776AF40904AEFCE49C13BDA + 2.11.0: + url: https://github.com/catchorg/Catch2/archive/v2.11.0.tar.gz + sha256: b9957af46a04327d80833960ae51cf5e67765fd264389bd1e275294907f1a3e0 diff --git a/recipes/catch2/config.yml b/recipes/catch2/config.yml index e0983c98b3e02..94adeb55e56b9 100644 --- a/recipes/catch2/config.yml +++ b/recipes/catch2/config.yml @@ -1,3 +1,5 @@ versions: 2.9.2: folder: 2.x.x + 2.11.0: + folder: 2.x.x From 1f932416911fdae0912e7429db2e5314f6dc2526 Mon Sep 17 00:00:00 2001 From: Alexandr Timofeev Date: Tue, 17 Dec 2019 00:04:48 +0300 Subject: [PATCH 08/41] Revert "Fix builddirs on Windows to pass the check" This reverts commit bda0870f319c68f1ee1db9e455a6f186bbf82fa9. --- recipes/catch2/2.x.x/conanfile.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/recipes/catch2/2.x.x/conanfile.py b/recipes/catch2/2.x.x/conanfile.py index 21a28de1bb774..d96043d593306 100644 --- a/recipes/catch2/2.x.x/conanfile.py +++ b/recipes/catch2/2.x.x/conanfile.py @@ -50,6 +50,4 @@ def package_id(self): self.info.header_only() def package_info(self): - self.cpp_info.builddirs = [ - os.path.join("lib", "cmake", "Catch2").replace("\\", "/") - ] + self.cpp_info.builddirs = [os.path.join("lib", "cmake", "Catch2")] From 10d7b3801376944f9400c2b5c32d06bad49d4ff1 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 19 Dec 2019 14:53:38 +0100 Subject: [PATCH 09/41] fix mingw compilation msys2 build requirement was missing --- recipes/libjpeg/all/conanfile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipes/libjpeg/all/conanfile.py b/recipes/libjpeg/all/conanfile.py index 62c1a80e8586f..bb20b88a7b0d3 100644 --- a/recipes/libjpeg/all/conanfile.py +++ b/recipes/libjpeg/all/conanfile.py @@ -28,6 +28,11 @@ def configure(self): if self.settings.compiler == 'Visual Studio' and self.options.shared: raise ConanInvalidConfiguration("shared builds aren't supported for MSVC") + def build_requirements(self): + if tools.os_info.is_windows and self.settings.compiler != "Visual Studio": + if "CONAN_BASH_PATH" not in os.environ: + self.build_requires("msys2/20190524") + def source(self): tools.get(**self.conan_data["sources"][self.version]) os.rename("jpeg-" + self.version, self.source_subfolder) From 4acbfdeb4b601e4db147b323a4067a319bb01270 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 19 Dec 2019 16:05:41 +0100 Subject: [PATCH 10/41] fix mingw compilation msys2 build requirement was missing --- recipes/libpq/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py index 45fd2673d3c97..0134fef3f2bc9 100644 --- a/recipes/libpq/all/conanfile.py +++ b/recipes/libpq/all/conanfile.py @@ -24,6 +24,9 @@ class LibpqConan(ConanFile): def build_requirements(self): if self.settings.compiler == "Visual Studio": self.build_requires("strawberryperl/5.30.0.1") + elif tools.os_info.is_windows: + if "CONAN_BASH_PATH" not in os.environ: + self.build_requires("msys2/20190524") @property def _source_subfolder(self): return "source_subfolder" From fab339c9bf76a28d23549bb7becad81101ae3af4 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 19 Dec 2019 16:16:24 +0100 Subject: [PATCH 11/41] remove author --- recipes/libpq/all/conanfile.py | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py index 0134fef3f2bc9..1456da9874a0c 100644 --- a/recipes/libpq/all/conanfile.py +++ b/recipes/libpq/all/conanfile.py @@ -9,7 +9,6 @@ class LibpqConan(ConanFile): topics = ("conan", "libpq", "postgresql", "database", "db") url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.postgresql.org/docs/current/static/libpq.html" - author = "Bincrafters " license = "PostgreSQL" settings = "os", "arch", "compiler", "build_type" options = { From d1ac12c302ee9bd383629c4b9ca7eeff46bb66d9 Mon Sep 17 00:00:00 2001 From: David Callu Date: Fri, 20 Dec 2019 10:49:40 +0100 Subject: [PATCH 12/41] fix(zlib): set pkg_config file name to "zlib" and add a test to check it --- recipes/zlib/1.2.11/conanfile.py | 1 + recipes/zlib/1.2.11/test_package/conanfile.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/zlib/1.2.11/conanfile.py b/recipes/zlib/1.2.11/conanfile.py index 82c20746b5299..a929412e25bf6 100644 --- a/recipes/zlib/1.2.11/conanfile.py +++ b/recipes/zlib/1.2.11/conanfile.py @@ -164,4 +164,5 @@ def package_info(self): self.cpp_info.defines.append('MINIZIP_DLL') self.cpp_info.libs.append('zlib' if self.settings.os == "Windows" else "z") self.cpp_info.name = "ZLIB" + self.cpp_info.names["pkg_config"] = "zlib" diff --git a/recipes/zlib/1.2.11/test_package/conanfile.py b/recipes/zlib/1.2.11/test_package/conanfile.py index 1a102ba9d3031..d0706d2d0eefd 100644 --- a/recipes/zlib/1.2.11/test_package/conanfile.py +++ b/recipes/zlib/1.2.11/test_package/conanfile.py @@ -6,7 +6,7 @@ class TestZlibConan(ConanFile): settings = "os", "compiler", "arch", "build_type" - generators = "cmake" + generators = "cmake", "pkg_config" def configure(self): del self.settings.compiler.libcxx @@ -19,6 +19,7 @@ def build(self): def test(self): assert os.path.exists(os.path.join(self.deps_cpp_info["zlib"].rootpath, "licenses", "LICENSE")) + assert os.path.exists(os.path.join(self.build_folder, "zlib.pc")) if "x86" in self.settings.arch: self.run(os.path.join("bin", "test"), run_environment=True) if self.options["zlib"].minizip: From 7439a17f4341cec20c29b4090d1f871f356885ff Mon Sep 17 00:00:00 2001 From: David Callu Date: Fri, 20 Dec 2019 11:06:34 +0100 Subject: [PATCH 13/41] fix(bzip2): set pkg_config file name to "bzip2" and add a test to check it --- recipes/bzip2/1.0.8/conanfile.py | 1 + recipes/bzip2/1.0.8/test_package/conanfile.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/bzip2/1.0.8/conanfile.py b/recipes/bzip2/1.0.8/conanfile.py index b9739f55e09d9..43537c2212263 100644 --- a/recipes/bzip2/1.0.8/conanfile.py +++ b/recipes/bzip2/1.0.8/conanfile.py @@ -54,4 +54,5 @@ def package(self): def package_info(self): self.cpp_info.name = "BZip2" + self.cpp_info.names["pkg_config"] = "bzip2" self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/bzip2/1.0.8/test_package/conanfile.py b/recipes/bzip2/1.0.8/test_package/conanfile.py index 1dd85faada77d..b96cf382c806b 100644 --- a/recipes/bzip2/1.0.8/test_package/conanfile.py +++ b/recipes/bzip2/1.0.8/test_package/conanfile.py @@ -4,15 +4,16 @@ class TestPackageConan(ConanFile): settings = "os", "compiler", "arch", "build_type" - generators = "cmake" + generators = "cmake", "pkg_config" def build(self): cmake = CMake(self) cmake.configure() cmake.build() - + def test(self): assert os.path.isfile(os.path.join(self.deps_cpp_info["bzip2"].rootpath, "licenses", "LICENSE")) + assert os.path.isfile(os.path.join(self.build_folder, "bzip2.pc")) if tools.cross_building(self.settings): self.output.warn("Skipping run cross built package") return From 228972ce941e28fddbfbf83b3fadb90fbf326fa0 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 20 Dec 2019 11:26:14 +0100 Subject: [PATCH 14/41] don't build_require msys2 if it is already in path --- recipes/libpq/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libpq/all/conanfile.py b/recipes/libpq/all/conanfile.py index 1456da9874a0c..fe84def04aef8 100644 --- a/recipes/libpq/all/conanfile.py +++ b/recipes/libpq/all/conanfile.py @@ -1,5 +1,6 @@ from conans import ConanFile, AutoToolsBuildEnvironment, tools from conans.errors import ConanInvalidConfiguration +from conans.tools import os_info import os @@ -24,7 +25,7 @@ def build_requirements(self): if self.settings.compiler == "Visual Studio": self.build_requires("strawberryperl/5.30.0.1") elif tools.os_info.is_windows: - if "CONAN_BASH_PATH" not in os.environ: + if "CONAN_BASH_PATH" not in os.environ and os_info.detect_windows_subsystem() != 'msys2': self.build_requires("msys2/20190524") @property def _source_subfolder(self): From 0dfc8171ae465b09af7fce14587db4ee39c77e96 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Fri, 20 Dec 2019 11:28:13 +0100 Subject: [PATCH 15/41] don't build_require msys2 if it is already in path --- recipes/libjpeg/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libjpeg/all/conanfile.py b/recipes/libjpeg/all/conanfile.py index bb20b88a7b0d3..badbf0debf0ab 100644 --- a/recipes/libjpeg/all/conanfile.py +++ b/recipes/libjpeg/all/conanfile.py @@ -2,6 +2,7 @@ import shutil from conans import ConanFile, AutoToolsBuildEnvironment, tools from conans.errors import ConanInvalidConfiguration +from conans.tools import os_info class LibjpegConan(ConanFile): @@ -30,7 +31,7 @@ def configure(self): def build_requirements(self): if tools.os_info.is_windows and self.settings.compiler != "Visual Studio": - if "CONAN_BASH_PATH" not in os.environ: + if "CONAN_BASH_PATH" not in os.environ and os_info.detect_windows_subsystem() != 'msys2': self.build_requires("msys2/20190524") def source(self): From 521146929e722e40c4f8bbe809f602bbe79e2b62 Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Fri, 20 Dec 2019 11:57:56 -0800 Subject: [PATCH 16/41] Add support for tinycbor/0.5.3 --- recipes/tinycbor/all/conandata.yml | 9 +++ recipes/tinycbor/all/conanfile.py | 65 +++++++++++++++++++ recipes/tinycbor/all/patches/conan.patch | 33 ++++++++++ .../tinycbor/all/test_package/CMakeLists.txt | 8 +++ .../tinycbor/all/test_package/conanfile.py | 16 +++++ recipes/tinycbor/all/test_package/example.cpp | 14 ++++ recipes/tinycbor/config.yml | 3 + 7 files changed, 148 insertions(+) create mode 100644 recipes/tinycbor/all/conandata.yml create mode 100644 recipes/tinycbor/all/conanfile.py create mode 100644 recipes/tinycbor/all/patches/conan.patch create mode 100644 recipes/tinycbor/all/test_package/CMakeLists.txt create mode 100644 recipes/tinycbor/all/test_package/conanfile.py create mode 100644 recipes/tinycbor/all/test_package/example.cpp create mode 100644 recipes/tinycbor/config.yml diff --git a/recipes/tinycbor/all/conandata.yml b/recipes/tinycbor/all/conandata.yml new file mode 100644 index 0000000000000..bd867242996ba --- /dev/null +++ b/recipes/tinycbor/all/conandata.yml @@ -0,0 +1,9 @@ +sources: + "0.5.3": + url: "https://github.com/intel/tinycbor/archive/v0.5.3.tar.gz" + sha256: "956eb4b670ea4969eaee67395b5bb6437b153960385b77357d6692e979d1b12d" +patches: + "0.5.3": + - patch_file: "patches/conan.patch" + base_path: "source_subfolder" + diff --git a/recipes/tinycbor/all/conanfile.py b/recipes/tinycbor/all/conanfile.py new file mode 100644 index 0000000000000..ba29cb4104d9b --- /dev/null +++ b/recipes/tinycbor/all/conanfile.py @@ -0,0 +1,65 @@ +import os +from conans import ConanFile, tools, AutoToolsBuildEnvironment + +class tinycborConan(ConanFile): + name = "tinycbor" + license = "MIT" + homepage = "https://github.com/intel/tinycbor" + url = "https://github.com/conan-io/conan-center-index" + description = ("A small CBOR encoder and decoder library, \ + optimized for very fast operation with very small footprint.") + settings = "os", "arch", "compiler", "build_type" + options = {"fPIC": [True, False], "shared": [True, False]} + default_options = {"fPIC": True, "shared": False} + topics = ("conan", "CBOR", "encoder", "decoder") + exports_sources = ["patches/*"] + _source_subfolder = "source_subfolder" + _env_build = None + _env_vars = [] + + def _configure_autotools(self): + if not self._env_build: + self._env_build = AutoToolsBuildEnvironment(self) + self._env_build.fpic = self.options.fPIC + self._env_vars = self._env_build.vars + self._env_vars['DESTDIR'] = self.package_folder + if self.settings.os == "Windows": + self._env_vars["BUILD_SHARED"] = "0" + self._env_vars["BUILD_STATIC"] = "1" + else: + self._env_vars["BUILD_SHARED"] = "1" if self.options.shared else "0" + self._env_vars["BUILD_STATIC"] = "1" if not self.options.shared else "0" + return self._env_build, self._env_vars + + def configure(self): + if self.settings.os == "Windows": + self.options.remove("fPIC") + self.options.remove("shared") # Shared lib only supported on unix systems + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def build(self): + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) + with tools.chdir(self._source_subfolder): + env_build, env_vars = self._configure_autotools() + env_build.make(vars=env_vars) + + def package(self): + with tools.chdir(self._source_subfolder): + env_build, env_vars = self._configure_autotools() + env_build.install(vars=env_vars) + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + tools.rmdir(os.path.join(self.package_folder, "bin")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Linux": + self.cpp_info.system_libs = ["m"] + self.cpp_info.includedirs = ["include", os.path.join("include","tinycbor")] diff --git a/recipes/tinycbor/all/patches/conan.patch b/recipes/tinycbor/all/patches/conan.patch new file mode 100644 index 0000000000000..7ded856e536c5 --- /dev/null +++ b/recipes/tinycbor/all/patches/conan.patch @@ -0,0 +1,33 @@ +--- Makefile 2019-10-22 08:11:21.000000000 -0700 ++++ Makefile_fix 2019-12-20 10:58:06.255975751 -0800 +@@ -1,15 +1,15 @@ + # Variables: +-prefix = /usr/local ++#prefix = /usr/local + exec_prefix = $(prefix) + bindir = $(exec_prefix)/bin + libdir = $(exec_prefix)/lib + includedir = $(prefix)/include + pkgconfigdir = $(libdir)/pkgconfig + +-CFLAGS = -Wall -Wextra +-LDFLAGS_GCSECTIONS = -Wl,--gc-sections ++CFLAGS += -Wall -Wextra ++LDFLAGS_GCSECTIONS += -Wl,--gc-sections + LDFLAGS += $(if $(gc_sections-pass),$(LDFLAGS_GCSECTIONS)) +-LDLIBS = -lm ++LDLIBS += -lm + + GIT_ARCHIVE = git archive --prefix="$(PACKAGE)/" -9 + INSTALL = install +@@ -31,8 +31,8 @@ + # + CBORDUMP_SOURCES = tools/cbordump/cbordump.c + +-BUILD_SHARED = $(shell file -L /bin/sh 2>/dev/null | grep -q ELF && echo 1) +-BUILD_STATIC = 1 ++BUILD_SHARED ?= $(shell file -L /bin/sh 2>/dev/null | grep -q ELF && echo 1) ++BUILD_STATIC ?= 1 + + ifneq ($(BUILD_STATIC),1) + ifneq ($(BUILD_SHARED),1) diff --git a/recipes/tinycbor/all/test_package/CMakeLists.txt b/recipes/tinycbor/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..d4fdee1a8a79c --- /dev/null +++ b/recipes/tinycbor/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(PackageTest CXX) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(example example.cpp) +target_link_libraries(example ${CONAN_LIBS}) diff --git a/recipes/tinycbor/all/test_package/conanfile.py b/recipes/tinycbor/all/test_package/conanfile.py new file mode 100644 index 0000000000000..fcae7e3c40edd --- /dev/null +++ b/recipes/tinycbor/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +import os +from conans import ConanFile, CMake, tools + +class apriltagTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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", "example") + self.run(bin_path, run_environment=True) diff --git a/recipes/tinycbor/all/test_package/example.cpp b/recipes/tinycbor/all/test_package/example.cpp new file mode 100644 index 0000000000000..96665e1d8d7cb --- /dev/null +++ b/recipes/tinycbor/all/test_package/example.cpp @@ -0,0 +1,14 @@ +#include +#include "cbor.h" + +int main(int argc, char *argv[]) +{ + CborParser parser; + CborValue it; + size_t length; + uint8_t *buf; + CborError err = cbor_parser_init(buf, length, 0, &parser, &it); + + printf("Tinycbor test_package ran successfully \n"); + return 0; +} \ No newline at end of file diff --git a/recipes/tinycbor/config.yml b/recipes/tinycbor/config.yml new file mode 100644 index 0000000000000..2a0554e18df80 --- /dev/null +++ b/recipes/tinycbor/config.yml @@ -0,0 +1,3 @@ +versions: + "0.5.3": + folder: all From 3b95b52eb23f20c14fbaf1961840aec29a39a96b Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Fri, 20 Dec 2019 17:04:50 -0300 Subject: [PATCH 17/41] added option disable_gethostuuid --- recipes/sqlite3/all/conanfile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/recipes/sqlite3/all/conanfile.py b/recipes/sqlite3/all/conanfile.py index 8dd7c7c2ad350..3a3da25a400c0 100644 --- a/recipes/sqlite3/all/conanfile.py +++ b/recipes/sqlite3/all/conanfile.py @@ -23,7 +23,8 @@ class ConanSqlite3(ConanFile): "enable_json1": [True, False], "enable_rtree": [True, False], "omit_load_extension": [True, False], - "enable_unlock_notify": [True, False] + "enable_unlock_notify": [True, False], + "disable_gethostuuid": [True, False], } default_options = {"shared": False, "fPIC": True, @@ -36,7 +37,8 @@ class ConanSqlite3(ConanFile): "enable_json1": False, "enable_rtree": True, "omit_load_extension": False, - "enable_unlock_notify": True + "enable_unlock_notify": True, + "disable_gethostuuid": False, } _source_subfolder = "source_subfolder" @@ -80,6 +82,8 @@ def _configure_cmake(self): cmake.definitions["HAVE_POSIX_FALLOCATE"] = False if self.settings.os == "Android": cmake.definitions["HAVE_POSIX_FALLOCATE"] = False + if self.options.disable_gethostuuid: + cmake.definitions["HAVE_GETHOSTUUID"] = False cmake.configure() return cmake From 4226e3b8c9af7fa88f303f0de665e6639f556988 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Fri, 20 Dec 2019 17:40:22 -0300 Subject: [PATCH 18/41] added option enable_target_os_embedded --- recipes/sqlite3/all/CMakeLists.txt | 4 ++++ recipes/sqlite3/all/conanfile.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/recipes/sqlite3/all/CMakeLists.txt b/recipes/sqlite3/all/CMakeLists.txt index c357fb3ebf320..766b321d41a3f 100644 --- a/recipes/sqlite3/all/CMakeLists.txt +++ b/recipes/sqlite3/all/CMakeLists.txt @@ -19,6 +19,7 @@ option(HAVE_LOCALTIME_R "Use the threadsafe localtime_r()") option(HAVE_POSIX_FALLOCATE "Use posix_fallocate()") option(HAVE_STRERROR_R "Use strerror_r()") option(HAVE_USLEEP "Use usleep() system call to implement the xSleep method") +option(TARGET_OS_EMBEDDED "Enable compilation for embedded systems") add_library(${PROJECT_NAME} source_subfolder/sqlite3.c source_subfolder/sqlite3.h @@ -68,6 +69,9 @@ endif() if(HAVE_USLEEP) target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_USLEEP) endif() +if(TARGET_OS_EMBEDDED) + target_compile_definitions(${PROJECT_NAME} PRIVATE TARGET_OS_EMBEDDED) +endif() target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_THREADSAFE=${THREADSAFE}) install(TARGETS ${PROJECT_NAME} diff --git a/recipes/sqlite3/all/conanfile.py b/recipes/sqlite3/all/conanfile.py index 3a3da25a400c0..4714a90f048b6 100644 --- a/recipes/sqlite3/all/conanfile.py +++ b/recipes/sqlite3/all/conanfile.py @@ -24,7 +24,7 @@ class ConanSqlite3(ConanFile): "enable_rtree": [True, False], "omit_load_extension": [True, False], "enable_unlock_notify": [True, False], - "disable_gethostuuid": [True, False], + "enable_target_os_embedded": [True, False], } default_options = {"shared": False, "fPIC": True, @@ -38,7 +38,7 @@ class ConanSqlite3(ConanFile): "enable_rtree": True, "omit_load_extension": False, "enable_unlock_notify": True, - "disable_gethostuuid": False, + "enable_target_os_embedded": False, } _source_subfolder = "source_subfolder" @@ -82,8 +82,8 @@ def _configure_cmake(self): cmake.definitions["HAVE_POSIX_FALLOCATE"] = False if self.settings.os == "Android": cmake.definitions["HAVE_POSIX_FALLOCATE"] = False - if self.options.disable_gethostuuid: - cmake.definitions["HAVE_GETHOSTUUID"] = False + if self.options.enable_target_os_embedded: + cmake.definitions["TARGET_OS_EMBEDDED"] = True cmake.configure() return cmake From 796fcd8b14c82fba6a3ce00bef0545d65e175587 Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Fri, 20 Dec 2019 13:05:44 -0800 Subject: [PATCH 19/41] Fix recipe for windows --- recipes/tinycbor/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/tinycbor/all/conanfile.py b/recipes/tinycbor/all/conanfile.py index ba29cb4104d9b..4f38f97a8026e 100644 --- a/recipes/tinycbor/all/conanfile.py +++ b/recipes/tinycbor/all/conanfile.py @@ -20,7 +20,6 @@ class tinycborConan(ConanFile): def _configure_autotools(self): if not self._env_build: self._env_build = AutoToolsBuildEnvironment(self) - self._env_build.fpic = self.options.fPIC self._env_vars = self._env_build.vars self._env_vars['DESTDIR'] = self.package_folder if self.settings.os == "Windows": @@ -29,6 +28,7 @@ def _configure_autotools(self): else: self._env_vars["BUILD_SHARED"] = "1" if self.options.shared else "0" self._env_vars["BUILD_STATIC"] = "1" if not self.options.shared else "0" + self._env_build.fpic = self.options.fPIC return self._env_build, self._env_vars def configure(self): From d27a47cb109021f7af99ffe6611618a9a5c00c9f Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Dec 2019 18:08:01 -0300 Subject: [PATCH 20/41] Build minizip on Windows Signed-off-by: Uilian Ries --- recipes/minizip/1.2.11/CMakeLists.txt | 83 +- recipes/minizip/1.2.11/conanfile.py | 27 +- recipes/minizip/1.2.11/minizip.patch | 972 +----------------- .../1.2.11/test_package/test_package.c | 10 +- 4 files changed, 112 insertions(+), 980 deletions(-) diff --git a/recipes/minizip/1.2.11/CMakeLists.txt b/recipes/minizip/1.2.11/CMakeLists.txt index 70dcc8fa1b5d7..dae7c0a388ecc 100644 --- a/recipes/minizip/1.2.11/CMakeLists.txt +++ b/recipes/minizip/1.2.11/CMakeLists.txt @@ -1,9 +1,80 @@ -cmake_minimum_required(VERSION 2.8) -project(cmakeconanwrapper) +cmake_minimum_required(VERSION 3.8) +project(minizip C) -set(CMAKE_VERBOSE_MAKEFILE ON) -include(conanbuildinfo.cmake) +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() -include_directories(${CMAKE_SOURCE_DIR}/source_subfolder) -add_subdirectory("source_subfolder") +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) diff --git a/recipes/minizip/1.2.11/conanfile.py b/recipes/minizip/1.2.11/conanfile.py index baa0e206b6a3c..f2c6328cb607a 100644 --- a/recipes/minizip/1.2.11/conanfile.py +++ b/recipes/minizip/1.2.11/conanfile.py @@ -1,6 +1,6 @@ import os +import shutil from conans import ConanFile, tools, CMake -from conans.errors import ConanException class MinizipConan(ConanFile): @@ -12,20 +12,15 @@ class MinizipConan(ConanFile): 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]} - default_options = {"shared": False, "fPIC": True} - exports_sources = ["CMakeLists.txt", "CMakeLists_minizip.txt", "minizip.patch"] - requires = ("zlib/1.2.11") - generators = "cmake" + 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" - @property - def _minizip_folder(self): - return os.path.join(self._source_subfolder, 'contrib', 'minizip') - def config_options(self): if self.settings.os == "Windows": del self.options.fPIC @@ -34,18 +29,25 @@ 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.configure(source_folder=self._minizip_folder) + 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) - os.rename("CMakeLists_minizip.txt", os.path.join(self._minizip_folder, 'CMakeLists.txt')) + shutil.move("CMakeLists.txt", os.path.join(self._source_subfolder, 'CMakeLists.txt')) cmake = self._configure_cmake() cmake.build() @@ -63,6 +65,7 @@ def package(self): def package_info(self): self.cpp_info.libs = ["minizip"] + self.cpp_info.includedirs = ["include", os.path.join("include", "minizip")] if self.options.shared and self.settings.os == "Windows": self.cpp_info.defines.append('MINIZIP_DLL') diff --git a/recipes/minizip/1.2.11/minizip.patch b/recipes/minizip/1.2.11/minizip.patch index 582818b31ca6d..51ec03ade115b 100644 --- a/recipes/minizip/1.2.11/minizip.patch +++ b/recipes/minizip/1.2.11/minizip.patch @@ -1,958 +1,16 @@ -diff --git a/src/contrib/minizip/minizip1.rc b_/contrib/minizip/minizip1.rc -new file mode 100644 -index 0000000..1c07357 ---- /dev/null -+++ b/contrib/minizip/minizip1.rc -@@ -0,0 +1,39 @@ -+#include -+ -+#ifdef GCC_WINDRES -+VS_VERSION_INFO VERSIONINFO -+#else -+VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE -+#endif -+ FILEVERSION 1,1,0,0 -+ PRODUCTVERSION 1,1,0,0 -+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -+#ifdef _DEBUG -+ FILEFLAGS 1 -+#else -+ FILEFLAGS 0 -+#endif -+ FILEOS VOS__WINDOWS32 -+ FILETYPE VFT_DLL -+ FILESUBTYPE 0 // not used -+BEGIN -+ BLOCK "StringFileInfo" -+ BEGIN -+ BLOCK "040904E4" -+ //language ID = U.S. English, char set = Windows, Multilingual -+ BEGIN -+ VALUE "FileDescription", "MiniZip - Zip and UnZip additionnal library for zlib\0" -+ VALUE "FileVersion", "1.1.0\0" -+ VALUE "InternalName", "minizip1.dll\0" -+ VALUE "LegalCopyright", "(C) 1998-2010 Gilles Vollant & Mathias Svensson\0" -+ VALUE "OriginalFilename", "minizip1.dll\0" -+ VALUE "ProductName", "minizip\0" -+ VALUE "ProductVersion", "1.1.0\0" -+ VALUE "Comments", "For more information visit http://www.winimage.com/zLibDll/minizip.html/\0" -+ END -+ END -+ BLOCK "VarFileInfo" -+ BEGIN -+ VALUE "Translation", 0x0409, 1252 -+ END -+END -diff --git a/src/contrib/minizip/minizip_extern.h b_/contrib/minizip/minizip_extern.h -new file mode 100644 -index 0000000..9202d7f ---- /dev/null -+++ b/contrib/minizip/minizip_extern.h -@@ -0,0 +1,21 @@ -+/* -+MiniZip DLL import/export -+Dmitriy Vetutnev, ODANT 2017 -+*/ -+ -+#ifndef MINIZIP_EXTERN_H -+#define MINIZIP_EXTERN_H -+ -+#if defined(_WIN32) && defined(MINIZIP_DLL) -+ #if defined(MINIZIP_BUILDING) -+ #define MINIZIP_EXTERN __declspec(dllexport) -+ #else -+ #define MINIZIP_EXTERN __declspec(dllimport) -+ #endif -+#endif -+ -+#ifndef MINIZIP_EXTERN -+ #define MINIZIP_EXTERN extern -+#endif -+ -+#endif /* MINIZIP_EXTERN_H */ -diff --git a/src/contrib/minizip/mztools.c b/contrib/minizip/mztools.c -index 96891c2..7d50c9b 100644 ---- a/src/contrib/minizip/mztools.c -+++ b/contrib/minizip/mztools.c -@@ -27,7 +27,7 @@ - WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \ - } while(0) - --extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) -+MINIZIP_EXTERN int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered) - const char* file; - const char* fileOut; - const char* fileOutTmp; -diff --git a/src/contrib/minizip/mztools.h b/contrib/minizip/mztools.h -index a49a426..b76eece 100644 ---- a/src/contrib/minizip/mztools.h -+++ b/contrib/minizip/mztools.h -@@ -22,7 +22,7 @@ extern "C" { - fileOut: output file after recovery - fileOutTmp: temporary file name used for recovery - */ --extern int ZEXPORT unzRepair(const char* file, -+MINIZIP_EXTERN int ZEXPORT unzRepair(const char* file, - const char* fileOut, - const char* fileOutTmp, - uLong* nRecovered, -diff --git a/src/contrib/minizip/unzip.c b/contrib/minizip/unzip.c -index bcfb941..2397db6 100644 ---- a/src/contrib/minizip/unzip.c +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 -@@ -387,7 +387,7 @@ local int strcmpcasenosensitive_internal (const char* fileName1, const char* fil - (like 1 on Unix, 2 on Windows) - - */ --extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, -+MINIZIP_EXTERN int ZEXPORT unzStringFileNameCompare (const char* fileName1, - const char* fileName2, - int iCaseSensitivity) - -@@ -762,7 +762,7 @@ local unzFile unzOpenInternal (const void *path, - } - - --extern unzFile ZEXPORT unzOpen2 (const char *path, -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen2 (const char *path, - zlib_filefunc_def* pzlib_filefunc32_def) - { - if (pzlib_filefunc32_def != NULL) -@@ -775,7 +775,7 @@ extern unzFile ZEXPORT unzOpen2 (const char *path, - return unzOpenInternal(path, NULL, 0); - } - --extern unzFile ZEXPORT unzOpen2_64 (const void *path, -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen2_64 (const void *path, - zlib_filefunc64_def* pzlib_filefunc_def) - { - if (pzlib_filefunc_def != NULL) -@@ -790,12 +790,12 @@ extern unzFile ZEXPORT unzOpen2_64 (const void *path, - return unzOpenInternal(path, NULL, 1); - } - --extern unzFile ZEXPORT unzOpen (const char *path) -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen (const char *path) - { - return unzOpenInternal(path, NULL, 0); - } - --extern unzFile ZEXPORT unzOpen64 (const void *path) -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen64 (const void *path) - { - return unzOpenInternal(path, NULL, 1); - } -@@ -805,7 +805,7 @@ extern unzFile ZEXPORT unzOpen64 (const void *path) - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzCloseCurrentFile before call unzClose. - return UNZ_OK if there is no problem. */ --extern int ZEXPORT unzClose (unzFile file) -+MINIZIP_EXTERN int ZEXPORT unzClose (unzFile file) - { - unz64_s* s; - if (file==NULL) -@@ -825,7 +825,7 @@ extern int ZEXPORT unzClose (unzFile file) - Write info about the ZipFile in the *pglobal_info structure. - No preparation of the structure is needed - return UNZ_OK if there is no problem. */ --extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) -+MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) - { - unz64_s* s; - if (file==NULL) -@@ -835,7 +835,7 @@ extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_ - return UNZ_OK; - } - --extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) -+MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) - { - unz64_s* s; - if (file==NULL) -@@ -1121,7 +1121,7 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file, - No preparation of the structure is needed - return UNZ_OK if there is no problem. - */ --extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, - unz_file_info64 * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, -@@ -1133,7 +1133,7 @@ extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, - szComment,commentBufferSize); - } - --extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo (unzFile file, - unz_file_info * pfile_info, - char * szFileName, uLong fileNameBufferSize, - void *extraField, uLong extraFieldBufferSize, -@@ -1175,7 +1175,7 @@ extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem - */ --extern int ZEXPORT unzGoToFirstFile (unzFile file) -+MINIZIP_EXTERN int ZEXPORT unzGoToFirstFile (unzFile file) - { - int err=UNZ_OK; - unz64_s* s; -@@ -1196,7 +1196,7 @@ extern int ZEXPORT unzGoToFirstFile (unzFile file) - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. - */ --extern int ZEXPORT unzGoToNextFile (unzFile file) -+MINIZIP_EXTERN int ZEXPORT unzGoToNextFile (unzFile file) - { - unz64_s* s; - int err; -@@ -1229,7 +1229,7 @@ extern int ZEXPORT unzGoToNextFile (unzFile file) - UNZ_OK if the file is found. It becomes the current file. - UNZ_END_OF_LIST_OF_FILE if the file is not found - */ --extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) -+MINIZIP_EXTERN int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) - { - unz64_s* s; - int err; -@@ -1305,7 +1305,7 @@ typedef struct unz_file_pos_s - } unz_file_pos; - */ - --extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) -+MINIZIP_EXTERN int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) - { - unz64_s* s; - -@@ -1321,7 +1321,7 @@ extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) - return UNZ_OK; - } - --extern int ZEXPORT unzGetFilePos( -+MINIZIP_EXTERN int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos) - { -@@ -1335,7 +1335,7 @@ extern int ZEXPORT unzGetFilePos( - return err; - } - --extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) -+MINIZIP_EXTERN int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) - { - unz64_s* s; - int err; -@@ -1357,7 +1357,7 @@ extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos - return err; - } - --extern int ZEXPORT unzGoToFilePos( -+MINIZIP_EXTERN int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos) - { -@@ -1469,7 +1469,7 @@ local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVa - Open for reading data the current file in the zipfile. - If there is no error and the file is opened, the return value is UNZ_OK. - */ --extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, - int* level, int raw, const char* password) - { - int err=UNZ_OK; -@@ -1638,24 +1638,24 @@ extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, - return UNZ_OK; - } - --extern int ZEXPORT unzOpenCurrentFile (unzFile file) -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile (unzFile file) - { - return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); - } - --extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) - { - return unzOpenCurrentFile3(file, NULL, NULL, 0, password); - } - --extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) - { - return unzOpenCurrentFile3(file, method, level, raw, NULL); - } - - /** Addition for GDAL : START */ - --extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) -+MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) - { - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; -@@ -1681,7 +1681,7 @@ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) - return <0 with error code if there is an error - (UNZ_ERRNO for IO error, or zLib error for uncompress error) - */ --extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) -+MINIZIP_EXTERN int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) - { - int err=UNZ_OK; - uInt iRead = 0; -@@ -1886,7 +1886,7 @@ extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) - /* - Give the current position in uncompressed data - */ --extern z_off_t ZEXPORT unztell (unzFile file) -+MINIZIP_EXTERN z_off_t ZEXPORT unztell (unzFile file) - { - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; -@@ -1901,7 +1901,7 @@ extern z_off_t ZEXPORT unztell (unzFile file) - return (z_off_t)pfile_in_zip_read_info->stream.total_out; - } - --extern ZPOS64_T ZEXPORT unztell64 (unzFile file) -+MINIZIP_EXTERN ZPOS64_T ZEXPORT unztell64 (unzFile file) - { - - unz64_s* s; -@@ -1921,7 +1921,7 @@ extern ZPOS64_T ZEXPORT unztell64 (unzFile file) - /* - return 1 if the end of file was reached, 0 elsewhere - */ --extern int ZEXPORT unzeof (unzFile file) -+MINIZIP_EXTERN int ZEXPORT unzeof (unzFile file) - { - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; -@@ -1953,7 +1953,7 @@ more info in the local-header version than in the central-header) - the return value is the number of bytes copied in buf, or (if <0) - the error code - */ --extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) -+MINIZIP_EXTERN int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) - { - unz64_s* s; - file_in_zip64_read_info_s* pfile_in_zip_read_info; -@@ -2001,7 +2001,7 @@ extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good - */ --extern int ZEXPORT unzCloseCurrentFile (unzFile file) -+MINIZIP_EXTERN int ZEXPORT unzCloseCurrentFile (unzFile file) - { - int err=UNZ_OK; - -@@ -2048,7 +2048,7 @@ extern int ZEXPORT unzCloseCurrentFile (unzFile file) - uSizeBuf is the size of the szComment buffer. - return the number of byte copied or an error code <0 - */ --extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) -+MINIZIP_EXTERN int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) - { - unz64_s* s; - uLong uReadThis ; -@@ -2076,7 +2076,7 @@ extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uS - } - - /* Additions by RX '2004 */ --extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) -+MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) - { - unz64_s* s; - -@@ -2091,7 +2091,7 @@ extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) - return s->pos_in_central_dir; - } - --extern uLong ZEXPORT unzGetOffset (unzFile file) -+MINIZIP_EXTERN uLong ZEXPORT unzGetOffset (unzFile file) - { - ZPOS64_T offset64; - -@@ -2101,7 +2101,7 @@ extern uLong ZEXPORT unzGetOffset (unzFile file) - return (uLong)offset64; - } - --extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) -+MINIZIP_EXTERN int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) - { - unz64_s* s; - int err; -@@ -2119,7 +2119,7 @@ extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) - return err; - } - --extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) -+MINIZIP_EXTERN int ZEXPORT unzSetOffset (unzFile file, uLong pos) - { - return unzSetOffset64(file,pos); - } -diff --git a/src/contrib/minizip/unzip.h b/contrib/minizip/unzip.h -index 2104e39..35bb602 100644 ---- a/src/contrib/minizip/unzip.h -+++ b/contrib/minizip/unzip.h -@@ -61,6 +61,8 @@ extern "C" { - - #define Z_BZIP2ED 12 - -+#include "minizip_extern.h" -+ - #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) - /* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -@@ -150,7 +152,7 @@ typedef struct unz_file_info_s - tm_unz tmu_date; - } unz_file_info; - --extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, -+MINIZIP_EXTERN int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - const char* fileName2, - int iCaseSensitivity)); - /* -@@ -163,8 +165,8 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, - */ - - --extern unzFile ZEXPORT unzOpen OF((const char *path)); --extern unzFile ZEXPORT unzOpen64 OF((const void *path)); -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen OF((const char *path)); -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen64 OF((const void *path)); - /* - Open a Zip file. path contain the full pathname (by example, - on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer -@@ -181,31 +183,31 @@ extern unzFile ZEXPORT unzOpen64 OF((const void *path)); - */ - - --extern unzFile ZEXPORT unzOpen2 OF((const char *path, -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen2 OF((const char *path, - zlib_filefunc_def* pzlib_filefunc_def)); - /* - Open a Zip file, like unzOpen, but provide a set of file low level API - for read/write the zip file (see ioapi.h) - */ - --extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, -+MINIZIP_EXTERN unzFile ZEXPORT unzOpen2_64 OF((const void *path, - zlib_filefunc64_def* pzlib_filefunc_def)); - /* - Open a Zip file, like unz64Open, but provide a set of file low level API - for read/write the zip file (see ioapi.h) - */ - --extern int ZEXPORT unzClose OF((unzFile file)); -+MINIZIP_EXTERN int ZEXPORT unzClose OF((unzFile file)); - /* - Close a ZipFile opened with unzOpen. - If there is files inside the .Zip opened with unzOpenCurrentFile (see later), - these files MUST be closed with unzCloseCurrentFile before call unzClose. - return UNZ_OK if there is no problem. */ - --extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo OF((unzFile file, - unz_global_info *pglobal_info)); - --extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, - unz_global_info64 *pglobal_info)); - /* - Write info about the ZipFile in the *pglobal_info structure. -@@ -213,7 +215,7 @@ extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, - return UNZ_OK if there is no problem. */ - - --extern int ZEXPORT unzGetGlobalComment OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetGlobalComment OF((unzFile file, - char *szComment, - uLong uSizeBuf)); - /* -@@ -226,20 +228,20 @@ extern int ZEXPORT unzGetGlobalComment OF((unzFile file, - /***************************************************************************/ - /* Unzip package allow you browse the directory of the zipfile */ - --extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); -+MINIZIP_EXTERN int ZEXPORT unzGoToFirstFile OF((unzFile file)); - /* - Set the current file of the zipfile to the first file. - return UNZ_OK if there is no problem - */ - --extern int ZEXPORT unzGoToNextFile OF((unzFile file)); -+MINIZIP_EXTERN int ZEXPORT unzGoToNextFile OF((unzFile file)); - /* - Set the current file of the zipfile to the next file. - return UNZ_OK if there is no problem - return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. - */ - --extern int ZEXPORT unzLocateFile OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzLocateFile OF((unzFile file, - const char *szFileName, - int iCaseSensitivity)); - /* -@@ -261,11 +263,11 @@ typedef struct unz_file_pos_s - uLong num_of_file; /* # of file */ - } unz_file_pos; - --extern int ZEXPORT unzGetFilePos( -+MINIZIP_EXTERN int ZEXPORT unzGetFilePos( - unzFile file, - unz_file_pos* file_pos); - --extern int ZEXPORT unzGoToFilePos( -+MINIZIP_EXTERN int ZEXPORT unzGoToFilePos( - unzFile file, - unz_file_pos* file_pos); - -@@ -275,17 +277,17 @@ typedef struct unz64_file_pos_s - ZPOS64_T num_of_file; /* # of file */ - } unz64_file_pos; - --extern int ZEXPORT unzGetFilePos64( -+MINIZIP_EXTERN int ZEXPORT unzGetFilePos64( - unzFile file, - unz64_file_pos* file_pos); - --extern int ZEXPORT unzGoToFilePos64( -+MINIZIP_EXTERN int ZEXPORT unzGoToFilePos64( - unzFile file, - const unz64_file_pos* file_pos); - - /* ****************************************** */ - --extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, - unz_file_info64 *pfile_info, - char *szFileName, - uLong fileNameBufferSize, -@@ -294,7 +296,7 @@ extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, - char *szComment, - uLong commentBufferSize)); - --extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - unz_file_info *pfile_info, - char *szFileName, - uLong fileNameBufferSize, -@@ -318,7 +320,7 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, - - /** Addition for GDAL : START */ - --extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); -+MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); - - /** Addition for GDAL : END */ - -@@ -328,13 +330,13 @@ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); - from it, and close it (you can close it before reading all the file) - */ - --extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile OF((unzFile file)); - /* - Open for reading data the current file in the zipfile. - If there is no error, the return value is UNZ_OK. - */ - --extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - const char* password)); - /* - Open for reading data the current file in the zipfile. -@@ -342,7 +344,7 @@ extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, - If there is no error, the return value is UNZ_OK. - */ - --extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - int* method, - int* level, - int raw)); -@@ -355,7 +357,7 @@ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, - but you CANNOT set method parameter as NULL - */ - --extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - int* method, - int* level, - int raw, -@@ -370,13 +372,13 @@ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, - */ - - --extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); -+MINIZIP_EXTERN int ZEXPORT unzCloseCurrentFile OF((unzFile file)); - /* - Close the file in zip opened with unzOpenCurrentFile - Return UNZ_CRCERROR if all the file was read but the CRC is not good - */ - --extern int ZEXPORT unzReadCurrentFile OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzReadCurrentFile OF((unzFile file, - voidp buf, - unsigned len)); - /* -@@ -390,19 +392,19 @@ extern int ZEXPORT unzReadCurrentFile OF((unzFile file, - (UNZ_ERRNO for IO error, or zLib error for uncompress error) - */ - --extern z_off_t ZEXPORT unztell OF((unzFile file)); -+MINIZIP_EXTERN z_off_t ZEXPORT unztell OF((unzFile file)); - --extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); -+MINIZIP_EXTERN ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); - /* - Give the current position in uncompressed data - */ - --extern int ZEXPORT unzeof OF((unzFile file)); -+MINIZIP_EXTERN int ZEXPORT unzeof OF((unzFile file)); - /* - return 1 if the end of file was reached, 0 elsewhere - */ - --extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, -+MINIZIP_EXTERN int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - voidp buf, - unsigned len)); - /* -@@ -421,12 +423,12 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, - /***************************************************************************/ - - /* Get the current file offset */ --extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); --extern uLong ZEXPORT unzGetOffset (unzFile file); -+MINIZIP_EXTERN ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); -+MINIZIP_EXTERN uLong ZEXPORT unzGetOffset (unzFile file); - - /* Set the current file offset */ --extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); --extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); -+MINIZIP_EXTERN int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); -+MINIZIP_EXTERN int ZEXPORT unzSetOffset (unzFile file, uLong pos); - - - -diff --git a/src/contrib/minizip/zip.c b/contrib/minizip/zip.c -index 44e88a9..2acd02c 100644 ---- a/src/contrib/minizip/zip.c -+++ b/contrib/minizip/zip.c -@@ -846,7 +846,7 @@ int LoadCentralDirectoryRecord(zip64_internal* pziinit) - - - /************************************************************/ --extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_32_def* pzlib_filefunc64_32_def) - { - zip64_internal ziinit; - zip64_internal* zi; -@@ -917,7 +917,7 @@ extern zipFile ZEXPORT zipOpen3 (const void *pathname, int append, zipcharpc* gl - } - } - --extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc32_def) - { - if (pzlib_filefunc32_def != NULL) - { -@@ -929,7 +929,7 @@ extern zipFile ZEXPORT zipOpen2 (const char *pathname, int append, zipcharpc* gl - return zipOpen3(pathname, append, globalcomment, NULL); - } - --extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def) - { - if (pzlib_filefunc_def != NULL) - { -@@ -945,12 +945,12 @@ extern zipFile ZEXPORT zipOpen2_64 (const void *pathname, int append, zipcharpc* - - - --extern zipFile ZEXPORT zipOpen (const char* pathname, int append) -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen (const char* pathname, int append) - { - return zipOpen3((const void*)pathname,append,NULL,NULL); - } - --extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append) -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen64 (const void* pathname, int append) - { - return zipOpen3(pathname,append,NULL,NULL); - } -@@ -1052,7 +1052,7 @@ int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_ex - It is not done here because then we need to realloc a new buffer since parameters are 'const' and I want to minimize - unnecessary allocations. - */ --extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, -@@ -1262,7 +1262,7 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename, - return err; - } - --extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, -@@ -1278,7 +1278,7 @@ extern int ZEXPORT zipOpenNewFileInZip4 (zipFile file, const char* filename, con - password, crcForCrypting, versionMadeBy, flagBase, 0); - } - --extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, -@@ -1293,7 +1293,7 @@ extern int ZEXPORT zipOpenNewFileInZip3 (zipFile file, const char* filename, con - password, crcForCrypting, VERSIONMADEBY, 0, 0); - } - --extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, -@@ -1308,7 +1308,7 @@ extern int ZEXPORT zipOpenNewFileInZip3_64(zipFile file, const char* filename, c - password, crcForCrypting, VERSIONMADEBY, 0, zip64); - } - --extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw) -@@ -1321,7 +1321,7 @@ extern int ZEXPORT zipOpenNewFileInZip2(zipFile file, const char* filename, cons - NULL, 0, VERSIONMADEBY, 0, 0); - } - --extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void* extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int raw, int zip64) -@@ -1334,7 +1334,7 @@ extern int ZEXPORT zipOpenNewFileInZip2_64(zipFile file, const char* filename, c - NULL, 0, VERSIONMADEBY, 0, zip64); - } - --extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void*extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level, int zip64) -@@ -1347,7 +1347,7 @@ extern int ZEXPORT zipOpenNewFileInZip64 (zipFile file, const char* filename, co - NULL, 0, VERSIONMADEBY, 0, zip64); - } - --extern int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip (zipFile file, const char* filename, const zip_fileinfo* zipfi, - const void* extrafield_local, uInt size_extrafield_local, - const void*extrafield_global, uInt size_extrafield_global, - const char* comment, int method, int level) -@@ -1399,7 +1399,7 @@ local int zip64FlushWriteBuffer(zip64_internal* zi) - return err; - } - --extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) -+MINIZIP_EXTERN int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned int len) - { - zip64_internal* zi; - int err=ZIP_OK; -@@ -1506,12 +1506,12 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in - return err; - } - --extern int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) -+MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw (zipFile file, uLong uncompressed_size, uLong crc32) - { - return zipCloseFileInZipRaw64 (file, uncompressed_size, crc32); - } - --extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) -+MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32) - { - zip64_internal* zi; - ZPOS64_T compressed_size; -@@ -1747,7 +1747,7 @@ extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_s - return err; - } - --extern int ZEXPORT zipCloseFileInZip (zipFile file) -+MINIZIP_EXTERN int ZEXPORT zipCloseFileInZip (zipFile file) - { - return zipCloseFileInZipRaw (file,0,0); - } -@@ -1879,7 +1879,7 @@ int Write_GlobalComment(zip64_internal* zi, const char* global_comment) - return err; - } - --extern int ZEXPORT zipClose (zipFile file, const char* global_comment) -+MINIZIP_EXTERN int ZEXPORT zipClose (zipFile file, const char* global_comment) - { - zip64_internal* zi; - int err = 0; -@@ -1948,7 +1948,7 @@ extern int ZEXPORT zipClose (zipFile file, const char* global_comment) - return err; - } - --extern int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) -+MINIZIP_EXTERN int ZEXPORT zipRemoveExtraInfoBlock (char* pData, int* dataLen, short sHeader) - { - char* p = pData; - int size = 0; -diff --git a/src/contrib/minizip/zip.h b/contrib/minizip/zip.h -index 8aaebb6..f6821f4 100644 ---- a/src/contrib/minizip/zip.h -+++ b/contrib/minizip/zip.h -@@ -60,6 +60,8 @@ extern "C" { - - #define Z_BZIP2ED 12 - -+#include "minizip_extern.h" -+ - #if defined(STRICTZIP) || defined(STRICTZIPUNZIP) - /* like the STRICT of WIN32, we define a pointer that cannot be converted - from (void*) without cast */ -@@ -113,8 +115,8 @@ typedef const char* zipcharpc; - #define APPEND_STATUS_CREATEAFTER (1) - #define APPEND_STATUS_ADDINZIP (2) - --extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); --extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); - /* - Create a zipfile. - pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on -@@ -134,17 +136,17 @@ extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); - Of couse, you can use RAW reading and writing to copy the file you did not want delte - */ - --extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen2 OF((const char *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc_def* pzlib_filefunc_def)); - --extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, -+MINIZIP_EXTERN zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, - int append, - zipcharpc* globalcomment, - zlib_filefunc64_def* pzlib_filefunc_def)); - --extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -155,7 +157,7 @@ extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, - int method, - int level)); - --extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -184,7 +186,7 @@ extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, - */ - - --extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -197,7 +199,7 @@ extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, - int raw)); - - --extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -213,7 +215,7 @@ extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, - Same than zipOpenNewFileInZip, except if raw=1, we write raw file - */ - --extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -230,7 +232,7 @@ extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, - const char* password, - uLong crcForCrypting)); - --extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -256,7 +258,7 @@ extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, - crcForCrypting : crc of file to compress (needed for crypting) - */ - --extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -277,7 +279,7 @@ extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, - )); - - --extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, - const char* filename, - const zip_fileinfo* zipfi, - const void* extrafield_local, -@@ -304,23 +306,23 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, - */ - - --extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipWriteInFileInZip OF((zipFile file, - const void* buf, - unsigned len)); - /* - Write data in the zipfile - */ - --extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); -+MINIZIP_EXTERN int ZEXPORT zipCloseFileInZip OF((zipFile file)); - /* - Close the current file in the zipfile - */ - --extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, - uLong uncompressed_size, - uLong crc32)); - --extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, - ZPOS64_T uncompressed_size, - uLong crc32)); - -@@ -330,14 +332,14 @@ extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, - uncompressed_size and crc32 are value for the uncompressed size - */ - --extern int ZEXPORT zipClose OF((zipFile file, -+MINIZIP_EXTERN int ZEXPORT zipClose OF((zipFile file, - const char* global_comment)); - /* - Close the zipfile - */ - - --extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); -+MINIZIP_EXTERN int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); - /* - zipRemoveExtraInfoBlock - Added by Mathias Svensson - +@@ -68,10 +68,6 @@ + #include + #include + +-#ifndef NOUNCRYPT +- #define NOUNCRYPT +-#endif +- + #include "zlib.h" + #include "unzip.h" + + diff --git a/recipes/minizip/1.2.11/test_package/test_package.c b/recipes/minizip/1.2.11/test_package/test_package.c index 3f3ecff720ccd..7c6e48aa82e0e 100644 --- a/recipes/minizip/1.2.11/test_package/test_package.c +++ b/recipes/minizip/1.2.11/test_package/test_package.c @@ -2,14 +2,14 @@ #include #include -#include -#include +#include +#include #ifdef _WIN32 - #include + #include #endif -#include -#include +#include +#include const char text[] = "" "Conveying or northward offending admitting perfectly my. Colonel gravity get thought fat smiling add but. Wonder twenty hunted and put income set desire expect. Am cottage calling my is mistake cousins talking up. Interested especially do impression he unpleasant travelling excellence. All few our knew time done draw ask.\n" From 867f9063f0fe721c39351c60186f9ccaf438fb39 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Dec 2019 18:09:04 -0300 Subject: [PATCH 21/41] Remove old cmake file for minizip Signed-off-by: Uilian Ries --- recipes/minizip/1.2.11/CMakeLists_minizip.txt | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 recipes/minizip/1.2.11/CMakeLists_minizip.txt diff --git a/recipes/minizip/1.2.11/CMakeLists_minizip.txt b/recipes/minizip/1.2.11/CMakeLists_minizip.txt deleted file mode 100644 index 97c295794584f..0000000000000 --- a/recipes/minizip/1.2.11/CMakeLists_minizip.txt +++ /dev/null @@ -1,46 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(minizip) - -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup() - -set(SOURCES ioapi.c mztools.c unzip.c zip.c) -set(HEADERS crypt.h ioapi.h mztools.h unzip.h zip.h minizip_extern.h) - -if(WIN32) - set(SOURCES ${SOURCES} iowin32.c) - set(HEADERS ${HEADERS} iowin32.h) - - if(BUILD_SHARED_LIBS) - set(SOURCES ${SOURCES} minizip1.rc) - endif() -endif() - -add_library(minizip ${SOURCES} ${HEADERS}) -target_include_directories(minizip PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/../.. - ${CMAKE_CURRENT_SOURCE_DIR}/../../_build - ${CMAKE_CURRENT_SOURCE_DIR}/../../_build/source_subfolder) - -target_link_libraries(minizip PRIVATE ${CONAN_LIBS}) -target_compile_definitions(minizip PRIVATE MINIZIP_BUILDING) -if(BUILD_SHARED_LIBS) - set_target_properties(minizip PROPERTIES INSTALL_RPATH "$ORIGIN" BUILD_WITH_INSTALL_RPATH True) - target_compile_definitions(minizip PRIVATE MINIZIP_DLL ZLIB_DLL) - - if(WIN32) - set_target_properties(minizip PROPERTIES SUFFIX "1.dll") - endif() -endif() - -set_target_properties(minizip PROPERTIES PUBLIC_HEADER "${HEADERS}") -set_target_properties(minizip PROPERTIES SOVERSION 1) -set_target_properties(minizip PROPERTIES VERSION "1.1.0") - -install(TARGETS minizip - ARCHIVE DESTINATION "lib" - LIBRARY DESTINATION "lib" - RUNTIME DESTINATION "bin" - PUBLIC_HEADER DESTINATION "include" - COMPONENT library -) From dec1a4f372a375d8a2a661f9a6b2dc195504e46d Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Dec 2019 18:11:37 -0300 Subject: [PATCH 22/41] Keep minizip test simplest Signed-off-by: Uilian Ries --- .../1.2.11/test_package/test_package.c | 206 +----------------- 1 file changed, 1 insertion(+), 205 deletions(-) diff --git a/recipes/minizip/1.2.11/test_package/test_package.c b/recipes/minizip/1.2.11/test_package/test_package.c index 7c6e48aa82e0e..4660d0af60925 100644 --- a/recipes/minizip/1.2.11/test_package/test_package.c +++ b/recipes/minizip/1.2.11/test_package/test_package.c @@ -11,33 +11,9 @@ #include #include -const char text[] = "" -"Conveying or northward offending admitting perfectly my. Colonel gravity get thought fat smiling add but. Wonder twenty hunted and put income set desire expect. Am cottage calling my is mistake cousins talking up. Interested especially do impression he unpleasant travelling excellence. All few our knew time done draw ask.\n" -"\n" -"Village did removed enjoyed explain nor ham saw calling talking. Securing as informed declared or margaret. Joy horrible moreover man feelings own shy. Request norland neither mistake for yet. Between the for morning assured country believe. On even feet time have an no at. Relation so in confined smallest children unpacked delicate. Why sir end believe uncivil respect. Always get adieus nature day course for common. My little garret repair to desire he esteem.\n" -"" -"As it so contrasted oh estimating instrument. Size like body some one had. Are conduct viewing boy minutes warrant expense. Tolerably behaviour may admitting daughters offending her ask own. Praise effect wishes change way and any wanted. Lively use looked latter regard had. Do he it part more last in. Merits ye if mr narrow points. Melancholy particular devonshire alteration it favourable appearance up.\n" -"" -"Extremity direction existence as dashwoods do up. Securing marianne led welcomed offended but offering six raptures. Conveying concluded newspaper rapturous oh at. Two indeed suffer saw beyond far former mrs remain. Occasional continuing possession we insensible an sentiments as is. Law but reasonably motionless principles she. Has six worse downs far blush rooms above stood.\n" -"" -"Comfort reached gay perhaps chamber his six detract besides add. Moonlight newspaper up he it enjoyment agreeable depending. Timed voice share led his widen noisy young. On weddings believed laughing although material do exercise of. Up attempt offered ye civilly so sitting to. She new course get living within elinor joy. She her rapturous suffering concealed.\n" -"" -"Neat own nor she said see walk. And charm add green you these. Sang busy in this drew ye fine. At greater prepare musical so attacks as on distant. Improving age our her cordially intention. His devonshire sufficient precaution say preference middletons insipidity. Since might water hence the her worse. Concluded it offending dejection do earnestly as me direction. Nature played thirty all him.\n" -"" -"Mr do raising article general norland my hastily. Its companions say uncommonly pianoforte favourable. Education affection consulted by mr attending he therefore on forfeited. High way more far feet kind evil play led. Sometimes furnished collected add for resources attention. Norland an by minuter enquire it general on towards forming. Adapted mrs totally company two yet conduct men.\n" -"" -"An sincerity so extremity he additions. Her yet there truth merit. Mrs all projecting favourable now unpleasing. Son law garden chatty temper. Oh children provided to mr elegance marriage strongly. Off can admiration prosperous now devonshire diminution law.\n" -"" -"He share of first to worse. Weddings and any opinions suitable smallest nay. My he houses or months settle remove ladies appear. Engrossed suffering supposing he recommend do eagerness. Commanded no of depending extremity recommend attention tolerably. Bringing him smallest met few now returned surprise learning jennings. Objection delivered eagerness he exquisite at do in. Warmly up he nearer mr merely me.\n" -"" -"Yet remarkably appearance get him his projection. Diverted endeavor bed peculiar men the not desirous. Acuteness abilities ask can offending furnished fulfilled sex. Warrant fifteen exposed ye at mistake. Blush since so in noisy still built up an again. As young ye hopes no he place means. Partiality diminution gay yet entreaties admiration. In mr it he mention perhaps attempt pointed suppose. Unknown ye chamber of warrant of norland arrived.\n" -""; - +const char text[] = "Conveying or northward offending admitting perfectly my."; const char* zip_fname = "test_minizip.zip"; -int print_zip_info(unzFile); -void Display64BitsSize(ZPOS64_T, int); - int main(int argc, char** argv) { zipFile zf = zipOpen64(zip_fname, APPEND_STATUS_CREATE); if (zf == NULL) { @@ -73,186 +49,6 @@ int main(int argc, char** argv) { printf("ZIP file created, name: %s\n", zip_fname); - /* unZip */ - printf("---------- Test unZIP ----------\n"); - - unzFile unzf = unzOpen64(zip_fname); - if (unzf == NULL) { - printf("Error in unzOpen64, fname: %s\n", zip_fname); - exit(EXIT_FAILURE); - } - - res = print_zip_info(unzf); - if (res != UNZ_OK) { - printf("Read ZIP info error, code: %d\n", res); - exit(EXIT_FAILURE); - } - - res = unzGoToFirstFile(unzf); - if (res != UNZ_OK) { - printf("Error in unzGoToFirstFile, code: %d\n", res); - exit(EXIT_FAILURE); - } - - unz_file_info64 unz_fi = {0}; - res = unzGetCurrentFileInfo64(unzf, &unz_fi, NULL, 0, NULL, 0, NULL, 0); - if (res != UNZ_OK) { - printf("Error in unzGetCurrentFileInfo64, code: %d\n", res); - exit(EXIT_FAILURE); - } - - /* Compare size */ - if (unz_fi.uncompressed_size != (ZPOS64_T) sizeof(text)) { - printf("Error in Zip, failed compare size. In Zip => %llu, source size => %llu\n", unz_fi.uncompressed_size, (ZPOS64_T) sizeof(text)); - exit(EXIT_FAILURE); - } - - res = unzOpenCurrentFile(unzf); - if (res != UNZ_OK) { - printf("Error in unzOpenCurrentFile, code: %d\n", res); - exit(EXIT_FAILURE); - } - - char* read_data = calloc(1, sizeof(text)); - if (read_data == NULL) { - printf("Can`t allocate read buffer\n"); - exit(EXIT_FAILURE); - } - - res = unzReadCurrentFile(unzf, read_data, sizeof(text)); - if (res < 0) { - printf("Error in unzReadCurrentFile, code: %d\n", res); - exit(EXIT_FAILURE); - } - - if (memcmp(text, read_data, sizeof(text)) != 0) { - printf("Error in zip, source and uncompressed data not equal.\n"); - exit(EXIT_FAILURE); - } - - res = unzClose(unzf); - if (res != UNZ_OK) { - printf("Error in unzClose, code: %d\n", res); - exit(EXIT_FAILURE); - } - - printf("Zip / Unzip OK\n"); - free(read_data); return EXIT_SUCCESS; } -int print_zip_info(unzFile unzf) { - char comment[256] = {0}; - int res; - res = unzGetGlobalComment(unzf, comment, sizeof(comment)); - if (res < 0) { - printf("Error in unzGetGlobalComment, code: %d\n", res); - return res; - } - printf("unZIP. Global comment => %s\n", comment); - - res = unzGoToFirstFile(unzf); - if (res != UNZ_OK) { - printf("Error in unzGoToFirstFile, code: %d\n", res); - return res; - } - - unz_global_info64 gi = {0}; - res = unzGetGlobalInfo64(unzf, &gi); - if (res != UNZ_OK) { - printf("Error in unzGetGlobalInfo64, code: %d\n", res); - return res; - } - printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); - printf(" ------ ------ ---- ----- ---- ---- ------ ----\n"); - - for (uLong i = 0; i < gi.number_entry; i++) { - unz_file_info64 file_info = {0}; - char fname_inzip[256] = {0}; - res = unzGetCurrentFileInfo64(unzf, &file_info, fname_inzip, sizeof(fname_inzip), NULL, 0, NULL, 0); - if (res != UNZ_OK) { - printf("Error in unzGetCurrentFileInfo64, code: %d\n", res); - return res; - } - - uLong ratio = 0; - if (file_info.uncompressed_size>0) { - ratio = (uLong) ((file_info.compressed_size*100) / file_info.uncompressed_size); - } - - char crypt = ' '; - if ((file_info.flag & 1) != 0) { - char crypt = '*'; - } - - const char* str_method = NULL; - if (file_info.compression_method==0) { - str_method = "Stored"; - } else if (file_info.compression_method == Z_DEFLATED) { - uInt iLevel=(uInt) ((file_info.flag & 0x6) / 2); - if (iLevel == 0) { - str_method = "Defl:N"; - } else if (iLevel == 1) { - str_method = "Defl:X"; - } else if ((iLevel == 2) || (iLevel == 3)) { - str_method="Defl:F"; /* 2:fast , 3 : extra fast*/ - } - } else if (file_info.compression_method==Z_BZIP2ED) { - str_method="BZip2 "; - } else { - str_method="Unkn. "; - } - - Display64BitsSize(file_info.uncompressed_size, 7); - printf(" %6s%c", str_method, crypt); - Display64BitsSize(file_info.compressed_size, 7); - printf(" %3lu%% %2.2lu-%2.2lu-%2.2lu %2.2lu:%2.2lu %8.8lx %s\n", - ratio, - (uLong) file_info.tmu_date.tm_mon + 1, - (uLong) file_info.tmu_date.tm_mday, - (uLong) file_info.tmu_date.tm_year - 1900, - (uLong) file_info.tmu_date.tm_hour, - (uLong) file_info.tmu_date.tm_min, - (uLong) file_info.crc, - fname_inzip - ); - if ((i + 1) < gi.number_entry) { - res = unzGoToNextFile(unzf); - if (res != UNZ_OK) { - printf("Error in unzGoToNextFile, code: %d\n", res); - return res; - } - } - } - - return UNZ_OK; -} - -void Display64BitsSize(ZPOS64_T n, int size_char) { - /* to avoid compatibility problem , we do here the conversion */ - char number[21] = {0}; - int offset = 19; - int pos_string = 19; - number[20] = 0; - - for (;;) { - number[offset] = (char) ((n % 10) + '0'); - if (number[offset] != '0') { - pos_string = offset; - } - n /= 10; - if (offset == 0) { - break; - } - offset--; - } - - int size_display_string = 19 - pos_string; - while (size_char > size_display_string) { - size_char--; - printf(" "); - } - - printf("%s", &number[pos_string]); -} - From 94953cf52750d9824d2986cc9b403bdf408be5f2 Mon Sep 17 00:00:00 2001 From: Paulo Coutinho Date: Fri, 20 Dec 2019 18:13:03 -0300 Subject: [PATCH 23/41] added option disable_gethostuuid --- recipes/sqlite3/all/CMakeLists.txt | 6 +++--- recipes/sqlite3/all/conanfile.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/recipes/sqlite3/all/CMakeLists.txt b/recipes/sqlite3/all/CMakeLists.txt index 766b321d41a3f..eccc8c0ee5675 100644 --- a/recipes/sqlite3/all/CMakeLists.txt +++ b/recipes/sqlite3/all/CMakeLists.txt @@ -19,7 +19,7 @@ option(HAVE_LOCALTIME_R "Use the threadsafe localtime_r()") option(HAVE_POSIX_FALLOCATE "Use posix_fallocate()") option(HAVE_STRERROR_R "Use strerror_r()") option(HAVE_USLEEP "Use usleep() system call to implement the xSleep method") -option(TARGET_OS_EMBEDDED "Enable compilation for embedded systems") +option(DISABLE_GETHOSTUUID "Disable function gethostuuid") add_library(${PROJECT_NAME} source_subfolder/sqlite3.c source_subfolder/sqlite3.h @@ -69,8 +69,8 @@ endif() if(HAVE_USLEEP) target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_USLEEP) endif() -if(TARGET_OS_EMBEDDED) - target_compile_definitions(${PROJECT_NAME} PRIVATE TARGET_OS_EMBEDDED) +if(DISABLE_GETHOSTUUID) + target_compile_definitions(${PROJECT_NAME} PRIVATE HAVE_GETHOSTUUID=0) endif() target_compile_definitions(${PROJECT_NAME} PRIVATE SQLITE_THREADSAFE=${THREADSAFE}) diff --git a/recipes/sqlite3/all/conanfile.py b/recipes/sqlite3/all/conanfile.py index 4714a90f048b6..ecb366f721f53 100644 --- a/recipes/sqlite3/all/conanfile.py +++ b/recipes/sqlite3/all/conanfile.py @@ -24,7 +24,7 @@ class ConanSqlite3(ConanFile): "enable_rtree": [True, False], "omit_load_extension": [True, False], "enable_unlock_notify": [True, False], - "enable_target_os_embedded": [True, False], + "disable_gethostuuid": [True, False], } default_options = {"shared": False, "fPIC": True, @@ -38,7 +38,7 @@ class ConanSqlite3(ConanFile): "enable_rtree": True, "omit_load_extension": False, "enable_unlock_notify": True, - "enable_target_os_embedded": False, + "disable_gethostuuid": False, } _source_subfolder = "source_subfolder" @@ -82,8 +82,8 @@ def _configure_cmake(self): cmake.definitions["HAVE_POSIX_FALLOCATE"] = False if self.settings.os == "Android": cmake.definitions["HAVE_POSIX_FALLOCATE"] = False - if self.options.enable_target_os_embedded: - cmake.definitions["TARGET_OS_EMBEDDED"] = True + if self.options.disable_gethostuuid: + cmake.definitions["DISABLE_GETHOSTUUID"] = True cmake.configure() return cmake From 586a18230048e641d98248f687c7c93533bdc7de Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Dec 2019 18:16:02 -0300 Subject: [PATCH 24/41] Export bzip define for minizip Signed-off-by: Uilian Ries --- recipes/minizip/1.2.11/conanfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/minizip/1.2.11/conanfile.py b/recipes/minizip/1.2.11/conanfile.py index f2c6328cb607a..023eda52718ce 100644 --- a/recipes/minizip/1.2.11/conanfile.py +++ b/recipes/minizip/1.2.11/conanfile.py @@ -66,6 +66,5 @@ def package(self): def package_info(self): self.cpp_info.libs = ["minizip"] self.cpp_info.includedirs = ["include", os.path.join("include", "minizip")] - if self.options.shared and self.settings.os == "Windows": - self.cpp_info.defines.append('MINIZIP_DLL') - + if self.options.bzip2: + self.cpp_info.defines.append('HAVE_BZIP2') From 774ecebc51879a898ecc33d2c2fecff79f541eeb Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Fri, 20 Dec 2019 19:24:59 -0300 Subject: [PATCH 25/41] Fix Windows build for tinycbor Signed-off-by: Uilian Ries --- recipes/tinycbor/all/conanfile.py | 55 ++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/recipes/tinycbor/all/conanfile.py b/recipes/tinycbor/all/conanfile.py index 4f38f97a8026e..4500bec5c1d85 100644 --- a/recipes/tinycbor/all/conanfile.py +++ b/recipes/tinycbor/all/conanfile.py @@ -17,6 +17,21 @@ class tinycborConan(ConanFile): _env_build = None _env_vars = [] + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + # INFO: shared options does not work on Windows + del self.options.shared + + def configure(self): + del self.settings.compiler.libcxx + del self.settings.compiler.cppstd + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + def _configure_autotools(self): if not self._env_build: self._env_build = AutoToolsBuildEnvironment(self) @@ -31,33 +46,43 @@ def _configure_autotools(self): self._env_build.fpic = self.options.fPIC return self._env_build, self._env_vars - def configure(self): - if self.settings.os == "Windows": - self.options.remove("fPIC") - self.options.remove("shared") # Shared lib only supported on unix systems - del self.settings.compiler.libcxx - del self.settings.compiler.cppstd + def _build_nmake(self): + with tools.chdir(self._source_subfolder): + vcvars_command = tools.vcvars_command(self.settings) + self.run("%s && nmake -f Makefile.nmake" % vcvars_command) - def source(self): - tools.get(**self.conan_data["sources"][self.version]) - extracted_dir = self.name + "-" + self.version - os.rename(extracted_dir, self._source_subfolder) + def _build_make(self): + with tools.chdir(self._source_subfolder): + env_build, env_vars = self._configure_autotools() + env_build.make(vars=env_vars) def build(self): for patch in self.conan_data["patches"][self.version]: tools.patch(**patch) - with tools.chdir(self._source_subfolder): - env_build, env_vars = self._configure_autotools() - env_build.make(vars=env_vars) + if self.settings.compiler == "Visual Studio": + self._build_nmake() + else: + self._build_make() - def package(self): + def _package_unix(self): with tools.chdir(self._source_subfolder): env_build, env_vars = self._configure_autotools() env_build.install(vars=env_vars) - self.copy("LICENSE", src=self._source_subfolder, dst="licenses") tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) tools.rmdir(os.path.join(self.package_folder, "bin")) + def _package_visual(self): + self.copy("tinycbor.lib", src=os.path.join(self._source_subfolder, "lib"), dst="lib") + for header in ["cbor.h", "cborjson.h", "tinycbor-version.h"]: + self.copy(header, src=os.path.join(self._source_subfolder, "src"), dst="include") + + def package(self): + self.copy("LICENSE", src=self._source_subfolder, dst="licenses") + if self.settings.compiler == "Visual Studio": + self._package_visual() + else: + self._package_unix() + def package_info(self): self.cpp_info.libs = tools.collect_libs(self) if self.settings.os == "Linux": From d491c4c8021256071009720422406a3b2e118808 Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Fri, 20 Dec 2019 16:02:36 -0800 Subject: [PATCH 26/41] Raise ConanInvalidConfiguration to remove shared option in Windows --- recipes/tinycbor/all/conanfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/recipes/tinycbor/all/conanfile.py b/recipes/tinycbor/all/conanfile.py index 4500bec5c1d85..bede5190148f6 100644 --- a/recipes/tinycbor/all/conanfile.py +++ b/recipes/tinycbor/all/conanfile.py @@ -1,5 +1,6 @@ import os from conans import ConanFile, tools, AutoToolsBuildEnvironment +from conans.errors import ConanInvalidConfiguration class tinycborConan(ConanFile): name = "tinycbor" @@ -20,12 +21,13 @@ class tinycborConan(ConanFile): def config_options(self): if self.settings.os == "Windows": del self.options.fPIC - # INFO: shared options does not work on Windows - del self.options.shared def configure(self): del self.settings.compiler.libcxx del self.settings.compiler.cppstd + if self.settings.os == "Windows": + if self.options.shared: + raise ConanInvalidConfiguration("Shared library only supported on Unix systems") def source(self): tools.get(**self.conan_data["sources"][self.version]) From fdc0053109f4567e8434f5411b4ef36c73f68677 Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Fri, 20 Dec 2019 17:00:23 -0800 Subject: [PATCH 27/41] Allocate memory on the test_package cpp --- recipes/tinycbor/all/test_package/example.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/tinycbor/all/test_package/example.cpp b/recipes/tinycbor/all/test_package/example.cpp index 96665e1d8d7cb..a8abd1183cdfc 100644 --- a/recipes/tinycbor/all/test_package/example.cpp +++ b/recipes/tinycbor/all/test_package/example.cpp @@ -1,4 +1,5 @@ #include +#include #include "cbor.h" int main(int argc, char *argv[]) @@ -6,7 +7,7 @@ int main(int argc, char *argv[]) CborParser parser; CborValue it; size_t length; - uint8_t *buf; + uint8_t *buf = (uint8_t*)malloc(sizeof(int[10])); CborError err = cbor_parser_init(buf, length, 0, &parser, &it); printf("Tinycbor test_package ran successfully \n"); From eaa5f46cf7ecf926ab86523176ff3b229ba3feee Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 23 Dec 2019 08:40:31 -0300 Subject: [PATCH 28/41] Accept shared only on linux for tinycbor Signed-off-by: Uilian Ries --- recipes/tinycbor/all/conanfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/recipes/tinycbor/all/conanfile.py b/recipes/tinycbor/all/conanfile.py index bede5190148f6..8f88ea357c6b1 100644 --- a/recipes/tinycbor/all/conanfile.py +++ b/recipes/tinycbor/all/conanfile.py @@ -25,9 +25,8 @@ def config_options(self): def configure(self): del self.settings.compiler.libcxx del self.settings.compiler.cppstd - if self.settings.os == "Windows": - if self.options.shared: - raise ConanInvalidConfiguration("Shared library only supported on Unix systems") + if self.settings.os != "Linux" and self.options.shared: + raise ConanInvalidConfiguration("Shared library only supported on Linux platform") def source(self): tools.get(**self.conan_data["sources"][self.version]) From 4865b94690d49db3add5ad8069220101d57484d3 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 23 Dec 2019 10:34:53 -0300 Subject: [PATCH 29/41] Remove cmake wrapper for ranges-v3 Signed-off-by: Uilian Ries --- recipes/range-v3/all/CMakeLists.txt | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 recipes/range-v3/all/CMakeLists.txt diff --git a/recipes/range-v3/all/CMakeLists.txt b/recipes/range-v3/all/CMakeLists.txt deleted file mode 100644 index a96e179310685..0000000000000 --- a/recipes/range-v3/all/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 2.8.12) -project(cmake_wrapper) - -include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") -conan_basic_setup() - -add_subdirectory("source_subfolder") From 0e1633a5e5d42bf373074f0f994731964813de52 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 23 Dec 2019 10:38:35 -0300 Subject: [PATCH 30/41] Remove cmake wrapper for ranges-v3 Signed-off-by: Uilian Ries --- recipes/range-v3/all/conanfile.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py index 101439925e111..53fcbe7975069 100644 --- a/recipes/range-v3/all/conanfile.py +++ b/recipes/range-v3/all/conanfile.py @@ -8,8 +8,6 @@ class Rangev3Conan(ConanFile): url = "https://github.com/conan-io/conan-center-index" description = "Experimental range library for C++11/14/17" topics = ("range", "range-library", "proposal", "iterator") - exports_sources = "CMakeLists.txt" - generators = "cmake" no_copy_source = True @property @@ -21,18 +19,6 @@ def source(self): extracted_folder = self.name + "-" + self.version os.rename(extracted_folder, self._source_subfolder) - def _configure_cmake(self): - cmake = CMake(self) - cmake.definitions["RANGE_V3_TESTS"] = "OFF" - cmake.definitions["RANGE_V3_EXAMPLES"] = "OFF" - cmake.definitions["RANGE_V3_PERF"] = "OFF" - cmake.definitions["RANGE_V3_DOCS"] = "OFF" - cmake.definitions["RANGE_V3_HEADER_CHECKS"] = "OFF" - cmake.configure() - return cmake - def package(self): + self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) - cmake = self._configure_cmake() - cmake.install() - tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) From 27009a04642d5b748a32e49b3d31026c2e13071e Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 23 Dec 2019 10:42:20 -0300 Subject: [PATCH 31/41] Add range-v3 0.10.0 Signed-off-by: Uilian Ries --- recipes/range-v3/all/conandata.yml | 3 +++ recipes/range-v3/all/conanfile.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/recipes/range-v3/all/conandata.yml b/recipes/range-v3/all/conandata.yml index 20c844ed75493..65f07346c9a4a 100644 --- a/recipes/range-v3/all/conandata.yml +++ b/recipes/range-v3/all/conandata.yml @@ -2,3 +2,6 @@ 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 diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py index 53fcbe7975069..c19ac35c569dc 100644 --- a/recipes/range-v3/all/conanfile.py +++ b/recipes/range-v3/all/conanfile.py @@ -19,6 +19,9 @@ def source(self): extracted_folder = self.name + "-" + self.version os.rename(extracted_folder, self._source_subfolder) + def package_id(self): + self.info.header_only() + def package(self): self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) From 8c64335eea56f00d7ae7835256ceb39e8c49bc25 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 23 Dec 2019 10:50:21 -0300 Subject: [PATCH 32/41] Add cmake extract info for minizip Signed-off-by: Uilian Ries --- recipes/minizip/1.2.11/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/minizip/1.2.11/CMakeLists.txt b/recipes/minizip/1.2.11/CMakeLists.txt index dae7c0a388ecc..73e32af77da35 100644 --- a/recipes/minizip/1.2.11/CMakeLists.txt +++ b/recipes/minizip/1.2.11/CMakeLists.txt @@ -1,3 +1,5 @@ +# 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) From f382515cd5c16de27f86ffdcf4cacb685ec65712 Mon Sep 17 00:00:00 2001 From: Uilian Ries Date: Mon, 23 Dec 2019 10:54:35 -0300 Subject: [PATCH 33/41] Remove explicit package id for range-v3 Signed-off-by: Uilian Ries --- recipes/range-v3/all/conanfile.py | 3 --- recipes/range-v3/all/test_package/CMakeLists.txt | 2 -- 2 files changed, 5 deletions(-) diff --git a/recipes/range-v3/all/conanfile.py b/recipes/range-v3/all/conanfile.py index c19ac35c569dc..53fcbe7975069 100644 --- a/recipes/range-v3/all/conanfile.py +++ b/recipes/range-v3/all/conanfile.py @@ -19,9 +19,6 @@ def source(self): extracted_folder = self.name + "-" + self.version os.rename(extracted_folder, self._source_subfolder) - def package_id(self): - self.info.header_only() - def package(self): self.copy(pattern="*", dst="include", src=os.path.join(self._source_subfolder, "include")) self.copy("LICENSE.txt", dst="licenses", src=self._source_subfolder) diff --git a/recipes/range-v3/all/test_package/CMakeLists.txt b/recipes/range-v3/all/test_package/CMakeLists.txt index 7dcf1ac9d5af6..375ca9b3cc686 100644 --- a/recipes/range-v3/all/test_package/CMakeLists.txt +++ b/recipes/range-v3/all/test_package/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.5) project(test_package) -set(CMAKE_VERBOSE_MAKEFILE TRUE) - find_package(range-v3) add_executable(${PROJECT_NAME} test_package.cpp) From 68964e7175b04f7bc4d86ac87bf6ec15b0575fe6 Mon Sep 17 00:00:00 2001 From: intelligide Date: Thu, 5 Dec 2019 21:08:47 -0500 Subject: [PATCH 34/41] Add stduuid 1.0 --- recipes/stduuid/all/conandata.yml | 4 +++ recipes/stduuid/all/conanfile.py | 35 +++++++++++++++++++ .../stduuid/all/test_package/CMakeLists.txt | 11 ++++++ recipes/stduuid/all/test_package/conanfile.py | 17 +++++++++ .../stduuid/all/test_package/test_package.cpp | 24 +++++++++++++ recipes/stduuid/config.yml | 3 ++ 6 files changed, 94 insertions(+) create mode 100644 recipes/stduuid/all/conandata.yml create mode 100644 recipes/stduuid/all/conanfile.py create mode 100644 recipes/stduuid/all/test_package/CMakeLists.txt create mode 100644 recipes/stduuid/all/test_package/conanfile.py create mode 100644 recipes/stduuid/all/test_package/test_package.cpp create mode 100644 recipes/stduuid/config.yml diff --git a/recipes/stduuid/all/conandata.yml b/recipes/stduuid/all/conandata.yml new file mode 100644 index 0000000000000..4bece5ecf54aa --- /dev/null +++ b/recipes/stduuid/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.0": + sha256: e96f2ac7c950c3c24d7e2e44a84236277b7774ee346dcc620edf400d9eda0a3c + url: https://github.com/mariusbancila/stduuid/archive/v1.0.tar.gz \ No newline at end of file diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py new file mode 100644 index 0000000000000..ca5075a6cfac1 --- /dev/null +++ b/recipes/stduuid/all/conanfile.py @@ -0,0 +1,35 @@ +from conans import ConanFile, CMake, tools +import os + + +class StduuidConan(ConanFile): + name = "stduuid" + description = "A C++17 cross-platform implementation for UUIDs" + topics = ("conan", "uuid", "guid") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mariusbancila/stduuid" + license = "MIT" + + requires = "ms-gsl/2.0.0" + + no_copy_source = True + _source_subfolder = "source_subfolder" + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def package(self): + root_dir = self._source_subfolder + include_dir = os.path.join(root_dir, "include") + self.copy(pattern="LICENSE", dst="licenses", src=root_dir) + self.copy(pattern="uuid.h", dst="include", src=include_dir) + + def package_info(self): + self.cpp_info.defines.append('ASIO_STANDALONE') + if tools.os_info.is_linux: + self.cpp_info.libs.append('pthread') + + def package_id(self): + self.info.header_only() diff --git a/recipes/stduuid/all/test_package/CMakeLists.txt b/recipes/stduuid/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..7eb421d150efc --- /dev/null +++ b/recipes/stduuid/all/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 2.8.12) +project(test_package) + +set(CMAKE_VERBOSE_MAKEFILE TRUE) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(${PROJECT_NAME} test_package.cpp) +target_link_libraries(${PROJECT_NAME} ${CONAN_LIBS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) diff --git a/recipes/stduuid/all/test_package/conanfile.py b/recipes/stduuid/all/test_package/conanfile.py new file mode 100644 index 0000000000000..bd7165a553cf4 --- /dev/null +++ b/recipes/stduuid/all/test_package/conanfile.py @@ -0,0 +1,17 @@ +from conans import ConanFile, CMake, tools +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + 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) diff --git a/recipes/stduuid/all/test_package/test_package.cpp b/recipes/stduuid/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..b19cec797852d --- /dev/null +++ b/recipes/stduuid/all/test_package/test_package.cpp @@ -0,0 +1,24 @@ +#include +#include +#include "uuid.h" + +using namespace uuids; +using namespace std::string_literals; + +int main() { + + { + auto str = "47183823-2574-4bfd-b411-99ed177d3e43"s; + auto guid = uuids::uuid::from_string(str); + assert(uuids::to_string(guid) == str); + } + + { + uuid const guid = uuids::uuid_random_generator{}(); + assert(!guid.is_nil()); + assert(guid.size() == 16); + assert(guid.version() == uuids::uuid_version::random_number_based); + assert(guid.variant() == uuids::uuid_variant::rfc); + } + +} \ No newline at end of file diff --git a/recipes/stduuid/config.yml b/recipes/stduuid/config.yml new file mode 100644 index 0000000000000..e48437cd10c0d --- /dev/null +++ b/recipes/stduuid/config.yml @@ -0,0 +1,3 @@ +versions: + "1.0": + folder: all \ No newline at end of file From 3d25154c849cdaa266ecf80d6534f4a94517d6b6 Mon Sep 17 00:00:00 2001 From: intelligide Date: Fri, 6 Dec 2019 03:26:06 -0500 Subject: [PATCH 35/41] stduuid: Fix --- recipes/stduuid/all/conanfile.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py index ca5075a6cfac1..5d727f0db8cb8 100644 --- a/recipes/stduuid/all/conanfile.py +++ b/recipes/stduuid/all/conanfile.py @@ -1,4 +1,5 @@ from conans import ConanFile, CMake, tools +from conans.errors import ConanInvalidConfiguration import os @@ -20,6 +21,23 @@ def source(self): extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self._source_subfolder) + def configure(self): + version = Version( self.settings.compiler.version ) + compiler = self.settings.compiler + if self.settings.compiler.cppstd and \ + not any([str(self.settings.compiler.cppstd) == std for std in ["17", "20", "gnu17", "gnu20"]]): + raise ConanInvalidConfiguration("stduuid requires at least c++17") + elif compiler == "Visual Studio" and \ + not any([self.settings.compiler.cppstd == std for std in ["17", "20"]]): + raise ConanInvalidConfiguration("stduuid requires at least c++17") + else: + if ( compiler == "gcc" and version < "7" ) or ( compiler == "clang" and version < "5" ): + raise ConanInvalidConfiguration("stduuid requires a compiler that supports at least C++17") + elif compiler == "apple-clang": + self.output.warn("stduuid is not tested with apple-clang") + if version < "10": + raise ConanInvalidConfiguration("stduuid requires a compiler that supports at least C++17") + def package(self): root_dir = self._source_subfolder include_dir = os.path.join(root_dir, "include") @@ -29,7 +47,7 @@ def package(self): def package_info(self): self.cpp_info.defines.append('ASIO_STANDALONE') if tools.os_info.is_linux: - self.cpp_info.libs.append('pthread') + self.cpp_info.system_libs.append('pthread') def package_id(self): self.info.header_only() From 3ec24d1e6d552d29ca0854b4cd187850c1a70540 Mon Sep 17 00:00:00 2001 From: intelligide Date: Mon, 23 Dec 2019 12:08:37 -0500 Subject: [PATCH 36/41] stduuid: Fix --- recipes/stduuid/all/conanfile.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py index 5d727f0db8cb8..2f8a1d10e891a 100644 --- a/recipes/stduuid/all/conanfile.py +++ b/recipes/stduuid/all/conanfile.py @@ -1,5 +1,6 @@ from conans import ConanFile, CMake, tools from conans.errors import ConanInvalidConfiguration +from conans.tools import Version import os @@ -13,6 +14,8 @@ class StduuidConan(ConanFile): requires = "ms-gsl/2.0.0" + settings = "compiler" + no_copy_source = True _source_subfolder = "source_subfolder" @@ -27,14 +30,13 @@ def configure(self): if self.settings.compiler.cppstd and \ not any([str(self.settings.compiler.cppstd) == std for std in ["17", "20", "gnu17", "gnu20"]]): raise ConanInvalidConfiguration("stduuid requires at least c++17") - elif compiler == "Visual Studio" and \ - not any([self.settings.compiler.cppstd == std for std in ["17", "20"]]): - raise ConanInvalidConfiguration("stduuid requires at least c++17") + elif compiler == "Visual Studio": + if version < "16": + raise ConanInvalidConfiguration("stduuid requires at least Visual Studio version 16") else: if ( compiler == "gcc" and version < "7" ) or ( compiler == "clang" and version < "5" ): raise ConanInvalidConfiguration("stduuid requires a compiler that supports at least C++17") elif compiler == "apple-clang": - self.output.warn("stduuid is not tested with apple-clang") if version < "10": raise ConanInvalidConfiguration("stduuid requires a compiler that supports at least C++17") @@ -44,10 +46,5 @@ def package(self): self.copy(pattern="LICENSE", dst="licenses", src=root_dir) self.copy(pattern="uuid.h", dst="include", src=include_dir) - def package_info(self): - self.cpp_info.defines.append('ASIO_STANDALONE') - if tools.os_info.is_linux: - self.cpp_info.system_libs.append('pthread') - def package_id(self): self.info.header_only() From f772876592e5861ed3a89c8bd2c7be399573b01b Mon Sep 17 00:00:00 2001 From: intelligide Date: Mon, 23 Dec 2019 12:23:47 -0500 Subject: [PATCH 37/41] stduuid: link libuuid --- recipes/stduuid/all/conanfile.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py index 2f8a1d10e891a..118e391d951fe 100644 --- a/recipes/stduuid/all/conanfile.py +++ b/recipes/stduuid/all/conanfile.py @@ -24,6 +24,10 @@ def source(self): extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self._source_subfolder) + def requirements(self): + if self.settings.os != "Windows": + self.requires("libuuid/1.0.3") + def configure(self): version = Version( self.settings.compiler.version ) compiler = self.settings.compiler From 7c7b5dca085a580f2a118d4570b8f00387674a67 Mon Sep 17 00:00:00 2001 From: Yoann POTINET Date: Mon, 23 Dec 2019 16:07:28 -0500 Subject: [PATCH 38/41] Update recipes/stduuid/all/conanfile.py Co-Authored-By: Uilian Ries --- recipes/stduuid/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py index 118e391d951fe..d3029e3f5dac8 100644 --- a/recipes/stduuid/all/conanfile.py +++ b/recipes/stduuid/all/conanfile.py @@ -11,7 +11,7 @@ class StduuidConan(ConanFile): url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/mariusbancila/stduuid" license = "MIT" - + settings = "os", "compiler" requires = "ms-gsl/2.0.0" settings = "compiler" From b0e402bfdffc798414641fd762ef6b053d093a4e Mon Sep 17 00:00:00 2001 From: intelligide Date: Mon, 23 Dec 2019 16:16:01 -0500 Subject: [PATCH 39/41] stduuid: Fix settings --- recipes/stduuid/all/conanfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/stduuid/all/conanfile.py b/recipes/stduuid/all/conanfile.py index d3029e3f5dac8..76396c6d01f63 100644 --- a/recipes/stduuid/all/conanfile.py +++ b/recipes/stduuid/all/conanfile.py @@ -14,8 +14,6 @@ class StduuidConan(ConanFile): settings = "os", "compiler" requires = "ms-gsl/2.0.0" - settings = "compiler" - no_copy_source = True _source_subfolder = "source_subfolder" From c2ef79358facb6ce5c4c6fccf7a2bf800ab1e4c9 Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Tue, 24 Dec 2019 12:18:50 +0100 Subject: [PATCH 40/41] libalsa: fix pkg_config file name also, split self.cpp_info.system_libs from self.cpp_info.libs as a drive by --- recipes/libalsa/all/conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/libalsa/all/conanfile.py b/recipes/libalsa/all/conanfile.py index 6eabca8e83c97..d804aa736c461 100644 --- a/recipes/libalsa/all/conanfile.py +++ b/recipes/libalsa/all/conanfile.py @@ -66,4 +66,6 @@ def package(self): os.unlink(la_file) def package_info(self): - self.cpp_info.libs = ["asound", "dl", "m", "rt", "pthread"] + self.cpp_info.libs = ["asound"] + self.cpp_info.system_libs = ["dl", "m", "rt", "pthread"] + self.cpp_info.names['pkg_config'] = 'alsa' From 66cd93068bd015a76ca9fa95c9380b666b799f34 Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Tue, 24 Dec 2019 16:33:13 -0800 Subject: [PATCH 41/41] Move patches to patches folder --- recipes/gtest/all/conandata.yml | 8 ++++---- recipes/gtest/all/conanfile.py | 5 +++-- recipes/gtest/all/{ => patches}/gtest-1.10.0.patch | 0 recipes/gtest/all/{ => patches}/gtest-1.8.1.patch | 0 4 files changed, 7 insertions(+), 6 deletions(-) rename recipes/gtest/all/{ => patches}/gtest-1.10.0.patch (100%) rename recipes/gtest/all/{ => patches}/gtest-1.8.1.patch (100%) diff --git a/recipes/gtest/all/conandata.yml b/recipes/gtest/all/conandata.yml index 6ff839b7e98dc..832a4aae40270 100644 --- a/recipes/gtest/all/conandata.yml +++ b/recipes/gtest/all/conandata.yml @@ -7,8 +7,8 @@ sources: sha256: "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb" patches: "1.8.1": - patch_file: "gtest-1.8.1.patch" - base_path: "source_subfolder" + - patch_file: "patches/gtest-1.8.1.patch" + base_path: "source_subfolder" "1.10.0": - patch_file: "gtest-1.10.0.patch" - base_path: "source_subfolder" + - patch_file: "patches/gtest-1.10.0.patch" + base_path: "source_subfolder" diff --git a/recipes/gtest/all/conanfile.py b/recipes/gtest/all/conanfile.py index f21c6328eefcc..797443f8b1ab9 100644 --- a/recipes/gtest/all/conanfile.py +++ b/recipes/gtest/all/conanfile.py @@ -12,7 +12,7 @@ class GTestConan(ConanFile): homepage = "https://github.com/google/googletest" license = "BSD-3-Clause" topics = ("conan", "gtest", "testing", "google-testing", "unit-test") - exports_sources = ["CMakeLists.txt", "gtest-*.patch"] + exports_sources = ["CMakeLists.txt", "patches/*"] generators = "cmake" settings = "os", "arch", "compiler", "build_type" options = {"shared": [True, False], "build_gmock": [True, False], "fPIC": [True, False], "no_main": [True, False], "debug_postfix": "ANY", "hide_symbols": [True, False]} @@ -54,7 +54,8 @@ def _configure_cmake(self): return cmake def build(self): - tools.patch(**self.conan_data["patches"][self.version]) + for patch in self.conan_data["patches"][self.version]: + tools.patch(**patch) cmake = self._configure_cmake() cmake.build() diff --git a/recipes/gtest/all/gtest-1.10.0.patch b/recipes/gtest/all/patches/gtest-1.10.0.patch similarity index 100% rename from recipes/gtest/all/gtest-1.10.0.patch rename to recipes/gtest/all/patches/gtest-1.10.0.patch diff --git a/recipes/gtest/all/gtest-1.8.1.patch b/recipes/gtest/all/patches/gtest-1.8.1.patch similarity index 100% rename from recipes/gtest/all/gtest-1.8.1.patch rename to recipes/gtest/all/patches/gtest-1.8.1.patch