Bläddra i källkod

Auto-update openexr to v3.3.3 (#6846)

* Update openexr to v3.3.3

* fix cmake

* patch mingw32

---------

Co-authored-by: star9029 <[email protected]>
ruki 4 månader sedan
förälder
incheckning
12c104b876

+ 0 - 8
packages/i/imath/xmake.lua

@@ -29,15 +29,7 @@ package("imath")
         local configs = {"-DBUILD_TESTING=OFF"}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
-        if package:is_plat("windows") then
-            table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''")
-        end
         import("package.tools.cmake").install(package, configs)
-
-        if package:is_plat("windows") and package:is_debug() then
-            local dir = package:installdir(package:config("shared") and "bin" or "lib")
-            os.vcp(path.join(package:buildir(), "**.pdb"), dir)
-        end
     end)
 
     on_test(function (package)

+ 43 - 0
packages/o/openexr/patches/3.3.3/mingw32.patch

@@ -0,0 +1,43 @@
+From 914de9d8fdcd7963b44ec496f32deacd859083e3 Mon Sep 17 00:00:00 2001
+From: Christopher Schwartz <[email protected]>
+Date: Wed, 26 Mar 2025 14:00:04 +0100
+Subject: [PATCH] Fix issue #2009 of failing build on 32-bit MinGW
+
+Signed-off-by: Christopher Schwartz <[email protected]>
+---
+ src/lib/OpenEXRCore/chunk.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/lib/OpenEXRCore/chunk.c b/src/lib/OpenEXRCore/chunk.c
+index ec3ed7777..ababa9d00 100644
+--- a/src/lib/OpenEXRCore/chunk.c
++++ b/src/lib/OpenEXRCore/chunk.c
+@@ -565,7 +565,13 @@ extract_chunk_table (
+     if (ctable == NULL)
+     {
+         int64_t      nread = 0;
++#ifdef EXR_HAS_STD_ATOMICS
++        uintptr_t eptr = 0, nptr = 0;
++#elif defined(_MSC_VER)
+         uint64_t     eptr = 0, nptr = 0;
++#else
++#    error OS unimplemented support for atomics
++#endif
+         int          complete = 1;
+         uint64_t     maxoff   = ((uint64_t) -1);
+         exr_result_t rv;
+@@ -639,7 +645,13 @@ extract_chunk_table (
+         }
+         else { priv_to_native64 (ctable, part->chunk_count); }
+ 
++#ifdef EXR_HAS_STD_ATOMICS
++        nptr = (uintptr_t) ctable;
++#elif defined(_MSC_VER)
+         nptr = (uint64_t) ctable;
++#else
++#    error OS unimplemented support for atomics
++#endif
+         // see if we win or not
+         if (!atomic_compare_exchange_strong (
+                 EXR_CONST_CAST (atomic_uintptr_t*, &(part->chunk_table)),
+ 

+ 6 - 8
packages/o/openexr/xmake.lua

@@ -6,6 +6,7 @@ package("openexr")
     add_urls("https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/$(version).tar.gz",
              "https://github.com/AcademySoftwareFoundation/openexr.git")
 
+    add_versions("v3.3.3", "0ffbd842a7ee2128d44affdea30f42294b4061293cde3aa75b61a53573413d1e")
     add_versions("v3.3.2", "5013e964de7399bff1dd328cbf65d239a989a7be53255092fa10b85a8715744d")
     add_versions("v3.3.1", "58aad2b32c047070a52f1205b309bdae007442e0f983120e4ff57551eb6f10f1")
     add_versions("v3.3.0", "58b00f50d2012f3107573c4b7371f70516d2972c2b301a50925e1b4a60a7be6f")
@@ -21,6 +22,8 @@ package("openexr")
     add_versions("v3.1.5", "93925805c1fc4f8162b35f0ae109c4a75344e6decae5a240afdfce25f8a433ec")
     add_versions("v3.2.1", "61e175aa2203399fb3c8c2288752fbea3c2637680d50b6e306ea5f8ffdd46a9b")
 
+    add_patches("3.3.3", "patches/3.3.3/mingw32.patch", "17cbe9d0cbc0c670a846454893c1a427590789cf6bf052a4d800d1263e0faa9a")
+
     add_configs("build_both", {description = "Build both static library and shared library. (deprecated)", default = false, type = "boolean"})
     add_configs("tools", {description = "Build tools", default = false, type = "boolean"})
 
@@ -64,6 +67,7 @@ package("openexr")
 
     on_install(function (package)
         io.replace("CMakeLists.txt", "add_subdirectory(website/src)", "", {plain = true})
+        io.replace("cmake/OpenEXRSetup.cmake", [[set(CMAKE_DEBUG_POSTFIX "_d")]], "", {plain = true})
 
         local configs = {
             "-DBUILD_TESTING=OFF",
@@ -72,11 +76,10 @@ package("openexr")
             "-DINSTALL_OPENEXR_DOCS=OFF",
             "-DBUILD_WEBSITE=OFF",
             "-DCMAKE_DEBUG_POSTFIX=''",
+            "-DOPENEXR_FORCE_INTERNAL_IMATH=OFF",
+            "-DOPENEXR_IS_SUBPROJECT=ON",
         }
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
-        if package:is_plat("windows") then
-            table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=''")
-        end
         table.insert(configs, "-DOPENEXR_BUILD_TOOLS=" .. (package:config("tools") and "ON" or "OFF"))
         table.insert(configs, "-DOPENEXR_BUILD_UTILS=" .. (package:config("tools") and "ON" or "OFF"))
         if package:version():ge("3.0") then
@@ -101,11 +104,6 @@ package("openexr")
             table.insert(configs, "-DPYILMBASE_ENABLE=OFF")
         end
         import("package.tools.cmake").install(package, configs)
-
-        if package:is_plat("windows") and package:is_debug() then
-            os.vcp(path.join(package:buildir(), "bin/*.pdb"), package:installdir("bin"))
-            os.vcp(path.join(package:buildir(), "src/lib/*.pdb"), package:installdir("lib"))
-        end
     end)
 
     on_test(function (package)