diff --git a/recipes/minizip/all/conandata.yml b/recipes/minizip/all/conandata.yml index f8773fd58975f..d4b240b65caab 100644 --- a/recipes/minizip/all/conandata.yml +++ b/recipes/minizip/all/conandata.yml @@ -14,11 +14,23 @@ sources: patches: "1.3.1": - patch_file: "patches/minizip.patch" + - patch_file: "patches/android-pre-24.diff" + patch_description: "Fix building for Android against API level < 24" + patch_type: "portability" "1.2.13": - patch_file: "patches/minizip.patch" + - patch_file: "patches/android-pre-24.diff" + patch_description: "Fix building for Android against API level < 24" + patch_type: "portability" "1.2.12": - patch_file: "patches/minizip.patch" - patch_file: "patches/ioapi.patch" + - patch_file: "patches/android-pre-24.diff" + patch_description: "Fix building for Android against API level < 24" + patch_type: "portability" "1.2.11": - patch_file: "patches/minizip.patch" - patch_file: "patches/miniunz.patch" + - patch_file: "patches/android-pre-24.diff" + patch_description: "Fix building for Android against API level < 24" + patch_type: "portability" diff --git a/recipes/minizip/all/conanfile.py b/recipes/minizip/all/conanfile.py index cec7c823f0429..99b5910b23989 100644 --- a/recipes/minizip/all/conanfile.py +++ b/recipes/minizip/all/conanfile.py @@ -52,13 +52,14 @@ def requirements(self): def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) + apply_conandata_patches(self) def generate(self): tc = CMakeToolchain(self) tc.variables["MINIZIP_SRC_DIR"] = os.path.join(self.source_folder, "contrib", "minizip").replace("\\", "/") tc.variables["MINIZIP_ENABLE_BZIP2"] = self.options.bzip2 tc.variables["MINIZIP_BUILD_TOOLS"] = self.options.tools - # fopen64 and similar are unavailable before API level 24: https://github.com/madler/zlib/pull/436 + # fopen64 and similar are unavailable before API level 24: https://github.com/madler/zlib/pull/1025 if self.settings.os == "Android" and int(str(self.settings.os.api_level)) < 24: tc.preprocessor_definitions["IOAPI_NO_64"] = "1" tc.generate() @@ -66,7 +67,6 @@ def generate(self): deps.generate() def build(self): - apply_conandata_patches(self) cmake = CMake(self) cmake.configure(build_script_folder=os.path.join(self.source_folder, os.pardir)) cmake.build() diff --git a/recipes/minizip/all/patches/android-pre-24.diff b/recipes/minizip/all/patches/android-pre-24.diff new file mode 100644 index 0000000000000..07fe64046d86c --- /dev/null +++ b/recipes/minizip/all/patches/android-pre-24.diff @@ -0,0 +1,11 @@ +--- a/contrib/minizip/ioapi.h ++++ b/contrib/minizip/ioapi.h +@@ -21,7 +21,7 @@ + #ifndef _ZLIBIOAPI64_H + #define _ZLIBIOAPI64_H + +-#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) ++#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__)) && !(defined(__ANDROID_API__) && __ANDROID_API__ < 24) + + // Linux needs this to support file operation on files larger then 4+GB + // But might need better if/def to select just the platforms that needs them.