-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[opencolorio] Fix minizip-ng related errors (#33335)
* Generate Imath.pc * update version * add dependency imath minizip-ng * updata version * update version * Fix minizip-ng related errors * update version * delete option * update version * Modify the license copy method * update version * shrink patch * update version * shrink patch * update version
- Loading branch information
1 parent
147d186
commit 42cc786
Showing
10 changed files
with
104 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 6f6c6bc..1856944 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -334,12 +334,8 @@ endif() | ||
if(MZ_ZSTD) | ||
# Check if zstd is present | ||
if(NOT MZ_FORCE_FETCH_LIBS) | ||
- find_package(PkgConfig QUIET) | ||
- if(PKGCONFIG_FOUND) | ||
- pkg_check_modules(ZSTD libzstd) | ||
- endif() | ||
if(NOT ZSTD_FOUND) | ||
- find_package(ZSTD QUIET) | ||
+ find_package(ZSTD NAMES zstd REQUIRED) | ||
if(ZSTD_FOUND) | ||
if(TARGET zstd::libzstd_static) | ||
list(APPEND ZSTD_LIBRARIES zstd::libzstd_static) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,93 @@ | ||
diff --git a/src/OpenColorIO/OCIOZArchive.cpp b/src/OpenColorIO/OCIOZArchive.cpp | ||
index 85fc7bb..e07ed23 100644 | ||
index 85fc7bb..aa90943 100644 | ||
--- a/src/OpenColorIO/OCIOZArchive.cpp | ||
+++ b/src/OpenColorIO/OCIOZArchive.cpp | ||
@@ -225,7 +225,7 @@ void archiveConfig(std::ostream & ostream, const Config & config, const char * c | ||
@@ -24,9 +24,11 @@ | ||
#include "mz_strm_mem.h" | ||
#include "mz_strm_os.h" | ||
#include "mz_strm_split.h" | ||
-#include "mz_strm_zlib.h" | ||
#include "mz_zip.h" | ||
#include "mz_zip_rw.h" | ||
+#ifndef __APPLE__ | ||
+#include "mz_strm_zlib.h" | ||
+#endif | ||
|
||
namespace OCIO_NAMESPACE | ||
{ | ||
@@ -225,7 +227,11 @@ void archiveConfig(std::ostream & ostream, const Config & config, const char * c | ||
std::string configStr = ss.str(); | ||
|
||
// Write zip to memory stream. | ||
- mz_stream_mem_create(&write_mem_stream); | ||
+ mz_stream_mem_create(); | ||
+#if MZ_VERSION_BUILD >= 040000 | ||
+ write_mem_stream = mz_stream_mem_create(); | ||
+#else | ||
mz_stream_mem_create(&write_mem_stream); | ||
+#endif | ||
mz_stream_mem_set_grow_size(write_mem_stream, 128 * 1024); | ||
mz_stream_open(write_mem_stream, NULL, MZ_OPEN_MODE_CREATE); | ||
|
||
@@ -237,7 +237,7 @@ void archiveConfig(std::ostream & ostream, const Config & config, const char * c | ||
@@ -237,7 +243,11 @@ void archiveConfig(std::ostream & ostream, const Config & config, const char * c | ||
options.compress_level = ArchiveCompressionLevels::BEST; | ||
|
||
// Create the writer handle. | ||
- mz_zip_writer_create(&archiver); | ||
+ mz_zip_writer_create(); | ||
+#if MZ_VERSION_BUILD >= 040000 | ||
+ archiver = mz_zip_writer_create(); | ||
+#else | ||
mz_zip_writer_create(&archiver); | ||
+#endif | ||
|
||
// Archive options. | ||
// Compression method | ||
@@ -332,7 +332,7 @@ void ExtractOCIOZArchive(const char * archivePath, const char * destination) | ||
@@ -332,7 +342,11 @@ void ExtractOCIOZArchive(const char * archivePath, const char * destination) | ||
std::string outputDestination = pystring::os::path::normpath(destination); | ||
|
||
// Create zip reader. | ||
- mz_zip_reader_create(&extracter); | ||
+ mz_zip_reader_create(); | ||
+#if MZ_VERSION_BUILD >= 040000 | ||
+ extracter = mz_zip_reader_create(); | ||
+#else | ||
mz_zip_reader_create(&extracter); | ||
+#endif | ||
|
||
MinizipNgHandlerGuard extracterGuard(extracter, false, false); | ||
|
||
@@ -450,7 +450,7 @@ std::vector<uint8_t> getFileStringFromArchiveFile(const std::string & filepath, | ||
@@ -450,7 +464,11 @@ std::vector<uint8_t> getFileStringFromArchiveFile(const std::string & filepath, | ||
std::vector<uint8_t> buffer; | ||
|
||
// Create the reader object. | ||
- mz_zip_reader_create(&reader); | ||
+ mz_zip_reader_create(); | ||
+#if MZ_VERSION_BUILD >= 040000 | ||
+ reader = mz_zip_reader_create(); | ||
+#else | ||
mz_zip_reader_create(&reader); | ||
+#endif | ||
|
||
MinizipNgHandlerGuard extracterGuard(reader, false, true); | ||
|
||
@@ -510,7 +510,7 @@ void getEntriesMappingFromArchiveFile(const std::string & archivePath, | ||
@@ -510,7 +528,11 @@ void getEntriesMappingFromArchiveFile(const std::string & archivePath, | ||
void *reader = NULL; | ||
|
||
// Create the reader object. | ||
- mz_zip_reader_create(&reader); | ||
+ mz_zip_reader_create(); | ||
+#if MZ_VERSION_BUILD >= 040000 | ||
+ reader = mz_zip_reader_create(); | ||
+#else | ||
mz_zip_reader_create(&reader); | ||
+#endif | ||
|
||
MinizipNgHandlerGuard extracterGuard(reader, false, false); | ||
|
||
diff --git a/src/OpenColorIO/OCIOZArchive.cpp b/src/OpenColorIO/OCIOZArchive.cpp | ||
index 85fc7bb..45416cd 100644 | ||
--- a/src/OpenColorIO/OCIOZArchive.cpp | ||
+++ b/src/OpenColorIO/OCIOZArchive.cpp | ||
@@ -24,9 +24,11 @@ | ||
#include "mz_strm_mem.h" | ||
#include "mz_strm_os.h" | ||
#include "mz_strm_split.h" | ||
-#include "mz_strm_zlib.h" | ||
#include "mz_zip.h" | ||
#include "mz_zip_rw.h" | ||
+#ifndef __APPLE__ | ||
+#include "mz_strm_zlib.h" | ||
diff --git a/src/apps/ocioarchive/main.cpp b/src/apps/ocioarchive/main.cpp | ||
index 190cade..68054a6 100644 | ||
--- a/src/apps/ocioarchive/main.cpp | ||
+++ b/src/apps/ocioarchive/main.cpp | ||
@@ -235,7 +235,11 @@ int main(int argc, const char **argv) | ||
} | ||
|
||
std::string path = args[0]; | ||
+#if MZ_VERSION_BUILD >= 040000 | ||
+ reader = mz_zip_reader_create(); | ||
+#else | ||
mz_zip_reader_create(&reader); | ||
+#endif | ||
|
||
namespace OCIO_NAMESPACE | ||
{ | ||
struct tm tmu_date; | ||
err = mz_zip_reader_open_file(reader, path.c_str()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters