Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions recipes/minizip/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions recipes/minizip/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ 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()
deps = CMakeDeps(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()
Expand Down
11 changes: 11 additions & 0 deletions recipes/minizip/all/patches/android-pre-24.diff
Original file line number Diff line number Diff line change
@@ -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.