From a3b09cf60d192cb5ccd9ae9b0041ab7477858388 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 8 Oct 2022 12:53:53 -0400 Subject: [PATCH 001/167] Fix rpmautospec changelog problems See: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/RAC2ZEWC75RIFHDR3QMPNKUSEAISIYTU/ --- changelog | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 changelog diff --git a/changelog b/changelog new file mode 100644 index 0000000..df1af24 --- /dev/null +++ b/changelog @@ -0,0 +1,92 @@ +* Sat Oct 08 2022 Benjamin A. Beasley 22.05b-11 +- Fix rpmautospec changelog problems + +* Fri Oct 07 2022 Richard Shaw 22.05b-10 +- Rebuild for OpenImageIO 2.4.4.2. + +* Wed Aug 03 2022 Benjamin A. Beasley 22.05b-9 +- Revert "Update to 22.08 (.so version bump); close RHBZ#2110024" + +* Tue Aug 02 2022 Benjamin A. Beasley 22.08-1 +- Update to 22.08 (.so version bump); close RHBZ#2110024 +- The monolithic library is also renamed from libusd_usd_ms.so to + libusd_ms.so. + +* Sat Jul 23 2022 Fedora Release Engineering 22.05b-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Wed Jul 06 2022 Benjamin A. Beasley 22.05b-7 +- Re-enable usdview now that RHBZ#2025599 is fixed + +* Mon Jul 04 2022 Luya Tshimbalanga 22.05b-6 +- Rebuild for embree 3.13.3 + +* Thu Jun 30 2022 Benjamin A. Beasley 22.05b-5 +- Updated (cleaner) patch in upstream PR#1928 + +* Tue Jun 28 2022 Benjamin A. Beasley 22.05b-4 +- Updated patch for upstream PR#1928 + +* Tue Jun 28 2022 Benjamin A. Beasley 22.05b-3 +- Temporarily disable usdview (close RHBZ#2099184) +- It can be re-enabled when pyside2 is ready for Python 3.11 (RHBZ#2025599) + +* Tue Jun 28 2022 Benjamin A. Beasley 22.05b-2 +- Fix a Python 3.11 incompatibility +- Apply upstream PR#1928 “Do not access PyFrameObject fields directly on + Python 3.10+” + +* Wed Jun 15 2022 Benjamin A. Beasley 22.05b-1 +- Update to 22.05b (close RHBZ#2097211) + +* Fri May 27 2022 Benjamin A. Beasley 22.05a-1 +- Update to 22.05a (close RHBZ#2078041) +- For working around deprecated/removed glibc malloc hooks, switch to + upstream PR#1830, which has similar effect to our pre-existing patch, but + is a little tidier +- Move usdview/testusdview binaries to python3-usd subpackage +- New downstream .so version 0.22.5 + +* Wed May 04 2022 Thomas Rodgers 22.03-9 +- Rebuilt for Boost 1.78 + +* Wed Apr 20 2022 Benjamin A. Beasley 22.03-8 +- Security fix for CVE-2022-28041 + +* Fri Apr 01 2022 Benjamin A. Beasley 22.03-7 +- Do not package pxrConfig.cmake (close RHBZ#2055414) + +* Fri Apr 01 2022 Benjamin A. Beasley 22.03-6 +- Apply a patch that would be required to build the tests + +* Fri Apr 01 2022 Benjamin A. Beasley 22.03-5 +- Move bundled library virtual Provides to -libs + +* Fri Apr 01 2022 Benjamin A. Beasley 22.03-4 +- No need to explicitly disable in-source build on Fedora + +* Fri Apr 01 2022 Benjamin A. Beasley 22.03-3 +- Stop using jemalloc + +* Wed Mar 30 2022 Benjamin A. Beasley 22.03-2 +- Change downstream .so version scheme +- Use the entire version number in the .so version to reflect the lack of + an upstream ABI stability policy. +- Use a separate .so version macro in the spec file rather than deducing it + from the package version. Having to manually change the .so version macro + on updates is a valuable reminder of the need to rebuild dependent + packages. +- Also support versioning shared libraries in non-monolithic builds. + +* Mon Feb 21 2022 Luya Tshimbalanga 22.03-1 +- New upstream release 22.03 This update adds workaround removing + depreciated glibc mallocHock + +* Sat Jan 22 2022 Fedora Release Engineering 21.11-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sun Nov 28 2021 Mamoru TASAKA 21.11-4 +- empty commit to fix upgrade path from F35 + +* Sat Nov 13 2021 Luya Tshimbalanga 21.11-3 +- RPMAUTOSPEC: unresolvable merge From 051d649e48e4d5e1c0c218e5222b3e3ee46a96b7 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Tue, 15 Nov 2022 09:08:02 -0600 Subject: [PATCH 002/167] Move from OpenColorIO 1 compat package to OpenColorIO 2 as the compat package does not build with yaml-cpp 0.7.0. From 68fe1a288844cdb833a7476060ced4cc68ba6f4c Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Tue, 15 Nov 2022 09:09:06 -0600 Subject: [PATCH 003/167] Move from OpenColorIO 1 compat package to OpenColorIO 2 as the compat package does not build with yaml-cpp 0.7.0. --- usd.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 3da41cb..909ea41 100644 --- a/usd.spec +++ b/usd.spec @@ -137,8 +137,7 @@ BuildRequires: pkgconfig(dri) BuildRequires: pkgconfig(jemalloc) %endif %if %{with ocio} -# usd is not yet compatible with OpenColorIO 2 so use compat package. -BuildRequires: pkgconfig(OpenColorIO) < 2 +BuildRequires: cmake(OpenColorIO) %endif %if %{with oiio} BuildRequires: pkgconfig(OpenImageIO) From a9e448e663abc04e87c55e38e7f0ec03be6ae686 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 29 Nov 2022 16:51:06 -0500 Subject: [PATCH 004/167] Update License to SPDX --- usd.spec | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/usd.spec b/usd.spec index 909ea41..bd00d03 100644 --- a/usd.spec +++ b/usd.spec @@ -25,12 +25,13 @@ Version: 22.05b Release: %autorelease -b 9 Summary: 3D VFX pipeline interchange file format -# The entire source is ASL 2.0 except: +# The entire source is Apache-2.0 except: # -# BSD: +# BSD-3-Clause: # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ # - pxr/base/tf/pxrDoubleConversion/ +# BSD-2-Clause: # - pxr/base/tf/pxrLZ4/ # MIT: # - pxr/imaging/garch/khrplatform.h @@ -38,20 +39,16 @@ Summary: 3D VFX pipeline interchange file format # - third_party/renderman-24/plugin/rmanArgsParser/pugixml/ # - pxr/base/tf/pxrTslRobinMap/ # - pxr/imaging/hgiVulkan/vk_mem_alloc.h -# MIT or Unlicense: +# MIT OR Unlicense: # - pxr/imaging/hio/stb/ -# -# (Certain build system files are also under licenses other than ASL 2.0, but -# do not contribute their license terms to the built RPMs.) -# -# The following files mention GPLv3+, but are distributed under ASL 2.0 due to -# the special exception for Bison parser skeletons. See the comments in their -# headers for details. -# +# Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} # - third_party/renderman-24/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} -License: ASL 2.0 and BSD and MIT and (MIT or Unlicense) +# +# (Certain build system files are also under licenses other than Apache-2.0, but +# do not contribute their license terms to the built RPMs.) +License: Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/%{name} Source0: %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz From 37d241863d81946c7802cff4ca126c9ff300add3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 14 Dec 2022 17:33:27 -0500 Subject: [PATCH 005/167] Remove obsolete conditionals --- usd.spec | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usd.spec b/usd.spec index bd00d03..271c95f 100644 --- a/usd.spec +++ b/usd.spec @@ -118,6 +118,7 @@ BuildRequires: graphviz # For imaging and usd imaging %if %{with imaging} + %if %{with embree} BuildRequires: embree-devel %endif @@ -140,12 +141,9 @@ BuildRequires: cmake(OpenColorIO) BuildRequires: pkgconfig(OpenImageIO) %endif BuildRequires: cmake(OpenEXR) -%if 0%{?fedora} < 35 -BuildRequires: pkgconfig(IlmBase) >= 2.0 -%else BuildRequires: cmake(Imath) >= 2.0 -%endif BuildRequires: pkgconfig(Ptex) + %endif %if %{with alembic} BuildRequires: cmake(Alembic) From 5492b00ad80dec1a7d12f745b0857d77b02a1300 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Mon, 2 Jan 2023 13:54:50 -0800 Subject: [PATCH 006/167] Rebuild for openvdb 10.0.1 From 5084bed9de00d6a8c1399419f13abee888e42819 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Mon, 2 Jan 2023 16:24:42 -0800 Subject: [PATCH 007/167] Rebuild for openvdb 10.0.1 From 813268a493514d6bf2e1b55019a64ab7f0e277c6 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 9 Jan 2023 17:24:49 -0600 Subject: [PATCH 008/167] Rebuild for OpenColorIO. From f27d51f9400186a77ce8dc2f3f29b13cd35ecb06 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 05:59:39 +0000 Subject: [PATCH 009/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering From c0844eb572dc60c5361edc967a85c50dc27a47e1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 29 Jan 2023 14:43:34 -0500 Subject: [PATCH 010/167] Add missing #include for GCC13 --- 2215.patch | 21 +++++++++++++++++++++ usd.spec | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 2215.patch diff --git a/2215.patch b/2215.patch new file mode 100644 index 0000000..5b96cf1 --- /dev/null +++ b/2215.patch @@ -0,0 +1,21 @@ +From d40f0322e16dd3253181b65a5f10af9dcef0a845 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Sun, 29 Jan 2023 14:19:35 -0500 +Subject: [PATCH] Add missing #include for GCC13 + +--- + pxr/base/arch/virtualMemory.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/pxr/base/arch/virtualMemory.cpp b/pxr/base/arch/virtualMemory.cpp +index 4337b8c31e..3c409fab48 100644 +--- a/pxr/base/arch/virtualMemory.cpp ++++ b/pxr/base/arch/virtualMemory.cpp +@@ -26,6 +26,7 @@ + #include "pxr/base/arch/defines.h" + #include "pxr/base/arch/systemInfo.h" + ++#include + #if defined(ARCH_OS_WINDOWS) + #include + #include diff --git a/usd.spec b/usd.spec index 271c95f..53caaa9 100644 --- a/usd.spec +++ b/usd.spec @@ -79,6 +79,9 @@ Source1: org.open%{name}.%{name}view.desktop # because we do not want to package the built plugin anyway. (It should not be # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) Patch: USD-22.05-soversion.patch +# Add missing #include for GCC13 +# https://github.com/PixarAnimationStudios/USD/pull/2215 +Patch: %{forgeurl}/pull/2215.patch # Support OpenEXR 3 # https://github.com/PixarAnimationStudios/USD/issues/1591 From 7e99411579b84b9585146a416e83c90e86d1a4e9 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 29 Jan 2023 18:21:54 -0500 Subject: [PATCH 011/167] Fix patch to work with stb_image 2.28 --- stb_image.patch | 155 ++++++++++++++++++++++++++++++++++++++++++++++++ usd.spec | 20 +++++-- 2 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 stb_image.patch diff --git a/stb_image.patch b/stb_image.patch new file mode 100644 index 0000000..a8a3a30 --- /dev/null +++ b/stb_image.patch @@ -0,0 +1,155 @@ +--- stb/stb_image.h 2021-09-16 11:52:38.284782000 -0700k ++++ stb_image.h 2021-09-16 13:45:48.159770000 -0700 +@@ -488,14 +488,14 @@ + STBIDEF void stbi_image_free (void *retval_from_stbi_load); + + // get image dimensions & components without fully decoding +-STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); +-STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); ++STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, float *gamma); ++STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, float *gamma); + STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len); + STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *clbk, void *user); + + #ifndef STBI_NO_STDIO +-STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); +-STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); ++STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp, float *gamma); ++STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp, float *gamma); + STBIDEF int stbi_is_16_bit (char const *filename); + STBIDEF int stbi_is_16_bit_from_file(FILE *f); + #endif +@@ -911,7 +911,7 @@ + #ifndef STBI_NO_PNG + static int stbi__png_test(stbi__context *s); + static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); +-static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); ++static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp, float *gamma); + static int stbi__png_is16(stbi__context *s); + #endif + +@@ -4554,6 +4554,7 @@ + stbi__context *s; + stbi_uc *idata, *expanded, *out; + int depth; ++ float gamma = 0; + } stbi__png; + + +@@ -5112,6 +5113,13 @@ + break; + } + ++ case STBI__PNG_TYPE('g','A','M','A'): { ++ if (first) return stbi__err("first not IHDR", "Corrupt PNG"); ++ if (4 != c.length) return stbi__err("invalid gAMA","Corrupt PNG"); ++ z->gamma = stbi__get32be(s) / 100000.0f; ++ break; ++ } ++ + case STBI__PNG_TYPE('I','D','A','T'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); +@@ -5243,7 +5251,7 @@ + return r; + } + +-static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp) ++static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp, float *gamma) + { + if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { + stbi__rewind( p->s ); +@@ -5252,21 +5260,22 @@ + if (x) *x = p->s->img_x; + if (y) *y = p->s->img_y; + if (comp) *comp = p->s->img_n; ++ if (gamma) *gamma = p->gamma; + return 1; + } + +-static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) ++static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp, float *gamma) + { + stbi__png p; + p.s = s; +- return stbi__png_info_raw(&p, x, y, comp); ++ return stbi__png_info_raw(&p, x, y, comp, gamma); + } + + static int stbi__png_is16(stbi__context *s) + { + stbi__png p; + p.s = s; +- if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) ++ if (!stbi__png_info_raw(&p, NULL, NULL, NULL, NULL)) + return 0; + if (p.depth != 16) { + stbi__rewind(p.s); +@@ -7538,14 +7547,14 @@ + } + #endif + +-static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) ++static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp, float *gamma) + { + #ifndef STBI_NO_JPEG + if (stbi__jpeg_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_PNG +- if (stbi__png_info(s, x, y, comp)) return 1; ++ if (stbi__png_info(s, x, y, comp, gamma)) return 1; + #endif + + #ifndef STBI_NO_GIF +@@ -7597,23 +7606,23 @@ + } + + #ifndef STBI_NO_STDIO +-STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp) ++STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp, float *gamma) + { + FILE *f = stbi__fopen(filename, "rb"); + int result; + if (!f) return stbi__err("can't fopen", "Unable to open file"); +- result = stbi_info_from_file(f, x, y, comp); ++ result = stbi_info_from_file(f, x, y, comp, gamma); + fclose(f); + return result; + } + +-STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) ++STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp, float *gamma) + { + int r; + stbi__context s; + long pos = ftell(f); + stbi__start_file(&s, f); +- r = stbi__info_main(&s,x,y,comp); ++ r = stbi__info_main(&s,x,y,comp, gamma); + fseek(f,pos,SEEK_SET); + return r; + } +@@ -7640,18 +7649,18 @@ + } + #endif // !STBI_NO_STDIO + +-STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) ++STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, float *gamma) + { + stbi__context s; + stbi__start_mem(&s,buffer,len); +- return stbi__info_main(&s,x,y,comp); ++ return stbi__info_main(&s,x,y,comp, gamma); + } + +-STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) ++STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp, float *gamma) + { + stbi__context s; + stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); +- return stbi__info_main(&s,x,y,comp); ++ return stbi__info_main(&s,x,y,comp, gamma); + } + + STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len) diff --git a/usd.spec b/usd.spec index 53caaa9..a525c49 100644 --- a/usd.spec +++ b/usd.spec @@ -53,6 +53,13 @@ URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/%{name} Source0: %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: org.open%{name}.%{name}view.desktop +# Latest stb_image.patch that applies cleanly against 2.27: +# %%{forgeurl}/raw/8f9bb9563980b41e7695148b63bf09f7abd38a41/pxr/imaging/hio/stb/stb_image.patch +# We treat this as a source file because it is applied separately during +# unbundling. It has been hand-edited to apply to 2.28, where +# stbi__unpremultiply_on_load_thread is already renamed to +# stbi_set_unpremultiply_on_load_thread. +Source2: stb_image.patch # Upstream was asked about .so versioning and setting SONAME properly and # seemed unprepared to handle the request: @@ -157,11 +164,11 @@ BuildRequires: hdf5-devel # # stb_image 2.27^20210910gitaf1a5bc-0.2 is the minimum EVR to contain fixes for # all of CVE-2021-28021, CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041. -BuildRequires: stb_image-devel >= 2.27^20210910gitaf1a5bc-0.2 +BuildRequires: stb_image-devel >= 2.28 BuildRequires: stb_image-static -BuildRequires: stb_image_write-devel +BuildRequires: stb_image_write-devel >= 1.16 BuildRequires: stb_image_write-static -BuildRequires: stb_image_resize-devel +BuildRequires: stb_image_resize-devel >= 0.97 BuildRequires: stb_image_resize-static Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -285,9 +292,10 @@ ln -s %{_datadir}/fonts/google-roboto-mono \ # Unbundle stb_image, stb_image_write, stb_image_resize: pushd pxr/imaging/hio/stb -cp -p %{_includedir}/stb_image.h %{_includedir}/stb_image_write.h . -cat stb_image.patch stb_image_write.patch | patch -p1 -ln -svf %{_includedir}/stb_image_resize.h ./ +cp -p %{_includedir}/stb_image.h . +patch -p1 < '%{SOURCE2}' +ln -svf %{_includedir}/stb_image_resize.h \ + %{_includedir}/stb_image_write.h ./ popd # Use c++17 standard otherwise build fails From 775ace756847ef23531d27010e0bfa8bba0aa010 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 29 Jan 2023 18:21:54 -0500 Subject: [PATCH 012/167] Fix patch to work with stb_image 2.28 --- stb_image.patch | 155 ++++++++++++++++++++++++++++++++++++++++++++++++ usd.spec | 20 +++++-- 2 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 stb_image.patch diff --git a/stb_image.patch b/stb_image.patch new file mode 100644 index 0000000..a8a3a30 --- /dev/null +++ b/stb_image.patch @@ -0,0 +1,155 @@ +--- stb/stb_image.h 2021-09-16 11:52:38.284782000 -0700k ++++ stb_image.h 2021-09-16 13:45:48.159770000 -0700 +@@ -488,14 +488,14 @@ + STBIDEF void stbi_image_free (void *retval_from_stbi_load); + + // get image dimensions & components without fully decoding +-STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); +-STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); ++STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, float *gamma); ++STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, float *gamma); + STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len); + STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *clbk, void *user); + + #ifndef STBI_NO_STDIO +-STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); +-STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); ++STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp, float *gamma); ++STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp, float *gamma); + STBIDEF int stbi_is_16_bit (char const *filename); + STBIDEF int stbi_is_16_bit_from_file(FILE *f); + #endif +@@ -911,7 +911,7 @@ + #ifndef STBI_NO_PNG + static int stbi__png_test(stbi__context *s); + static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); +-static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); ++static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp, float *gamma); + static int stbi__png_is16(stbi__context *s); + #endif + +@@ -4554,6 +4554,7 @@ + stbi__context *s; + stbi_uc *idata, *expanded, *out; + int depth; ++ float gamma = 0; + } stbi__png; + + +@@ -5112,6 +5113,13 @@ + break; + } + ++ case STBI__PNG_TYPE('g','A','M','A'): { ++ if (first) return stbi__err("first not IHDR", "Corrupt PNG"); ++ if (4 != c.length) return stbi__err("invalid gAMA","Corrupt PNG"); ++ z->gamma = stbi__get32be(s) / 100000.0f; ++ break; ++ } ++ + case STBI__PNG_TYPE('I','D','A','T'): { + if (first) return stbi__err("first not IHDR", "Corrupt PNG"); + if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); +@@ -5243,7 +5251,7 @@ + return r; + } + +-static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp) ++static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp, float *gamma) + { + if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { + stbi__rewind( p->s ); +@@ -5252,21 +5260,22 @@ + if (x) *x = p->s->img_x; + if (y) *y = p->s->img_y; + if (comp) *comp = p->s->img_n; ++ if (gamma) *gamma = p->gamma; + return 1; + } + +-static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) ++static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp, float *gamma) + { + stbi__png p; + p.s = s; +- return stbi__png_info_raw(&p, x, y, comp); ++ return stbi__png_info_raw(&p, x, y, comp, gamma); + } + + static int stbi__png_is16(stbi__context *s) + { + stbi__png p; + p.s = s; +- if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) ++ if (!stbi__png_info_raw(&p, NULL, NULL, NULL, NULL)) + return 0; + if (p.depth != 16) { + stbi__rewind(p.s); +@@ -7538,14 +7547,14 @@ + } + #endif + +-static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) ++static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp, float *gamma) + { + #ifndef STBI_NO_JPEG + if (stbi__jpeg_info(s, x, y, comp)) return 1; + #endif + + #ifndef STBI_NO_PNG +- if (stbi__png_info(s, x, y, comp)) return 1; ++ if (stbi__png_info(s, x, y, comp, gamma)) return 1; + #endif + + #ifndef STBI_NO_GIF +@@ -7597,23 +7606,23 @@ + } + + #ifndef STBI_NO_STDIO +-STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp) ++STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp, float *gamma) + { + FILE *f = stbi__fopen(filename, "rb"); + int result; + if (!f) return stbi__err("can't fopen", "Unable to open file"); +- result = stbi_info_from_file(f, x, y, comp); ++ result = stbi_info_from_file(f, x, y, comp, gamma); + fclose(f); + return result; + } + +-STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) ++STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp, float *gamma) + { + int r; + stbi__context s; + long pos = ftell(f); + stbi__start_file(&s, f); +- r = stbi__info_main(&s,x,y,comp); ++ r = stbi__info_main(&s,x,y,comp, gamma); + fseek(f,pos,SEEK_SET); + return r; + } +@@ -7640,18 +7649,18 @@ + } + #endif // !STBI_NO_STDIO + +-STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) ++STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, float *gamma) + { + stbi__context s; + stbi__start_mem(&s,buffer,len); +- return stbi__info_main(&s,x,y,comp); ++ return stbi__info_main(&s,x,y,comp, gamma); + } + +-STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) ++STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp, float *gamma) + { + stbi__context s; + stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); +- return stbi__info_main(&s,x,y,comp); ++ return stbi__info_main(&s,x,y,comp, gamma); + } + + STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len) diff --git a/usd.spec b/usd.spec index 3da41cb..9f2c6b2 100644 --- a/usd.spec +++ b/usd.spec @@ -56,6 +56,13 @@ URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/%{name} Source0: %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: org.open%{name}.%{name}view.desktop +# Latest stb_image.patch that applies cleanly against 2.27: +# %%{forgeurl}/raw/8f9bb9563980b41e7695148b63bf09f7abd38a41/pxr/imaging/hio/stb/stb_image.patch +# We treat this as a source file because it is applied separately during +# unbundling. It has been hand-edited to apply to 2.28, where +# stbi__unpremultiply_on_load_thread is already renamed to +# stbi_set_unpremultiply_on_load_thread. +Source2: stb_image.patch # Upstream was asked about .so versioning and setting SONAME properly and # seemed unprepared to handle the request: @@ -160,11 +167,11 @@ BuildRequires: hdf5-devel # # stb_image 2.27^20210910gitaf1a5bc-0.2 is the minimum EVR to contain fixes for # all of CVE-2021-28021, CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041. -BuildRequires: stb_image-devel >= 2.27^20210910gitaf1a5bc-0.2 +BuildRequires: stb_image-devel >= 2.28 BuildRequires: stb_image-static -BuildRequires: stb_image_write-devel +BuildRequires: stb_image_write-devel >= 1.16 BuildRequires: stb_image_write-static -BuildRequires: stb_image_resize-devel +BuildRequires: stb_image_resize-devel >= 0.97 BuildRequires: stb_image_resize-static Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -288,9 +295,10 @@ ln -s %{_datadir}/fonts/google-roboto-mono \ # Unbundle stb_image, stb_image_write, stb_image_resize: pushd pxr/imaging/hio/stb -cp -p %{_includedir}/stb_image.h %{_includedir}/stb_image_write.h . -cat stb_image.patch stb_image_write.patch | patch -p1 -ln -svf %{_includedir}/stb_image_resize.h ./ +cp -p %{_includedir}/stb_image.h . +patch -p1 < '%{SOURCE2}' +ln -svf %{_includedir}/stb_image_resize.h \ + %{_includedir}/stb_image_write.h ./ popd # Use c++17 standard otherwise build fails From 9df1a73e38151e1b67a4bd08552a957c857cdd2d Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Fri, 10 Feb 2023 17:53:02 -0800 Subject: [PATCH 013/167] Rebuild for embree-4.0.0 From 77eb1478ebb444ec12c2df2687b6924eae1efb02 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Sat, 11 Feb 2023 01:57:23 -0800 Subject: [PATCH 014/167] Rebuild for embree 4.0.0 --- usd.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usd.spec b/usd.spec index a525c49..a316e91 100644 --- a/usd.spec +++ b/usd.spec @@ -363,6 +363,8 @@ flags="${flags} $(pkgconf --cflags Imath)" %if %{with embree} -DPXR_BUILD_EMBREE_PLUGIN=ON \ -DEMBREE_LOCATION=%{_prefix} \ + -DEMBREE_INCLUDE_DIR=%{_includedir}/embree4 \ + -DEMBREE_LIBRARY=%{_lidir}/embree4.so \ %endif %if %{with ocio} -DPXR_BUILD_OPENCOLORIO_PLUGIN=ON \ From f7dcba95bdf1573d286523c06042060480691908 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 11 Feb 2023 13:07:03 -0500 Subject: [PATCH 015/167] Port to Embree 4 --- 2266.patch | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++ usd.spec | 11 ++- 2 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 2266.patch diff --git a/2266.patch b/2266.patch new file mode 100644 index 0000000..e8f1419 --- /dev/null +++ b/2266.patch @@ -0,0 +1,217 @@ +From 4b6c23d459c602fdac5e0ebc9b7722cbd5475e86 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Sat, 11 Feb 2023 13:58:42 -0500 +Subject: [PATCH] Port to Embree 4.x + +--- + cmake/modules/FindEmbree.cmake | 16 ++++++++-------- + pxr/imaging/plugin/hdEmbree/context.h | 2 +- + pxr/imaging/plugin/hdEmbree/mesh.cpp | 2 +- + pxr/imaging/plugin/hdEmbree/mesh.h | 4 ++-- + pxr/imaging/plugin/hdEmbree/meshSamplers.h | 4 ++-- + pxr/imaging/plugin/hdEmbree/pch.h | 6 +++--- + pxr/imaging/plugin/hdEmbree/renderDelegate.h | 2 +- + pxr/imaging/plugin/hdEmbree/renderParam.h | 2 +- + pxr/imaging/plugin/hdEmbree/renderer.cpp | 8 ++------ + pxr/imaging/plugin/hdEmbree/renderer.h | 4 ++-- + .../plugin/hdEmbree/testenv/testHdEmbree.cpp | 2 +- + 11 files changed, 24 insertions(+), 28 deletions(-) + +diff --git a/cmake/modules/FindEmbree.cmake b/cmake/modules/FindEmbree.cmake +index e12639d6d9..ec13d0f5c4 100644 +--- a/cmake/modules/FindEmbree.cmake ++++ b/cmake/modules/FindEmbree.cmake +@@ -37,11 +37,11 @@ + #============================================================================= + + if (APPLE) +- set (EMBREE_LIB_NAME libembree3.dylib) ++ set (EMBREE_LIB_NAME libembree4.dylib) + elseif (UNIX) +- set (EMBREE_LIB_NAME libembree3.so) ++ set (EMBREE_LIB_NAME libembree4.so) + elseif (WIN32) +- set (EMBREE_LIB_NAME embree3.lib) ++ set (EMBREE_LIB_NAME embree4.lib) + endif() + + find_library(EMBREE_LIBRARY +@@ -56,7 +56,7 @@ find_library(EMBREE_LIBRARY + ) + + find_path(EMBREE_INCLUDE_DIR +- embree3/rtcore.h ++ embree4/rtcore.h + HINTS + "${EMBREE_LOCATION}/include" + "$ENV{EMBREE_LOCATION}/include" +@@ -64,12 +64,12 @@ DOC + "Embree headers path" + ) + +-if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" ) +- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") ++if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" ) ++ file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") + string(REGEX MATCHALL "[0-9]+" MAJOR ${TMP}) +- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") ++ file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") + string(REGEX MATCHALL "[0-9]+" MINOR ${TMP}) +- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") ++ file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") + string(REGEX MATCHALL "[0-9]+" PATCH ${TMP}) + + set (EMBREE_VERSION ${MAJOR}.${MINOR}.${PATCH}) +diff --git a/pxr/imaging/plugin/hdEmbree/context.h b/pxr/imaging/plugin/hdEmbree/context.h +index 7af4ab0d27..fb10e8ceff 100644 +--- a/pxr/imaging/plugin/hdEmbree/context.h ++++ b/pxr/imaging/plugin/hdEmbree/context.h +@@ -31,7 +31,7 @@ + #include "pxr/base/gf/matrix4f.h" + #include "pxr/base/vt/array.h" + +-#include ++#include + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/mesh.cpp b/pxr/imaging/plugin/hdEmbree/mesh.cpp +index e8e001e1cc..fe0f25b7b8 100644 +--- a/pxr/imaging/plugin/hdEmbree/mesh.cpp ++++ b/pxr/imaging/plugin/hdEmbree/mesh.cpp +@@ -220,7 +220,7 @@ void HdEmbreeMesh::_EmbreeCullFaces(const RTCFilterFunctionNArguments* args) + default: break; + } + if (cull) { +- // This is how you reject a hit in embree3 instead of setting ++ // This is how you reject a hit in embree3/4 instead of setting + // geomId to invalid on the ray + args->valid[i] = 0; + } +diff --git a/pxr/imaging/plugin/hdEmbree/mesh.h b/pxr/imaging/plugin/hdEmbree/mesh.h +index 4574454368..f83bf5d998 100644 +--- a/pxr/imaging/plugin/hdEmbree/mesh.h ++++ b/pxr/imaging/plugin/hdEmbree/mesh.h +@@ -32,8 +32,8 @@ + + #include "pxr/imaging/plugin/hdEmbree/meshSamplers.h" + +-#include +-#include ++#include ++#include + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/meshSamplers.h b/pxr/imaging/plugin/hdEmbree/meshSamplers.h +index bef6f65959..2b481e5694 100644 +--- a/pxr/imaging/plugin/hdEmbree/meshSamplers.h ++++ b/pxr/imaging/plugin/hdEmbree/meshSamplers.h +@@ -29,8 +29,8 @@ + #include "pxr/imaging/hd/meshUtil.h" + #include "pxr/base/vt/types.h" + +-#include +-#include ++#include ++#include + + #include + +diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h +index 7710229804..e8e733bfc4 100644 +--- a/pxr/imaging/plugin/hdEmbree/pch.h ++++ b/pxr/imaging/plugin/hdEmbree/pch.h +@@ -151,9 +151,9 @@ + #include + #include + #include +-#include +-#include +-#include ++#include ++#include ++#include + #include + #include + #include +diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h +index 20a80487a9..6a6bc9dbf1 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h ++++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h +@@ -31,7 +31,7 @@ + #include "pxr/base/tf/staticTokens.h" + + #include +-#include ++#include + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/renderParam.h b/pxr/imaging/plugin/hdEmbree/renderParam.h +index ff61000ab5..d3f903e0f3 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderParam.h ++++ b/pxr/imaging/plugin/hdEmbree/renderParam.h +@@ -28,7 +28,7 @@ + #include "pxr/imaging/hd/renderDelegate.h" + #include "pxr/imaging/hd/renderThread.h" + +-#include ++#include + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp +index 20ec78c6aa..72a897120d 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderer.cpp ++++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp +@@ -650,9 +650,7 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, + rayHit.ray.flags = 0; + _PopulateRayHit(&rayHit, origin, dir, 0.0f); + { +- RTCIntersectContext context; +- rtcInitIntersectContext(&context); +- rtcIntersect1(_scene, &context, &rayHit); ++ rtcIntersect1(_scene, &rayHit); + // + // there is something odd about how this is used in Embree. Is it reversed + // here and then when it it used in +@@ -992,9 +990,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, + shadow.flags = 0; + _PopulateRay(&shadow, position, shadowDir, 0.001f); + { +- RTCIntersectContext context; +- rtcInitIntersectContext(&context); +- rtcOccluded1(_scene,&context,&shadow); ++ rtcOccluded1(_scene,&shadow); + } + + // Record this AO ray's contribution to the occlusion factor: a +diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h +index 6af8081678..740812fb03 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderer.h ++++ b/pxr/imaging/plugin/hdEmbree/renderer.h +@@ -32,8 +32,8 @@ + #include "pxr/base/gf/matrix4d.h" + #include "pxr/base/gf/rect2i.h" + +-#include +-#include ++#include ++#include + + #include + #include +diff --git a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp +index c361c678bc..8380aebe72 100644 +--- a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp ++++ b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp +@@ -40,7 +40,7 @@ + + #include "pxr/base/tf/errorMark.h" + +-#include ++#include + #include + + PXR_NAMESPACE_USING_DIRECTIVE diff --git a/usd.spec b/usd.spec index a316e91..9f837e6 100644 --- a/usd.spec +++ b/usd.spec @@ -111,6 +111,10 @@ Patch: %{forgeurl}/pull/1830.patch # https://github.com/PixarAnimationStudios/USD/pull/1928 Patch: %{forgeurl}/pull/1928.patch +# Port to Embree 4.x +# https://github.com/PixarAnimationStudios/USD/pull/2266 +Patch: %{forgeurl}/pull/2266.patch + # Base BuildRequires: boost-devel BuildRequires: boost-program-options @@ -317,6 +321,11 @@ sed -i 's|plugin/usd|%{_libdir}/usd/plugin|g' \ # Fix cmake directory destination sed -i 's|"${CMAKE_INSTALL_PREFIX}"|%{_libdir}/cmake/pxr|g' pxr/CMakeLists.txt +# Use Embree4 instead of Embree3. The find-then-modify pattern preserves mtimes +# on sources that did not need to be modified. +find . -type f -exec gawk '/embree3/ { print FILENAME }' '{}' '+' | + xargs -r sed -r -i 's/(embree)3/\14/' + %build # Fix uic-qt5 use cat > uic-wrapper <<'EOF' @@ -363,8 +372,6 @@ flags="${flags} $(pkgconf --cflags Imath)" %if %{with embree} -DPXR_BUILD_EMBREE_PLUGIN=ON \ -DEMBREE_LOCATION=%{_prefix} \ - -DEMBREE_INCLUDE_DIR=%{_includedir}/embree4 \ - -DEMBREE_LIBRARY=%{_lidir}/embree4.so \ %endif %if %{with ocio} -DPXR_BUILD_OPENCOLORIO_PLUGIN=ON \ From f0cc97df57b692e20de9e3f60d7ae98f53fcd7b3 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 20 Feb 2023 22:39:43 +0000 Subject: [PATCH 016/167] Rebuilt for Boost 1.81 From ca6f528281fbef31bf600310d86656839558a07f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 25 Feb 2023 18:37:09 -0500 Subject: [PATCH 017/167] Update minimum stb_image versions Ensure we have a fix for null pointer dereference bug https://github.com/nothings/stb/issues/1452. --- usd.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 9f837e6..57f963c 100644 --- a/usd.spec +++ b/usd.spec @@ -166,9 +166,10 @@ BuildRequires: hdf5-devel # Header-only library: -static is for tracking per guidelines # -# stb_image 2.27^20210910gitaf1a5bc-0.2 is the minimum EVR to contain fixes for -# all of CVE-2021-28021, CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041. -BuildRequires: stb_image-devel >= 2.28 +# Enforce the the minimum EVR to contain fixes for all of CVE-2021-28021, +# CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041, plus the null-pointer +# dereference bug https://github.com/nothings/stb/issues/1452. +BuildRequires: stb_image-devel >= 2.28^20230129git5736b15-0.2 BuildRequires: stb_image-static BuildRequires: stb_image_write-devel >= 1.16 BuildRequires: stb_image_write-static From 9c103c70b8012b4cd88c97b6f246f6097620f0fc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 25 Feb 2023 18:37:09 -0500 Subject: [PATCH 018/167] Update minimum stb_image versions Ensure we have a fix for null pointer dereference bug https://github.com/nothings/stb/issues/1452. --- usd.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 9f837e6..57f963c 100644 --- a/usd.spec +++ b/usd.spec @@ -166,9 +166,10 @@ BuildRequires: hdf5-devel # Header-only library: -static is for tracking per guidelines # -# stb_image 2.27^20210910gitaf1a5bc-0.2 is the minimum EVR to contain fixes for -# all of CVE-2021-28021, CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041. -BuildRequires: stb_image-devel >= 2.28 +# Enforce the the minimum EVR to contain fixes for all of CVE-2021-28021, +# CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041, plus the null-pointer +# dereference bug https://github.com/nothings/stb/issues/1452. +BuildRequires: stb_image-devel >= 2.28^20230129git5736b15-0.2 BuildRequires: stb_image-static BuildRequires: stb_image_write-devel >= 1.16 BuildRequires: stb_image_write-static From fec1893bb0c98fc8a878223bb0da98008d457bf1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 25 Feb 2023 18:37:09 -0500 Subject: [PATCH 019/167] Update minimum stb_image versions Ensure we have a fix for null pointer dereference bug https://github.com/nothings/stb/issues/1452. --- usd.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 9f2c6b2..be8d581 100644 --- a/usd.spec +++ b/usd.spec @@ -165,9 +165,10 @@ BuildRequires: hdf5-devel # Header-only library: -static is for tracking per guidelines # -# stb_image 2.27^20210910gitaf1a5bc-0.2 is the minimum EVR to contain fixes for -# all of CVE-2021-28021, CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041. -BuildRequires: stb_image-devel >= 2.28 +# Enforce the the minimum EVR to contain fixes for all of CVE-2021-28021, +# CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041, plus the null-pointer +# dereference bug https://github.com/nothings/stb/issues/1452. +BuildRequires: stb_image-devel >= 2.28^20230129git5736b15-0.2 BuildRequires: stb_image-static BuildRequires: stb_image_write-devel >= 1.16 BuildRequires: stb_image_write-static From ad6954040674ddbf08cd0e9c9aef0843cc2be549 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Wed, 8 Mar 2023 22:01:06 +0900 Subject: [PATCH 020/167] Fix FTBFS on F39 - Apply upstream PR to fix build with boost 1.81 - Backport upstream fix for additional header inclusion for g++13 --- USD-c1c1c1de-g++13-header-include.patch | 36 ++++++++++++++++++ USD-pr2176-pxr_vt_hash-use-tfhash.patch | 49 +++++++++++++++++++++++++ usd.spec | 10 +++++ 3 files changed, 95 insertions(+) create mode 100644 USD-c1c1c1de-g++13-header-include.patch create mode 100644 USD-pr2176-pxr_vt_hash-use-tfhash.patch diff --git a/USD-c1c1c1de-g++13-header-include.patch b/USD-c1c1c1de-g++13-header-include.patch new file mode 100644 index 0000000..5a18d9a --- /dev/null +++ b/USD-c1c1c1de-g++13-header-include.patch @@ -0,0 +1,36 @@ +From c1c1c1de039451afaba9a0e04b50f4607df67886 Mon Sep 17 00:00:00 2001 +From: sunyab +Date: Mon, 23 Jan 2023 13:18:04 -0800 +Subject: [PATCH] Add missing headers that caused build failures when building + with boost 1.78. + +(Internal change: 2260370) +--- + pxr/base/gf/plane.h | 1 + + pxr/base/tf/stringUtils.cpp | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/pxr/base/gf/plane.h b/pxr/base/gf/plane.h +index 61c731085a..f4df8796e4 100644 +--- a/pxr/base/gf/plane.h ++++ b/pxr/base/gf/plane.h +@@ -32,6 +32,7 @@ + #include "pxr/base/gf/api.h" + + #include ++#include + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/base/tf/stringUtils.cpp b/pxr/base/tf/stringUtils.cpp +index 19f20f4fc3..02482983ac 100644 +--- a/pxr/base/tf/stringUtils.cpp ++++ b/pxr/base/tf/stringUtils.cpp +@@ -37,6 +37,7 @@ + #include + #include + ++#include + #include + #include + #include diff --git a/USD-pr2176-pxr_vt_hash-use-tfhash.patch b/USD-pr2176-pxr_vt_hash-use-tfhash.patch new file mode 100644 index 0000000..5056f5e --- /dev/null +++ b/USD-pr2176-pxr_vt_hash-use-tfhash.patch @@ -0,0 +1,49 @@ +From 326cad6188af42389e7e629250ea8bf16580b524 Mon Sep 17 00:00:00 2001 +From: Matt Kuruc +Date: Mon, 23 Jan 2023 12:33:05 -0800 +Subject: [PATCH] Replace boost hash usage with TfHash in pxr/base/vt + +--- + pxr/base/vt/array.h | 15 +++++++++------ + pxr/base/vt/dictionary.h | 3 +-- + pxr/base/vt/hash.cpp | 4 ++-- + pxr/base/vt/hash.h | 26 +++++--------------------- + pxr/base/vt/testenv/testVtCpp.cpp | 12 ++++++++++++ + pxr/base/vt/value.cpp | 12 +----------- + 6 files changed, 30 insertions(+), 42 deletions(-) + +diff --git a/pxr/base/vt/hash.h b/pxr/base/vt/hash.h +index 47ca66e797..6df07c58f3 100644 +--- a/pxr/base/vt/hash.h ++++ b/pxr/base/vt/hash.h +@@ -38,28 +37,15 @@ namespace Vt_HashDetail { + // Issue a coding error when we attempt to hash a t. + VT_API void _IssueUnimplementedHashError(std::type_info const &t); + +-// We make unqualified calls, intending to pick up boost::hash_value if an +-// overload isn't found by ADL. +-using boost::hash_value; +- + // A constexpr function that determines hashability. +-template ()))> +-constexpr bool _IsHashable(int) { return true; } + template ()))> + constexpr bool _IsHashable(long) { return true; } + template + constexpr bool _IsHashable(...) { return false; } + + // Hash implementations -- We're using an overload resolution ordering trick +-// here (int vs long vs ...) so that we pick hash_value first, if possible, +-// otherwise we do TfHash() if possible, otherwise we issue a runtime error. +-template ()))> +-inline size_t +-_HashValueImpl(T const &val, int) +-{ +- return hash_value(val); +-} +- ++// here (long vs ...) so that we pick TfHash() if possible, otherwise ++// we issue a runtime error. + template ()))> + inline size_t + _HashValueImpl(T const &val, long) diff --git a/usd.spec b/usd.spec index 57f963c..86c67bd 100644 --- a/usd.spec +++ b/usd.spec @@ -115,6 +115,16 @@ Patch: %{forgeurl}/pull/1928.patch # https://github.com/PixarAnimationStudios/USD/pull/2266 Patch: %{forgeurl}/pull/2266.patch +# Prefer TfHash to boost::hash +# Part of https://github.com/PixarAnimationStudios/USD/issues/2172 +# Part of https://github.com/PixarAnimationStudios/USD/pull/2176/ (currently under review) +# Needed for boost 1.81 +Patch: USD-pr2176-pxr_vt_hash-use-tfhash.patch + +# Add missing header for g++13 +# https://github.com/PixarAnimationStudios/USD/commit/c1c1c1de039451afaba9a0e04b50f4607df67886 +Patch: USD-c1c1c1de-g++13-header-include.patch + # Base BuildRequires: boost-devel BuildRequires: boost-program-options From 7729eb9581ae1555c2e635ff4383771d2717832b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 2 Aug 2022 11:39:27 -0400 Subject: [PATCH 021/167] Update to 22.08 (.so version bump) - The monolithic library is also renamed from libusd_usd_ms.so to libusd_ms.so. --- .gitignore | 1 + 1676.patch | 54 - 1830.patch | 189 - ...b9563980b41e7695148b63bf09f7abd38a41.patch | 3464 ----------------- USD-21.11-disable-malloc-hooks.patch | 23 - USD-22.05-soversion.patch | 35 - ...OpenEXR3.patch => USD-22.08-OpenEXR3.patch | 43 +- USD-22.08-soversion.patch | 35 + sources | 2 +- usd.spec | 29 +- 10 files changed, 72 insertions(+), 3803 deletions(-) delete mode 100644 1676.patch delete mode 100644 1830.patch delete mode 100644 8f9bb9563980b41e7695148b63bf09f7abd38a41.patch delete mode 100644 USD-21.11-disable-malloc-hooks.patch delete mode 100644 USD-22.05-soversion.patch rename USD-22.05-OpenEXR3.patch => USD-22.08-OpenEXR3.patch (72%) create mode 100644 USD-22.08-soversion.patch diff --git a/.gitignore b/.gitignore index 77cc4c5..ca9ebdc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /usd-22.05.tar.gz /usd-22.05a.tar.gz /usd-22.05b.tar.gz +/usd-22.08.tar.gz diff --git a/1676.patch b/1676.patch deleted file mode 100644 index 74e8ee5..0000000 --- a/1676.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 0f6c20fa64a6b2e84cd966aa210570576fe1fcc9 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Sat, 6 Nov 2021 22:52:12 -0400 -Subject: [PATCH] Fix #1675 - -Stop accidentally treating a message as a printf-style format string in -three places. - -See details in issue #1675. ---- - pxr/imaging/hd/dirtyList.cpp | 2 +- - pxr/imaging/hd/renderIndex.cpp | 2 +- - pxr/imaging/hdSt/drawItemsCache.cpp | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/pxr/imaging/hd/dirtyList.cpp b/pxr/imaging/hd/dirtyList.cpp -index 7fc798c336..1bd2600f6c 100644 ---- a/pxr/imaging/hd/dirtyList.cpp -+++ b/pxr/imaging/hd/dirtyList.cpp -@@ -191,7 +191,7 @@ HdDirtyList::UpdateRenderTagsAndReprSelectors( - std::stringstream ss; - ss << "Resetting tracked reprs in dirty list from " - << _trackedReprs << " to " << reprs << "\n"; -- TfDebug::Helper().Msg(ss.str().c_str()); -+ TfDebug::Helper().Msg(ss.str()); - } - _trackedReprs = reprs; - trackedReprsChanged = true; -diff --git a/pxr/imaging/hd/renderIndex.cpp b/pxr/imaging/hd/renderIndex.cpp -index 1503cc6988..b251c970b2 100644 ---- a/pxr/imaging/hd/renderIndex.cpp -+++ b/pxr/imaging/hd/renderIndex.cpp -@@ -1412,7 +1412,7 @@ HdRenderIndex::SyncAll(HdTaskSharedPtrVector *tasks, - << ratioNonVarying * 100.0f << "% (" - << numNonVarying << " / " << numDirtyRprims << ") \n"; - -- TfDebug::Helper().Msg(ss.str().c_str()); -+ TfDebug::Helper().Msg(ss.str()); - } - } - } -diff --git a/pxr/imaging/hdSt/drawItemsCache.cpp b/pxr/imaging/hdSt/drawItemsCache.cpp -index 1be6aec721..61bc6794e5 100644 ---- a/pxr/imaging/hdSt/drawItemsCache.cpp -+++ b/pxr/imaging/hdSt/drawItemsCache.cpp -@@ -114,7 +114,7 @@ HdSt_DrawItemsCache::GetDrawItems( - << collection << ", render tags " << renderTags << "\n"; - } - -- TfDebug::Helper().Msg(ss.str().c_str()); -+ TfDebug::Helper().Msg(ss.str()); - } - - if (cacheMiss || staleEntry) { diff --git a/1830.patch b/1830.patch deleted file mode 100644 index bdd7391..0000000 --- a/1830.patch +++ /dev/null @@ -1,189 +0,0 @@ -From 566da79a23d9c182e6fcc463efcc2cc585dde08b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Charles=20Fl=C3=A8che?= -Date: Sun, 10 Apr 2022 12:08:30 -0400 -Subject: [PATCH] Add PXR_ENABLE_MALLOCHOOK_SUPPORT build option - ---- - BUILDING.md | 9 ++++++++- - build_scripts/build_usd.py | 18 ++++++++++++++++++ - cmake/defaults/Options.cmake | 1 + - pxr/base/arch/CMakeLists.txt | 5 +++++ - pxr/base/arch/mallocHook.cpp | 17 +++++++++++------ - 5 files changed, 43 insertions(+), 7 deletions(-) - -diff --git a/BUILDING.md b/BUILDING.md -index d62efeb53b..16c22917ce 100644 ---- a/BUILDING.md -+++ b/BUILDING.md -@@ -413,7 +413,7 @@ There are certain optimizations that can be enabled in the build. - ##### Malloc Library - - We've found that USD performs best with allocators such as [Jemalloc](https://github.com/jemalloc/jemalloc). --In support of this, you can specify your own allocator through ```PXR_MALLOC_LIBRARY```. -+In support of this, for Linux systems you can specify your own allocator through ```PXR_MALLOC_LIBRARY```. - This variable should be set to a path to a shared object for the allocator. For example, - - ```bash -@@ -423,6 +423,13 @@ This variable should be set to a path to a shared object for the allocator. For - If none are specified, the default allocator will be used. More information on getting the most out of - USD can be found [Getting the Best Performance with USD](http://openusd.org/docs/Maximizing-USD-Performance.html). - -+However glibc 2.34 removed the deprecated memory allocation hooks, preventing USD to correctly build. Custom memory -+allocation code can be compiled out with the ```PXR_ENABLE_MALLOCHOOK_SUPPORT``` option. -+ -+```bash -+-DPXR_ENABLE_MALLOCHOOK_SUPPORT=OFF -+``` -+ - ## Linker Options - - There are four ways to link USD controlled by the following options: -diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py -index b00449266f..d45ade2152 100644 ---- a/build_scripts/build_usd.py -+++ b/build_scripts/build_usd.py -@@ -351,6 +351,10 @@ def AppendCXX11ABIArg(buildFlag, context, buildArgs): - buildArgs.append('{flag}="{flags}"'.format( - flag=buildFlag, flags=" ".join(cxxFlags))) - -+def AppendEnableMallocHookArg(buildFlag, context, buildArgs): -+ if context.enableMallocHook is None: -+ return -+ - def FormatMultiProcs(numJobs, generator): - tag = "-j" - if generator: -@@ -1559,6 +1563,10 @@ def InstallUSD(context, force, buildArgs): - else: - extraArgs.append('-DPXR_ENABLE_MATERIALX_SUPPORT=OFF') - -+ if context.enableMallocHook is not None: -+ support = 'ON' if context.enableMallocHook else 'OFF' -+ extraArgs.append('-DPXR_ENABLE_MALLOCHOOK_SUPPORT={}'.format(support)) -+ - if Windows(): - # Increase the precompiled header buffer limit. - extraArgs.append('-DCMAKE_CXX_FLAGS="/Zm150"') -@@ -1696,6 +1704,8 @@ def InstallUSD(context, force, buildArgs): - if Linux(): - group.add_argument("--use-cxx11-abi", type=int, choices=[0, 1], - help=("Use C++11 ABI for libstdc++. (see docs above)")) -+ group.add_argument("--enable-malloc-hook", type=int, choices=[0, 1], -+ help=("Enable specifying memory allocators on Linux with PXR_MALLOC_LIBRARY")) - - group = parser.add_argument_group(title="3rd Party Dependency Build Options") - group.add_argument("--src", type=str, -@@ -1941,6 +1951,8 @@ def __init__(self, args): - # Build options - self.useCXX11ABI = \ - (args.use_cxx11_abi if hasattr(args, "use_cxx11_abi") else None) -+ self.enableMallocHook = \ -+ (args.enable_malloc_hook if hasattr(args, "enable_malloc_hook") else None) - self.safetyFirst = args.safety_first - - # Dependencies that are forced to be built -@@ -2193,6 +2205,11 @@ def _JoinVersion(v): - Use C++11 ABI {useCXX11ABI} - """ - -+if context.enableMallocHook is not None: -+ summaryMsg += """\ -+ Enable malloc hook {enableMallocHook} -+""" -+ - summaryMsg += """\ - Variant {buildVariant} - Imaging {buildImaging} -@@ -2247,6 +2264,7 @@ def FormatBuildArguments(buildArgs): - ", ".join([d.name for d in dependenciesToBuild])), - buildArgs=FormatBuildArguments(context.buildArgs), - useCXX11ABI=("On" if context.useCXX11ABI else "Off"), -+ enableMallocHook=("On" if context.enableMallocHook else "Off"), - buildType=("Shared libraries" if context.buildShared - else "Monolithic shared library" if context.buildMonolithic - else ""), -diff --git a/cmake/defaults/Options.cmake b/cmake/defaults/Options.cmake -index f6a8fd8741..fc7b344d36 100644 ---- a/cmake/defaults/Options.cmake -+++ b/cmake/defaults/Options.cmake -@@ -51,6 +51,7 @@ option(PXR_PREFER_SAFETY_OVER_SPEED - "Enable certain checks designed to avoid crashes or out-of-bounds memory reads with malformed input files. These checks may negatively impact performance." - ON) - option(PXR_USE_AR_2 "Use Asset Resolver (Ar) 2.0" ON) -+option(PXR_ENABLE_MALLOCHOOK_SUPPORT "Enable Arch malloc hooks" ON) - - # Determine GFX api - # Metal only valid on Apple platforms -diff --git a/pxr/base/arch/CMakeLists.txt b/pxr/base/arch/CMakeLists.txt -index 97be26e83c..ca24bc767e 100644 ---- a/pxr/base/arch/CMakeLists.txt -+++ b/pxr/base/arch/CMakeLists.txt -@@ -59,6 +59,11 @@ pxr_library(arch - DOXYGEN_FILES - overview.dox - ) -+if (PXR_ENABLE_MALLOCHOOK_SUPPORT) -+ target_compile_definitions(arch -+ PRIVATE target_compile_definition ARCH_MALLOC_HOOK -+ ) -+endif() - - pxr_build_test_shared_lib(testArchAbiPlugin - CPPFILES -diff --git a/pxr/base/arch/mallocHook.cpp b/pxr/base/arch/mallocHook.cpp -index b68a31afb3..338263388f 100644 ---- a/pxr/base/arch/mallocHook.cpp -+++ b/pxr/base/arch/mallocHook.cpp -@@ -28,7 +28,7 @@ - #include "pxr/base/arch/defines.h" - #include "pxr/base/arch/env.h" - --#if !defined(ARCH_OS_WINDOWS) -+#if defined(ARCH_MALLOC_HOOK) && !defined(ARCH_OS_WINDOWS) - # include - #endif - #include -@@ -88,7 +88,7 @@ static bool - _MallocProvidedBySameLibraryAs(const char* functionName, - bool skipMallocCheck) - { --#if !defined(ARCH_OS_WINDOWS) -+#if defined(ARCH_MALLOC_HOOK) && !defined(ARCH_OS_WINDOWS) - const void* function = dlsym(RTLD_DEFAULT, functionName); - if (!function) { - return false; -@@ -151,8 +151,9 @@ ArchIsJemallocActive() - bool - ArchIsStlAllocatorOff() - { --#if defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_ICC) || \ -- defined(ARCH_COMPILER_CLANG) -+#if defined(ARCH_MALLOC_HOOK) && \ -+ (defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_ICC) || \ -+ defined(ARCH_COMPILER_CLANG)) - // I'm assuming that ICC compiles will use the gcc STL library. - - /* -@@ -177,7 +178,7 @@ ArchMallocHook::IsInitialized() - _underlyingMemalignFunc || _underlyingFreeFunc; - } - --#if defined(ARCH_OS_LINUX) -+#if defined(ARCH_MALLOC_HOOK) && defined(ARCH_OS_LINUX) - template - static bool _GetSymbol(T* addr, const char* name, string* errMsg) { - if (void* symbol = dlsym(RTLD_DEFAULT, name)) { -@@ -241,8 +242,12 @@ ArchMallocHook::Initialize( - ARCH_UNUSED_ARG void (*freeWrapper)(void*, const void*), - string* errMsg) - { --#if !defined(ARCH_OS_LINUX) -+#if !defined(ARCH_MALLOC_HOOK) || !defined(ARCH_OS_LINUX) -+ #if !defined(ARCH_MALLOC_HOOK) -+ *errMsg = "ArchMallocHook functionality deactivated at build time"; -+ #else - *errMsg = "ArchMallocHook functionality not implemented for non-linux systems"; -+ #endif - return false; - #else - if (IsInitialized()) { diff --git a/8f9bb9563980b41e7695148b63bf09f7abd38a41.patch b/8f9bb9563980b41e7695148b63bf09f7abd38a41.patch deleted file mode 100644 index fc8e60c..0000000 --- a/8f9bb9563980b41e7695148b63bf09f7abd38a41.patch +++ /dev/null @@ -1,3464 +0,0 @@ -From 8f9bb9563980b41e7695148b63bf09f7abd38a41 Mon Sep 17 00:00:00 2001 -From: gitamohr -Date: Fri, 17 Sep 2021 23:28:16 -0700 -Subject: [PATCH] hio: Update stb_image code to latest versions, enable UTF-8 - filename support for Windows. - -See #1580 - -(Internal change: 2188891) ---- - pxr/imaging/hio/stb/README | 10 +- - pxr/imaging/hio/stb/stb_image.h | 887 ++++++++++++++++------ - pxr/imaging/hio/stb/stb_image.patch | 31 +- - pxr/imaging/hio/stb/stb_image_resize.h | 119 +-- - pxr/imaging/hio/stb/stb_image_write.h | 440 +++++++---- - pxr/imaging/hio/stb/stb_image_write.patch | 15 - - pxr/imaging/hio/stbImage.cpp | 6 + - 7 files changed, 1052 insertions(+), 456 deletions(-) - delete mode 100644 pxr/imaging/hio/stb/stb_image_write.patch - -diff --git a/pxr/imaging/hio/stb/README b/pxr/imaging/hio/stb/README -index 8b81ebcaea..8d2f1263a0 100644 ---- a/pxr/imaging/hio/stb/README -+++ b/pxr/imaging/hio/stb/README -@@ -1,9 +1,11 @@ - stb_image_write - --Current version : 1.09 -+Current version : see file source versions in each .h file. - Source: https://github.com/nothings/stb - - Patch file: --- Download original source code from github --- diff -ruN stb_image_write.h > stb_image_write.patch --- diff -ruN stb_image.h > stb_image.patch -+- Download original/new source code from github. -+- Inspect current .patch file to understand local modifications. -+- Merge existing code with new code to incorporate patches. -+- Generate new patch: -+ diff -ruN stb_image.h > stb_image.patch -diff --git a/pxr/imaging/hio/stb/stb_image.h b/pxr/imaging/hio/stb/stb_image.h -index 4c2d313b5b..03ccd13da5 100644 ---- a/pxr/imaging/hio/stb/stb_image.h -+++ b/pxr/imaging/hio/stb/stb_image.h -@@ -1,4 +1,4 @@ --/* stb_image - v2.19 - public domain image loader - http://nothings.org/stb -+/* stb_image - v2.27 - public domain image loader - http://nothings.org/stb - no warranty implied; use at your own risk - - Do this: -@@ -48,6 +48,14 @@ LICENSE - - RECENT REVISION HISTORY: - -+ 2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes -+ 2.26 (2020-07-13) many minor fixes -+ 2.25 (2020-02-02) fix warnings -+ 2.24 (2020-02-02) fix warnings; thread-local failure_reason and flip_vertically -+ 2.23 (2019-08-11) fix clang static analysis warning -+ 2.22 (2019-03-04) gif fixes, fix warnings -+ 2.21 (2019-02-25) fix typo in comment -+ 2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs - 2.19 (2018-02-11) fix warning - 2.18 (2018-01-30) fix warnings - 2.17 (2018-01-29) bugfix, 1-bit BMP, 16-bitness query, fix warnings -@@ -82,25 +90,37 @@ RECENT REVISION HISTORY: - Jeremy Sawicki (handle all ImageNet JPGs) - Optimizations & bugfixes Mikhail Morozov (1-bit BMP) - Fabian "ryg" Giesen Anael Seghezzi (is-16-bit query) -- Arseny Kapoulkine -+ Arseny Kapoulkine Simon Breuss (16-bit PNM) - John-Mark Allen -+ Carmelo J Fdez-Aguera - - Bug & warning fixes -- Marc LeBlanc David Woo Guillaume George Martins Mozeiko -- Christpher Lloyd Jerry Jansson Joseph Thomson Phil Jordan -- Dave Moore Roy Eltham Hayaki Saito Nathan Reed -- Won Chun Luke Graham Johan Duparc Nick Verigakis -- the Horde3D community Thomas Ruf Ronny Chevalier github:rlyeh -- Janez Zemva John Bartholomew Michal Cichon github:romigrou -- Jonathan Blow Ken Hamada Tero Hanninen github:svdijk -- Laurent Gomila Cort Stratton Sergio Gonzalez github:snagar -- Aruelien Pocheville Thibault Reuille Cass Everitt github:Zelex -- Ryamond Barbiero Paul Du Bois Engin Manap github:grim210 -- Aldo Culquicondor Philipp Wiesemann Dale Weiler github:sammyhw -- Oriol Ferrer Mesia Josh Tobin Matthew Gregan github:phprus -- Julian Raschke Gregory Mullen Baldur Karlsson github:poppolopoppo -- Christian Floisand Kevin Schmidt github:darealshinji -- Blazej Dariusz Roszkowski github:Michaelangel007 -+ Marc LeBlanc David Woo Guillaume George Martins Mozeiko -+ Christpher Lloyd Jerry Jansson Joseph Thomson Blazej Dariusz Roszkowski -+ Phil Jordan Dave Moore Roy Eltham -+ Hayaki Saito Nathan Reed Won Chun -+ Luke Graham Johan Duparc Nick Verigakis the Horde3D community -+ Thomas Ruf Ronny Chevalier github:rlyeh -+ Janez Zemva John Bartholomew Michal Cichon github:romigrou -+ Jonathan Blow Ken Hamada Tero Hanninen github:svdijk -+ Eugene Golushkov Laurent Gomila Cort Stratton github:snagar -+ Aruelien Pocheville Sergio Gonzalez Thibault Reuille github:Zelex -+ Cass Everitt Ryamond Barbiero github:grim210 -+ Paul Du Bois Engin Manap Aldo Culquicondor github:sammyhw -+ Philipp Wiesemann Dale Weiler Oriol Ferrer Mesia github:phprus -+ Josh Tobin Matthew Gregan github:poppolopoppo -+ Julian Raschke Gregory Mullen Christian Floisand github:darealshinji -+ Baldur Karlsson Kevin Schmidt JR Smith github:Michaelangel007 -+ Brad Weinberger Matvey Cherevko github:mosra -+ Luca Sas Alexander Veselov Zack Middleton [reserved] -+ Ryan C. Gordon [reserved] [reserved] -+ DO NOT ADD YOUR NAME HERE -+ -+ Jacko Dirks -+ -+ To add your name to the credits, pick a random blank space in the middle and fill it. -+ 80% of merge conflicts on stb PRs are due to people adding their name at the end -+ of the credits. - */ - - #ifndef STBI_INCLUDE_STB_IMAGE_H -@@ -159,6 +179,42 @@ RECENT REVISION HISTORY: - // - // Paletted PNG, BMP, GIF, and PIC images are automatically depalettized. - // -+// To query the width, height and component count of an image without having to -+// decode the full file, you can use the stbi_info family of functions: -+// -+// int x,y,n,ok; -+// ok = stbi_info(filename, &x, &y, &n); -+// // returns ok=1 and sets x, y, n if image is a supported format, -+// // 0 otherwise. -+// -+// Note that stb_image pervasively uses ints in its public API for sizes, -+// including sizes of memory buffers. This is now part of the API and thus -+// hard to change without causing breakage. As a result, the various image -+// loaders all have certain limits on image size; these differ somewhat -+// by format but generally boil down to either just under 2GB or just under -+// 1GB. When the decoded image would be larger than this, stb_image decoding -+// will fail. -+// -+// Additionally, stb_image will reject image files that have any of their -+// dimensions set to a larger value than the configurable STBI_MAX_DIMENSIONS, -+// which defaults to 2**24 = 16777216 pixels. Due to the above memory limit, -+// the only way to have an image with such dimensions load correctly -+// is for it to have a rather extreme aspect ratio. Either way, the -+// assumption here is that such larger images are likely to be malformed -+// or malicious. If you do need to load an image with individual dimensions -+// larger than that, and it still fits in the overall size limit, you can -+// #define STBI_MAX_DIMENSIONS on your own to be something larger. -+// -+// =========================================================================== -+// -+// UNICODE: -+// -+// If compiling for Windows and you wish to use Unicode filenames, compile -+// with -+// #define STBI_WINDOWS_UTF8 -+// and pass utf8-encoded filenames. Call stbi_convert_wchar_to_utf8 to convert -+// Windows wchar_t filenames to utf8. -+// - // =========================================================================== - // - // Philosophy -@@ -171,12 +227,12 @@ RECENT REVISION HISTORY: - // - // Sometimes I let "good performance" creep up in priority over "easy to maintain", - // and for best performance I may provide less-easy-to-use APIs that give higher --// performance, in addition to the easy to use ones. Nevertheless, it's important -+// performance, in addition to the easy-to-use ones. Nevertheless, it's important - // to keep in mind that from the standpoint of you, a client of this library, - // all you care about is #1 and #3, and stb libraries DO NOT emphasize #3 above all. - // - // Some secondary priorities arise directly from the first two, some of which --// make more explicit reasons why performance can't be emphasized. -+// provide more explicit reasons why performance can't be emphasized. - // - // - Portable ("ease of use") - // - Small source code footprint ("easy to maintain") -@@ -219,11 +275,10 @@ RECENT REVISION HISTORY: - // - // HDR image support (disable by defining STBI_NO_HDR) - // --// stb_image now supports loading HDR images in general, and currently --// the Radiance .HDR file format, although the support is provided --// generically. You can still load any file through the existing interface; --// if you attempt to load an HDR file, it will be automatically remapped to --// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; -+// stb_image supports loading HDR images in general, and currently the Radiance -+// .HDR file format specifically. You can still load any file through the existing -+// interface; if you attempt to load an HDR file, it will be automatically remapped -+// to LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1; - // both of these constants can be reconfigured through this interface: - // - // stbi_hdr_to_ldr_gamma(2.2f); -@@ -255,11 +310,10 @@ RECENT REVISION HISTORY: - // - // iPhone PNG support: - // --// By default we convert iphone-formatted PNGs back to RGB, even though --// they are internally encoded differently. You can disable this conversion --// by by calling stbi_convert_iphone_png_to_rgb(0), in which case --// you will always just get the native iphone "format" through (which --// is BGR stored in RGB). -+// We optionally support converting iPhone-formatted PNGs (which store -+// premultiplied BGRA) back to RGB, even though they're internally encoded -+// differently. To enable this conversion, call -+// stbi_convert_iphone_png_to_rgb(1). - // - // Call stbi_set_unpremultiply_on_load(1) as well to force a divide per - // pixel to remove any premultiplied alpha *only* if the image file explicitly -@@ -301,7 +355,14 @@ RECENT REVISION HISTORY: - // - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still - // want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB - // -- -+// - If you define STBI_MAX_DIMENSIONS, stb_image will reject images greater -+// than that size (in either width or height) without further processing. -+// This is to let programs in the wild set an upper bound to prevent -+// denial-of-service attacks on untrusted data, as one could generate a -+// valid image of gigantic dimensions and force stb_image to allocate a -+// huge block of memory and spend disproportionate time decoding it. By -+// default this is set to (1 << 24), which is 16777216, but that's still -+// very big. - - #ifndef STBI_NO_STDIO - #include -@@ -319,6 +380,7 @@ enum - STBI_rgb_alpha = 4 - }; - -+#include - typedef unsigned char stbi_uc; - typedef unsigned short stbi_us; - -@@ -326,11 +388,13 @@ typedef unsigned short stbi_us; - extern "C" { - #endif - -+#ifndef STBIDEF - #ifdef STB_IMAGE_STATIC - #define STBIDEF static - #else - #define STBIDEF extern - #endif -+#endif - - ////////////////////////////////////////////////////////////////////////////// - // -@@ -355,10 +419,6 @@ typedef struct - - STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *channels_in_file, int desired_channels); - STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *channels_in_file, int desired_channels); --#ifndef STBI_NO_GIF --STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp); --#endif -- - - #ifndef STBI_NO_STDIO - STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels); -@@ -366,6 +426,14 @@ STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *channels_in - // for stbi_load_from_file, file pointer is left pointing immediately after image - #endif - -+#ifndef STBI_NO_GIF -+STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp); -+#endif -+ -+#ifdef STBI_WINDOWS_UTF8 -+STBIDEF int stbi_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input); -+#endif -+ - //////////////////////////////////// - // - // 16-bits-per-channel interface -@@ -413,7 +481,7 @@ STBIDEF int stbi_is_hdr_from_file(FILE *f); - - - // get a VERY brief reason for failure --// NOT THREADSAFE -+// on most compilers (and ALL modern mainstream compilers) this is threadsafe - STBIDEF const char *stbi_failure_reason (void); - - // free the loaded image -- this is just free() -@@ -446,6 +514,13 @@ STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); - // flip the image vertically, so the first pixel in the output array is the bottom left - STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip); - -+// as above, but only applies to images loaded on the thread that calls the function -+// this function is only available if your compiler supports thread-local variables; -+// calling it will fail to link if your compiler doesn't -+STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply); -+STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_convert); -+STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip); -+ - // ZLIB client - used by PNG, available for other purposes - - STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen); -@@ -525,6 +600,12 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const ch - #define STBI_ASSERT(x) assert(x) - #endif - -+#ifdef __cplusplus -+#define STBI_EXTERN extern "C" -+#else -+#define STBI_EXTERN extern -+#endif -+ - - #ifndef _MSC_VER - #ifdef __cplusplus -@@ -536,6 +617,23 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const ch - #define stbi_inline __forceinline - #endif - -+#ifndef STBI_NO_THREAD_LOCALS -+ #if defined(__cplusplus) && __cplusplus >= 201103L -+ #define STBI_THREAD_LOCAL thread_local -+ #elif defined(__GNUC__) && __GNUC__ < 5 -+ #define STBI_THREAD_LOCAL __thread -+ #elif defined(_MSC_VER) -+ #define STBI_THREAD_LOCAL __declspec(thread) -+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__) -+ #define STBI_THREAD_LOCAL _Thread_local -+ #endif -+ -+ #ifndef STBI_THREAD_LOCAL -+ #if defined(__GNUC__) -+ #define STBI_THREAD_LOCAL __thread -+ #endif -+ #endif -+#endif - - #ifdef _MSC_VER - typedef unsigned short stbi__uint16; -@@ -566,7 +664,7 @@ typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1]; - #ifdef STBI_HAS_LROTL - #define stbi_lrot(x,y) _lrotl(x,y) - #else -- #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y)))) -+ #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (-(y) & 31))) - #endif - - #if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED)) -@@ -649,14 +747,18 @@ static int stbi__cpuid3(void) - - #define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name - -+#if !defined(STBI_NO_JPEG) && defined(STBI_SSE2) - static int stbi__sse2_available(void) - { - int info3 = stbi__cpuid3(); - return ((info3 >> 26) & 1) != 0; - } -+#endif -+ - #else // assume GCC-style if not VC++ - #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) - -+#if !defined(STBI_NO_JPEG) && defined(STBI_SSE2) - static int stbi__sse2_available(void) - { - // If we're even attempting to compile this on GCC/Clang, that means -@@ -664,6 +766,8 @@ static int stbi__sse2_available(void) - // instructions at will, and so are we. - return 1; - } -+#endif -+ - #endif - #endif - -@@ -674,14 +778,21 @@ static int stbi__sse2_available(void) - - #ifdef STBI_NEON - #include --// assume GCC or Clang on ARM targets -+#ifdef _MSC_VER -+#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name -+#else - #define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16))) - #endif -+#endif - - #ifndef STBI_SIMD_ALIGN - #define STBI_SIMD_ALIGN(type, name) type name - #endif - -+#ifndef STBI_MAX_DIMENSIONS -+#define STBI_MAX_DIMENSIONS (1 << 24) -+#endif -+ - /////////////////////////////////////////////// - // - // stbi__context struct and start_xxx functions -@@ -699,6 +810,7 @@ typedef struct - int read_from_callbacks; - int buflen; - stbi_uc buffer_start[128]; -+ int callback_already_read; - - stbi_uc *img_buffer, *img_buffer_end; - stbi_uc *img_buffer_original, *img_buffer_original_end; -@@ -712,6 +824,7 @@ static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len) - { - s->io.read = NULL; - s->read_from_callbacks = 0; -+ s->callback_already_read = 0; - s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer; - s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len; - } -@@ -723,7 +836,8 @@ static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void * - s->io_user_data = user; - s->buflen = sizeof(s->buffer_start); - s->read_from_callbacks = 1; -- s->img_buffer_original = s->buffer_start; -+ s->callback_already_read = 0; -+ s->img_buffer = s->img_buffer_original = s->buffer_start; - stbi__refill_buffer(s); - s->img_buffer_original_end = s->img_buffer_end; - } -@@ -737,12 +851,17 @@ static int stbi__stdio_read(void *user, char *data, int size) - - static void stbi__stdio_skip(void *user, int n) - { -+ int ch; - fseek((FILE*) user, n, SEEK_CUR); -+ ch = fgetc((FILE*) user); /* have to read a byte to reset feof()'s flag */ -+ if (ch != EOF) { -+ ungetc(ch, (FILE *) user); /* push byte back onto stream if valid. */ -+ } - } - - static int stbi__stdio_eof(void *user) - { -- return feof((FILE*) user); -+ return feof((FILE*) user) || ferror((FILE *) user); - } - - static stbi_io_callbacks stbi__stdio_callbacks = -@@ -838,21 +957,27 @@ static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp); - static int stbi__pnm_test(stbi__context *s); - static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); - static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp); -+static int stbi__pnm_is16(stbi__context *s); - #endif - --// this is not threadsafe --static const char *stbi__g_failure_reason; -+static -+#ifdef STBI_THREAD_LOCAL -+STBI_THREAD_LOCAL -+#endif -+const char *stbi__g_failure_reason; - - STBIDEF const char *stbi_failure_reason(void) - { - return stbi__g_failure_reason; - } - -+#ifndef STBI_NO_FAILURE_STRINGS - static int stbi__err(const char *str) - { - stbi__g_failure_reason = str; - return 0; - } -+#endif - - static void *stbi__malloc(size_t size) - { -@@ -891,11 +1016,13 @@ static int stbi__mul2sizes_valid(int a, int b) - return a <= INT_MAX/b; - } - -+#if !defined(STBI_NO_JPEG) || !defined(STBI_NO_PNG) || !defined(STBI_NO_TGA) || !defined(STBI_NO_HDR) - // returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow - static int stbi__mad2sizes_valid(int a, int b, int add) - { - return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add); - } -+#endif - - // returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow - static int stbi__mad3sizes_valid(int a, int b, int c, int add) -@@ -905,7 +1032,7 @@ static int stbi__mad3sizes_valid(int a, int b, int c, int add) - } - - // returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow --#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) -+#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) || !defined(STBI_NO_PNM) - static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add) - { - return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) && -@@ -913,12 +1040,14 @@ static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add) - } - #endif - -+#if !defined(STBI_NO_JPEG) || !defined(STBI_NO_PNG) || !defined(STBI_NO_TGA) || !defined(STBI_NO_HDR) - // mallocs with size overflow checking - static void *stbi__malloc_mad2(int a, int b, int add) - { - if (!stbi__mad2sizes_valid(a, b, add)) return NULL; - return stbi__malloc(a*b + add); - } -+#endif - - static void *stbi__malloc_mad3(int a, int b, int c, int add) - { -@@ -926,7 +1055,7 @@ static void *stbi__malloc_mad3(int a, int b, int c, int add) - return stbi__malloc(a*b*c + add); - } - --#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) -+#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) || !defined(STBI_NO_PNM) - static void *stbi__malloc_mad4(int a, int b, int c, int d, int add) - { - if (!stbi__mad4sizes_valid(a, b, c, d, add)) return NULL; -@@ -962,13 +1091,29 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp); - static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp); - #endif - --static int stbi__vertically_flip_on_load = 0; -+static int stbi__vertically_flip_on_load_global = 0; - - STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip) - { -- stbi__vertically_flip_on_load = flag_true_if_should_flip; -+ stbi__vertically_flip_on_load_global = flag_true_if_should_flip; - } - -+#ifndef STBI_THREAD_LOCAL -+#define stbi__vertically_flip_on_load stbi__vertically_flip_on_load_global -+#else -+static STBI_THREAD_LOCAL int stbi__vertically_flip_on_load_local, stbi__vertically_flip_on_load_set; -+ -+STBIDEF void stbi_set_flip_vertically_on_load_thread(int flag_true_if_should_flip) -+{ -+ stbi__vertically_flip_on_load_local = flag_true_if_should_flip; -+ stbi__vertically_flip_on_load_set = 1; -+} -+ -+#define stbi__vertically_flip_on_load (stbi__vertically_flip_on_load_set \ -+ ? stbi__vertically_flip_on_load_local \ -+ : stbi__vertically_flip_on_load_global) -+#endif // STBI_THREAD_LOCAL -+ - static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc) - { - memset(ri, 0, sizeof(*ri)); // make sure it's initialized if we add new fields -@@ -976,9 +1121,8 @@ static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int re - ri->channel_order = STBI_ORDER_RGB; // all current input & output are this, but this is here so we can add BGR order - ri->num_channels = 0; - -- #ifndef STBI_NO_JPEG -- if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri); -- #endif -+ // test the formats with a very explicit header first (at least a FOURCC -+ // or distinctive magic number first) - #ifndef STBI_NO_PNG - if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp, ri); - #endif -@@ -990,10 +1134,19 @@ static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int re - #endif - #ifndef STBI_NO_PSD - if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp, ri, bpc); -+ #else -+ STBI_NOTUSED(bpc); - #endif - #ifndef STBI_NO_PIC - if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp, ri); - #endif -+ -+ // then the formats that can end up attempting to load with just 1 or 2 -+ // bytes matching expectations; these are prone to false positives, so -+ // try them later -+ #ifndef STBI_NO_JPEG -+ if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri); -+ #endif - #ifndef STBI_NO_PNM - if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp, ri); - #endif -@@ -1070,6 +1223,7 @@ static void stbi__vertical_flip(void *image, int w, int h, int bytes_per_pixel) - } - } - -+#ifndef STBI_NO_GIF - static void stbi__vertical_flip_slices(void *image, int w, int h, int z, int bytes_per_pixel) - { - int slice; -@@ -1077,10 +1231,11 @@ static void stbi__vertical_flip_slices(void *image, int w, int h, int z, int byt - - stbi_uc *bytes = (stbi_uc *)image; - for (slice = 0; slice < z; ++slice) { -- stbi__vertical_flip(bytes, w, h, bytes_per_pixel); -- bytes += slice_size; -+ stbi__vertical_flip(bytes, w, h, bytes_per_pixel); -+ bytes += slice_size; - } - } -+#endif - - static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp) - { -@@ -1090,8 +1245,10 @@ static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, - if (result == NULL) - return NULL; - -+ // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. -+ STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); -+ - if (ri.bits_per_channel != 8) { -- STBI_ASSERT(ri.bits_per_channel == 16); - result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp); - ri.bits_per_channel = 8; - } -@@ -1114,8 +1271,10 @@ static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, - if (result == NULL) - return NULL; - -+ // it is the responsibility of the loaders to make sure we get either 8 or 16 bit. -+ STBI_ASSERT(ri.bits_per_channel == 8 || ri.bits_per_channel == 16); -+ - if (ri.bits_per_channel != 16) { -- STBI_ASSERT(ri.bits_per_channel == 8); - result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp); - ri.bits_per_channel = 16; - } -@@ -1131,7 +1290,7 @@ static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, - return (stbi__uint16 *) result; - } - --#if !defined(STBI_NO_HDR) || !defined(STBI_NO_LINEAR) -+#if !defined(STBI_NO_HDR) && !defined(STBI_NO_LINEAR) - static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp) - { - if (stbi__vertically_flip_on_load && result != NULL) { -@@ -1143,10 +1302,38 @@ static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, in - - #ifndef STBI_NO_STDIO - -+#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) -+STBI_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide); -+STBI_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default); -+#endif -+ -+#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) -+STBIDEF int stbi_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input) -+{ -+ return WideCharToMultiByte(65001 /* UTF8 */, 0, input, -1, buffer, (int) bufferlen, NULL, NULL); -+} -+#endif -+ - static FILE *stbi__fopen(char const *filename, char const *mode) - { - FILE *f; -+#if defined(_WIN32) && defined(STBI_WINDOWS_UTF8) -+ wchar_t wMode[64]; -+ wchar_t wFilename[1024]; -+ if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename))) -+ return 0; -+ -+ if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode))) -+ return 0; -+ - #if defined(_MSC_VER) && _MSC_VER >= 1400 -+ if (0 != _wfopen_s(&f, wFilename, wMode)) -+ f = 0; -+#else -+ f = _wfopen(wFilename, wMode); -+#endif -+ -+#elif defined(_MSC_VER) && _MSC_VER >= 1400 - if (0 != fopen_s(&f, filename, mode)) - f=0; - #else -@@ -1237,15 +1424,15 @@ STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *u - STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp) - { - unsigned char *result; -- stbi__context s; -- stbi__start_mem(&s,buffer,len); -- -+ stbi__context s; -+ stbi__start_mem(&s,buffer,len); -+ - result = (unsigned char*) stbi__load_gif_main(&s, delays, x, y, z, comp, req_comp); - if (stbi__vertically_flip_on_load) { -- stbi__vertical_flip_slices( result, *x, *y, *z, *comp ); -+ stbi__vertical_flip_slices( result, *x, *y, *z, *comp ); - } - -- return result; -+ return result; - } - #endif - -@@ -1390,6 +1577,7 @@ enum - static void stbi__refill_buffer(stbi__context *s) - { - int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen); -+ s->callback_already_read += (int) (s->img_buffer - s->img_buffer_original); - if (n == 0) { - // at end of file, treat same as if from memory, but need to handle case - // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file -@@ -1414,6 +1602,9 @@ stbi_inline static stbi_uc stbi__get8(stbi__context *s) - return 0; - } - -+#if defined(STBI_NO_JPEG) && defined(STBI_NO_HDR) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) -+// nothing -+#else - stbi_inline static int stbi__at_eof(stbi__context *s) - { - if (s->io.read) { -@@ -1425,9 +1616,14 @@ stbi_inline static int stbi__at_eof(stbi__context *s) - - return s->img_buffer >= s->img_buffer_end; - } -+#endif - -+#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) -+// nothing -+#else - static void stbi__skip(stbi__context *s, int n) - { -+ if (n == 0) return; // already there! - if (n < 0) { - s->img_buffer = s->img_buffer_end; - return; -@@ -1442,7 +1638,11 @@ static void stbi__skip(stbi__context *s, int n) - } - s->img_buffer += n; - } -+#endif - -+#if defined(STBI_NO_PNG) && defined(STBI_NO_TGA) && defined(STBI_NO_HDR) && defined(STBI_NO_PNM) -+// nothing -+#else - static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n) - { - if (s->io.read) { -@@ -1466,18 +1666,27 @@ static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n) - } else - return 0; - } -+#endif - -+#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_PSD) && defined(STBI_NO_PIC) -+// nothing -+#else - static int stbi__get16be(stbi__context *s) - { - int z = stbi__get8(s); - return (z << 8) + stbi__get8(s); - } -+#endif - -+#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) && defined(STBI_NO_PIC) -+// nothing -+#else - static stbi__uint32 stbi__get32be(stbi__context *s) - { - stbi__uint32 z = stbi__get16be(s); - return (z << 16) + stbi__get16be(s); - } -+#endif - - #if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) - // nothing -@@ -1493,13 +1702,16 @@ static int stbi__get16le(stbi__context *s) - static stbi__uint32 stbi__get32le(stbi__context *s) - { - stbi__uint32 z = stbi__get16le(s); -- return z + (stbi__get16le(s) << 16); -+ z += (stbi__uint32)stbi__get16le(s) << 16; -+ return z; - } - #endif - - #define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings - -- -+#if defined(STBI_NO_JPEG) && defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) -+// nothing -+#else - ////////////////////////////////////////////////////////////////////////////// - // - // generic converter from built-in img_n to req_comp -@@ -1515,7 +1727,11 @@ static stbi_uc stbi__compute_y(int r, int g, int b) - { - return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8); - } -+#endif - -+#if defined(STBI_NO_PNG) && defined(STBI_NO_BMP) && defined(STBI_NO_PSD) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF) && defined(STBI_NO_PIC) && defined(STBI_NO_PNM) -+// nothing -+#else - static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y) - { - int i,j; -@@ -1539,19 +1755,19 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r - // convert source image with img_n components to one with req_comp components; - // avoid switch per pixel, so use switch per scanline and massive macros - switch (STBI__COMBO(img_n, req_comp)) { -- STBI__CASE(1,2) { dest[0]=src[0], dest[1]=255; } break; -+ STBI__CASE(1,2) { dest[0]=src[0]; dest[1]=255; } break; - STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; -- STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; } break; -+ STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=255; } break; - STBI__CASE(2,1) { dest[0]=src[0]; } break; - STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; -- STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break; -- STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; } break; -+ STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=src[1]; } break; -+ STBI__CASE(3,4) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2];dest[3]=255; } break; - STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; -- STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; } break; -+ STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); dest[1] = 255; } break; - STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break; -- STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; } break; -- STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break; -- default: STBI_ASSERT(0); -+ STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); dest[1] = src[3]; } break; -+ STBI__CASE(4,3) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2]; } break; -+ default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return stbi__errpuc("unsupported", "Unsupported format conversion"); - } - #undef STBI__CASE - } -@@ -1559,12 +1775,20 @@ static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int r - STBI_FREE(data); - return good; - } -+#endif - -+#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) -+// nothing -+#else - static stbi__uint16 stbi__compute_y_16(int r, int g, int b) - { - return (stbi__uint16) (((r*77) + (g*150) + (29*b)) >> 8); - } -+#endif - -+#if defined(STBI_NO_PNG) && defined(STBI_NO_PSD) -+// nothing -+#else - static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int req_comp, unsigned int x, unsigned int y) - { - int i,j; -@@ -1588,19 +1812,19 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r - // convert source image with img_n components to one with req_comp components; - // avoid switch per pixel, so use switch per scanline and massive macros - switch (STBI__COMBO(img_n, req_comp)) { -- STBI__CASE(1,2) { dest[0]=src[0], dest[1]=0xffff; } break; -+ STBI__CASE(1,2) { dest[0]=src[0]; dest[1]=0xffff; } break; - STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; -- STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=0xffff; } break; -+ STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=0xffff; } break; - STBI__CASE(2,1) { dest[0]=src[0]; } break; - STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break; -- STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break; -- STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=0xffff; } break; -+ STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0]; dest[3]=src[1]; } break; -+ STBI__CASE(3,4) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2];dest[3]=0xffff; } break; - STBI__CASE(3,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; -- STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = 0xffff; } break; -+ STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); dest[1] = 0xffff; } break; - STBI__CASE(4,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break; -- STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = src[3]; } break; -- STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break; -- default: STBI_ASSERT(0); -+ STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); dest[1] = src[3]; } break; -+ STBI__CASE(4,3) { dest[0]=src[0];dest[1]=src[1];dest[2]=src[2]; } break; -+ default: STBI_ASSERT(0); STBI_FREE(data); STBI_FREE(good); return (stbi__uint16*) stbi__errpuc("unsupported", "Unsupported format conversion"); - } - #undef STBI__CASE - } -@@ -1608,6 +1832,7 @@ static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int r - STBI_FREE(data); - return good; - } -+#endif - - #ifndef STBI_NO_LINEAR - static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) -@@ -1623,7 +1848,11 @@ static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp) - for (k=0; k < n; ++k) { - output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale); - } -- if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f; -+ } -+ if (n < comp) { -+ for (i=0; i < x*y; ++i) { -+ output[i*comp + n] = data[i*comp + n]/255.0f; -+ } - } - STBI_FREE(data); - return output; -@@ -1902,13 +2131,12 @@ stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n) - int sgn; - if (j->code_bits < n) stbi__grow_buffer_unsafe(j); - -- sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB -+ sgn = j->code_buffer >> 31; // sign bit always in MSB; 0 if MSB clear (positive), 1 if MSB set (negative) - k = stbi_lrot(j->code_buffer, n); -- STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask))); - j->code_buffer = k & ~stbi__bmask[n]; - k &= stbi__bmask[n]; - j->code_bits -= n; -- return k + (stbi__jbias[n] & ~sgn); -+ return k + (stbi__jbias[n] & (sgn - 1)); - } - - // get some unsigned bits -@@ -1958,7 +2186,7 @@ static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman - - if (j->code_bits < 16) stbi__grow_buffer_unsafe(j); - t = stbi__jpeg_huff_decode(j, hdc); -- if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG"); -+ if (t < 0 || t > 15) return stbi__err("bad huffman code","Corrupt JPEG"); - - // 0 all the ac values now so we can do it 32-bits at a time - memset(data,0,64*sizeof(data[0])); -@@ -2015,11 +2243,12 @@ static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__ - // first scan for DC coefficient, must be first - memset(data,0,64*sizeof(data[0])); // 0 all the ac values now - t = stbi__jpeg_huff_decode(j, hdc); -+ if (t < 0 || t > 15) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); - diff = t ? stbi__extend_receive(j, t) : 0; - - dc = j->img_comp[b].dc_pred + diff; - j->img_comp[b].dc_pred = dc; -- data[0] = (short) (dc << j->succ_low); -+ data[0] = (short) (dc * (1 << j->succ_low)); - } else { - // refinement scan for DC coefficient - if (stbi__jpeg_get_bit(j)) -@@ -2056,7 +2285,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__ - j->code_buffer <<= s; - j->code_bits -= s; - zig = stbi__jpeg_dezigzag[k++]; -- data[zig] = (short) ((r >> 8) << shift); -+ data[zig] = (short) ((r >> 8) * (1 << shift)); - } else { - int rs = stbi__jpeg_huff_decode(j, hac); - if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG"); -@@ -2074,7 +2303,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__ - } else { - k += r; - zig = stbi__jpeg_dezigzag[k++]; -- data[zig] = (short) (stbi__extend_receive(j,s) << shift); -+ data[zig] = (short) (stbi__extend_receive(j,s) * (1 << shift)); - } - } - } while (k <= j->spec_end); -@@ -3005,6 +3234,8 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) - p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline - s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG - s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires -+ if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); -+ if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - c = stbi__get8(s); - if (c != 3 && c != 1 && c != 4) return stbi__err("bad component count","Corrupt JPEG"); - s->img_n = c; -@@ -3036,6 +3267,13 @@ static int stbi__process_frame_header(stbi__jpeg *z, int scan) - if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v; - } - -+ // check that plane subsampling factors are integer ratios; our resamplers can't deal with fractional ratios -+ // and I've never seen a non-corrupted JPEG file actually use them -+ for (i=0; i < s->img_n; ++i) { -+ if (h_max % z->img_comp[i].h != 0) return stbi__err("bad H","Corrupt JPEG"); -+ if (v_max % z->img_comp[i].v != 0) return stbi__err("bad V","Corrupt JPEG"); -+ } -+ - // compute interleaved mcu info - z->img_h_max = h_max; - z->img_v_max = v_max; -@@ -3591,12 +3829,16 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp - else - decode_n = z->s->img_n; - -+ // nothing to do if no components requested; check this now to avoid -+ // accessing uninitialized coutput[0] later -+ if (decode_n <= 0) { stbi__cleanup_jpeg(z); return NULL; } -+ - // resample and color-convert - { - int k; - unsigned int i,j; - stbi_uc *output; -- stbi_uc *coutput[4]; -+ stbi_uc *coutput[4] = { NULL, NULL, NULL, NULL }; - - stbi__resample res_comp[4]; - -@@ -3717,7 +3959,7 @@ static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp - if (n == 1) - for (i=0; i < z->s->img_x; ++i) out[i] = y[i]; - else -- for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255; -+ for (i=0; i < z->s->img_x; ++i) { *out++ = y[i]; *out++ = 255; } - } - } - } -@@ -3733,6 +3975,7 @@ static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int re - { - unsigned char* result; - stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); -+ if (!j) return stbi__errpuc("outofmem", "Out of memory"); - STBI_NOTUSED(ri); - j->s = s; - stbi__setup_jpeg(j); -@@ -3745,6 +3988,7 @@ static int stbi__jpeg_test(stbi__context *s) - { - int r; - stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg)); -+ if (!j) return stbi__err("outofmem", "Out of memory"); - j->s = s; - stbi__setup_jpeg(j); - r = stbi__decode_jpeg_header(j, STBI__SCAN_type); -@@ -3769,6 +4013,7 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) - { - int result; - stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg))); -+ if (!j) return stbi__err("outofmem", "Out of memory"); - j->s = s; - result = stbi__jpeg_info_raw(j, x, y, comp); - STBI_FREE(j); -@@ -3788,6 +4033,7 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) - // fast-way is faster to check than jpeg huffman, but slow way is slower - #define STBI__ZFAST_BITS 9 // accelerate all cases in default tables - #define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1) -+#define STBI__ZNSYMS 288 // number of symbols in literal/length alphabet - - // zlib-style huffman encoding - // (jpegs packs from left, zlib from right, so can't share code) -@@ -3797,8 +4043,8 @@ typedef struct - stbi__uint16 firstcode[16]; - int maxcode[17]; - stbi__uint16 firstsymbol[16]; -- stbi_uc size[288]; -- stbi__uint16 value[288]; -+ stbi_uc size[STBI__ZNSYMS]; -+ stbi__uint16 value[STBI__ZNSYMS]; - } stbi__zhuffman; - - stbi_inline static int stbi__bitreverse16(int n) -@@ -3885,16 +4131,23 @@ typedef struct - stbi__zhuffman z_length, z_distance; - } stbi__zbuf; - -+stbi_inline static int stbi__zeof(stbi__zbuf *z) -+{ -+ return (z->zbuffer >= z->zbuffer_end); -+} -+ - stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z) - { -- if (z->zbuffer >= z->zbuffer_end) return 0; -- return *z->zbuffer++; -+ return stbi__zeof(z) ? 0 : *z->zbuffer++; - } - - static void stbi__fill_bits(stbi__zbuf *z) - { - do { -- STBI_ASSERT(z->code_buffer < (1U << z->num_bits)); -+ if (z->code_buffer >= (1U << z->num_bits)) { -+ z->zbuffer = z->zbuffer_end; /* treat this as EOF so we fail. */ -+ return; -+ } - z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits; - z->num_bits += 8; - } while (z->num_bits <= 24); -@@ -3919,10 +4172,11 @@ static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) - for (s=STBI__ZFAST_BITS+1; ; ++s) - if (k < z->maxcode[s]) - break; -- if (s == 16) return -1; // invalid code! -+ if (s >= 16) return -1; // invalid code! - // code size is s, so: - b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s]; -- STBI_ASSERT(z->size[b] == s); -+ if (b >= STBI__ZNSYMS) return -1; // some data was corrupt somewhere! -+ if (z->size[b] != s) return -1; // was originally an assert, but report failure instead. - a->code_buffer >>= s; - a->num_bits -= s; - return z->value[b]; -@@ -3931,7 +4185,12 @@ static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z) - stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) - { - int b,s; -- if (a->num_bits < 16) stbi__fill_bits(a); -+ if (a->num_bits < 16) { -+ if (stbi__zeof(a)) { -+ return -1; /* report error for unexpected end of data. */ -+ } -+ stbi__fill_bits(a); -+ } - b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; - if (b) { - s = b >> 9; -@@ -3945,13 +4204,16 @@ stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) - static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes - { - char *q; -- int cur, limit, old_limit; -+ unsigned int cur, limit, old_limit; - z->zout = zout; - if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG"); -- cur = (int) (z->zout - z->zout_start); -- limit = old_limit = (int) (z->zout_end - z->zout_start); -- while (cur + n > limit) -+ cur = (unsigned int) (z->zout - z->zout_start); -+ limit = old_limit = (unsigned) (z->zout_end - z->zout_start); -+ if (UINT_MAX - cur < (unsigned) n) return stbi__err("outofmem", "Out of memory"); -+ while (cur + n > limit) { -+ if(limit > UINT_MAX / 2) return stbi__err("outofmem", "Out of memory"); - limit *= 2; -+ } - q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit); - STBI_NOTUSED(old_limit); - if (q == NULL) return stbi__err("outofmem", "Out of memory"); -@@ -4049,11 +4311,12 @@ static int stbi__compute_huffman_codes(stbi__zbuf *a) - c = stbi__zreceive(a,2)+3; - if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG"); - fill = lencodes[n-1]; -- } else if (c == 17) -+ } else if (c == 17) { - c = stbi__zreceive(a,3)+3; -- else { -- STBI_ASSERT(c == 18); -+ } else if (c == 18) { - c = stbi__zreceive(a,7)+11; -+ } else { -+ return stbi__err("bad codelengths", "Corrupt PNG"); - } - if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG"); - memset(lencodes+n, fill, c); -@@ -4079,7 +4342,7 @@ static int stbi__parse_uncompressed_block(stbi__zbuf *a) - a->code_buffer >>= 8; - a->num_bits -= 8; - } -- STBI_ASSERT(a->num_bits == 0); -+ if (a->num_bits < 0) return stbi__err("zlib corrupt","Corrupt PNG"); - // now fill header the normal way - while (k < 4) - header[k++] = stbi__zget8(a); -@@ -4101,6 +4364,7 @@ static int stbi__parse_zlib_header(stbi__zbuf *a) - int cm = cmf & 15; - /* int cinfo = cmf >> 4; */ - int flg = stbi__zget8(a); -+ if (stbi__zeof(a)) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec - if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec - if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png - if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png -@@ -4108,7 +4372,7 @@ static int stbi__parse_zlib_header(stbi__zbuf *a) - return 1; - } - --static const stbi_uc stbi__zdefault_length[288] = -+static const stbi_uc stbi__zdefault_length[STBI__ZNSYMS] = - { - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, -@@ -4154,7 +4418,7 @@ static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) - } else { - if (type == 1) { - // use fixed code lengths -- if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0; -+ if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , STBI__ZNSYMS)) return 0; - if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0; - } else { - if (!stbi__compute_huffman_codes(a)) return 0; -@@ -4363,7 +4627,7 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r - return stbi__err("invalid filter","Corrupt PNG"); - - if (depth < 8) { -- STBI_ASSERT(img_width_bytes <= x); -+ if (img_width_bytes > x) return stbi__err("invalid width","Corrupt PNG"); - cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place - filter_bytes = 1; - width = img_width_bytes; -@@ -4551,6 +4815,7 @@ static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint3 - - // de-interlacing - final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0); -+ if (!final) return stbi__err("outofmem", "Out of memory"); - for (p=0; p < 7; ++p) { - int xorig[] = { 0,4,0,2,0,1,0 }; - int yorig[] = { 0,0,4,0,2,0,1 }; -@@ -4671,19 +4936,46 @@ static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int - return 1; - } - --static int stbi__unpremultiply_on_load = 0; --static int stbi__de_iphone_flag = 0; -+static int stbi__unpremultiply_on_load_global = 0; -+static int stbi__de_iphone_flag_global = 0; - - STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply) - { -- stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply; -+ stbi__unpremultiply_on_load_global = flag_true_if_should_unpremultiply; - } - - STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert) - { -- stbi__de_iphone_flag = flag_true_if_should_convert; -+ stbi__de_iphone_flag_global = flag_true_if_should_convert; -+} -+ -+#ifndef STBI_THREAD_LOCAL -+#define stbi__unpremultiply_on_load stbi__unpremultiply_on_load_global -+#define stbi__de_iphone_flag stbi__de_iphone_flag_global -+#else -+static STBI_THREAD_LOCAL int stbi__unpremultiply_on_load_local, stbi__unpremultiply_on_load_set; -+static STBI_THREAD_LOCAL int stbi__de_iphone_flag_local, stbi__de_iphone_flag_set; -+ -+STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply) -+{ -+ stbi__unpremultiply_on_load_local = flag_true_if_should_unpremultiply; -+ stbi__unpremultiply_on_load_set = 1; - } - -+STBIDEF void stbi_convert_iphone_png_to_rgb_thread(int flag_true_if_should_convert) -+{ -+ stbi__de_iphone_flag_local = flag_true_if_should_convert; -+ stbi__de_iphone_flag_set = 1; -+} -+ -+#define stbi__unpremultiply_on_load (stbi__unpremultiply_on_load_set \ -+ ? stbi__unpremultiply_on_load_local \ -+ : stbi__unpremultiply_on_load_global) -+#define stbi__de_iphone_flag (stbi__de_iphone_flag_set \ -+ ? stbi__de_iphone_flag_local \ -+ : stbi__de_iphone_flag_global) -+#endif // STBI_THREAD_LOCAL -+ - static void stbi__de_iphone(stbi__png *z) - { - stbi__context *s = z->s; -@@ -4732,7 +5024,7 @@ static void stbi__de_iphone(stbi__png *z) - static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) - { - stbi_uc palette[1024], pal_img_n=0; -- stbi_uc has_trans=0, tc[3]; -+ stbi_uc has_trans=0, tc[3]={0}; - stbi__uint16 tc16[3]; - stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0; - int first=1,k,interlace=0, color=0, is_iphone=0; -@@ -4758,8 +5050,10 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) - if (!first) return stbi__err("multiple IHDR","Corrupt PNG"); - first = 0; - if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG"); -- s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); -- s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)"); -+ s->img_x = stbi__get32be(s); -+ s->img_y = stbi__get32be(s); -+ if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); -+ if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); - z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only"); - color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG"); - if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG"); -@@ -4883,6 +5177,8 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp) - ++s->img_n; - } - STBI_FREE(z->expanded); z->expanded = NULL; -+ // end of PNG chunk, read and skip CRC -+ stbi__get32be(s); - return 1; - } - -@@ -4913,10 +5209,12 @@ static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, st - void *result=NULL; - if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error"); - if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) { -- if (p->depth < 8) -+ if (p->depth <= 8) - ri->bits_per_channel = 8; -+ else if (p->depth == 16) -+ ri->bits_per_channel = 16; - else -- ri->bits_per_channel = p->depth; -+ return stbi__errpuc("bad bits_per_channel", "PNG not supported: unsupported color depth"); - result = p->out; - p->out = NULL; - if (req_comp && req_comp != p->s->img_out_n) { -@@ -5018,11 +5316,11 @@ static int stbi__high_bit(unsigned int z) - { - int n=0; - if (z == 0) return -1; -- if (z >= 0x10000) n += 16, z >>= 16; -- if (z >= 0x00100) n += 8, z >>= 8; -- if (z >= 0x00010) n += 4, z >>= 4; -- if (z >= 0x00004) n += 2, z >>= 2; -- if (z >= 0x00002) n += 1, z >>= 1; -+ if (z >= 0x10000) { n += 16; z >>= 16; } -+ if (z >= 0x00100) { n += 8; z >>= 8; } -+ if (z >= 0x00010) { n += 4; z >>= 4; } -+ if (z >= 0x00004) { n += 2; z >>= 2; } -+ if (z >= 0x00002) { n += 1;/* >>= 1;*/ } - return n; - } - -@@ -5039,7 +5337,7 @@ static int stbi__bitcount(unsigned int a) - // extract an arbitrarily-aligned N-bit value (N=bits) - // from v, and then make it 8-bits long and fractionally - // extend it to full full range. --static int stbi__shiftsigned(int v, int shift, int bits) -+static int stbi__shiftsigned(unsigned int v, int shift, int bits) - { - static unsigned int mul_table[9] = { - 0, -@@ -5053,7 +5351,7 @@ static int stbi__shiftsigned(int v, int shift, int bits) - v <<= -shift; - else - v >>= shift; -- STBI_ASSERT(v >= 0 && v < 256); -+ STBI_ASSERT(v < 256); - v >>= (8-bits); - STBI_ASSERT(bits >= 0 && bits <= 8); - return (int) ((unsigned) v * mul_table[bits]) >> shift_table[bits]; -@@ -5063,8 +5361,35 @@ typedef struct - { - int bpp, offset, hsz; - unsigned int mr,mg,mb,ma, all_a; -+ int extra_read; - } stbi__bmp_data; - -+static int stbi__bmp_set_mask_defaults(stbi__bmp_data *info, int compress) -+{ -+ // BI_BITFIELDS specifies masks explicitly, don't override -+ if (compress == 3) -+ return 1; -+ -+ if (compress == 0) { -+ if (info->bpp == 16) { -+ info->mr = 31u << 10; -+ info->mg = 31u << 5; -+ info->mb = 31u << 0; -+ } else if (info->bpp == 32) { -+ info->mr = 0xffu << 16; -+ info->mg = 0xffu << 8; -+ info->mb = 0xffu << 0; -+ info->ma = 0xffu << 24; -+ info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0 -+ } else { -+ // otherwise, use defaults, which is all-0 -+ info->mr = info->mg = info->mb = info->ma = 0; -+ } -+ return 1; -+ } -+ return 0; // error -+} -+ - static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) - { - int hsz; -@@ -5075,6 +5400,9 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) - info->offset = stbi__get32le(s); - info->hsz = hsz = stbi__get32le(s); - info->mr = info->mg = info->mb = info->ma = 0; -+ info->extra_read = 14; -+ -+ if (info->offset < 0) return stbi__errpuc("bad BMP", "bad BMP"); - - if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown"); - if (hsz == 12) { -@@ -5089,6 +5417,8 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) - if (hsz != 12) { - int compress = stbi__get32le(s); - if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE"); -+ if (compress >= 4) return stbi__errpuc("BMP JPEG/PNG", "BMP type not supported: unsupported compression"); // this includes PNG/JPEG modes -+ if (compress == 3 && info->bpp != 16 && info->bpp != 32) return stbi__errpuc("bad BMP", "bad BMP"); // bitfields requires 16 or 32 bits/pixel - stbi__get32le(s); // discard sizeof - stbi__get32le(s); // discard hres - stbi__get32le(s); // discard vres -@@ -5103,21 +5433,12 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) - } - if (info->bpp == 16 || info->bpp == 32) { - if (compress == 0) { -- if (info->bpp == 32) { -- info->mr = 0xffu << 16; -- info->mg = 0xffu << 8; -- info->mb = 0xffu << 0; -- info->ma = 0xffu << 24; -- info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0 -- } else { -- info->mr = 31u << 10; -- info->mg = 31u << 5; -- info->mb = 31u << 0; -- } -+ stbi__bmp_set_mask_defaults(info, compress); - } else if (compress == 3) { - info->mr = stbi__get32le(s); - info->mg = stbi__get32le(s); - info->mb = stbi__get32le(s); -+ info->extra_read += 12; - // not documented, but generated by photoshop and handled by mspaint - if (info->mr == info->mg && info->mg == info->mb) { - // ?!?!? -@@ -5127,6 +5448,7 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) - return stbi__errpuc("bad BMP", "bad BMP"); - } - } else { -+ // V4/V5 header - int i; - if (hsz != 108 && hsz != 124) - return stbi__errpuc("bad BMP", "bad BMP"); -@@ -5134,6 +5456,8 @@ static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info) - info->mg = stbi__get32le(s); - info->mb = stbi__get32le(s); - info->ma = stbi__get32le(s); -+ if (compress != 3) // override mr/mg/mb unless in BI_BITFIELDS mode, as per docs -+ stbi__bmp_set_mask_defaults(info, compress); - stbi__get32le(s); // discard color space - for (i=0; i < 12; ++i) - stbi__get32le(s); // discard color space parameters -@@ -5166,6 +5490,9 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req - flip_vertically = ((int) s->img_y) > 0; - s->img_y = abs((int) s->img_y); - -+ if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ - mr = info.mr; - mg = info.mg; - mb = info.mb; -@@ -5174,13 +5501,21 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req - - if (info.hsz == 12) { - if (info.bpp < 24) -- psize = (info.offset - 14 - 24) / 3; -+ psize = (info.offset - info.extra_read - 24) / 3; - } else { - if (info.bpp < 16) -- psize = (info.offset - 14 - info.hsz) >> 2; -+ psize = (info.offset - info.extra_read - info.hsz) >> 2; -+ } -+ if (psize == 0) { -+ if (info.offset != s->callback_already_read + (s->img_buffer - s->img_buffer_original)) { -+ return stbi__errpuc("bad offset", "Corrupt BMP"); -+ } - } - -- s->img_n = ma ? 4 : 3; -+ if (info.bpp == 24 && ma == 0xff000000) -+ s->img_n = 3; -+ else -+ s->img_n = ma ? 4 : 3; - if (req_comp && req_comp >= 3) // we can directly decode 3 or 4 - target = req_comp; - else -@@ -5202,7 +5537,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req - if (info.hsz != 12) stbi__get8(s); - pal[i][3] = 255; - } -- stbi__skip(s, info.offset - 14 - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); -+ stbi__skip(s, info.offset - info.extra_read - info.hsz - psize * (info.hsz == 12 ? 3 : 4)); - if (info.bpp == 1) width = (s->img_x + 7) >> 3; - else if (info.bpp == 4) width = (s->img_x + 1) >> 1; - else if (info.bpp == 8) width = s->img_x; -@@ -5216,6 +5551,8 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req - out[z++] = pal[color][0]; - out[z++] = pal[color][1]; - out[z++] = pal[color][2]; -+ if (target == 4) out[z++] = 255; -+ if (i+1 == (int) s->img_x) break; - if((--bit_offset) < 0) { - bit_offset = 7; - v = stbi__get8(s); -@@ -5249,7 +5586,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req - int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0; - int z = 0; - int easy=0; -- stbi__skip(s, info.offset - 14 - info.hsz); -+ stbi__skip(s, info.offset - info.extra_read - info.hsz); - if (info.bpp == 24) width = 3 * s->img_x; - else if (info.bpp == 16) width = 2*s->img_x; - else /* bpp = 32 and pad = 0 */ width=0; -@@ -5267,6 +5604,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req - gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg); - bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb); - ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma); -+ if (rcount > 8 || gcount > 8 || bcount > 8 || acount > 8) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); } - } - for (j=0; j < (int) s->img_y; ++j) { - if (easy) { -@@ -5308,7 +5646,7 @@ static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req - stbi_uc *p1 = out + j *s->img_x*target; - stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target; - for (i=0; i < (int) s->img_x*target; ++i) { -- t = p1[i], p1[i] = p2[i], p2[i] = t; -+ t = p1[i]; p1[i] = p2[i]; p2[i] = t; - } - } - } -@@ -5488,6 +5826,11 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req - int RLE_repeating = 0; - int read_next_pixel = 1; - STBI_NOTUSED(ri); -+ STBI_NOTUSED(tga_x_origin); // @TODO -+ STBI_NOTUSED(tga_y_origin); // @TODO -+ -+ if (tga_height > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ if (tga_width > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); - - // do a tiny bit of precessing - if ( tga_image_type >= 8 ) -@@ -5528,6 +5871,11 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req - // do I need to load a palette? - if ( tga_indexed) - { -+ if (tga_palette_len == 0) { /* you have to have at least one entry! */ -+ STBI_FREE(tga_data); -+ return stbi__errpuc("bad palette", "Corrupt TGA"); -+ } -+ - // any data to skip? (offset usually = 0) - stbi__skip(s, tga_palette_start ); - // load the palette -@@ -5651,6 +5999,7 @@ static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req - // Microsoft's C compilers happy... [8^( - tga_palette_start = tga_palette_len = tga_palette_bits = - tga_x_origin = tga_y_origin = 0; -+ STBI_NOTUSED(tga_palette_start); - // OK, done - return tga_data; - } -@@ -5735,6 +6084,9 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req - h = stbi__get32be(s); - w = stbi__get32be(s); - -+ if (h > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ if (w > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ - // Make sure the depth is 8 bits. - bitdepth = stbi__get16be(s); - if (bitdepth != 8 && bitdepth != 16) -@@ -5798,7 +6150,7 @@ static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req - // Else if n is 128, noop. - // Endloop - -- // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data, -+ // The RLE-compressed data is preceded by a 2-byte data count for each row in the data, - // which we're going to just skip. - stbi__skip(s, h * channelCount * 2 ); - -@@ -6089,6 +6441,10 @@ static void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_c - - x = stbi__get16be(s); - y = stbi__get16be(s); -+ -+ if (y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ if (x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ - if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)"); - if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc("too large", "PIC image too large to decode"); - -@@ -6098,6 +6454,7 @@ static void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_c - - // intermediate buffer is RGBA - result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0); -+ if (!result) return stbi__errpuc("outofmem", "Out of memory"); - memset(result, 0xff, x*y*4); - - if (!stbi__pic_load_core(s,x,y,comp, result)) { -@@ -6136,7 +6493,7 @@ typedef struct - int w,h; - stbi_uc *out; // output buffer (always 4 components) - stbi_uc *background; // The current "background" as far as a gif is concerned -- stbi_uc *history; -+ stbi_uc *history; - int flags, bgindex, ratio, transparent, eflags; - stbi_uc pal[256][4]; - stbi_uc lpal[256][4]; -@@ -6197,6 +6554,9 @@ static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_in - g->ratio = stbi__get8(s); - g->transparent = -1; - -+ if (g->w > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); -+ if (g->h > STBI_MAX_DIMENSIONS) return stbi__err("too large","Very large image (corrupt?)"); -+ - if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments - - if (is_info) return 1; -@@ -6210,6 +6570,7 @@ static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_in - static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp) - { - stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif)); -+ if (!g) return stbi__err("outofmem", "Out of memory"); - if (!stbi__gif_header(s, g, comp, 1)) { - STBI_FREE(g); - stbi__rewind( s ); -@@ -6224,7 +6585,7 @@ static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp) - static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) - { - stbi_uc *p, *c; -- int idx; -+ int idx; - - // recurse to decode the prefixes, since the linked-list is backwards, - // and working backwards through an interleaved image would be nasty -@@ -6233,12 +6594,12 @@ static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code) - - if (g->cur_y >= g->max_y) return; - -- idx = g->cur_x + g->cur_y; -+ idx = g->cur_x + g->cur_y; - p = &g->out[idx]; -- g->history[idx / 4] = 1; -+ g->history[idx / 4] = 1; - - c = &g->color_table[g->codes[code].suffix * 4]; -- if (c[3] > 128) { // don't render transparent pixels; -+ if (c[3] > 128) { // don't render transparent pixels; - p[0] = c[2]; - p[1] = c[1]; - p[2] = c[0]; -@@ -6347,31 +6708,36 @@ static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g) - // two back is the image from two frames ago, used for a very specific disposal format - static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp, stbi_uc *two_back) - { -- int dispose; -- int first_frame; -- int pi; -- int pcount; -+ int dispose; -+ int first_frame; -+ int pi; -+ int pcount; -+ STBI_NOTUSED(req_comp); - - // on first frame, any non-written pixels get the background colour (non-transparent) -- first_frame = 0; -+ first_frame = 0; - if (g->out == 0) { -- if (!stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header -- g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h); -- g->background = (stbi_uc *) stbi__malloc(4 * g->w * g->h); -- g->history = (stbi_uc *) stbi__malloc(g->w * g->h); -- if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory"); -- -- // image is treated as "tranparent" at the start - ie, nothing overwrites the current background; -+ if (!stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header -+ if (!stbi__mad3sizes_valid(4, g->w, g->h, 0)) -+ return stbi__errpuc("too large", "GIF image is too large"); -+ pcount = g->w * g->h; -+ g->out = (stbi_uc *) stbi__malloc(4 * pcount); -+ g->background = (stbi_uc *) stbi__malloc(4 * pcount); -+ g->history = (stbi_uc *) stbi__malloc(pcount); -+ if (!g->out || !g->background || !g->history) -+ return stbi__errpuc("outofmem", "Out of memory"); -+ -+ // image is treated as "transparent" at the start - ie, nothing overwrites the current background; - // background colour is only used for pixels that are not rendered first frame, after that "background" -- // color refers to teh color that was there the previous frame. -- memset( g->out, 0x00, 4 * g->w * g->h ); -- memset( g->background, 0x00, 4 * g->w * g->h ); // state of the background (starts transparent) -- memset( g->history, 0x00, g->w * g->h ); // pixels that were affected previous frame -- first_frame = 1; -+ // color refers to the color that was there the previous frame. -+ memset(g->out, 0x00, 4 * pcount); -+ memset(g->background, 0x00, 4 * pcount); // state of the background (starts transparent) -+ memset(g->history, 0x00, pcount); // pixels that were affected previous frame -+ first_frame = 1; - } else { -- // second frame - how do we dispoase of the previous one? -- dispose = (g->eflags & 0x1C) >> 2; -- pcount = g->w * g->h; -+ // second frame - how do we dispose of the previous one? -+ dispose = (g->eflags & 0x1C) >> 2; -+ pcount = g->w * g->h; - - if ((dispose == 3) && (two_back == 0)) { - dispose = 2; // if I don't have an image to revert back to, default to the old background -@@ -6380,32 +6746,32 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i - if (dispose == 3) { // use previous graphic - for (pi = 0; pi < pcount; ++pi) { - if (g->history[pi]) { -- memcpy( &g->out[pi * 4], &two_back[pi * 4], 4 ); -+ memcpy( &g->out[pi * 4], &two_back[pi * 4], 4 ); - } - } -- } else if (dispose == 2) { -- // restore what was changed last frame to background before that frame; -+ } else if (dispose == 2) { -+ // restore what was changed last frame to background before that frame; - for (pi = 0; pi < pcount; ++pi) { - if (g->history[pi]) { -- memcpy( &g->out[pi * 4], &g->background[pi * 4], 4 ); -+ memcpy( &g->out[pi * 4], &g->background[pi * 4], 4 ); - } - } - } else { -- // This is a non-disposal case eithe way, so just -+ // This is a non-disposal case eithe way, so just - // leave the pixels as is, and they will become the new background - // 1: do not dispose - // 0: not specified. - } - -- // background is what out is after the undoing of the previou frame; -- memcpy( g->background, g->out, 4 * g->w * g->h ); -+ // background is what out is after the undoing of the previou frame; -+ memcpy( g->background, g->out, 4 * g->w * g->h ); - } - -- // clear my history; -+ // clear my history; - memset( g->history, 0x00, g->w * g->h ); // pixels that were affected previous frame - - for (;;) { -- int tag = stbi__get8(s); -+ int tag = stbi__get8(s); - switch (tag) { - case 0x2C: /* Image Descriptor */ - { -@@ -6427,6 +6793,13 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i - g->cur_x = g->start_x; - g->cur_y = g->start_y; - -+ // if the width of the specified rectangle is 0, that means -+ // we may not see *any* pixels or the image is malformed; -+ // to make sure this is caught, move the current y down to -+ // max_y (which is what out_gif_code checks). -+ if (w == 0) -+ g->cur_y = g->max_y; -+ - g->lflags = stbi__get8(s); - - if (g->lflags & 0x40) { -@@ -6443,19 +6816,19 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i - } else if (g->flags & 0x80) { - g->color_table = (stbi_uc *) g->pal; - } else -- return stbi__errpuc("missing color table", "Corrupt GIF"); -- -+ return stbi__errpuc("missing color table", "Corrupt GIF"); -+ - o = stbi__process_gif_raster(s, g); -- if (o == NULL) return NULL; -+ if (!o) return NULL; - -- // if this was the first frame, -- pcount = g->w * g->h; -+ // if this was the first frame, -+ pcount = g->w * g->h; - if (first_frame && (g->bgindex > 0)) { - // if first frame, any pixel not drawn to gets the background color - for (pi = 0; pi < pcount; ++pi) { - if (g->history[pi] == 0) { -- g->pal[g->bgindex][3] = 255; // just in case it was made transparent, undo that; It will be reset next frame if need be; -- memcpy( &g->out[pi * 4], &g->pal[g->bgindex], 4 ); -+ g->pal[g->bgindex][3] = 255; // just in case it was made transparent, undo that; It will be reset next frame if need be; -+ memcpy( &g->out[pi * 4], &g->pal[g->bgindex], 4 ); - } - } - } -@@ -6466,7 +6839,7 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i - case 0x21: // Comment Extension. - { - int len; -- int ext = stbi__get8(s); -+ int ext = stbi__get8(s); - if (ext == 0xF9) { // Graphic Control Extension. - len = stbi__get8(s); - if (len == 4) { -@@ -6475,23 +6848,23 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i - - // unset old transparent - if (g->transparent >= 0) { -- g->pal[g->transparent][3] = 255; -- } -+ g->pal[g->transparent][3] = 255; -+ } - if (g->eflags & 0x01) { - g->transparent = stbi__get8(s); - if (g->transparent >= 0) { -- g->pal[g->transparent][3] = 0; -+ g->pal[g->transparent][3] = 0; - } - } else { - // don't need transparent -- stbi__skip(s, 1); -- g->transparent = -1; -+ stbi__skip(s, 1); -+ g->transparent = -1; - } - } else { - stbi__skip(s, len); - break; - } -- } -+ } - while ((len = stbi__get8(s)) != 0) { - stbi__skip(s, len); - } -@@ -6507,18 +6880,35 @@ static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, i - } - } - -+static void *stbi__load_gif_main_outofmem(stbi__gif *g, stbi_uc *out, int **delays) -+{ -+ STBI_FREE(g->out); -+ STBI_FREE(g->history); -+ STBI_FREE(g->background); -+ -+ if (out) STBI_FREE(out); -+ if (delays && *delays) STBI_FREE(*delays); -+ return stbi__errpuc("outofmem", "Out of memory"); -+} -+ - static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, int *z, int *comp, int req_comp) - { - if (stbi__gif_test(s)) { -- int layers = 0; -+ int layers = 0; - stbi_uc *u = 0; - stbi_uc *out = 0; -- stbi_uc *two_back = 0; -+ stbi_uc *two_back = 0; - stbi__gif g; -- int stride; -+ int stride; -+ int out_size = 0; -+ int delays_size = 0; -+ -+ STBI_NOTUSED(out_size); -+ STBI_NOTUSED(delays_size); -+ - memset(&g, 0, sizeof(g)); - if (delays) { -- *delays = 0; -+ *delays = 0; - } - - do { -@@ -6528,44 +6918,61 @@ static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, - if (u) { - *x = g.w; - *y = g.h; -- ++layers; -- stride = g.w * g.h * 4; -- -+ ++layers; -+ stride = g.w * g.h * 4; -+ - if (out) { -- out = (stbi_uc*) STBI_REALLOC( out, layers * stride ); -+ void *tmp = (stbi_uc*) STBI_REALLOC_SIZED( out, out_size, layers * stride ); -+ if (!tmp) -+ return stbi__load_gif_main_outofmem(&g, out, delays); -+ else { -+ out = (stbi_uc*) tmp; -+ out_size = layers * stride; -+ } -+ - if (delays) { -- *delays = (int*) STBI_REALLOC( *delays, sizeof(int) * layers ); -+ int *new_delays = (int*) STBI_REALLOC_SIZED( *delays, delays_size, sizeof(int) * layers ); -+ if (!new_delays) -+ return stbi__load_gif_main_outofmem(&g, out, delays); -+ *delays = new_delays; -+ delays_size = layers * sizeof(int); - } - } else { -- out = (stbi_uc*)stbi__malloc( layers * stride ); -+ out = (stbi_uc*)stbi__malloc( layers * stride ); -+ if (!out) -+ return stbi__load_gif_main_outofmem(&g, out, delays); -+ out_size = layers * stride; - if (delays) { -- *delays = (int*) stbi__malloc( layers * sizeof(int) ); -+ *delays = (int*) stbi__malloc( layers * sizeof(int) ); -+ if (!*delays) -+ return stbi__load_gif_main_outofmem(&g, out, delays); -+ delays_size = layers * sizeof(int); - } - } -- memcpy( out + ((layers - 1) * stride), u, stride ); -+ memcpy( out + ((layers - 1) * stride), u, stride ); - if (layers >= 2) { -- two_back = out - 2 * stride; -+ two_back = out - 2 * stride; - } - - if (delays) { -- (*delays)[layers - 1U] = g.delay; -+ (*delays)[layers - 1U] = g.delay; - } - } -- } while (u != 0); -+ } while (u != 0); - -- // free temp buffer; -- STBI_FREE(g.out); -- STBI_FREE(g.history); -- STBI_FREE(g.background); -+ // free temp buffer; -+ STBI_FREE(g.out); -+ STBI_FREE(g.history); -+ STBI_FREE(g.background); - -- // do the final conversion after loading everything; -+ // do the final conversion after loading everything; - if (req_comp && req_comp != 4) - out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h); - -- *z = layers; -+ *z = layers; - return out; - } else { -- return stbi__errpuc("not GIF", "Image was not as a gif type."); -+ return stbi__errpuc("not GIF", "Image was not as a gif type."); - } - } - -@@ -6574,6 +6981,7 @@ static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req - stbi_uc *u = 0; - stbi__gif g; - memset(&g, 0, sizeof(g)); -+ STBI_NOTUSED(ri); - - u = stbi__gif_load_next(s, &g, comp, req_comp, 0); - if (u == (stbi_uc *) s) u = 0; // end of animated gif marker -@@ -6582,14 +6990,17 @@ static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req - *y = g.h; - - // moved conversion to after successful load so that the same -- // can be done for multiple frames. -+ // can be done for multiple frames. - if (req_comp && req_comp != 4) - u = stbi__convert_format(u, 4, req_comp, g.w, g.h); -+ } else if (g.out) { -+ // if there was an error and we allocated an image buffer, free it! -+ STBI_FREE(g.out); - } - -- // free buffers needed for multiple frame loading; -+ // free buffers needed for multiple frame loading; - STBI_FREE(g.history); -- STBI_FREE(g.background); -+ STBI_FREE(g.background); - - return u; - } -@@ -6714,6 +7125,9 @@ static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int re - token += 3; - width = (int) strtol(token, NULL, 10); - -+ if (height > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)"); -+ if (width > STBI_MAX_DIMENSIONS) return stbi__errpf("too large","Very large image (corrupt?)"); -+ - *x = width; - *y = height; - -@@ -6856,12 +7270,18 @@ static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp) - - info.all_a = 255; - p = stbi__bmp_parse_header(s, &info); -- stbi__rewind( s ); -- if (p == NULL) -+ if (p == NULL) { -+ stbi__rewind( s ); - return 0; -+ } - if (x) *x = s->img_x; - if (y) *y = s->img_y; -- if (comp) *comp = info.ma ? 4 : 3; -+ if (comp) { -+ if (info.bpp == 24 && info.ma == 0xff000000) -+ *comp = 3; -+ else -+ *comp = info.ma ? 4 : 3; -+ } - return 1; - } - #endif -@@ -6919,8 +7339,8 @@ static int stbi__psd_is16(stbi__context *s) - stbi__rewind( s ); - return 0; - } -- (void) stbi__get32be(s); -- (void) stbi__get32be(s); -+ STBI_NOTUSED(stbi__get32be(s)); -+ STBI_NOTUSED(stbi__get32be(s)); - depth = stbi__get16be(s); - if (depth != 16) { - stbi__rewind( s ); -@@ -6999,7 +7419,6 @@ static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp) - // Known limitations: - // Does not support comments in the header section - // Does not support ASCII image data (formats P2 and P3) --// Does not support 16-bit-per-channel - - #ifndef STBI_NO_PNM - -@@ -7020,19 +7439,23 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req - stbi_uc *out; - STBI_NOTUSED(ri); - -- if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n)) -+ ri->bits_per_channel = stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n); -+ if (ri->bits_per_channel == 0) - return 0; - -+ if (s->img_y > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ if (s->img_x > STBI_MAX_DIMENSIONS) return stbi__errpuc("too large","Very large image (corrupt?)"); -+ - *x = s->img_x; - *y = s->img_y; - if (comp) *comp = s->img_n; - -- if (!stbi__mad3sizes_valid(s->img_n, s->img_x, s->img_y, 0)) -+ if (!stbi__mad4sizes_valid(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0)) - return stbi__errpuc("too large", "PNM too large"); - -- out = (stbi_uc *) stbi__malloc_mad3(s->img_n, s->img_x, s->img_y, 0); -+ out = (stbi_uc *) stbi__malloc_mad4(s->img_n, s->img_x, s->img_y, ri->bits_per_channel / 8, 0); - if (!out) return stbi__errpuc("outofmem", "Out of memory"); -- stbi__getn(s, out, s->img_n * s->img_x * s->img_y); -+ stbi__getn(s, out, s->img_n * s->img_x * s->img_y * (ri->bits_per_channel / 8)); - - if (req_comp && req_comp != s->img_n) { - out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y); -@@ -7108,11 +7531,19 @@ static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp) - stbi__pnm_skip_whitespace(s, &c); - - maxv = stbi__pnm_getinteger(s, &c); // read max value -- -- if (maxv > 255) -- return stbi__err("max value > 255", "PPM image not 8-bit"); -+ if (maxv > 65535) -+ return stbi__err("max value > 65535", "PPM image supports only 8-bit and 16-bit images"); -+ else if (maxv > 255) -+ return 16; - else -- return 1; -+ return 8; -+} -+ -+static int stbi__pnm_is16(stbi__context *s) -+{ -+ if (stbi__pnm_info(s, NULL, NULL, NULL) == 16) -+ return 1; -+ return 0; - } - #endif - -@@ -7168,6 +7599,9 @@ static int stbi__is_16_main(stbi__context *s) - if (stbi__psd_is16(s)) return 1; - #endif - -+ #ifndef STBI_NO_PNM -+ if (stbi__pnm_is16(s)) return 1; -+ #endif - return 0; - } - -@@ -7247,6 +7681,7 @@ STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *c, void *user - - /* - revision history: -+ 2.20 (2019-02-07) support utf8 filenames in Windows; fix warnings and platform ifdefs - 2.19 (2018-02-11) fix warning - 2.18 (2018-01-30) fix warnings - 2.17 (2018-01-29) change sbti__shiftsigned to avoid clang -O2 bug -diff --git a/pxr/imaging/hio/stb/stb_image.patch b/pxr/imaging/hio/stb/stb_image.patch -index 868b0a74fb..22fc041cba 100644 ---- a/pxr/imaging/hio/stb/stb_image.patch -+++ b/pxr/imaging/hio/stb/stb_image.patch -@@ -1,6 +1,6 @@ ----- stb/stb_image.h 2018-11-20 14:06:26.446637000 -0800 --+++ stb_image.h 2018-11-20 14:10:10.830961000 -0800 --@@ -420,14 +420,14 @@ -+--- stb/stb_image.h 2021-09-16 11:52:38.284782000 -0700k -++++ stb_image.h 2021-09-16 13:45:48.159770000 -0700 -+@@ -488,14 +488,14 @@ - STBIDEF void stbi_image_free (void *retval_from_stbi_load); - - // get image dimensions & components without fully decoding -@@ -19,7 +19,7 @@ - STBIDEF int stbi_is_16_bit (char const *filename); - STBIDEF int stbi_is_16_bit_from_file(FILE *f); - #endif --@@ -792,7 +792,7 @@ -+@@ -911,7 +911,7 @@ - #ifndef STBI_NO_PNG - static int stbi__png_test(stbi__context *s); - static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); -@@ -28,7 +28,7 @@ - static int stbi__png_is16(stbi__context *s); - #endif - --@@ -4290,6 +4290,7 @@ -+@@ -4554,6 +4554,7 @@ - stbi__context *s; - stbi_uc *idata, *expanded, *out; - int depth; -@@ -36,7 +36,16 @@ - } stbi__png; - - --@@ -4818,6 +4819,13 @@ -+@@ -4955,7 +4956,7 @@ -+ static STBI_THREAD_LOCAL int stbi__unpremultiply_on_load_local, stbi__unpremultiply_on_load_set; -+ static STBI_THREAD_LOCAL int stbi__de_iphone_flag_local, stbi__de_iphone_flag_set; -+ -+-STBIDEF void stbi__unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply) -++STBIDEF void stbi_set_unpremultiply_on_load_thread(int flag_true_if_should_unpremultiply) -+ { -+ stbi__unpremultiply_on_load_local = flag_true_if_should_unpremultiply; -+ stbi__unpremultiply_on_load_set = 1; -+@@ -5112,6 +5113,13 @@ - break; - } - -@@ -50,7 +59,7 @@ - case STBI__PNG_TYPE('I','D','A','T'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); --@@ -4945,7 +4994,7 @@ -+@@ -5243,7 +5251,7 @@ - return r; - } - -@@ -59,7 +68,7 @@ - { - if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { - stbi__rewind( p->s ); --@@ -4954,21 +5003,22 @@ -+@@ -5252,21 +5260,22 @@ - if (x) *x = p->s->img_x; - if (y) *y = p->s->img_y; - if (comp) *comp = p->s->img_n; -@@ -85,7 +94,7 @@ - return 0; - if (p.depth != 16) { - stbi__rewind(p.s); --@@ -7107,14 +7157,14 @@ -+@@ -7538,14 +7547,14 @@ - } - #endif - -@@ -102,7 +111,7 @@ - #endif - - #ifndef STBI_NO_GIF --@@ -7163,23 +7213,23 @@ -+@@ -7597,23 +7606,23 @@ - } - - #ifndef STBI_NO_STDIO -@@ -130,7 +139,7 @@ - fseek(f,pos,SEEK_SET); - return r; - } --@@ -7206,18 +7256,18 @@ -+@@ -7640,18 +7649,18 @@ - } - #endif // !STBI_NO_STDIO - -diff --git a/pxr/imaging/hio/stb/stb_image_resize.h b/pxr/imaging/hio/stb/stb_image_resize.h -index 031ca99dc3..ef9e6fe870 100644 ---- a/pxr/imaging/hio/stb/stb_image_resize.h -+++ b/pxr/imaging/hio/stb/stb_image_resize.h -@@ -1,4 +1,4 @@ --/* stb_image_resize - v0.95 - public domain image resizing -+/* stb_image_resize - v0.97 - public domain image resizing - by Jorge L Rodriguez (@VinoBS) - 2014 - http://github.com/nothings/stb - -@@ -20,8 +20,8 @@ - output_pixels, out_w, out_h, 0, - num_channels , alpha_chan , 0) - stbir_resize_uint8_srgb_edgemode( -- input_pixels , in_w , in_h , 0, -- output_pixels, out_w, out_h, 0, -+ input_pixels , in_w , in_h , 0, -+ output_pixels, out_w, out_h, 0, - num_channels , alpha_chan , 0, STBIR_EDGE_CLAMP) - // WRAP/REFLECT/ZERO - -@@ -159,6 +159,8 @@ - Nathan Reed: warning fixes - - REVISIONS -+ 0.97 (2020-02-02) fixed warning -+ 0.96 (2019-03-04) fixed warnings - 0.95 (2017-07-23) fixed warnings - 0.94 (2017-03-18) fixed warnings - 0.93 (2017-03-03) fixed bug with certain combinations of heights -@@ -193,6 +195,7 @@ typedef uint16_t stbir_uint16; - typedef uint32_t stbir_uint32; - #endif - -+#ifndef STBIRDEF - #ifdef STB_IMAGE_RESIZE_STATIC - #define STBIRDEF static - #else -@@ -202,7 +205,7 @@ typedef uint32_t stbir_uint32; - #define STBIRDEF extern - #endif - #endif -- -+#endif - - ////////////////////////////////////////////////////////////////////////////// - // -@@ -231,7 +234,7 @@ STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , i - int num_channels); - - --// The following functions interpret image data as gamma-corrected sRGB. -+// The following functions interpret image data as gamma-corrected sRGB. - // Specify STBIR_ALPHA_CHANNEL_NONE if you have no alpha channel, - // or otherwise provide the index of the alpha channel. Flags value - // of 0 will probably do the right thing if you're not sure what -@@ -304,19 +307,19 @@ typedef enum - STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, -+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - - STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, -+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - - STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - float *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, -+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context); - - -@@ -348,7 +351,7 @@ STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, -+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context); - -@@ -356,7 +359,7 @@ STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, -+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float x_scale, float y_scale, -@@ -366,7 +369,7 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, -+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float s0, float t0, float s1, float t1); -@@ -668,14 +671,14 @@ static const stbir_uint32 fp32_to_srgb8_tab4[104] = { - 0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559, - 0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723, - }; -- -+ - static stbir_uint8 stbir__linear_to_srgb_uchar(float in) - { - static const stbir__FP32 almostone = { 0x3f7fffff }; // 1-eps - static const stbir__FP32 minval = { (127-13) << 23 }; - stbir_uint32 tab,bias,scale,t; - stbir__FP32 f; -- -+ - // Clamp to [2^(-13), 1-eps]; these two values map to 0 and 1, respectively. - // The tests are carefully written so that NaNs map to 0, same as in the reference - // implementation. -@@ -683,13 +686,13 @@ static stbir_uint8 stbir__linear_to_srgb_uchar(float in) - in = minval.f; - if (in > almostone.f) - in = almostone.f; -- -+ - // Do the table lookup and unpack bias, scale - f.f = in; - tab = fp32_to_srgb8_tab4[(f.u - minval.u) >> 20]; - bias = (tab >> 16) << 9; - scale = tab & 0xffff; -- -+ - // Grab next-highest mantissa bits and perform linear interpolation - t = (f.u >> 12) & 0xff; - return (unsigned char) ((bias + scale*t) >> 16); -@@ -1061,7 +1064,11 @@ static void stbir__calculate_coefficients_upsample(stbir_filter filter, float sc - total_filter += coefficient_group[i]; - } - -- STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); -+ // NOTE(fg): Not actually true in general, nor is there any reason to expect it should be. -+ // It would be true in exact math but is at best approximately true in floating-point math, -+ // and it would not make sense to try and put actual bounds on this here because it depends -+ // on the image aspect ratio which can get pretty extreme. -+ //STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0); - - STBIR_ASSERT(total_filter > 0.9); - STBIR_ASSERT(total_filter < 1.1f); // Make sure it's not way off. -@@ -1086,7 +1093,7 @@ static void stbir__calculate_coefficients_downsample(stbir_filter filter, float - { - int i; - -- STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. -+ STBIR_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical. - - contributor->n0 = out_first_pixel; - contributor->n1 = out_last_pixel; -@@ -1100,7 +1107,11 @@ static void stbir__calculate_coefficients_downsample(stbir_filter filter, float - coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio; - } - -- STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); -+ // NOTE(fg): Not actually true in general, nor is there any reason to expect it should be. -+ // It would be true in exact math but is at best approximately true in floating-point math, -+ // and it would not make sense to try and put actual bounds on this here because it depends -+ // on the image aspect ratio which can get pretty extreme. -+ //STBIR_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0); - - for (i = out_last_pixel - out_first_pixel; i >= 0; i--) - { -@@ -1236,7 +1247,7 @@ static float* stbir__get_decode_buffer(stbir__info* stbir_info) - return &stbir_info->decode_buffer[stbir_info->horizontal_filter_pixel_margin * stbir_info->channels]; - } - --#define STBIR__DECODE(type, colorspace) ((type) * (STBIR_MAX_COLORSPACES) + (colorspace)) -+#define STBIR__DECODE(type, colorspace) ((int)(type) * (STBIR_MAX_COLORSPACES) + (int)(colorspace)) - - static void stbir__decode_scanline(stbir__info* stbir_info, int n) - { -@@ -1549,7 +1560,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float - { - int out_pixel_index = k * 1; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; -- STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - } - } -@@ -1570,7 +1580,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float - { - int out_pixel_index = k * 2; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; -- STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - } -@@ -1592,7 +1601,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float - { - int out_pixel_index = k * 3; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; -- STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; -@@ -1615,7 +1623,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float - { - int out_pixel_index = k * 4; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; -- STBIR_ASSERT(coefficient != 0); - output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient; - output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient; - output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient; -@@ -1640,7 +1647,6 @@ static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, float - int c; - int out_pixel_index = k * channels; - float coefficient = horizontal_coefficients[coefficient_group + k - n0]; -- STBIR_ASSERT(coefficient != 0); - for (c = 0; c < channels; c++) - output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient; - } -@@ -2324,8 +2330,9 @@ static int stbir__resize_allocated(stbir__info *info, - if (alpha_channel < 0) - flags |= STBIR_FLAG_ALPHA_USES_COLORSPACE | STBIR_FLAG_ALPHA_PREMULTIPLIED; - -- if (!(flags&STBIR_FLAG_ALPHA_USES_COLORSPACE) || !(flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) -+ if (!(flags&STBIR_FLAG_ALPHA_USES_COLORSPACE) || !(flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)) { - STBIR_ASSERT(alpha_channel >= 0 && alpha_channel < info->channels); -+ } - - if (alpha_channel >= info->channels) - return 0; -@@ -2442,7 +2449,7 @@ static int stbir__resize_arbitrary( - return 0; - - result = stbir__resize_allocated(&info, input_data, input_stride_in_bytes, -- output_data, output_stride_in_bytes, -+ output_data, output_stride_in_bytes, - alpha_channel, flags, type, - edge_horizontal, edge_vertical, - colorspace, extra_memory, memory_required); -@@ -2496,7 +2503,7 @@ STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels - STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, -+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) - { - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, -@@ -2508,7 +2515,7 @@ STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int - STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, -+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) - { - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, -@@ -2521,7 +2528,7 @@ STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int - STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes, - float *output_pixels , int output_w, int output_h, int output_stride_in_bytes, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, -+ stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space, - void *alloc_context) - { - return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes, -@@ -2535,7 +2542,7 @@ STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, -+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context) - { -@@ -2550,7 +2557,7 @@ STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, -+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float x_scale, float y_scale, -@@ -2571,7 +2578,7 @@ STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int - void *output_pixels, int output_w, int output_h, int output_stride_in_bytes, - stbir_datatype datatype, - int num_channels, int alpha_channel, int flags, -- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, -+ stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical, - stbir_filter filter_horizontal, stbir_filter filter_vertical, - stbir_colorspace space, void *alloc_context, - float s0, float t0, float s1, float t1) -@@ -2590,38 +2597,38 @@ This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett --Permission is hereby granted, free of charge, to any person obtaining a copy of --this software and associated documentation files (the "Software"), to deal in --the Software without restriction, including without limitation the rights to --use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies --of the Software, and to permit persons to whom the Software is furnished to do -+Permission is hereby granted, free of charge, to any person obtaining a copy of -+this software and associated documentation files (the "Software"), to deal in -+the Software without restriction, including without limitation the rights to -+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -+of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: --The above copyright notice and this permission notice shall be included in all -+The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. --Anyone is free to copy, modify, publish, use, compile, sell, or distribute this --software, either in source code form or as a compiled binary, for any purpose, -+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -+software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. --In jurisdictions that recognize copyright laws, the author or authors of this --software dedicate any and all copyright interest in the software to the public --domain. We make this dedication for the benefit of the public at large and to --the detriment of our heirs and successors. We intend this dedication to be an --overt act of relinquishment in perpetuity of all present and future rights to -+In jurisdictions that recognize copyright laws, the author or authors of this -+software dedicate any and all copyright interest in the software to the public -+domain. We make this dedication for the benefit of the public at large and to -+the detriment of our heirs and successors. We intend this dedication to be an -+overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN --ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------------------------------------------------------------------------------ - */ -diff --git a/pxr/imaging/hio/stb/stb_image_write.h b/pxr/imaging/hio/stb/stb_image_write.h -index 7c63a2dc20..e4b32ed1bc 100644 ---- a/pxr/imaging/hio/stb/stb_image_write.h -+++ b/pxr/imaging/hio/stb/stb_image_write.h -@@ -1,4 +1,4 @@ --/* stb_image_write - v1.09 - public domain - http://nothings.org/stb/stb_image_write.h -+/* stb_image_write - v1.16 - public domain - http://nothings.org/stb - writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015 - no warranty implied; use at your own risk - -@@ -10,15 +10,9 @@ - - Will probably not work correctly with strict-aliasing optimizations. - -- If using a modern Microsoft Compiler, non-safe versions of CRT calls may cause -- compilation warnings or even errors. To avoid this, also before #including, -- -- #define STBI_MSC_SECURE_CRT -- - ABOUT: - -- This header file is a library for writing images to C stdio. It could be -- adapted to write to memory or a general streaming interface; let me know. -+ This header file is a library for writing images to C stdio or a callback. - - The PNG output is not optimal; it is 20-50% larger than the file - written by a decent optimizing implementation; though providing a custom -@@ -38,6 +32,14 @@ - The returned data will be freed with STBIW_FREE() (free() by default), - so it must be heap allocated with STBIW_MALLOC() (malloc() by default), - -+UNICODE: -+ -+ If compiling for Windows and you wish to use Unicode filenames, compile -+ with -+ #define STBIW_WINDOWS_UTF8 -+ and pass utf8-encoded filenames. Call stbiw_convert_wchar_to_utf8 to convert -+ Windows wchar_t filenames to utf8. -+ - USAGE: - - There are five functions, one for each image file format: -@@ -103,7 +105,7 @@ - - TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed - data, set the global variable 'stbi_write_tga_with_rle' to 0. -- -+ - JPEG does ignore alpha channels in input data; quality is between 1 and 100. - Higher quality looks better but results in a bigger image. - JPEG baseline (no JPEG progressive). -@@ -111,7 +113,7 @@ - CREDITS: - - -- Sean Barrett - PNG/BMP/TGA -+ Sean Barrett - PNG/BMP/TGA - Baldur Karlsson - HDR - Jean-Sebastien Guay - TGA monochrome - Tim Kelsey - misc enhancements -@@ -138,6 +140,7 @@ - Ivan Tikhonov - github:ignotion - Adam Schackart -+ Andrew Kensler - - LICENSE - -@@ -148,6 +151,8 @@ LICENSE - #ifndef INCLUDE_STB_IMAGE_WRITE_H - #define INCLUDE_STB_IMAGE_WRITE_H - -+#include -+ - // if STB_IMAGE_WRITE_STATIC causes problems, try defining STBIWDEF to 'inline' or 'static inline' - #ifndef STBIWDEF - #ifdef STB_IMAGE_WRITE_STATIC -@@ -162,9 +167,9 @@ LICENSE - #endif - - #ifndef STB_IMAGE_WRITE_STATIC // C++ forbids static forward declarations --extern int stbi_write_tga_with_rle; --extern int stbi_write_png_compression_level; --extern int stbi_write_force_png_filter; -+STBIWDEF int stbi_write_tga_with_rle; -+STBIWDEF int stbi_write_png_compression_level; -+STBIWDEF int stbi_write_force_png_filter; - #endif - - #ifndef STBI_WRITE_NO_STDIO -@@ -173,6 +178,10 @@ STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const - STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); - STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); - STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality); -+ -+#ifdef STBIW_WINDOWS_UTF8 -+STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input); -+#endif - #endif - - typedef void stbi_write_func(void *context, void *data, int size); -@@ -239,17 +248,17 @@ STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean); - #define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) - - #ifdef STB_IMAGE_WRITE_STATIC --static int stbi__flip_vertically_on_write=0; - static int stbi_write_png_compression_level = 8; - static int stbi_write_tga_with_rle = 1; - static int stbi_write_force_png_filter = -1; - #else - int stbi_write_png_compression_level = 8; --int stbi__flip_vertically_on_write=0; - int stbi_write_tga_with_rle = 1; - int stbi_write_force_png_filter = -1; - #endif - -+static int stbi__flip_vertically_on_write = 0; -+ - STBIWDEF void stbi_flip_vertically_on_write(int flag) - { - stbi__flip_vertically_on_write = flag; -@@ -259,6 +268,8 @@ typedef struct - { - stbi_write_func *func; - void *context; -+ unsigned char buffer[64]; -+ int buf_used; - } stbi__write_context; - - // initialize a callback-based context -@@ -275,15 +286,52 @@ static void stbi__stdio_write(void *context, void *data, int size) - fwrite(data,1,size,(FILE*) context); - } - --static int stbi__start_write_file(stbi__write_context *s, const char *filename) -+#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8) -+#ifdef __cplusplus -+#define STBIW_EXTERN extern "C" -+#else -+#define STBIW_EXTERN extern -+#endif -+STBIW_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide); -+STBIW_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default); -+ -+STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input) -+{ -+ return WideCharToMultiByte(65001 /* UTF8 */, 0, input, -1, buffer, (int) bufferlen, NULL, NULL); -+} -+#endif -+ -+static FILE *stbiw__fopen(char const *filename, char const *mode) - { - FILE *f; --#ifdef STBI_MSC_SECURE_CRT -- if (fopen_s(&f, filename, "wb")) -- f = NULL; -+#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8) -+ wchar_t wMode[64]; -+ wchar_t wFilename[1024]; -+ if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename))) -+ return 0; -+ -+ if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode))) -+ return 0; -+ -+#if defined(_MSC_VER) && _MSC_VER >= 1400 -+ if (0 != _wfopen_s(&f, wFilename, wMode)) -+ f = 0; - #else -- f = fopen(filename, "wb"); -+ f = _wfopen(wFilename, wMode); - #endif -+ -+#elif defined(_MSC_VER) && _MSC_VER >= 1400 -+ if (0 != fopen_s(&f, filename, mode)) -+ f=0; -+#else -+ f = fopen(filename, mode); -+#endif -+ return f; -+} -+ -+static int stbi__start_write_file(stbi__write_context *s, const char *filename) -+{ -+ FILE *f = stbiw__fopen(filename, "wb"); - stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f); - return f != NULL; - } -@@ -335,16 +383,36 @@ static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) - va_end(v); - } - -+static void stbiw__write_flush(stbi__write_context *s) -+{ -+ if (s->buf_used) { -+ s->func(s->context, &s->buffer, s->buf_used); -+ s->buf_used = 0; -+ } -+} -+ - static void stbiw__putc(stbi__write_context *s, unsigned char c) - { - s->func(s->context, &c, 1); - } - -+static void stbiw__write1(stbi__write_context *s, unsigned char a) -+{ -+ if ((size_t)s->buf_used + 1 > sizeof(s->buffer)) -+ stbiw__write_flush(s); -+ s->buffer[s->buf_used++] = a; -+} -+ - static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c) - { -- unsigned char arr[3]; -- arr[0] = a, arr[1] = b, arr[2] = c; -- s->func(s->context, arr, 3); -+ int n; -+ if ((size_t)s->buf_used + 3 > sizeof(s->buffer)) -+ stbiw__write_flush(s); -+ n = s->buf_used; -+ s->buf_used = n+3; -+ s->buffer[n+0] = a; -+ s->buffer[n+1] = b; -+ s->buffer[n+2] = c; - } - - static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d) -@@ -353,7 +421,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in - int k; - - if (write_alpha < 0) -- s->func(s->context, &d[comp - 1], 1); -+ stbiw__write1(s, d[comp - 1]); - - switch (comp) { - case 2: // 2 pixels = mono + alpha, alpha is written separately, so same as 1-channel case -@@ -361,7 +429,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in - if (expand_mono) - stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp - else -- s->func(s->context, d, 1); // monochrome TGA -+ stbiw__write1(s, d[0]); // monochrome TGA - break; - case 4: - if (!write_alpha) { -@@ -377,7 +445,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in - break; - } - if (write_alpha > 0) -- s->func(s->context, &d[comp - 1], 1); -+ stbiw__write1(s, d[comp - 1]); - } - - static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono) -@@ -391,16 +459,18 @@ static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, i - if (stbi__flip_vertically_on_write) - vdir *= -1; - -- if (vdir < 0) -- j_end = -1, j = y-1; -- else -- j_end = y, j = 0; -+ if (vdir < 0) { -+ j_end = -1; j = y-1; -+ } else { -+ j_end = y; j = 0; -+ } - - for (; j != j_end; j += vdir) { - for (i=0; i < x; ++i) { - unsigned char *d = (unsigned char *) data + (j*x+i)*comp; - stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d); - } -+ stbiw__write_flush(s); - s->func(s->context, &zero, scanline_pad); - } - } -@@ -421,16 +491,27 @@ static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, - - static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data) - { -- int pad = (-x*3) & 3; -- return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, -- "11 4 22 4" "4 44 22 444444", -- 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header -- 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header -+ if (comp != 4) { -+ // write RGB bitmap -+ int pad = (-x*3) & 3; -+ return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, -+ "11 4 22 4" "4 44 22 444444", -+ 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header -+ 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header -+ } else { -+ // RGBA bitmaps need a v4 header -+ // use BI_BITFIELDS mode with 32bpp and alpha mask -+ // (straight BI_RGB with alpha mask doesn't work in most readers) -+ return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *)data,1,0, -+ "11 4 22 4" "4 44 22 444444 4444 4 444 444 444 444", -+ 'B', 'M', 14+108+x*y*4, 0, 0, 14+108, // file header -+ 108, x,y, 1,32, 3,0,0,0,0,0, 0xff0000,0xff00,0xff,0xff000000u, 0, 0,0,0, 0,0,0, 0,0,0, 0,0,0); // bitmap V4 header -+ } - } - - STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_bmp_core(&s, x, y, comp, data); - } -@@ -438,7 +519,7 @@ STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, - #ifndef STBI_WRITE_NO_STDIO - STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_bmp_core(&s, x, y, comp, data); - stbi__end_write_file(&s); -@@ -511,24 +592,25 @@ static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, v - - if (diff) { - unsigned char header = STBIW_UCHAR(len - 1); -- s->func(s->context, &header, 1); -+ stbiw__write1(s, header); - for (k = 0; k < len; ++k) { - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp); - } - } else { - unsigned char header = STBIW_UCHAR(len - 129); -- s->func(s->context, &header, 1); -+ stbiw__write1(s, header); - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin); - } - } - } -+ stbiw__write_flush(s); - } - return 1; - } - - STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_tga_core(&s, x, y, comp, (void *) data); - } -@@ -536,7 +618,7 @@ STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, - #ifndef STBI_WRITE_NO_STDIO - STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_tga_core(&s, x, y, comp, (void *) data); - stbi__end_write_file(&s); -@@ -552,7 +634,9 @@ STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const - - #define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) - --void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) -+#ifndef STBI_WRITE_NO_STDIO -+ -+static void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) - { - int exponent; - float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); -@@ -569,7 +653,7 @@ void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) - } - } - --void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) -+static void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) - { - unsigned char lengthbyte = STBIW_UCHAR(length+128); - STBIW_ASSERT(length+128 <= 255); -@@ -577,7 +661,7 @@ void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char dat - s->func(s->context, &databyte, 1); - } - --void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) -+static void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) - { - unsigned char lengthbyte = STBIW_UCHAR(length); - STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code -@@ -585,7 +669,7 @@ void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *d - s->func(s->context, data, length); - } - --void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) -+static void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) - { - unsigned char scanlineheader[4] = { 2, 2, 0, 0 }; - unsigned char rgbe[4]; -@@ -686,18 +770,14 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f - char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"; - s->func(s->context, header, sizeof(header)-1); - --#ifdef STBI_MSC_SECURE_CRT -- len = sprintf_s(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); -+#ifdef __STDC_LIB_EXT1__ -+ len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); - #else - len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); - #endif - s->func(s->context, buffer, len); - - for(i=0; i < y; i++) -- // XXX PIXAR: fix to the following call to stbiw__write_hdr_scanline -- // XXX Issue: Original included extra multiplication by x when computing -- // XXX starting position of scanline -- // XXX Fix : deleted extra x - stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)); - STBIW_FREE(scratch); - return 1; -@@ -706,15 +786,14 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f - - STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_hdr_core(&s, x, y, comp, (float *) data); - } - --#ifndef STBI_WRITE_NO_STDIO - STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data); - stbi__end_write_file(&s); -@@ -732,7 +811,7 @@ STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const - - #ifndef STBIW_ZLIB_COMPRESS - // stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size() --#define stbiw__sbraw(a) ((int *) (a) - 2) -+#define stbiw__sbraw(a) ((int *) (void *) (a) - 2) - #define stbiw__sbm(a) stbiw__sbraw(a)[0] - #define stbiw__sbn(a) stbiw__sbraw(a)[1] - -@@ -813,7 +892,7 @@ static unsigned int stbiw__zhash(unsigned char *data) - - #endif // STBIW_ZLIB_COMPRESS - --unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) -+STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) - { - #ifdef STBIW_ZLIB_COMPRESS - // user provided a zlib compress implementation, use that -@@ -826,7 +905,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l - unsigned int bitbuf=0; - int i,j, bitcount=0; - unsigned char *out = NULL; -- unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); -+ unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(unsigned char**)); - if (hash_table == NULL) - return NULL; - if (quality < 5) quality = 5; -@@ -849,7 +928,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l - for (j=0; j < n; ++j) { - if (hlist[j]-data > i-32768) { // if entry lies within window - int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); -- if (d >= best) best=d,bestloc=hlist[j]; -+ if (d >= best) { best=d; bestloc=hlist[j]; } - } - } - // when hash table entry is too long, delete half the entries -@@ -902,14 +981,31 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l - (void) stbiw__sbfree(hash_table[i]); - STBIW_FREE(hash_table); - -+ // store uncompressed instead if compression was worse -+ if (stbiw__sbn(out) > data_len + 2 + ((data_len+32766)/32767)*5) { -+ stbiw__sbn(out) = 2; // truncate to DEFLATE 32K window and FLEVEL = 1 -+ for (j = 0; j < data_len;) { -+ int blocklen = data_len - j; -+ if (blocklen > 32767) blocklen = 32767; -+ stbiw__sbpush(out, data_len - j == blocklen); // BFINAL = ?, BTYPE = 0 -- no compression -+ stbiw__sbpush(out, STBIW_UCHAR(blocklen)); // LEN -+ stbiw__sbpush(out, STBIW_UCHAR(blocklen >> 8)); -+ stbiw__sbpush(out, STBIW_UCHAR(~blocklen)); // NLEN -+ stbiw__sbpush(out, STBIW_UCHAR(~blocklen >> 8)); -+ memcpy(out+stbiw__sbn(out), data+j, blocklen); -+ stbiw__sbn(out) += blocklen; -+ j += blocklen; -+ } -+ } -+ - { - // compute adler32 on input - unsigned int s1=1, s2=0; - int blocklen = (int) (data_len % 5552); - j=0; - while (j < data_len) { -- for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1; -- s1 %= 65521, s2 %= 65521; -+ for (i=0; i < blocklen; ++i) { s1 += data[j+i]; s2 += s1; } -+ s1 %= 65521; s2 %= 65521; - j += blocklen; - blocklen = 5552; - } -@@ -927,6 +1023,9 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l - - static unsigned int stbiw__crc32(unsigned char *buffer, int len) - { -+#ifdef STBIW_CRC32 -+ return STBIW_CRC32(buffer, len); -+#else - static unsigned int crc_table[256] = - { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, -@@ -968,6 +1067,7 @@ static unsigned int stbiw__crc32(unsigned char *buffer, int len) - for (i=0; i < len; ++i) - crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; - return ~crc; -+#endif - } - - #define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4) -@@ -998,9 +1098,15 @@ static void stbiw__encode_png_line(unsigned char *pixels, int stride_bytes, int - int type = mymap[filter_type]; - unsigned char *z = pixels + stride_bytes * (stbi__flip_vertically_on_write ? height-1-y : y); - int signed_stride = stbi__flip_vertically_on_write ? -stride_bytes : stride_bytes; -+ -+ if (type==0) { -+ memcpy(line_buffer, z, width*n); -+ return; -+ } -+ -+ // first loop isn't optimized since it's just one pixel - for (i = 0; i < n; ++i) { - switch (type) { -- case 0: line_buffer[i] = z[i]; break; - case 1: line_buffer[i] = z[i]; break; - case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break; - case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break; -@@ -1009,20 +1115,17 @@ static void stbiw__encode_png_line(unsigned char *pixels, int stride_bytes, int - case 6: line_buffer[i] = z[i]; break; - } - } -- for (i=n; i < width*n; ++i) { -- switch (type) { -- case 0: line_buffer[i] = z[i]; break; -- case 1: line_buffer[i] = z[i] - z[i-n]; break; -- case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break; -- case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-signed_stride])>>1); break; -- case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-signed_stride], z[i-signed_stride-n]); break; -- case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break; -- case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; -- } -+ switch (type) { -+ case 1: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-n]; break; -+ case 2: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-signed_stride]; break; -+ case 3: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - ((z[i-n] + z[i-signed_stride])>>1); break; -+ case 4: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-signed_stride], z[i-signed_stride-n]); break; -+ case 5: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - (z[i-n]>>1); break; -+ case 6: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; - } - } - --unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) -+STBIWDEF unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) - { - int force_filter = stbi_write_force_png_filter; - int ctype[5] = { -1, 0, 4, 2, 6 }; -@@ -1044,11 +1147,11 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in - int filter_type; - if (force_filter > -1) { - filter_type = force_filter; -- stbiw__encode_png_line(pixels, stride_bytes, x, y, j, n, force_filter, line_buffer); -+ stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, force_filter, line_buffer); - } else { // Estimate the best filter by running through all of them: - int best_filter = 0, best_filter_val = 0x7fffffff, est, i; - for (filter_type = 0; filter_type < 5; filter_type++) { -- stbiw__encode_png_line(pixels, stride_bytes, x, y, j, n, filter_type, line_buffer); -+ stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, filter_type, line_buffer); - - // Estimate the entropy of the line using this filter; the less, the better. - est = 0; -@@ -1061,7 +1164,7 @@ unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, in - } - } - if (filter_type != best_filter) { // If the last iteration already got us the best filter, don't redo it -- stbiw__encode_png_line(pixels, stride_bytes, x, y, j, n, best_filter, line_buffer); -+ stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, best_filter, line_buffer); - filter_type = best_filter; - } - } -@@ -1113,14 +1216,10 @@ STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const - { - FILE *f; - int len; -- unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); -+ unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; --#ifdef STBI_MSC_SECURE_CRT -- if (fopen_s(&f, filename, "wb")) -- f = NULL; --#else -- f = fopen(filename, "wb"); --#endif -+ -+ f = stbiw__fopen(filename, "wb"); - if (!f) { STBIW_FREE(png); return 0; } - fwrite(png, 1, len, f); - fclose(f); -@@ -1132,7 +1231,7 @@ STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const - STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes) - { - int len; -- unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); -+ unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; - func(context, png, len); - STBIW_FREE(png); -@@ -1226,26 +1325,31 @@ static void stbiw__jpg_calcBits(int val, unsigned short bits[2]) { - bits[0] = val & ((1< 100 ? 100 : quality; - quality = quality < 50 ? 5000 / quality : 200 - quality * 2; - -@@ -1394,7 +1499,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in - static const unsigned char head0[] = { 0xFF,0xD8,0xFF,0xE0,0,0x10,'J','F','I','F',0,1,1,0,0,1,0,1,0,0,0xFF,0xDB,0,0x84,0 }; - static const unsigned char head2[] = { 0xFF,0xDA,0,0xC,3,1,0,2,0x11,3,0x11,0,0x3F,0 }; - const unsigned char head1[] = { 0xFF,0xC0,0,0x11,8,(unsigned char)(height>>8),STBIW_UCHAR(height),(unsigned char)(width>>8),STBIW_UCHAR(width), -- 3,1,0x11,0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 }; -+ 3,1,(unsigned char)(subsample?0x22:0x11),0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 }; - s->func(s->context, (void*)head0, sizeof(head0)); - s->func(s->context, (void*)YTable, sizeof(YTable)); - stbiw__putc(s, 1); -@@ -1417,38 +1522,74 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in - // Encode 8x8 macroblocks - { - static const unsigned short fillBits[] = {0x7F, 7}; -- const unsigned char *imageData = (const unsigned char *)data; - int DCY=0, DCU=0, DCV=0; - int bitBuf=0, bitCnt=0; - // comp == 2 is grey+alpha (alpha is ignored) - int ofsG = comp > 2 ? 1 : 0, ofsB = comp > 2 ? 2 : 0; -+ const unsigned char *dataR = (const unsigned char *)data; -+ const unsigned char *dataG = dataR + ofsG; -+ const unsigned char *dataB = dataR + ofsB; - int x, y, pos; -- for(y = 0; y < height; y += 8) { -- for(x = 0; x < width; x += 8) { -- float YDU[64], UDU[64], VDU[64]; -- for(row = y, pos = 0; row < y+8; ++row) { -- for(col = x; col < x+8; ++col, ++pos) { -- int p = (stbi__flip_vertically_on_write ? height-1-row : row)*width*comp + col*comp; -- float r, g, b; -- if(row >= height) { -- p -= width*comp*(row+1 - height); -+ if(subsample) { -+ for(y = 0; y < height; y += 16) { -+ for(x = 0; x < width; x += 16) { -+ float Y[256], U[256], V[256]; -+ for(row = y, pos = 0; row < y+16; ++row) { -+ // row >= height => use last input row -+ int clamped_row = (row < height) ? row : height - 1; -+ int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp; -+ for(col = x; col < x+16; ++col, ++pos) { -+ // if col >= width => use pixel from last input column -+ int p = base_p + ((col < width) ? col : (width-1))*comp; -+ float r = dataR[p], g = dataG[p], b = dataB[p]; -+ Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128; -+ U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b; -+ V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b; - } -- if(col >= width) { -- p -= comp*(col+1 - width); -+ } -+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+0, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); -+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+8, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); -+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+128, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); -+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+136, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT); -+ -+ // subsample U,V -+ { -+ float subU[64], subV[64]; -+ int yy, xx; -+ for(yy = 0, pos = 0; yy < 8; ++yy) { -+ for(xx = 0; xx < 8; ++xx, ++pos) { -+ int j = yy*32+xx*2; -+ subU[pos] = (U[j+0] + U[j+1] + U[j+16] + U[j+17]) * 0.25f; -+ subV[pos] = (V[j+0] + V[j+1] + V[j+16] + V[j+17]) * 0.25f; -+ } - } -- -- r = imageData[p+0]; -- g = imageData[p+ofsG]; -- b = imageData[p+ofsB]; -- YDU[pos]=+0.29900f*r+0.58700f*g+0.11400f*b-128; -- UDU[pos]=-0.16874f*r-0.33126f*g+0.50000f*b; -- VDU[pos]=+0.50000f*r-0.41869f*g-0.08131f*b; -+ DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subU, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); -+ DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subV, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); - } - } -+ } -+ } else { -+ for(y = 0; y < height; y += 8) { -+ for(x = 0; x < width; x += 8) { -+ float Y[64], U[64], V[64]; -+ for(row = y, pos = 0; row < y+8; ++row) { -+ // row >= height => use last input row -+ int clamped_row = (row < height) ? row : height - 1; -+ int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp; -+ for(col = x; col < x+8; ++col, ++pos) { -+ // if col >= width => use pixel from last input column -+ int p = base_p + ((col < width) ? col : (width-1))*comp; -+ float r = dataR[p], g = dataG[p], b = dataB[p]; -+ Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128; -+ U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b; -+ V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b; -+ } -+ } - -- DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, YDU, fdtbl_Y, DCY, YDC_HT, YAC_HT); -- DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, UDU, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); -- DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, VDU, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); -+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y, 8, fdtbl_Y, DCY, YDC_HT, YAC_HT); -+ DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, U, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT); -+ DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, V, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT); -+ } - } - } - -@@ -1465,7 +1606,7 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in - - STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_jpg_core(&s, x, y, comp, (void *) data, quality); - } -@@ -1474,7 +1615,7 @@ STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, - #ifndef STBI_WRITE_NO_STDIO - STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality) - { -- stbi__write_context s; -+ stbi__write_context s = { 0 }; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_jpg_core(&s, x, y, comp, data, quality); - stbi__end_write_file(&s); -@@ -1487,6 +1628,17 @@ STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const - #endif // STB_IMAGE_WRITE_IMPLEMENTATION - - /* Revision history -+ 1.16 (2021-07-11) -+ make Deflate code emit uncompressed blocks when it would otherwise expand -+ support writing BMPs with alpha channel -+ 1.15 (2020-07-13) unknown -+ 1.14 (2020-02-02) updated JPEG writer to downsample chroma channels -+ 1.13 -+ 1.12 -+ 1.11 (2019-08-11) -+ -+ 1.10 (2019-02-07) -+ support utf8 filenames in Windows; fix warnings and platform ifdefs - 1.09 (2018-02-11) - fix typo in zlib quality API, improve STB_I_W_STATIC in C++ - 1.08 (2018-01-29) -@@ -1517,7 +1669,7 @@ STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const - add HDR output - fix monochrome BMP - 0.95 (2014-08-17) -- add monochrome TGA output -+ add monochrome TGA output - 0.94 (2014-05-31) - rename private functions to avoid conflicts with stb_image.h - 0.93 (2014-05-27) -@@ -1535,38 +1687,38 @@ This software is available under 2 licenses -- choose whichever you prefer. - ------------------------------------------------------------------------------ - ALTERNATIVE A - MIT License - Copyright (c) 2017 Sean Barrett --Permission is hereby granted, free of charge, to any person obtaining a copy of --this software and associated documentation files (the "Software"), to deal in --the Software without restriction, including without limitation the rights to --use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies --of the Software, and to permit persons to whom the Software is furnished to do -+Permission is hereby granted, free of charge, to any person obtaining a copy of -+this software and associated documentation files (the "Software"), to deal in -+the Software without restriction, including without limitation the rights to -+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -+of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: --The above copyright notice and this permission notice shall be included in all -+The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - ------------------------------------------------------------------------------ - ALTERNATIVE B - Public Domain (www.unlicense.org) - This is free and unencumbered software released into the public domain. --Anyone is free to copy, modify, publish, use, compile, sell, or distribute this --software, either in source code form or as a compiled binary, for any purpose, -+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -+software, either in source code form or as a compiled binary, for any purpose, - commercial or non-commercial, and by any means. --In jurisdictions that recognize copyright laws, the author or authors of this --software dedicate any and all copyright interest in the software to the public --domain. We make this dedication for the benefit of the public at large and to --the detriment of our heirs and successors. We intend this dedication to be an --overt act of relinquishment in perpetuity of all present and future rights to -+In jurisdictions that recognize copyright laws, the author or authors of this -+software dedicate any and all copyright interest in the software to the public -+domain. We make this dedication for the benefit of the public at large and to -+the detriment of our heirs and successors. We intend this dedication to be an -+overt act of relinquishment in perpetuity of all present and future rights to - this software under copyright law. --THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN --ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------------------------------------------------------------------------------ - */ -diff --git a/pxr/imaging/hio/stb/stb_image_write.patch b/pxr/imaging/hio/stb/stb_image_write.patch -deleted file mode 100644 -index 0df4340b11..0000000000 ---- a/pxr/imaging/hio/stb/stb_image_write.patch -+++ /dev/null -@@ -1,15 +0,0 @@ ----- stb/stb_image_write.h 2018-02-11 11:57:53.000000000 -0800 --+++ stb_image_write.h 2018-06-11 14:01:49.258945863 -0700 --@@ -694,7 +694,11 @@ -- s->func(s->context, buffer, len); -- -- for(i=0; i < y; i++) --- stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)*x); --+ // XXX PIXAR: fix to the following call to stbiw__write_hdr_scanline --+ // XXX Issue: Original included extra multiplication by x when computing --+ // XXX starting position of scanline --+ // XXX Fix : deleted extra x --+ stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i)); -- STBIW_FREE(scratch); -- return 1; -- } -diff --git a/pxr/imaging/hio/stbImage.cpp b/pxr/imaging/hio/stbImage.cpp -index 8ac15e5420..da9efb1a7e 100644 ---- a/pxr/imaging/hio/stbImage.cpp -+++ b/pxr/imaging/hio/stbImage.cpp -@@ -47,6 +47,9 @@ ARCH_PRAGMA_PUSH - ARCH_PRAGMA_UNUSED_FUNCTION - - #define STB_IMAGE_STATIC -+#ifdef ARCH_OS_WINDOWS -+#define STBI_WINDOWS_UTF8 -+#endif - #define STB_IMAGE_IMPLEMENTATION - #include "pxr/imaging/hio/stb/stb_image.h" - -@@ -55,6 +58,9 @@ ARCH_PRAGMA_UNUSED_FUNCTION - #include "pxr/imaging/hio/stb/stb_image_resize.h" - - #define STB_IMAGE_WRITE_STATIC -+#ifdef ARCH_OS_WINDOWS -+#define STBIW_WINDOWS_UTF8 -+#endif - #define STB_IMAGE_WRITE_IMPLEMENTATION - #include "pxr/imaging/hio/stb/stb_image_write.h" - diff --git a/USD-21.11-disable-malloc-hooks.patch b/USD-21.11-disable-malloc-hooks.patch deleted file mode 100644 index e9164cb..0000000 --- a/USD-21.11-disable-malloc-hooks.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -Naur USD-21.11-original/pxr/base/arch/mallocHook.cpp USD-21.11/pxr/base/arch/mallocHook.cpp ---- USD-21.11-original/pxr/base/arch/mallocHook.cpp 2021-11-01 13:10:51.000000000 -0400 -+++ USD-21.11/pxr/base/arch/mallocHook.cpp 2022-03-31 17:26:22.176739670 -0400 -@@ -177,7 +177,7 @@ - _underlyingMemalignFunc || _underlyingFreeFunc; - } - --#if defined(ARCH_OS_LINUX) -+#if 0 - template - static bool _GetSymbol(T* addr, const char* name, string* errMsg) { - if (void* symbol = dlsym(RTLD_DEFAULT, name)) { -@@ -241,8 +241,8 @@ - ARCH_UNUSED_ARG void (*freeWrapper)(void*, const void*), - string* errMsg) - { --#if !defined(ARCH_OS_LINUX) -- *errMsg = "ArchMallocHook functionality not implemented for non-linux systems"; -+#if 1 -+ *errMsg = "ArchMallocHook functionality not implemented"; - return false; - #else - if (IsInitialized()) { diff --git a/USD-22.05-soversion.patch b/USD-22.05-soversion.patch deleted file mode 100644 index ef09b72..0000000 --- a/USD-22.05-soversion.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -Naur USD-22.05-original/cmake/defaults/Version.cmake USD-22.05/cmake/defaults/Version.cmake ---- USD-22.05-original/cmake/defaults/Version.cmake 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/cmake/defaults/Version.cmake 2022-05-24 18:49:29.199851843 -0400 -@@ -27,3 +27,9 @@ - set(PXR_PATCH_VERSION "5") - - math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") -+ -+set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" -+ CACHE -+ STRING -+ "Downstream shared object version" -+) -diff -Naur USD-22.05-original/cmake/macros/Private.cmake USD-22.05/cmake/macros/Private.cmake ---- USD-22.05-original/cmake/macros/Private.cmake 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/cmake/macros/Private.cmake 2022-05-24 18:49:29.200851859 -0400 -@@ -1285,6 +1285,7 @@ - PREFIX "${args_PREFIX}" - SUFFIX "${args_SUFFIX}" - PUBLIC_HEADER "${args_PUBLIC_HEADERS}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - - set(pythonEnabled "PXR_PYTHON_ENABLED=1") -diff -Naur USD-22.05-original/cmake/macros/Public.cmake USD-22.05/cmake/macros/Public.cmake ---- USD-22.05-original/cmake/macros/Public.cmake 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/cmake/macros/Public.cmake 2022-05-24 18:49:29.201851876 -0400 -@@ -998,6 +998,7 @@ - FOLDER "${folder}" - PREFIX "${PXR_LIB_PREFIX}" - IMPORT_PREFIX "${PXR_LIB_PREFIX}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - _get_install_dir("lib" libInstallPrefix) - install( diff --git a/USD-22.05-OpenEXR3.patch b/USD-22.08-OpenEXR3.patch similarity index 72% rename from USD-22.05-OpenEXR3.patch rename to USD-22.08-OpenEXR3.patch index 3583fb5..6ef72ce 100644 --- a/USD-22.05-OpenEXR3.patch +++ b/USD-22.08-OpenEXR3.patch @@ -1,6 +1,6 @@ -diff -Naur USD-22.05-original/cmake/defaults/Packages.cmake USD-22.05/cmake/defaults/Packages.cmake ---- USD-22.05-original/cmake/defaults/Packages.cmake 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/cmake/defaults/Packages.cmake 2022-05-24 18:51:26.406485870 -0400 +diff -Naur USD-22.08-original/cmake/defaults/Packages.cmake USD-22.08/cmake/defaults/Packages.cmake +--- USD-22.08-original/cmake/defaults/Packages.cmake 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/cmake/defaults/Packages.cmake 2022-08-02 11:13:07.413807117 -0400 @@ -188,6 +188,7 @@ # --OpenImageIO if (PXR_BUILD_OPENIMAGEIO_PLUGIN) @@ -14,19 +14,10 @@ diff -Naur USD-22.05-original/cmake/defaults/Packages.cmake USD-22.05/cmake/defa # --OpenVDB if (PXR_ENABLE_OPENVDB_SUPPORT) - find_package(OpenEXR REQUIRED) -+ find_package(Imath REQUIRED) ++ find_package(Imath REQUIRED) find_package(OpenVDB REQUIRED) add_definitions(-DPXR_OPENVDB_SUPPORT_ENABLED) endif() -@@ -285,7 +286,7 @@ - - if (PXR_BUILD_ALEMBIC_PLUGIN) - find_package(Alembic REQUIRED) -- find_package(OpenEXR REQUIRED) -+ find_package(Imath REQUIRED) - if (PXR_ENABLE_HDF5_SUPPORT) - find_package(HDF5 REQUIRED - COMPONENTS @@ -307,6 +308,7 @@ if(PXR_ENABLE_OSL_SUPPORT) find_package(OSL REQUIRED) @@ -35,9 +26,9 @@ diff -Naur USD-22.05-original/cmake/defaults/Packages.cmake USD-22.05/cmake/defa add_definitions(-DPXR_OSL_SUPPORT_ENABLED) endif() -diff -Naur USD-22.05-original/cmake/modules/FindOpenEXR.cmake USD-22.05/cmake/modules/FindOpenEXR.cmake ---- USD-22.05-original/cmake/modules/FindOpenEXR.cmake 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/cmake/modules/FindOpenEXR.cmake 1969-12-31 19:00:00.000000000 -0500 +diff -Naur USD-22.08-original/cmake/modules/FindOpenEXR.cmake USD-22.08/cmake/modules/FindOpenEXR.cmake +--- USD-22.08-original/cmake/modules/FindOpenEXR.cmake 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/cmake/modules/FindOpenEXR.cmake 1969-12-31 19:00:00.000000000 -0500 @@ -1,101 +0,0 @@ -# -# Copyright 2016 Pixar @@ -140,10 +131,10 @@ diff -Naur USD-22.05-original/cmake/modules/FindOpenEXR.cmake USD-22.05/cmake/mo - OPENEXR_VERSION -) - -diff -Naur USD-22.05-original/pxr/imaging/hioOpenVDB/CMakeLists.txt USD-22.05/pxr/imaging/hioOpenVDB/CMakeLists.txt ---- USD-22.05-original/pxr/imaging/hioOpenVDB/CMakeLists.txt 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/pxr/imaging/hioOpenVDB/CMakeLists.txt 2022-05-24 18:51:26.407485884 -0400 -@@ -14,7 +14,7 @@ +diff -Naur USD-22.08-original/pxr/imaging/hioOpenVDB/CMakeLists.txt USD-22.08/pxr/imaging/hioOpenVDB/CMakeLists.txt +--- USD-22.08-original/pxr/imaging/hioOpenVDB/CMakeLists.txt 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/pxr/imaging/hioOpenVDB/CMakeLists.txt 2022-08-02 11:13:40.602217640 -0400 +@@ -20,7 +20,7 @@ hio tf usd @@ -152,9 +143,9 @@ diff -Naur USD-22.05-original/pxr/imaging/hioOpenVDB/CMakeLists.txt USD-22.05/px ${OPENVDB_LIBRARY} INCLUDE_DIRS -diff -Naur USD-22.05-original/pxr/imaging/plugin/hioOiio/CMakeLists.txt USD-22.05/pxr/imaging/plugin/hioOiio/CMakeLists.txt ---- USD-22.05-original/pxr/imaging/plugin/hioOiio/CMakeLists.txt 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/pxr/imaging/plugin/hioOiio/CMakeLists.txt 2022-05-24 18:51:26.407485884 -0400 +diff -Naur USD-22.08-original/pxr/imaging/plugin/hioOiio/CMakeLists.txt USD-22.08/pxr/imaging/plugin/hioOiio/CMakeLists.txt +--- USD-22.08-original/pxr/imaging/plugin/hioOiio/CMakeLists.txt 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/pxr/imaging/plugin/hioOiio/CMakeLists.txt 2022-08-02 11:14:09.930580416 -0400 @@ -16,6 +16,7 @@ tf ${OIIO_LIBRARIES} @@ -163,9 +154,9 @@ diff -Naur USD-22.05-original/pxr/imaging/plugin/hioOiio/CMakeLists.txt USD-22.0 INCLUDE_DIRS ${OIIO_INCLUDE_DIRS} -diff -Naur USD-22.05-original/pxr/usd/plugin/usdAbc/CMakeLists.txt USD-22.05/pxr/usd/plugin/usdAbc/CMakeLists.txt ---- USD-22.05-original/pxr/usd/plugin/usdAbc/CMakeLists.txt 2022-04-22 14:48:13.000000000 -0400 -+++ USD-22.05/pxr/usd/plugin/usdAbc/CMakeLists.txt 2022-05-24 18:51:26.407485884 -0400 +diff -Naur USD-22.08-original/pxr/usd/plugin/usdAbc/CMakeLists.txt USD-22.08/pxr/usd/plugin/usdAbc/CMakeLists.txt +--- USD-22.08-original/pxr/usd/plugin/usdAbc/CMakeLists.txt 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/pxr/usd/plugin/usdAbc/CMakeLists.txt 2022-08-02 11:14:40.941964010 -0400 @@ -23,15 +23,12 @@ usd usdGeom diff --git a/USD-22.08-soversion.patch b/USD-22.08-soversion.patch new file mode 100644 index 0000000..004eb3e --- /dev/null +++ b/USD-22.08-soversion.patch @@ -0,0 +1,35 @@ +diff -Naur USD-22.08-original/cmake/defaults/Version.cmake USD-22.08/cmake/defaults/Version.cmake +--- USD-22.08-original/cmake/defaults/Version.cmake 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/cmake/defaults/Version.cmake 2022-08-02 11:16:45.716507405 -0400 +@@ -27,3 +27,9 @@ + set(PXR_PATCH_VERSION "8") + + math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") ++ ++set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" ++ CACHE ++ STRING ++ "Downstream shared object version" ++) +diff -Naur USD-22.08-original/cmake/macros/Private.cmake USD-22.08/cmake/macros/Private.cmake +--- USD-22.08-original/cmake/macros/Private.cmake 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/cmake/macros/Private.cmake 2022-08-02 11:28:32.783243353 -0400 +@@ -1304,6 +1304,7 @@ + PREFIX "${args_PREFIX}" + SUFFIX "${args_SUFFIX}" + PUBLIC_HEADER "${args_PUBLIC_HEADERS}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + + set(pythonEnabled "PXR_PYTHON_ENABLED=1") +diff -Naur USD-22.08-original/cmake/macros/Public.cmake USD-22.08/cmake/macros/Public.cmake +--- USD-22.08-original/cmake/macros/Public.cmake 2022-07-20 19:14:16.000000000 -0400 ++++ USD-22.08/cmake/macros/Public.cmake 2022-08-02 11:25:11.738761820 -0400 +@@ -1002,6 +1002,7 @@ + FOLDER "${folder}" + PREFIX "${libPrefix}" + IMPORT_PREFIX "${libPrefix}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + _get_install_dir("lib" libInstallPrefix) + install( diff --git a/sources b/sources index 630fba6..bb7a92e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (usd-22.05b.tar.gz) = 9a68ae60fe1826e3f100b3715bc41b622813caaa83dbde833d085fb2b18449bd5ec3241d74264ed8f6ea999e2652db5c8c572cd1399210f86a60483be6bc6aea +SHA512 (usd-22.08.tar.gz) = 8a45490cd2d308b9e43d5947ab7e1f40c573e5a7f0ba0ebb0f82c9f46ccc5fc530294b1f649ffb51e4f5537e5e5237048344617b740de7b6a0e61d98fde0eb15 diff --git a/usd.spec b/usd.spec index 86c67bd..85b42b0 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.22.5 +%global downstream_so_version 0.22.8 %bcond_without alembic %bcond_with documentation @@ -14,6 +14,8 @@ %bcond_without ocio %bcond_without oiio %bcond_without python3 +# Not yet packaged +%bcond_with pyside6 %bcond_without usdview # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the @@ -21,8 +23,8 @@ %bcond_with test Name: usd -Version: 22.05b -Release: %autorelease -b 9 +Version: 22.08 +Release: %autorelease Summary: 3D VFX pipeline interchange file format # The entire source is Apache-2.0 except: @@ -85,7 +87,8 @@ Source2: stb_image.patch # to be versioned as well, which is undesired. This is not a serious problem # because we do not want to package the built plugin anyway. (It should not be # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) -Patch: USD-22.05-soversion.patch +Patch: USD-22.08-soversion.patch + # Add missing #include for GCC13 # https://github.com/PixarAnimationStudios/USD/pull/2215 Patch: %{forgeurl}/pull/2215.patch @@ -98,11 +101,7 @@ Patch: %{forgeurl}/pull/2215.patch # https://github.com/PixarAnimationStudios/USD/pull/1829 # Support OpenVDB without depending on OpenEXR # https://github.com/PixarAnimationStudios/USD/pull/1728 -Patch: USD-22.05-OpenEXR3.patch - -# Allow building against recent glibc with no malloc hooks (>= 2.34) -# https://github.com/PixarAnimationStudios/USD/pull/1830 -Patch: %{forgeurl}/pull/1830.patch +Patch: USD-22.08-OpenEXR3.patch # Do not access PyFrameObject fields directly on Python 3.10+ # @@ -255,8 +254,12 @@ BuildRequires: pkgconfig(Qt5) BuildRequires: python3dist(jinja2) %if %{with usdview} BuildRequires: desktop-file-utils +%if %{with pyside6} +BuildRequires: python3dist(pyside6) +%else BuildRequires: python3dist(pyside2) %endif +%endif BuildRequires: python3dist(pyopengl) Requires: font(roboto) Requires: font(robotoblack) @@ -264,8 +267,12 @@ Requires: font(robotolight) Requires: font(robotomono) Requires: python3dist(jinja2) %if %{with usdview} +%if %{with pyside6} +Requires: python3dist(pyside6) +%else Requires: python3dist(pyside2) %endif +%endif Requires: python3dist(pyopengl) %py_provides python3-pxr @@ -476,14 +483,14 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %files libs %license LICENSE.txt %doc NOTICE.txt README.md -%{_libdir}/lib%{name}_%{name}_ms.so.%{downstream_so_version} +%{_libdir}/lib%{name}_ms.so.%{downstream_so_version} %{_libdir}/%{name} %exclude %{_libdir}/%{name}/%{name}/resources/codegenTemplates %files devel %doc BUILDING.md CHANGELOG.md VERSIONS.md %{_includedir}/pxr/ -%{_libdir}/lib%{name}_%{name}_ms.so +%{_libdir}/lib%{name}_ms.so %{_libdir}/%{name}/%{name}/resources/codegenTemplates/ %if %{with documentation} From 7be532d93286ef6bac6645c7cfbc5632c28db1b2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 14 Dec 2022 15:38:12 -0500 Subject: [PATCH 022/167] Update to 22.11 --- .gitignore | 1 + 1928.patch | 112 ------------------------ USD-22.08-OpenEXR3.patch | 177 -------------------------------------- USD-22.08-soversion.patch | 35 -------- USD-22.11-soversion.patch | 35 ++++++++ sources | 2 +- usd.spec | 60 ++++++------- 7 files changed, 62 insertions(+), 360 deletions(-) delete mode 100644 1928.patch delete mode 100644 USD-22.08-OpenEXR3.patch delete mode 100644 USD-22.08-soversion.patch create mode 100644 USD-22.11-soversion.patch diff --git a/.gitignore b/.gitignore index ca9ebdc..a0f1819 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /usd-22.05a.tar.gz /usd-22.05b.tar.gz /usd-22.08.tar.gz +/usd-22.11.tar.gz diff --git a/1928.patch b/1928.patch deleted file mode 100644 index 73d1ee7..0000000 --- a/1928.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 899e6456986d42629a1ca5f2a01d07bca261207b Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 27 Jun 2022 11:50:04 -0400 -Subject: [PATCH 1/2] Do not access PyFrameObject fields directly on Python - 3.10+ - -Fixes a Python 3.11 incompatibility. Still accesses PyCodeObject fields -directly. ---- - pxr/base/tf/pyTracing.cpp | 22 ++++++++++++++++++---- - 1 file changed, 18 insertions(+), 4 deletions(-) - -diff --git a/pxr/base/tf/pyTracing.cpp b/pxr/base/tf/pyTracing.cpp -index 62262d7d75..300c30a435 100644 ---- a/pxr/base/tf/pyTracing.cpp -+++ b/pxr/base/tf/pyTracing.cpp -@@ -35,8 +35,9 @@ - - #include - --// This is from python, needed for PyFrameObject. -+// These are from python, needed for PyFrameObject. - #include -+#include - - #include - #include -@@ -110,11 +111,24 @@ static int _TracePythonFn(PyObject *, PyFrameObject *frame, - { - // Build up a trace info struct. - TfPyTraceInfo info; -+#if PY_VERSION_HEX >= 0x030a00f0 -+ // PyFrame_GetCode introduced in 3.9, added to Stable ABI in 3.10; -+ // PyFrameObject is opaque in 3.11 -+ PyCodeObject * code = PyFrame_GetCode(frame); -+#else -+ // Use direct access to PyFrameObject fields. -+ PyCodeObject * code = frame->f_code; -+ // Create a strong reference as PyFrame_GetCode() would, so we do not have -+ // to conditionalize decrementing the reference count. -+ Py_INCREF((PyObject *)code); -+#endif - info.arg = arg; -- info.funcName = TfPyString_AsString(frame->f_code->co_name); -- info.fileName = TfPyString_AsString(frame->f_code->co_filename); -- info.funcLine = frame->f_code->co_firstlineno; -+ info.funcName = TfPyString_AsString(code->co_name); -+ info.fileName = TfPyString_AsString(code->co_filename); -+ info.funcLine = code->co_firstlineno; - info.what = what; -+ // PyFrame_GetCode returned a strong reference -+ Py_DECREF((PyObject *)code); - - _InvokeTraceFns(info); - - -From 71ec813641e4e763db5f674d78efe533997eac1a Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Wed, 29 Jun 2022 14:15:26 -0400 -Subject: [PATCH 2/2] Simplified patch with compatibility PyFrame_GetCode() - -Based on suggestions in https://docs.python.org/3.11/whatsnew/3.11.html#id6 ---- - pxr/base/tf/pyTracing.cpp | 24 ++++++++++++------------ - 1 file changed, 12 insertions(+), 12 deletions(-) - -diff --git a/pxr/base/tf/pyTracing.cpp b/pxr/base/tf/pyTracing.cpp -index 300c30a435..4b201744fa 100644 ---- a/pxr/base/tf/pyTracing.cpp -+++ b/pxr/base/tf/pyTracing.cpp -@@ -106,29 +106,29 @@ static void _SetTraceFnEnabled(bool enable) { - } - - -+#if PY_VERSION_HEX < 0x030900B1 -+// Define PyFrame_GetCode() on Python 3.8 and older: -+// https://docs.python.org/3.11/whatsnew/3.11.html#id6 -+static inline PyCodeObject* PyFrame_GetCode(PyFrameObject *frame) -+{ -+ Py_INCREF(frame->f_code); -+ return frame->f_code; -+} -+#endif -+ -+ - static int _TracePythonFn(PyObject *, PyFrameObject *frame, - int what, PyObject *arg) - { - // Build up a trace info struct. - TfPyTraceInfo info; --#if PY_VERSION_HEX >= 0x030a00f0 -- // PyFrame_GetCode introduced in 3.9, added to Stable ABI in 3.10; -- // PyFrameObject is opaque in 3.11 - PyCodeObject * code = PyFrame_GetCode(frame); --#else -- // Use direct access to PyFrameObject fields. -- PyCodeObject * code = frame->f_code; -- // Create a strong reference as PyFrame_GetCode() would, so we do not have -- // to conditionalize decrementing the reference count. -- Py_INCREF((PyObject *)code); --#endif - info.arg = arg; - info.funcName = TfPyString_AsString(code->co_name); - info.fileName = TfPyString_AsString(code->co_filename); - info.funcLine = code->co_firstlineno; - info.what = what; -- // PyFrame_GetCode returned a strong reference -- Py_DECREF((PyObject *)code); -+ Py_DECREF(code); - - _InvokeTraceFns(info); - diff --git a/USD-22.08-OpenEXR3.patch b/USD-22.08-OpenEXR3.patch deleted file mode 100644 index 6ef72ce..0000000 --- a/USD-22.08-OpenEXR3.patch +++ /dev/null @@ -1,177 +0,0 @@ -diff -Naur USD-22.08-original/cmake/defaults/Packages.cmake USD-22.08/cmake/defaults/Packages.cmake ---- USD-22.08-original/cmake/defaults/Packages.cmake 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/cmake/defaults/Packages.cmake 2022-08-02 11:13:07.413807117 -0400 -@@ -188,6 +188,7 @@ - # --OpenImageIO - if (PXR_BUILD_OPENIMAGEIO_PLUGIN) - find_package(OpenEXR REQUIRED) -+ find_package(Imath REQUIRED) - find_package(OpenImageIO REQUIRED) - add_definitions(-DPXR_OIIO_PLUGIN_ENABLED) - if (OIIO_idiff_BINARY) -@@ -256,7 +257,7 @@ - endif() - # --OpenVDB - if (PXR_ENABLE_OPENVDB_SUPPORT) -- find_package(OpenEXR REQUIRED) -+ find_package(Imath REQUIRED) - find_package(OpenVDB REQUIRED) - add_definitions(-DPXR_OPENVDB_SUPPORT_ENABLED) - endif() -@@ -307,6 +308,7 @@ - if(PXR_ENABLE_OSL_SUPPORT) - find_package(OSL REQUIRED) - find_package(OpenEXR REQUIRED) -+ find_package(Imath REQUIRED) - add_definitions(-DPXR_OSL_SUPPORT_ENABLED) - endif() - -diff -Naur USD-22.08-original/cmake/modules/FindOpenEXR.cmake USD-22.08/cmake/modules/FindOpenEXR.cmake ---- USD-22.08-original/cmake/modules/FindOpenEXR.cmake 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/cmake/modules/FindOpenEXR.cmake 1969-12-31 19:00:00.000000000 -0500 -@@ -1,101 +0,0 @@ --# --# Copyright 2016 Pixar --# --# Licensed under the Apache License, Version 2.0 (the "Apache License") --# with the following modification; you may not use this file except in --# compliance with the Apache License and the following modification to it: --# Section 6. Trademarks. is deleted and replaced with: --# --# 6. Trademarks. This License does not grant permission to use the trade --# names, trademarks, service marks, or product names of the Licensor --# and its affiliates, except as required to comply with Section 4(c) of --# the License and to reproduce the content of the NOTICE file. --# --# You may obtain a copy of the Apache License at --# --# http://www.apache.org/licenses/LICENSE-2.0 --# --# Unless required by applicable law or agreed to in writing, software --# distributed under the Apache License with the above modification is --# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY --# KIND, either express or implied. See the Apache License for the specific --# language governing permissions and limitations under the Apache License. --# -- --find_path(OPENEXR_INCLUDE_DIR -- OpenEXR/half.h --HINTS -- "${OPENEXR_LOCATION}" -- "$ENV{OPENEXR_LOCATION}" --PATH_SUFFIXES -- include/ --DOC -- "OpenEXR headers path" --) -- --if(OPENEXR_INCLUDE_DIR) -- set(openexr_config_file "${OPENEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h") -- if(EXISTS ${openexr_config_file}) -- file(STRINGS -- ${openexr_config_file} -- TMP -- REGEX "#define OPENEXR_VERSION_STRING.*$") -- string(REGEX MATCHALL "[0-9.]+" OPENEXR_VERSION ${TMP}) -- -- file(STRINGS -- ${openexr_config_file} -- TMP -- REGEX "#define OPENEXR_VERSION_MAJOR.*$") -- string(REGEX MATCHALL "[0-9]" OPENEXR_MAJOR_VERSION ${TMP}) -- -- file(STRINGS -- ${openexr_config_file} -- TMP -- REGEX "#define OPENEXR_VERSION_MINOR.*$") -- string(REGEX MATCHALL "[0-9]" OPENEXR_MINOR_VERSION ${TMP}) -- endif() --endif() -- --foreach(OPENEXR_LIB -- Half -- Iex -- Imath -- IlmImf -- IlmThread -- IlmImfUtil -- IexMath -- ) -- -- # OpenEXR libraries may be suffixed with the version number, so we search -- # using both versioned and unversioned names. -- find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY -- NAMES -- ${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION} -- ${OPENEXR_LIB} -- HINTS -- "${OPENEXR_LOCATION}" -- "$ENV{OPENEXR_LOCATION}" -- PATH_SUFFIXES -- lib/ -- DOC -- "OPENEXR's ${OPENEXR_LIB} library path" -- ) -- -- if(OPENEXR_${OPENEXR_LIB}_LIBRARY) -- list(APPEND OPENEXR_LIBRARIES ${OPENEXR_${OPENEXR_LIB}_LIBRARY}) -- endif() --endforeach(OPENEXR_LIB) -- --# So #include works --list(APPEND OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR}) --list(APPEND OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR}/OpenEXR) -- --include(FindPackageHandleStandardArgs) --find_package_handle_standard_args(OpenEXR -- REQUIRED_VARS -- OPENEXR_INCLUDE_DIRS -- OPENEXR_LIBRARIES -- VERSION_VAR -- OPENEXR_VERSION --) -- -diff -Naur USD-22.08-original/pxr/imaging/hioOpenVDB/CMakeLists.txt USD-22.08/pxr/imaging/hioOpenVDB/CMakeLists.txt ---- USD-22.08-original/pxr/imaging/hioOpenVDB/CMakeLists.txt 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/pxr/imaging/hioOpenVDB/CMakeLists.txt 2022-08-02 11:13:40.602217640 -0400 -@@ -20,7 +20,7 @@ - hio - tf - usd -- ${OPENEXR_Half_LIBRARY} -+ ${IMATH_LIBRARIES} - ${OPENVDB_LIBRARY} - - INCLUDE_DIRS -diff -Naur USD-22.08-original/pxr/imaging/plugin/hioOiio/CMakeLists.txt USD-22.08/pxr/imaging/plugin/hioOiio/CMakeLists.txt ---- USD-22.08-original/pxr/imaging/plugin/hioOiio/CMakeLists.txt 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/pxr/imaging/plugin/hioOiio/CMakeLists.txt 2022-08-02 11:14:09.930580416 -0400 -@@ -16,6 +16,7 @@ - tf - ${OIIO_LIBRARIES} - ${OPENEXR_LIBRARIES} -+ ${IMATH_LIBRARIES} - - INCLUDE_DIRS - ${OIIO_INCLUDE_DIRS} -diff -Naur USD-22.08-original/pxr/usd/plugin/usdAbc/CMakeLists.txt USD-22.08/pxr/usd/plugin/usdAbc/CMakeLists.txt ---- USD-22.08-original/pxr/usd/plugin/usdAbc/CMakeLists.txt 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/pxr/usd/plugin/usdAbc/CMakeLists.txt 2022-08-02 11:14:40.941964010 -0400 -@@ -23,15 +23,12 @@ - usd - usdGeom - ${ALEMBIC_LIBRARIES} -- ${OPENEXR_Half_LIBRARY} -- ${OPENEXR_Imath_LIBRARY} -- ${OPENEXR_Iex_LIBRARY} -- ${OPENEXR_IexMath_LIBRARY} -+ ${IMATH_LIBRARIES} - ${optionalLibs} - - INCLUDE_DIRS - ${ALEMBIC_INCLUDE_DIR} -- ${OPENEXR_INCLUDE_DIRS} -+ ${IMATH_INCLUDE_DIRS} - ${optionalIncludeDirs} - - PRIVATE_CLASSES diff --git a/USD-22.08-soversion.patch b/USD-22.08-soversion.patch deleted file mode 100644 index 004eb3e..0000000 --- a/USD-22.08-soversion.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -Naur USD-22.08-original/cmake/defaults/Version.cmake USD-22.08/cmake/defaults/Version.cmake ---- USD-22.08-original/cmake/defaults/Version.cmake 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/cmake/defaults/Version.cmake 2022-08-02 11:16:45.716507405 -0400 -@@ -27,3 +27,9 @@ - set(PXR_PATCH_VERSION "8") - - math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") -+ -+set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" -+ CACHE -+ STRING -+ "Downstream shared object version" -+) -diff -Naur USD-22.08-original/cmake/macros/Private.cmake USD-22.08/cmake/macros/Private.cmake ---- USD-22.08-original/cmake/macros/Private.cmake 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/cmake/macros/Private.cmake 2022-08-02 11:28:32.783243353 -0400 -@@ -1304,6 +1304,7 @@ - PREFIX "${args_PREFIX}" - SUFFIX "${args_SUFFIX}" - PUBLIC_HEADER "${args_PUBLIC_HEADERS}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - - set(pythonEnabled "PXR_PYTHON_ENABLED=1") -diff -Naur USD-22.08-original/cmake/macros/Public.cmake USD-22.08/cmake/macros/Public.cmake ---- USD-22.08-original/cmake/macros/Public.cmake 2022-07-20 19:14:16.000000000 -0400 -+++ USD-22.08/cmake/macros/Public.cmake 2022-08-02 11:25:11.738761820 -0400 -@@ -1002,6 +1002,7 @@ - FOLDER "${folder}" - PREFIX "${libPrefix}" - IMPORT_PREFIX "${libPrefix}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - _get_install_dir("lib" libInstallPrefix) - install( diff --git a/USD-22.11-soversion.patch b/USD-22.11-soversion.patch new file mode 100644 index 0000000..9164a30 --- /dev/null +++ b/USD-22.11-soversion.patch @@ -0,0 +1,35 @@ +diff -Naur USD-22.11-original/cmake/defaults/Version.cmake USD-22.11/cmake/defaults/Version.cmake +--- USD-22.11-original/cmake/defaults/Version.cmake 2022-10-21 13:48:04.000000000 -0400 ++++ USD-22.11/cmake/defaults/Version.cmake 2022-12-14 15:40:25.889730217 -0500 +@@ -27,3 +27,9 @@ + set(PXR_PATCH_VERSION "11") + + math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") ++ ++set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" ++ CACHE ++ STRING ++ "Downstream shared object version" ++) +diff -Naur USD-22.11-original/cmake/macros/Private.cmake USD-22.11/cmake/macros/Private.cmake +--- USD-22.11-original/cmake/macros/Private.cmake 2022-10-21 13:48:04.000000000 -0400 ++++ USD-22.11/cmake/macros/Private.cmake 2022-12-14 15:41:14.623335507 -0500 +@@ -1299,6 +1299,7 @@ + IMPORT_PREFIX "${args_PREFIX}" + PREFIX "${args_PREFIX}" + SUFFIX "${args_SUFFIX}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + + set(pythonEnabled "PXR_PYTHON_ENABLED=1") +diff -Naur USD-22.11-original/cmake/macros/Public.cmake USD-22.11/cmake/macros/Public.cmake +--- USD-22.11-original/cmake/macros/Public.cmake 2022-10-21 13:48:04.000000000 -0400 ++++ USD-22.11/cmake/macros/Public.cmake 2022-12-14 15:41:42.026675866 -0500 +@@ -1002,6 +1002,7 @@ + FOLDER "${folder}" + PREFIX "${libPrefix}" + IMPORT_PREFIX "${libPrefix}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + _get_install_dir("lib" libInstallPrefix) + install( diff --git a/sources b/sources index bb7a92e..ab685e7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (usd-22.08.tar.gz) = 8a45490cd2d308b9e43d5947ab7e1f40c573e5a7f0ba0ebb0f82c9f46ccc5fc530294b1f649ffb51e4f5537e5e5237048344617b740de7b6a0e61d98fde0eb15 +SHA512 (usd-22.11.tar.gz) = 5116bbea7b7965e08abacb6db0024ef41d128cd61019d92cbf771b377f446e55eaaf8031cd9b9cfe0495011192318bcca4a89857869d3c0041bc95eab7329f4a diff --git a/usd.spec b/usd.spec index 85b42b0..845a722 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.22.8 +%global downstream_so_version 0.22.11 %bcond_without alembic %bcond_with documentation @@ -13,6 +13,7 @@ %bcond_with openvdb %bcond_without ocio %bcond_without oiio +%bcond_without ptex %bcond_without python3 # Not yet packaged %bcond_with pyside6 @@ -23,7 +24,7 @@ %bcond_with test Name: usd -Version: 22.08 +Version: 22.11 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -87,28 +88,7 @@ Source2: stb_image.patch # to be versioned as well, which is undesired. This is not a serious problem # because we do not want to package the built plugin anyway. (It should not be # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) -Patch: USD-22.08-soversion.patch - -# Add missing #include for GCC13 -# https://github.com/PixarAnimationStudios/USD/pull/2215 -Patch: %{forgeurl}/pull/2215.patch - -# Support OpenEXR 3 -# https://github.com/PixarAnimationStudios/USD/issues/1591 -# -# See also: -# Support compiling against imath -# https://github.com/PixarAnimationStudios/USD/pull/1829 -# Support OpenVDB without depending on OpenEXR -# https://github.com/PixarAnimationStudios/USD/pull/1728 -Patch: USD-22.08-OpenEXR3.patch - -# Do not access PyFrameObject fields directly on Python 3.10+ -# -# Fixes a Python 3.11 incompatibility. Still accesses PyCodeObject fields -# directly. -# https://github.com/PixarAnimationStudios/USD/pull/1928 -Patch: %{forgeurl}/pull/1928.patch +Patch: USD-22.11-soversion.patch # Port to Embree 4.x # https://github.com/PixarAnimationStudios/USD/pull/2266 @@ -120,6 +100,10 @@ Patch: %{forgeurl}/pull/2266.patch # Needed for boost 1.81 Patch: USD-pr2176-pxr_vt_hash-use-tfhash.patch +# Add missing #include for GCC13 +# https://github.com/PixarAnimationStudios/USD/pull/2215 +Patch: %{forgeurl}/pull/2215.patch + # Add missing header for g++13 # https://github.com/PixarAnimationStudios/USD/commit/c1c1c1de039451afaba9a0e04b50f4607df67886 Patch: USD-c1c1c1de-g++13-header-include.patch @@ -165,7 +149,9 @@ BuildRequires: pkgconfig(OpenImageIO) %endif BuildRequires: cmake(OpenEXR) BuildRequires: cmake(Imath) >= 2.0 +%if %{with ptex} BuildRequires: pkgconfig(Ptex) +%endif %endif %if %{with alembic} @@ -397,12 +383,14 @@ flags="${flags} $(pkgconf --cflags Imath)" %if %{with oiio} -DPXR_BUILD_OPENIMAGEIO_PLUGIN=ON \ %endif +%if %{with ptex} + -DPXR_ENABLE_PTEX_SUPPORT=ON \ +%endif %if %{with openshading} -DPXR_ENABLE_OSL_SUPPORT=ON \ %endif -DPYTHON_EXECUTABLE=%{python3} \ %if %{with python3} - -DPXR_USE_PYTHON_3=ON \ -DPYSIDE_AVAILABLE=ON \ -DPYSIDEUICBINARY:PATH=${PWD}/uic-wrapper \ %else @@ -438,13 +426,11 @@ mv %{buildroot}%{_prefix}/lib/python/pxr/Usdviewq/* \ %{buildroot}%{python3_sitearch}/pxr/Usdviewq/ %endif -# Currently, the pxrConfig.cmake that is installed is not correct for -# monolithic builds (and we must do a monolithic build in order to be usable as -# a dependency for Blender). It relies on the libraries that would be in -# pxrTargets.cmake, which is not generated for monolithic builds. -# https://bugzilla.redhat.com/show_bug.cgi?id=2055414 -# https://github.com/PixarAnimationStudios/USD/issues/1088 -rm -vrf '%{buildroot}%{_libdir}/cmake' +# TODO: Can we figure out how to fix the installation path for +# pxrTargets{,-release}.cmake, instead of moving them after the fact? We choose +# to put them in the same directory as pxrConfig.cmake. +find %{buildroot}%{_prefix}/cmake -mindepth 1 -maxdepth 1 -type f \ + -exec mv -v '{}' '%{buildroot}%{_libdir}/cmake/pxr' ';' %check %if %{with usdview} @@ -462,6 +448,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usddiff %{_bindir}/usddumpcrate %{_bindir}/usdedit +%{_bindir}/usdfixbrokenpixarschemas %{_bindir}/usdgenschemafromsdr %{_bindir}/usdrecord %{_bindir}/usdresolve @@ -472,7 +459,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %if %{with python3} %files -n python3-%{name} -%{python3_sitearch}/pxr +%{python3_sitearch}/pxr/ %if %{with usdview} %{_datadir}/applications/org.open%{name}.%{name}view.desktop %{_bindir}/testusdview @@ -484,7 +471,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %license LICENSE.txt %doc NOTICE.txt README.md %{_libdir}/lib%{name}_ms.so.%{downstream_so_version} -%{_libdir}/%{name} +%{_libdir}/%{name}/ %exclude %{_libdir}/%{name}/%{name}/resources/codegenTemplates %files devel @@ -492,11 +479,14 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_includedir}/pxr/ %{_libdir}/lib%{name}_ms.so %{_libdir}/%{name}/%{name}/resources/codegenTemplates/ +%{_libdir}/cmake/pxr/pxrConfig.cmake +%{_libdir}/cmake/pxr/pxrTargets.cmake +%{_libdir}/cmake/pxr/pxrTargets-release.cmake %if %{with documentation} %files doc %license LICENSE.txt -%{_docdir}/%{name} +%{_docdir}/%{name}/ %endif %changelog From 5198aefc5b280297002f3f90038b377027b93f2e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 20 Mar 2023 09:53:30 -0400 Subject: [PATCH 023/167] Update to 23.02 (close RHBZ#2110024) --- .gitignore | 1 + USD-22.11-soversion.patch | 35 ----------------- USD-23.02-soversion.patch | 52 +++++++++++++++++++++++++ USD-c1c1c1de-g++13-header-include.patch | 36 ----------------- sources | 2 +- usd.spec | 15 ++++--- 6 files changed, 61 insertions(+), 80 deletions(-) delete mode 100644 USD-22.11-soversion.patch create mode 100644 USD-23.02-soversion.patch delete mode 100644 USD-c1c1c1de-g++13-header-include.patch diff --git a/.gitignore b/.gitignore index a0f1819..acc72ba 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /usd-22.05b.tar.gz /usd-22.08.tar.gz /usd-22.11.tar.gz +/usd-23.02.tar.gz diff --git a/USD-22.11-soversion.patch b/USD-22.11-soversion.patch deleted file mode 100644 index 9164a30..0000000 --- a/USD-22.11-soversion.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -Naur USD-22.11-original/cmake/defaults/Version.cmake USD-22.11/cmake/defaults/Version.cmake ---- USD-22.11-original/cmake/defaults/Version.cmake 2022-10-21 13:48:04.000000000 -0400 -+++ USD-22.11/cmake/defaults/Version.cmake 2022-12-14 15:40:25.889730217 -0500 -@@ -27,3 +27,9 @@ - set(PXR_PATCH_VERSION "11") - - math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") -+ -+set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" -+ CACHE -+ STRING -+ "Downstream shared object version" -+) -diff -Naur USD-22.11-original/cmake/macros/Private.cmake USD-22.11/cmake/macros/Private.cmake ---- USD-22.11-original/cmake/macros/Private.cmake 2022-10-21 13:48:04.000000000 -0400 -+++ USD-22.11/cmake/macros/Private.cmake 2022-12-14 15:41:14.623335507 -0500 -@@ -1299,6 +1299,7 @@ - IMPORT_PREFIX "${args_PREFIX}" - PREFIX "${args_PREFIX}" - SUFFIX "${args_SUFFIX}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - - set(pythonEnabled "PXR_PYTHON_ENABLED=1") -diff -Naur USD-22.11-original/cmake/macros/Public.cmake USD-22.11/cmake/macros/Public.cmake ---- USD-22.11-original/cmake/macros/Public.cmake 2022-10-21 13:48:04.000000000 -0400 -+++ USD-22.11/cmake/macros/Public.cmake 2022-12-14 15:41:42.026675866 -0500 -@@ -1002,6 +1002,7 @@ - FOLDER "${folder}" - PREFIX "${libPrefix}" - IMPORT_PREFIX "${libPrefix}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - _get_install_dir("lib" libInstallPrefix) - install( diff --git a/USD-23.02-soversion.patch b/USD-23.02-soversion.patch new file mode 100644 index 0000000..2a0ca84 --- /dev/null +++ b/USD-23.02-soversion.patch @@ -0,0 +1,52 @@ +From a5c6a2e45bb21c72c5447a64507425a483ac63b0 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Mon, 20 Mar 2023 09:59:18 -0400 +Subject: [PATCH] Support downstream .so versioning + +--- + cmake/defaults/Version.cmake | 6 ++++++ + cmake/macros/Private.cmake | 1 + + cmake/macros/Public.cmake | 1 + + 3 files changed, 8 insertions(+) + +diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake +index 872881b4b..58806c9be 100644 +--- a/cmake/defaults/Version.cmake ++++ b/cmake/defaults/Version.cmake +@@ -27,3 +27,9 @@ set(PXR_MINOR_VERSION "23") + set(PXR_PATCH_VERSION "02") + + math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") ++ ++set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" ++ CACHE ++ STRING ++ "Downstream shared object version" ++) +diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake +index 585db955e..f6def8087 100644 +--- a/cmake/macros/Private.cmake ++++ b/cmake/macros/Private.cmake +@@ -1299,6 +1299,7 @@ function(_pxr_library NAME) + IMPORT_PREFIX "${args_PREFIX}" + PREFIX "${args_PREFIX}" + SUFFIX "${args_SUFFIX}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + + target_compile_definitions(${NAME} +diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake +index c201093ef..c86d16d9d 100644 +--- a/cmake/macros/Public.cmake ++++ b/cmake/macros/Public.cmake +@@ -1003,6 +1003,7 @@ function(pxr_toplevel_prologue) + FOLDER "${folder}" + PREFIX "${libPrefix}" + IMPORT_PREFIX "${libPrefix}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + _get_install_dir("lib" libInstallPrefix) + install( +-- +2.39.2 + diff --git a/USD-c1c1c1de-g++13-header-include.patch b/USD-c1c1c1de-g++13-header-include.patch deleted file mode 100644 index 5a18d9a..0000000 --- a/USD-c1c1c1de-g++13-header-include.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c1c1c1de039451afaba9a0e04b50f4607df67886 Mon Sep 17 00:00:00 2001 -From: sunyab -Date: Mon, 23 Jan 2023 13:18:04 -0800 -Subject: [PATCH] Add missing headers that caused build failures when building - with boost 1.78. - -(Internal change: 2260370) ---- - pxr/base/gf/plane.h | 1 + - pxr/base/tf/stringUtils.cpp | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/pxr/base/gf/plane.h b/pxr/base/gf/plane.h -index 61c731085a..f4df8796e4 100644 ---- a/pxr/base/gf/plane.h -+++ b/pxr/base/gf/plane.h -@@ -32,6 +32,7 @@ - #include "pxr/base/gf/api.h" - - #include -+#include - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/base/tf/stringUtils.cpp b/pxr/base/tf/stringUtils.cpp -index 19f20f4fc3..02482983ac 100644 ---- a/pxr/base/tf/stringUtils.cpp -+++ b/pxr/base/tf/stringUtils.cpp -@@ -37,6 +37,7 @@ - #include - #include - -+#include - #include - #include - #include diff --git a/sources b/sources index ab685e7..40b48cf 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (usd-22.11.tar.gz) = 5116bbea7b7965e08abacb6db0024ef41d128cd61019d92cbf771b377f446e55eaaf8031cd9b9cfe0495011192318bcca4a89857869d3c0041bc95eab7329f4a +SHA512 (usd-23.02.tar.gz) = 2529aec788cab3ff4c47041f5bc0043fde81dcef8ca313f6390f2e5fb7a10b1b0b1dd47fd6c86e3b4cfc0a1b27bff4d9b94b96bfba6bec3d5ff8f6e2fccb9e11 diff --git a/usd.spec b/usd.spec index 845a722..da9c668 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.22.11 +%global downstream_so_version 0.23.02 %bcond_without alembic %bcond_with documentation @@ -24,7 +24,7 @@ %bcond_with test Name: usd -Version: 22.11 +Version: 23.02 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -34,6 +34,7 @@ Summary: 3D VFX pipeline interchange file format # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ # - pxr/base/tf/pxrDoubleConversion/ +# - pxr/base/tf/pxrCLI11/ # BSD-2-Clause: # - pxr/base/tf/pxrLZ4/ # MIT: @@ -88,7 +89,7 @@ Source2: stb_image.patch # to be versioned as well, which is undesired. This is not a serious problem # because we do not want to package the built plugin anyway. (It should not be # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) -Patch: USD-22.11-soversion.patch +Patch: USD-23.02-soversion.patch # Port to Embree 4.x # https://github.com/PixarAnimationStudios/USD/pull/2266 @@ -104,13 +105,8 @@ Patch: USD-pr2176-pxr_vt_hash-use-tfhash.patch # https://github.com/PixarAnimationStudios/USD/pull/2215 Patch: %{forgeurl}/pull/2215.patch -# Add missing header for g++13 -# https://github.com/PixarAnimationStudios/USD/commit/c1c1c1de039451afaba9a0e04b50f4607df67886 -Patch: USD-c1c1c1de-g++13-header-include.patch - # Base BuildRequires: boost-devel -BuildRequires: boost-program-options BuildRequires: cmake BuildRequires: dos2unix BuildRequires: gcc-c++ @@ -200,6 +196,8 @@ Provides: bundled(double-conversion) = 2.0.0 Provides: bundled(ilmbase) = 2.5.3 # Version from: pxr/base/tf/pxrLZ4/lz4.h (LZ4_VERSION_{MAJOR,MINOR_PATCH}) Provides: bundled(lz4) = 1.9.2 +# Version from: pxr/base/tf/pxrCLI11/README.md +Provides: bundled(cli11) = 2.3.1 # Version from: # third_party/renderman-24/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # (header comment) @@ -383,6 +381,7 @@ flags="${flags} $(pkgconf --cflags Imath)" %if %{with oiio} -DPXR_BUILD_OPENIMAGEIO_PLUGIN=ON \ %endif + -DPXR_ENABLE_HDF5_SUPPORT=ON \ %if %{with ptex} -DPXR_ENABLE_PTEX_SUPPORT=ON \ %endif From b66e0f7b690e52abb237a6bee36866064a6abebf Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 20 Mar 2023 10:32:11 -0400 Subject: [PATCH 024/167] Drop manual dependency on cmake-filesystem, now automatic --- usd.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/usd.spec b/usd.spec index da9c668..249c5b7 100644 --- a/usd.spec +++ b/usd.spec @@ -220,7 +220,6 @@ interchange between graphics applications. %package devel Summary: Development files for USD -Requires: cmake-filesystem Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel From fdf058b2e7f636e5b9cae0e741cff26e002eb108 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 20 Mar 2023 10:32:29 -0400 Subject: [PATCH 025/167] Re-enable OpenShadingLanguage and OpenVDB support --- usd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 249c5b7..1be1580 100644 --- a/usd.spec +++ b/usd.spec @@ -9,8 +9,8 @@ %bcond_without embree %bcond_without imaging %bcond_with jemalloc -%bcond_with openshading -%bcond_with openvdb +%bcond_without openshading +%bcond_without openvdb %bcond_without ocio %bcond_without oiio %bcond_without ptex From 06228d97d4d567871f3ea276598a788b5ea19df0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 17 Apr 2023 10:11:01 -0400 Subject: [PATCH 026/167] Build with the draco plugin --- usd.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 1be1580..9fcf4b0 100644 --- a/usd.spec +++ b/usd.spec @@ -6,6 +6,7 @@ %bcond_without alembic %bcond_with documentation +%bcond_without draco %bcond_without embree %bcond_without imaging %bcond_with jemalloc @@ -122,6 +123,9 @@ BuildRequires: graphviz # For imaging and usd imaging %if %{with imaging} +%if %{with draco} +BuildRequires: draco-devel +%endif %if %{with embree} BuildRequires: embree-devel %endif @@ -227,7 +231,7 @@ This package contains the C++ header files and symbolic links to the shared libraries for %{name}. If you would like to develop programs using %{name}, you will need to install %{name}-devel. -# For usdview +# For usdview, usdcompress %if %{with python3} %package -n python3-%{name} Summary: %{summary} @@ -370,6 +374,9 @@ flags="${flags} $(pkgconf --cflags Imath)" -DOPENEXR_LOCATION=%{_includedir} \ -DPXR_BUILD_ALEMBIC_PLUGIN=ON \ %endif +%if %{with draco} + -DPXR_BUILD_DRACO_PLUGIN=ON \ +%endif %if %{with embree} -DPXR_BUILD_EMBREE_PLUGIN=ON \ -DEMBREE_LOCATION=%{_prefix} \ @@ -458,6 +465,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %if %{with python3} %files -n python3-%{name} %{python3_sitearch}/pxr/ +%if %{with draco} +%{_bindir}/usdcompress +%endif %if %{with usdview} %{_datadir}/applications/org.open%{name}.%{name}view.desktop %{_bindir}/testusdview From 8654f1f33e769dae7506613f1878f4a4ac76cfa5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 17 Apr 2023 10:51:14 -0400 Subject: [PATCH 027/167] Stop conditionalizing Python --- usd.spec | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/usd.spec b/usd.spec index 9fcf4b0..ad34131 100644 --- a/usd.spec +++ b/usd.spec @@ -15,7 +15,6 @@ %bcond_without ocio %bcond_without oiio %bcond_without ptex -%bcond_without python3 # Not yet packaged %bcond_with pyside6 %bcond_without usdview @@ -172,9 +171,7 @@ BuildRequires: stb_image_resize-devel >= 0.97 BuildRequires: stb_image_resize-static Requires: %{name}-libs%{?_isa} = %{version}-%{release} -%if %{with python3} Requires: python3-%{name}%{?_isa} = %{version}-%{release} -%endif # This package is only available for x86_64 and aarch64 # Will fail to build on other architectures @@ -232,7 +229,6 @@ libraries for %{name}. If you would like to develop programs using %{name}, you will need to install %{name}-devel. # For usdview, usdcompress -%if %{with python3} %package -n python3-%{name} Summary: %{summary} @@ -265,7 +261,7 @@ Requires: python3dist(pyopengl) %description -n python3-%{name} Python language bindings for the Universal Scene Description (USD) C++ API -%endif + %if %{with documentation} %package doc @@ -282,10 +278,8 @@ Documentation for the Universal Scene Description (USD) C++ API # Convert NOTICE.txt from CRNL line encoding dos2unix NOTICE.txt -%if %{with python3} # Fix all Python shebangs recursively in . %py3_shebang_fix . -%endif # Further drop shebangs line for some py files sed -r -i '1{/^#!/d}' \ @@ -339,9 +333,6 @@ exec uic-qt5 -g python "$@" EOF chmod +x uic-wrapper -# Fix python3 support -# https://github.com/PixarAnimationStudios/USD/issues/1419 - flags="%{optflags} -Wl,--as-needed -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" \ # Patch2 was not good enough to get the include path for Imath everywhere it # was needed. Add it globally. @@ -395,12 +386,8 @@ flags="${flags} $(pkgconf --cflags Imath)" -DPXR_ENABLE_OSL_SUPPORT=ON \ %endif -DPYTHON_EXECUTABLE=%{python3} \ -%if %{with python3} -DPYSIDE_AVAILABLE=ON \ -DPYSIDEUICBINARY:PATH=${PWD}/uic-wrapper \ -%else - -DPXR_ENABLE_PYTHON_SUPPORT=OFF \ -%endif -DPXR_BUILD_MONOLITHIC=ON \ -DPXR_ENABLE_MALLOCHOOK_SUPPORT=OFF %cmake_build @@ -462,7 +449,6 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdtree %{_bindir}/usdzip -%if %{with python3} %files -n python3-%{name} %{python3_sitearch}/pxr/ %if %{with draco} @@ -473,7 +459,6 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/testusdview %{_bindir}/usdview %endif -%endif %files libs %license LICENSE.txt From c8f652afadb7cb8ac70e8d932e82d99f9f5d9aad Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 17 Apr 2023 10:54:20 -0400 Subject: [PATCH 028/167] Put all the tools and apps in the base package They were not correctly sorted between Python and non-Python anyway. --- usd.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usd.spec b/usd.spec index ad34131..6b73129 100644 --- a/usd.spec +++ b/usd.spec @@ -437,6 +437,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdGenSchema %{_bindir}/usdcat %{_bindir}/usdchecker +%if %{with draco} +%{_bindir}/usdcompress +%endif %{_bindir}/usddiff %{_bindir}/usddumpcrate %{_bindir}/usdedit @@ -448,18 +451,15 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdstitchclips %{_bindir}/usdtree %{_bindir}/usdzip - -%files -n python3-%{name} -%{python3_sitearch}/pxr/ -%if %{with draco} -%{_bindir}/usdcompress -%endif %if %{with usdview} %{_datadir}/applications/org.open%{name}.%{name}view.desktop %{_bindir}/testusdview %{_bindir}/usdview %endif +%files -n python3-%{name} +%{python3_sitearch}/pxr/ + %files libs %license LICENSE.txt %doc NOTICE.txt README.md From 8d86f169a0414b65845399e80b9c6e26d165c95e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 17 Apr 2023 10:55:34 -0400 Subject: [PATCH 029/167] Reduce macro indirection in the spec file --- usd.spec | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/usd.spec b/usd.spec index 6b73129..8358285 100644 --- a/usd.spec +++ b/usd.spec @@ -54,9 +54,9 @@ Summary: 3D VFX pipeline interchange file format # do not contribute their license terms to the built RPMs.) License: Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) URL: http://www.openusd.org/ -%global forgeurl https://github.com/PixarAnimationStudios/%{name} -Source0: %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz -Source1: org.open%{name}.%{name}view.desktop +%global forgeurl https://github.com/PixarAnimationStudios/usd +Source0: %{forgeurl}/archive/v%{version}/usd-%{version}.tar.gz +Source1: org.openusd.usdview.desktop # Latest stb_image.patch that applies cleanly against 2.27: # %%{forgeurl}/raw/8f9bb9563980b41e7695148b63bf09f7abd38a41/pxr/imaging/hio/stb/stb_image.patch # We treat this as a source file because it is applied separately during @@ -170,8 +170,8 @@ BuildRequires: stb_image_write-static BuildRequires: stb_image_resize-devel >= 0.97 BuildRequires: stb_image_resize-static -Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Requires: python3-%{name}%{?_isa} = %{version}-%{release} +Requires: usd-libs%{?_isa} = %{version}-%{release} +Requires: python3-usd%{?_isa} = %{version}-%{release} # This package is only available for x86_64 and aarch64 # Will fail to build on other architectures @@ -221,15 +221,15 @@ interchange between graphics applications. %package devel Summary: Development files for USD -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: usd-libs%{?_isa} = %{version}-%{release} %description devel This package contains the C++ header files and symbolic links to the shared -libraries for %{name}. If you would like to develop programs using %{name}, -you will need to install %{name}-devel. +libraries for usd. If you would like to develop programs using usd, +you will need to install usd-devel. # For usdview, usdcompress -%package -n python3-%{name} +%package -n python3-usd Summary: %{summary} BuildRequires: pkgconfig(python3) @@ -259,7 +259,7 @@ Requires: python3dist(pyside2) Requires: python3dist(pyopengl) %py_provides python3-pxr -%description -n python3-%{name} +%description -n python3-usd Python language bindings for the Universal Scene Description (USD) C++ API @@ -357,7 +357,7 @@ flags="${flags} $(pkgconf --cflags Imath)" %if %{with openvdb} -DPXR_ENABLE_OPENVDB_SUPPORT=ON \ %endif - -DPXR_INSTALL_LOCATION="%{_libdir}/%{name}/plugin" \ + -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ %if %{with jemalloc} -DPXR_MALLOC_LIBRARY="%{_libdir}/libjemalloc.so" \ %endif @@ -408,7 +408,7 @@ desktop-file-install \ # Remove examples that were built and installed even though we set # -DPXR_BUILD_EXAMPLES=OFF. -rm -vrf '%{buildroot}%{_datadir}/%{name}/examples' +rm -vrf '%{buildroot}%{_datadir}/usd/examples' # Fix installation path for some files mv %{buildroot}%{_prefix}/lib/python/pxr/*.* \ @@ -426,7 +426,7 @@ find %{buildroot}%{_prefix}/cmake -mindepth 1 -maxdepth 1 -type f \ %check %if %{with usdview} -desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{name}view.desktop +desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.desktop %endif %{?with_test:%ctest} @@ -452,26 +452,26 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdtree %{_bindir}/usdzip %if %{with usdview} -%{_datadir}/applications/org.open%{name}.%{name}view.desktop +%{_datadir}/applications/org.openusd.usdview.desktop %{_bindir}/testusdview %{_bindir}/usdview %endif -%files -n python3-%{name} +%files -n python3-usd %{python3_sitearch}/pxr/ %files libs %license LICENSE.txt %doc NOTICE.txt README.md -%{_libdir}/lib%{name}_ms.so.%{downstream_so_version} -%{_libdir}/%{name}/ -%exclude %{_libdir}/%{name}/%{name}/resources/codegenTemplates +%{_libdir}/libusd_ms.so.%{downstream_so_version} +%{_libdir}/usd/ +%exclude %{_libdir}/usd/usd/resources/codegenTemplates %files devel %doc BUILDING.md CHANGELOG.md VERSIONS.md %{_includedir}/pxr/ -%{_libdir}/lib%{name}_ms.so -%{_libdir}/%{name}/%{name}/resources/codegenTemplates/ +%{_libdir}/libusd_ms.so +%{_libdir}/usd/usd/resources/codegenTemplates/ %{_libdir}/cmake/pxr/pxrConfig.cmake %{_libdir}/cmake/pxr/pxrTargets.cmake %{_libdir}/cmake/pxr/pxrTargets-release.cmake @@ -479,7 +479,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %if %{with documentation} %files doc %license LICENSE.txt -%{_docdir}/%{name}/ +%{_docdir}/usd/ %endif %changelog From 0ec6c30a4b7b4c8f853a1767a05d79e1e0ea57cb Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 08:43:54 -0400 Subject: [PATCH 030/167] Be more explicit that we are on OpenEXR/Imath 3 --- usd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 8358285..8f79f38 100644 --- a/usd.spec +++ b/usd.spec @@ -146,8 +146,8 @@ BuildRequires: cmake(OpenColorIO) %if %{with oiio} BuildRequires: pkgconfig(OpenImageIO) %endif -BuildRequires: cmake(OpenEXR) -BuildRequires: cmake(Imath) >= 2.0 +BuildRequires: cmake(OpenEXR) >= 3.0 +BuildRequires: cmake(Imath) >= 3.0 %if %{with ptex} BuildRequires: pkgconfig(Ptex) %endif From 3def9ccc3b98edd5c66c57a13dbb93f8d0b44022 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 08:44:27 -0400 Subject: [PATCH 031/167] Slightly improve handling of compiler/linker flags --- usd.spec | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/usd.spec b/usd.spec index 8f79f38..8dba53f 100644 --- a/usd.spec +++ b/usd.spec @@ -326,6 +326,8 @@ find . -type f -exec gawk '/embree3/ { print FILENAME }' '{}' '+' | xargs -r sed -r -i 's/(embree)3/\14/' %build +%set_build_flags + # Fix uic-qt5 use cat > uic-wrapper <<'EOF' #!/bin/sh @@ -333,17 +335,20 @@ exec uic-qt5 -g python "$@" EOF chmod +x uic-wrapper -flags="%{optflags} -Wl,--as-needed -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" \ -# Patch2 was not good enough to get the include path for Imath everywhere it -# was needed. Add it globally. -# https://github.com/PixarAnimationStudios/USD/issues/1591 -flags="${flags} $(pkgconf --cflags Imath)" +# Although upstream supports OpenEXR3 / Imath now, the necessary include path +# is not set everywhere it’s needed. It’s not immediately clear exactly why +# this is happening here or what should be changed upstream. +extra_flags="${extra_flags-} $(pkgconf --cflags Imath)" +# Suppress deprecation warnings from TBB; upstream should act on them +# eventually, but they just add noise here. +extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" %cmake \ - -DCMAKE_CXX_FLAGS_RELEASE="${flags}" \ - -DCMAKE_C_FLAGS_RELEASE="${flags}" \ + -DCMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS-} ${extra_flags}" \ + -DCMAKE_C_FLAGS_RELEASE="${CFLAGS-} ${extra_flags}" \ -DCMAKE_CXX_STANDARD=17 \ - -DCMAKE_EXE_LINKER_FLAGS="-pie" \ + -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \ + -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ From f0e17042995248aa4f6d7c19249b60f66cbb42b7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 09:02:31 -0400 Subject: [PATCH 032/167] Set CMake options more compactly and explicitly Use RPM macro expressions with the ternary operator, and always set Boolean conditionals one way or the other rather than relying on upstream defaults. --- usd.spec | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/usd.spec b/usd.spec index 8dba53f..c58673d 100644 --- a/usd.spec +++ b/usd.spec @@ -352,44 +352,26 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DPXR_BUILD_USDVIEW=%{?with_usdview:ON}%{?!with_usdview:OFF} \ -%if %{with documentation} - -DPXR_BUILD_DOCUMENTATION=TRUE \ -%endif + -DPXR_BUILD_USDVIEW=%{expr:%{with usdview}?"ON":"OFF"} \ + -DPXR_BUILD_DOCUMENTATION=%{expr:%{with documentation}?"TRUE":"FALSE"} \ -DPXR_BUILD_EXAMPLES=OFF \ -DPXR_BUILD_TUTORIALS=OFF \ - -DPXR_BUILD_TESTS=%{?with_test:ON}%{!?with_test:OFF} \ -%if %{with openvdb} - -DPXR_ENABLE_OPENVDB_SUPPORT=ON \ -%endif + -DPXR_BUILD_TESTS=%{expr:%{with test}?"ON":"OFF"} \ + -DPXR_ENABLE_OPENVDB_SUPPORT=%{expr:%{with openvdb}?"ON":"OFF"} \ -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ %if %{with jemalloc} -DPXR_MALLOC_LIBRARY="%{_libdir}/libjemalloc.so" \ %endif -%if %{with alembic} -DOPENEXR_LOCATION=%{_includedir} \ - -DPXR_BUILD_ALEMBIC_PLUGIN=ON \ -%endif -%if %{with draco} - -DPXR_BUILD_DRACO_PLUGIN=ON \ -%endif -%if %{with embree} - -DPXR_BUILD_EMBREE_PLUGIN=ON \ + -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ + -DPXR_BUILD_DRACO_PLUGIN=%{expr:%{with draco}?"ON":"OFF"} \ + -DPXR_BUILD_EMBREE_PLUGIN=%{expr:%{with embree}?"ON":"OFF"} \ -DEMBREE_LOCATION=%{_prefix} \ -%endif -%if %{with ocio} - -DPXR_BUILD_OPENCOLORIO_PLUGIN=ON \ -%endif -%if %{with oiio} - -DPXR_BUILD_OPENIMAGEIO_PLUGIN=ON \ -%endif + -DPXR_BUILD_OPENCOLORIO_PLUGIN=%{expr:%{with ocio}?"ON":"OFF"} \ + -DPXR_BUILD_OPENIMAGEIO_PLUGIN=%{expr:%{with oiio}?"ON":"OFF"} \ -DPXR_ENABLE_HDF5_SUPPORT=ON \ -%if %{with ptex} - -DPXR_ENABLE_PTEX_SUPPORT=ON \ -%endif -%if %{with openshading} - -DPXR_ENABLE_OSL_SUPPORT=ON \ -%endif + -DPXR_ENABLE_PTEX_SUPPORT=%{expr:%{with ptex}?"ON":"OFF"} \ + -DPXR_ENABLE_OSL_SUPPORT=%{expr:%{with openshading}?"ON":"OFF"} \ -DPYTHON_EXECUTABLE=%{python3} \ -DPYSIDE_AVAILABLE=ON \ -DPYSIDEUICBINARY:PATH=${PWD}/uic-wrapper \ From 9f7b7c503b55051fefef2fe6cda77c4af59836fe Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 09:50:54 -0400 Subject: [PATCH 033/167] Use Ninja backend for CMake by default (a bit faster) --- usd.spec | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/usd.spec b/usd.spec index c58673d..6f2cb16 100644 --- a/usd.spec +++ b/usd.spec @@ -10,6 +10,10 @@ %bcond_without embree %bcond_without imaging %bcond_with jemalloc +# Default "UNIX Makefiles" backend for CMake would also work fine; ninja is a +# bit faster. We conditionalize it just in case there are backend-specific +# issues in the future. +%bcond_without ninja %bcond_without openshading %bcond_without openvdb %bcond_without ocio @@ -106,10 +110,16 @@ Patch: USD-pr2176-pxr_vt_hash-use-tfhash.patch Patch: %{forgeurl}/pull/2215.patch # Base -BuildRequires: boost-devel -BuildRequires: cmake -BuildRequires: dos2unix BuildRequires: gcc-c++ + +BuildRequires: cmake +%if %{with ninja} +BuildRequires: ninja-build +%endif + +BuildRequires: dos2unix + +BuildRequires: boost-devel BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(tbb) @@ -344,6 +354,12 @@ extra_flags="${extra_flags-} $(pkgconf --cflags Imath)" extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" %cmake \ +%if %{with ninja} + -GNinja \ +%endif +%if %{with jemalloc} + -DPXR_MALLOC_LIBRARY="%{_libdir}/libjemalloc.so" \ +%endif -DCMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS-} ${extra_flags}" \ -DCMAKE_C_FLAGS_RELEASE="${CFLAGS-} ${extra_flags}" \ -DCMAKE_CXX_STANDARD=17 \ @@ -359,9 +375,6 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_BUILD_TESTS=%{expr:%{with test}?"ON":"OFF"} \ -DPXR_ENABLE_OPENVDB_SUPPORT=%{expr:%{with openvdb}?"ON":"OFF"} \ -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ -%if %{with jemalloc} - -DPXR_MALLOC_LIBRARY="%{_libdir}/libjemalloc.so" \ -%endif -DOPENEXR_LOCATION=%{_includedir} \ -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ -DPXR_BUILD_DRACO_PLUGIN=%{expr:%{with draco}?"ON":"OFF"} \ From d893566ad9e0a030a5c8f277477f0c2f8dcd38e4 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 09:51:47 -0400 Subject: [PATCH 034/167] Write the uic-wrapper script in prep, not build --- usd.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 6f2cb16..122437d 100644 --- a/usd.spec +++ b/usd.spec @@ -335,9 +335,6 @@ sed -i 's|"${CMAKE_INSTALL_PREFIX}"|%{_libdir}/cmake/pxr|g' pxr/CMakeLists.txt find . -type f -exec gawk '/embree3/ { print FILENAME }' '{}' '+' | xargs -r sed -r -i 's/(embree)3/\14/' -%build -%set_build_flags - # Fix uic-qt5 use cat > uic-wrapper <<'EOF' #!/bin/sh @@ -345,6 +342,10 @@ exec uic-qt5 -g python "$@" EOF chmod +x uic-wrapper + +%build +%set_build_flags + # Although upstream supports OpenEXR3 / Imath now, the necessary include path # is not set everywhere it’s needed. It’s not immediately clear exactly why # this is happening here or what should be changed upstream. From a88e488a02e6e7798bb50fa5e1281a91ba589f7f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 11:52:33 -0400 Subject: [PATCH 035/167] Reorganize the CMake options for readability --- usd.spec | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/usd.spec b/usd.spec index 122437d..ac7e6d7 100644 --- a/usd.spec +++ b/usd.spec @@ -362,35 +362,41 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_MALLOC_LIBRARY="%{_libdir}/libjemalloc.so" \ %endif -DCMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS-} ${extra_flags}" \ - -DCMAKE_C_FLAGS_RELEASE="${CFLAGS-} ${extra_flags}" \ -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_C_FLAGS_RELEASE="${CFLAGS-} ${extra_flags}" \ -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \ -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \ - -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ + -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DPXR_BUILD_USDVIEW=%{expr:%{with usdview}?"ON":"OFF"} \ + \ -DPXR_BUILD_DOCUMENTATION=%{expr:%{with documentation}?"TRUE":"FALSE"} \ -DPXR_BUILD_EXAMPLES=OFF \ - -DPXR_BUILD_TUTORIALS=OFF \ + -DPXR_BUILD_MONOLITHIC=ON \ -DPXR_BUILD_TESTS=%{expr:%{with test}?"ON":"OFF"} \ - -DPXR_ENABLE_OPENVDB_SUPPORT=%{expr:%{with openvdb}?"ON":"OFF"} \ - -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ - -DOPENEXR_LOCATION=%{_includedir} \ + -DPXR_BUILD_TUTORIALS=OFF \ + -DPXR_BUILD_USDVIEW=%{expr:%{with usdview}?"ON":"OFF"} \ + \ -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ -DPXR_BUILD_DRACO_PLUGIN=%{expr:%{with draco}?"ON":"OFF"} \ -DPXR_BUILD_EMBREE_PLUGIN=%{expr:%{with embree}?"ON":"OFF"} \ - -DEMBREE_LOCATION=%{_prefix} \ -DPXR_BUILD_OPENCOLORIO_PLUGIN=%{expr:%{with ocio}?"ON":"OFF"} \ -DPXR_BUILD_OPENIMAGEIO_PLUGIN=%{expr:%{with oiio}?"ON":"OFF"} \ + \ + -DPXR_ENABLE_OPENVDB_SUPPORT=%{expr:%{with openvdb}?"ON":"OFF"} \ -DPXR_ENABLE_HDF5_SUPPORT=ON \ -DPXR_ENABLE_PTEX_SUPPORT=%{expr:%{with ptex}?"ON":"OFF"} \ -DPXR_ENABLE_OSL_SUPPORT=%{expr:%{with openshading}?"ON":"OFF"} \ - -DPYTHON_EXECUTABLE=%{python3} \ - -DPYSIDE_AVAILABLE=ON \ + -DPXR_ENABLE_MALLOCHOOK_SUPPORT=OFF \ + \ + -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ + \ + -DEMBREE_LOCATION=%{_prefix} \ + -DOPENEXR_LOCATION=%{_includedir} \ + \ -DPYSIDEUICBINARY:PATH=${PWD}/uic-wrapper \ - -DPXR_BUILD_MONOLITHIC=ON \ - -DPXR_ENABLE_MALLOCHOOK_SUPPORT=OFF + -DPYSIDE_AVAILABLE=ON \ + -DPYTHON_EXECUTABLE=%{python3} %cmake_build %install From 679d045c1fd6e2a46a130a1d5025bf7cc15c3d93 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 12:00:20 -0400 Subject: [PATCH 036/167] Explicitly enable/disable all plugins --- usd.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usd.spec b/usd.spec index ac7e6d7..ec5c20f 100644 --- a/usd.spec +++ b/usd.spec @@ -10,6 +10,8 @@ %bcond_without embree %bcond_without imaging %bcond_with jemalloc +# Not yet packaged: https://github.com/AcademySoftwareFoundation/MaterialX +%bcond_with materialx # Default "UNIX Makefiles" backend for CMake would also work fine; ninja is a # bit faster. We conditionalize it just in case there are backend-specific # issues in the future. @@ -380,8 +382,10 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ -DPXR_BUILD_DRACO_PLUGIN=%{expr:%{with draco}?"ON":"OFF"} \ -DPXR_BUILD_EMBREE_PLUGIN=%{expr:%{with embree}?"ON":"OFF"} \ + -DPXR_BUILD_MATERIALX_PLUGIN=%{expr:%{with materialx}?"ON":"OFF"} \ -DPXR_BUILD_OPENCOLORIO_PLUGIN=%{expr:%{with ocio}?"ON":"OFF"} \ -DPXR_BUILD_OPENIMAGEIO_PLUGIN=%{expr:%{with oiio}?"ON":"OFF"} \ + -DPXR_BUILD_PRMAN_PLUGIN=OFF \ \ -DPXR_ENABLE_OPENVDB_SUPPORT=%{expr:%{with openvdb}?"ON":"OFF"} \ -DPXR_ENABLE_HDF5_SUPPORT=ON \ From 67fbdf4266ceb379620fb73af0554b54d90816cd Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 12:29:34 -0400 Subject: [PATCH 037/167] Be explicit about not validating generated code This would require exact flex/bison versions matching those used upstream. --- usd.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usd.spec b/usd.spec index ec5c20f..ed772b4 100644 --- a/usd.spec +++ b/usd.spec @@ -395,6 +395,8 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" \ -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ \ + -DPXR_VALIDATE_GENERATED_CODE=OFF \ + \ -DEMBREE_LOCATION=%{_prefix} \ -DOPENEXR_LOCATION=%{_includedir} \ \ From 1253f72992772e988834955bb644b2d88e2dc7eb Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 12:41:32 -0400 Subject: [PATCH 038/167] Stop conditionalizing imaging/usd_imaging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s likely that additional work would be required to build cleanly without these, and it’s unlikely that we will want to try to do so. --- usd.spec | 54 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/usd.spec b/usd.spec index ed772b4..2538fdc 100644 --- a/usd.spec +++ b/usd.spec @@ -8,7 +8,6 @@ %bcond_with documentation %bcond_without draco %bcond_without embree -%bcond_without imaging %bcond_with jemalloc # Not yet packaged: https://github.com/AcademySoftwareFoundation/MaterialX %bcond_with materialx @@ -121,54 +120,58 @@ BuildRequires: ninja-build BuildRequires: dos2unix -BuildRequires: boost-devel BuildRequires: pkgconfig(blosc) +BuildRequires: boost-devel +BuildRequires: pkgconfig(dri) +BuildRequires: hdf5-devel +BuildRequires: opensubdiv-devel BuildRequires: pkgconfig(tbb) -# Documentation +BuildRequires: cmake(OpenEXR) >= 3.0 +BuildRequires: cmake(Imath) >= 3.0 + +%if %{with alembic} +BuildRequires: cmake(Alembic) +%endif + %if %{with documentation} BuildRequires: doxygen BuildRequires: graphviz %endif -# For imaging and usd imaging -%if %{with imaging} - %if %{with draco} BuildRequires: draco-devel %endif + %if %{with embree} BuildRequires: embree-devel %endif + +%if %{with jemalloc} +BuildRequires: pkgconfig(jemalloc) +%endif + +%if %{with ocio} +BuildRequires: cmake(OpenColorIO) +%endif + +%if %{with oiio} +BuildRequires: pkgconfig(OpenImageIO) +%endif + %if %{with openshading} BuildRequires: openshadinglanguage BuildRequires: pkgconfig(oslexec) %endif -BuildRequires: opensubdiv-devel + %if %{with openvdb} BuildRequires: openvdb-devel %endif -BuildRequires: pkgconfig(dri) -%if %{with jemalloc} -BuildRequires: pkgconfig(jemalloc) -%endif -%if %{with ocio} -BuildRequires: cmake(OpenColorIO) -%endif -%if %{with oiio} -BuildRequires: pkgconfig(OpenImageIO) -%endif -BuildRequires: cmake(OpenEXR) >= 3.0 -BuildRequires: cmake(Imath) >= 3.0 + %if %{with ptex} BuildRequires: pkgconfig(Ptex) %endif -%endif -%if %{with alembic} -BuildRequires: cmake(Alembic) -BuildRequires: hdf5-devel -%endif # Header-only library: -static is for tracking per guidelines # @@ -363,6 +366,7 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" %if %{with jemalloc} -DPXR_MALLOC_LIBRARY="%{_libdir}/libjemalloc.so" \ %endif + \ -DCMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS-} ${extra_flags}" \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_C_FLAGS_RELEASE="${CFLAGS-} ${extra_flags}" \ @@ -374,9 +378,11 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" \ -DPXR_BUILD_DOCUMENTATION=%{expr:%{with documentation}?"TRUE":"FALSE"} \ -DPXR_BUILD_EXAMPLES=OFF \ + -DPXR_BUILD_IMAGING=ON \ -DPXR_BUILD_MONOLITHIC=ON \ -DPXR_BUILD_TESTS=%{expr:%{with test}?"ON":"OFF"} \ -DPXR_BUILD_TUTORIALS=OFF \ + -DPXR_BUILD_USD_IMAGING=ON \ -DPXR_BUILD_USDVIEW=%{expr:%{with usdview}?"ON":"OFF"} \ \ -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ From 75f130e5a2c824b14cfadd028976bf1ae5224514 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 12:45:16 -0400 Subject: [PATCH 039/167] Be explicit about building the CLI tools --- usd.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/usd.spec b/usd.spec index 2538fdc..67eb735 100644 --- a/usd.spec +++ b/usd.spec @@ -383,6 +383,7 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_BUILD_TESTS=%{expr:%{with test}?"ON":"OFF"} \ -DPXR_BUILD_TUTORIALS=OFF \ -DPXR_BUILD_USD_IMAGING=ON \ + -DPXR_BUILD_USD_TOOLS=ON \ -DPXR_BUILD_USDVIEW=%{expr:%{with usdview}?"ON":"OFF"} \ \ -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ From 26034a49bfcdc46870f39de4738070400e536a20 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 13:56:07 -0400 Subject: [PATCH 040/167] Update to 23.05 (close RHBZ#2110024) --- .gitignore | 1 + 2215.patch | 21 -------- ...version.patch => USD-23.05-soversion.patch | 10 ++-- USD-pr2176-pxr_vt_hash-use-tfhash.patch | 49 ------------------- sources | 2 +- usd.spec | 22 ++------- 6 files changed, 12 insertions(+), 93 deletions(-) delete mode 100644 2215.patch rename USD-23.02-soversion.patch => USD-23.05-soversion.patch (89%) delete mode 100644 USD-pr2176-pxr_vt_hash-use-tfhash.patch diff --git a/.gitignore b/.gitignore index acc72ba..245c757 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /usd-22.08.tar.gz /usd-22.11.tar.gz /usd-23.02.tar.gz +/usd-23.05.tar.gz diff --git a/2215.patch b/2215.patch deleted file mode 100644 index 5b96cf1..0000000 --- a/2215.patch +++ /dev/null @@ -1,21 +0,0 @@ -From d40f0322e16dd3253181b65a5f10af9dcef0a845 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Sun, 29 Jan 2023 14:19:35 -0500 -Subject: [PATCH] Add missing #include for GCC13 - ---- - pxr/base/arch/virtualMemory.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/pxr/base/arch/virtualMemory.cpp b/pxr/base/arch/virtualMemory.cpp -index 4337b8c31e..3c409fab48 100644 ---- a/pxr/base/arch/virtualMemory.cpp -+++ b/pxr/base/arch/virtualMemory.cpp -@@ -26,6 +26,7 @@ - #include "pxr/base/arch/defines.h" - #include "pxr/base/arch/systemInfo.h" - -+#include - #if defined(ARCH_OS_WINDOWS) - #include - #include diff --git a/USD-23.02-soversion.patch b/USD-23.05-soversion.patch similarity index 89% rename from USD-23.02-soversion.patch rename to USD-23.05-soversion.patch index 2a0ca84..011bd82 100644 --- a/USD-23.02-soversion.patch +++ b/USD-23.05-soversion.patch @@ -1,4 +1,4 @@ -From a5c6a2e45bb21c72c5447a64507425a483ac63b0 Mon Sep 17 00:00:00 2001 +From 1be919609dfecfd8df2e119d1f489676d2193629 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 20 Mar 2023 09:59:18 -0400 Subject: [PATCH] Support downstream .so versioning @@ -10,11 +10,11 @@ Subject: [PATCH] Support downstream .so versioning 3 files changed, 8 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 872881b4b..58806c9be 100644 +index 647b8aabe..727ce577f 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -27,3 +27,9 @@ set(PXR_MINOR_VERSION "23") - set(PXR_PATCH_VERSION "02") + set(PXR_PATCH_VERSION "05") math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -24,7 +24,7 @@ index 872881b4b..58806c9be 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index 585db955e..f6def8087 100644 +index 23172745e..e3d8fd648 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake @@ -1299,6 +1299,7 @@ function(_pxr_library NAME) @@ -36,7 +36,7 @@ index 585db955e..f6def8087 100644 target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index c201093ef..c86d16d9d 100644 +index a1734b6a2..24f51ba75 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -1003,6 +1003,7 @@ function(pxr_toplevel_prologue) diff --git a/USD-pr2176-pxr_vt_hash-use-tfhash.patch b/USD-pr2176-pxr_vt_hash-use-tfhash.patch deleted file mode 100644 index 5056f5e..0000000 --- a/USD-pr2176-pxr_vt_hash-use-tfhash.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 326cad6188af42389e7e629250ea8bf16580b524 Mon Sep 17 00:00:00 2001 -From: Matt Kuruc -Date: Mon, 23 Jan 2023 12:33:05 -0800 -Subject: [PATCH] Replace boost hash usage with TfHash in pxr/base/vt - ---- - pxr/base/vt/array.h | 15 +++++++++------ - pxr/base/vt/dictionary.h | 3 +-- - pxr/base/vt/hash.cpp | 4 ++-- - pxr/base/vt/hash.h | 26 +++++--------------------- - pxr/base/vt/testenv/testVtCpp.cpp | 12 ++++++++++++ - pxr/base/vt/value.cpp | 12 +----------- - 6 files changed, 30 insertions(+), 42 deletions(-) - -diff --git a/pxr/base/vt/hash.h b/pxr/base/vt/hash.h -index 47ca66e797..6df07c58f3 100644 ---- a/pxr/base/vt/hash.h -+++ b/pxr/base/vt/hash.h -@@ -38,28 +37,15 @@ namespace Vt_HashDetail { - // Issue a coding error when we attempt to hash a t. - VT_API void _IssueUnimplementedHashError(std::type_info const &t); - --// We make unqualified calls, intending to pick up boost::hash_value if an --// overload isn't found by ADL. --using boost::hash_value; -- - // A constexpr function that determines hashability. --template ()))> --constexpr bool _IsHashable(int) { return true; } - template ()))> - constexpr bool _IsHashable(long) { return true; } - template - constexpr bool _IsHashable(...) { return false; } - - // Hash implementations -- We're using an overload resolution ordering trick --// here (int vs long vs ...) so that we pick hash_value first, if possible, --// otherwise we do TfHash() if possible, otherwise we issue a runtime error. --template ()))> --inline size_t --_HashValueImpl(T const &val, int) --{ -- return hash_value(val); --} -- -+// here (long vs ...) so that we pick TfHash() if possible, otherwise -+// we issue a runtime error. - template ()))> - inline size_t - _HashValueImpl(T const &val, long) diff --git a/sources b/sources index 40b48cf..d5fc7d7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (usd-23.02.tar.gz) = 2529aec788cab3ff4c47041f5bc0043fde81dcef8ca313f6390f2e5fb7a10b1b0b1dd47fd6c86e3b4cfc0a1b27bff4d9b94b96bfba6bec3d5ff8f6e2fccb9e11 +SHA512 (usd-23.05.tar.gz) = fd3e7a90f837a5d016d94be34747b2c1daed3f01f252e4b1aa5cb195f32acaecca9373b8f5c7be9c235148f04b0afa47da9462b357ef1dd1e11cf20a7225ae66 diff --git a/usd.spec b/usd.spec index 67eb735..28995f6 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.23.02 +%global downstream_so_version 0.23.05 %bcond_without alembic %bcond_with documentation @@ -29,7 +29,7 @@ %bcond_with test Name: usd -Version: 23.02 +Version: 23.05 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -94,22 +94,12 @@ Source2: stb_image.patch # to be versioned as well, which is undesired. This is not a serious problem # because we do not want to package the built plugin anyway. (It should not be # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) -Patch: USD-23.02-soversion.patch +Patch: USD-23.05-soversion.patch # Port to Embree 4.x # https://github.com/PixarAnimationStudios/USD/pull/2266 Patch: %{forgeurl}/pull/2266.patch -# Prefer TfHash to boost::hash -# Part of https://github.com/PixarAnimationStudios/USD/issues/2172 -# Part of https://github.com/PixarAnimationStudios/USD/pull/2176/ (currently under review) -# Needed for boost 1.81 -Patch: USD-pr2176-pxr_vt_hash-use-tfhash.patch - -# Add missing #include for GCC13 -# https://github.com/PixarAnimationStudios/USD/pull/2215 -Patch: %{forgeurl}/pull/2215.patch - # Base BuildRequires: gcc-c++ @@ -220,7 +210,7 @@ Provides: bundled(cli11) = 2.3.1 Provides: bundled(pugixml) = 1.9 # Version from: pxr/base/js/rapidjson/rapidjson.h # (RAPIDJSON_{MAJOR,MINOR,PATCH}_VERSION) -Provides: bundled(rapidjson) = 1.0.2 +Provides: bundled(rapidjson) = 1.1.0 # Version from: pxr/imaging/hgiVulkan/spirv_reflect.h (header comment) Provides: bundled(SPIRV-Reflect) = 1.0 # Version from: pxr/imaging/hgiVulkan/vk_mem_alloc.h (header comment) @@ -399,14 +389,12 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_ENABLE_PTEX_SUPPORT=%{expr:%{with ptex}?"ON":"OFF"} \ -DPXR_ENABLE_OSL_SUPPORT=%{expr:%{with openshading}?"ON":"OFF"} \ -DPXR_ENABLE_MALLOCHOOK_SUPPORT=OFF \ + -DPXR_ENABLE_PYTHON_SUPPORT=ON \ \ -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ \ -DPXR_VALIDATE_GENERATED_CODE=OFF \ \ - -DEMBREE_LOCATION=%{_prefix} \ - -DOPENEXR_LOCATION=%{_includedir} \ - \ -DPYSIDEUICBINARY:PATH=${PWD}/uic-wrapper \ -DPYSIDE_AVAILABLE=ON \ -DPYTHON_EXECUTABLE=%{python3} From 4382e4924a184d76c26db0f0bfad614effbc56b9 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 22 Apr 2023 15:03:52 -0400 Subject: [PATCH 041/167] Add generated man pages These are slightly sloppy in places. For example, there is a warning from _DiscoverPlugins mixed into some of them. However, they are of mostly-good quality, are perfectly usable, and are much better than nothing. --- usd.spec | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/usd.spec b/usd.spec index 28995f6..327c65b 100644 --- a/usd.spec +++ b/usd.spec @@ -109,6 +109,7 @@ BuildRequires: ninja-build %endif BuildRequires: dos2unix +BuildRequires: help2man BuildRequires: pkgconfig(blosc) BuildRequires: boost-devel @@ -432,6 +433,21 @@ mv %{buildroot}%{_prefix}/lib/python/pxr/Usdviewq/* \ find %{buildroot}%{_prefix}/cmake -mindepth 1 -maxdepth 1 -type f \ -exec mv -v '{}' '%{buildroot}%{_libdir}/cmake/pxr' ';' +# Generate and install man pages. While generating the man pages might more +# properly go in %%build, it is generally much easier to do this here in a +# single step, using the entry points installed into the buildroot. This is +# especially true for the entry points that are Python scripts. +install -d '%{buildroot}%{_mandir}/man1' +for cmd in %{buildroot}%{_bindir}/* +do + PYTHONPATH='%{buildroot}%{python3_sitearch}' \ + LD_LIBRARY_PATH='%{buildroot}%{_libdir}' \ + help2man \ + --no-info --no-discard-stderr --version-string='%{version}' \ + --output="%{buildroot}%{_mandir}/man1/$(basename "${cmd}").1" \ + "${cmd}" +done + %check %if %{with usdview} desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.desktop @@ -440,6 +456,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %files %doc NOTICE.txt README.md + %{_bindir}/sdfdump %{_bindir}/sdffilter %{_bindir}/usdGenSchema @@ -465,6 +482,30 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_bindir}/usdview %endif +%{_mandir}/man1/sdfdump.1* +%{_mandir}/man1/sdffilter.1* +%{_mandir}/man1/usdGenSchema.1* +%{_mandir}/man1/usdcat.1* +%{_mandir}/man1/usdchecker.1* +%if %{with draco} +%{_mandir}/man1/usdcompress.1* +%endif +%{_mandir}/man1/usddiff.1* +%{_mandir}/man1/usddumpcrate.1* +%{_mandir}/man1/usdedit.1* +%{_mandir}/man1/usdfixbrokenpixarschemas.1* +%{_mandir}/man1/usdgenschemafromsdr.1* +%{_mandir}/man1/usdrecord.1* +%{_mandir}/man1/usdresolve.1* +%{_mandir}/man1/usdstitch.1* +%{_mandir}/man1/usdstitchclips.1* +%{_mandir}/man1/usdtree.1* +%{_mandir}/man1/usdzip.1* +%if %{with usdview} +%{_mandir}/man1/testusdview.1* +%{_mandir}/man1/usdview.1* +%endif + %files -n python3-usd %{python3_sitearch}/pxr/ From 21e907dd816a74f2d5593e1d045033b69a0d430a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 20 Mar 2023 10:32:11 -0400 Subject: [PATCH 042/167] Drop manual dependency on cmake-filesystem, now automatic --- usd.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/usd.spec b/usd.spec index be8d581..4a84154 100644 --- a/usd.spec +++ b/usd.spec @@ -226,7 +226,6 @@ interchange between graphics applications. %package devel Summary: Development files for USD -Requires: cmake-filesystem Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description devel From ccf37b0ee20e86002e31b62e59a6d9c1768d4a28 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 20 Mar 2023 10:32:29 -0400 Subject: [PATCH 043/167] Re-enable OpenShadingLanguage and OpenVDB support --- usd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 4a84154..690f5e8 100644 --- a/usd.spec +++ b/usd.spec @@ -9,8 +9,8 @@ %bcond_without embree %bcond_without imaging %bcond_with jemalloc -%bcond_with openshading -%bcond_with openvdb +%bcond_without openshading +%bcond_without openvdb %bcond_without ocio %bcond_without oiio %bcond_without python3 From 3bd2fd5d8ffff132a93e41a7e93af7b66842ec8d Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 17 Apr 2023 10:11:01 -0400 Subject: [PATCH 044/167] Build with the draco plugin --- usd.spec | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 690f5e8..7a8bd23 100644 --- a/usd.spec +++ b/usd.spec @@ -6,6 +6,7 @@ %bcond_without alembic %bcond_with documentation +%bcond_without draco %bcond_without embree %bcond_without imaging %bcond_with jemalloc @@ -128,6 +129,10 @@ BuildRequires: graphviz # For imaging and usd imaging %if %{with imaging} + +%if %{with draco} +BuildRequires: draco-devel +%endif %if %{with embree} BuildRequires: embree-devel %endif @@ -233,7 +238,7 @@ This package contains the C++ header files and symbolic links to the shared libraries for %{name}. If you would like to develop programs using %{name}, you will need to install %{name}-devel. -# For usdview +# For usdview, usdcompress %if %{with python3} %package -n python3-%{name} Summary: %{summary} @@ -363,6 +368,9 @@ flags="${flags} $(pkgconf --cflags Imath)" -DOPENEXR_LOCATION=%{_includedir} \ -DPXR_BUILD_ALEMBIC_PLUGIN=ON \ %endif +%if %{with draco} + -DPXR_BUILD_DRACO_PLUGIN=ON \ +%endif %if %{with embree} -DPXR_BUILD_EMBREE_PLUGIN=ON \ -DEMBREE_LOCATION=%{_prefix} \ @@ -448,7 +456,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %if %{with python3} %files -n python3-%{name} -%{python3_sitearch}/pxr +%{python3_sitearch}/pxr/ +%if %{with draco} +%{_bindir}/usdcompress +%endif %if %{with usdview} %{_datadir}/applications/org.open%{name}.%{name}view.desktop %{_bindir}/testusdview From 6708320517e071d17b6cb4c53009400f3ea7df5c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 17 Apr 2023 10:51:14 -0400 Subject: [PATCH 045/167] Stop conditionalizing Python --- usd.spec | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/usd.spec b/usd.spec index 7a8bd23..d2b97d0 100644 --- a/usd.spec +++ b/usd.spec @@ -14,7 +14,6 @@ %bcond_without openvdb %bcond_without ocio %bcond_without oiio -%bcond_without python3 %bcond_without usdview # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the @@ -181,9 +180,7 @@ BuildRequires: stb_image_resize-devel >= 0.97 BuildRequires: stb_image_resize-static Requires: %{name}-libs%{?_isa} = %{version}-%{release} -%if %{with python3} Requires: python3-%{name}%{?_isa} = %{version}-%{release} -%endif # This package is only available for x86_64 and aarch64 # Will fail to build on other architectures @@ -239,7 +236,6 @@ libraries for %{name}. If you would like to develop programs using %{name}, you will need to install %{name}-devel. # For usdview, usdcompress -%if %{with python3} %package -n python3-%{name} Summary: %{summary} @@ -264,7 +260,7 @@ Requires: python3dist(pyopengl) %description -n python3-%{name} Python language bindings for the Universal Scene Description (USD) C++ API -%endif + %if %{with documentation} %package doc @@ -281,10 +277,8 @@ Documentation for the Universal Scene Description (USD) C++ API # Convert NOTICE.txt from CRNL line encoding dos2unix NOTICE.txt -%if %{with python3} # Fix all Python shebangs recursively in . %py3_shebang_fix . -%endif # Further drop shebangs line for some py files sed -r -i '1{/^#!/d}' \ @@ -333,9 +327,6 @@ exec uic-qt5 -g python "$@" EOF chmod +x uic-wrapper -# Fix python3 support -# https://github.com/PixarAnimationStudios/USD/issues/1419 - flags="%{optflags} -Wl,--as-needed -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" \ # Patch2 was not good enough to get the include path for Imath everywhere it # was needed. Add it globally. @@ -385,13 +376,9 @@ flags="${flags} $(pkgconf --cflags Imath)" -DPXR_ENABLE_OSL_SUPPORT=ON \ %endif -DPYTHON_EXECUTABLE=%{python3} \ -%if %{with python3} -DPXR_USE_PYTHON_3=ON \ -DPYSIDE_AVAILABLE=ON \ -DPYSIDEUICBINARY:PATH=${PWD}/uic-wrapper \ -%else - -DPXR_ENABLE_PYTHON_SUPPORT=OFF \ -%endif -DPXR_BUILD_MONOLITHIC=ON \ -DPXR_ENABLE_MALLOCHOOK_SUPPORT=OFF %cmake_build @@ -454,7 +441,6 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdtree %{_bindir}/usdzip -%if %{with python3} %files -n python3-%{name} %{python3_sitearch}/pxr/ %if %{with draco} @@ -465,7 +451,6 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/testusdview %{_bindir}/usdview %endif -%endif %files libs %license LICENSE.txt From 72c3d34dac4d285c86c0dc69b05c936b89b8f738 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 08:43:54 -0400 Subject: [PATCH 046/167] Be more explicit that we are on OpenEXR/Imath 3 --- usd.spec | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usd.spec b/usd.spec index d2b97d0..2eefa2a 100644 --- a/usd.spec +++ b/usd.spec @@ -154,12 +154,8 @@ BuildRequires: pkgconfig(OpenColorIO) < 2 %if %{with oiio} BuildRequires: pkgconfig(OpenImageIO) %endif -BuildRequires: cmake(OpenEXR) -%if 0%{?fedora} < 35 -BuildRequires: pkgconfig(IlmBase) >= 2.0 -%else -BuildRequires: cmake(Imath) >= 2.0 -%endif +BuildRequires: cmake(OpenEXR) >= 3.0 +BuildRequires: cmake(Imath) >= 3.0 BuildRequires: pkgconfig(Ptex) %endif %if %{with alembic} From f0cc08bac8d859db90af2f5bb584567ea28a6df8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 08:44:27 -0400 Subject: [PATCH 047/167] Slightly improve handling of compiler/linker flags --- usd.spec | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/usd.spec b/usd.spec index 2eefa2a..4173997 100644 --- a/usd.spec +++ b/usd.spec @@ -316,6 +316,8 @@ sed -i 's|plugin/usd|%{_libdir}/usd/plugin|g' \ sed -i 's|"${CMAKE_INSTALL_PREFIX}"|%{_libdir}/cmake/pxr|g' pxr/CMakeLists.txt %build +%set_build_flags + # Fix uic-qt5 use cat > uic-wrapper <<'EOF' #!/bin/sh @@ -323,17 +325,20 @@ exec uic-qt5 -g python "$@" EOF chmod +x uic-wrapper -flags="%{optflags} -Wl,--as-needed -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" \ -# Patch2 was not good enough to get the include path for Imath everywhere it -# was needed. Add it globally. -# https://github.com/PixarAnimationStudios/USD/issues/1591 -flags="${flags} $(pkgconf --cflags Imath)" +# Although upstream supports OpenEXR3 / Imath now, the necessary include path +# is not set everywhere it’s needed. It’s not immediately clear exactly why +# this is happening here or what should be changed upstream. +extra_flags="${extra_flags-} $(pkgconf --cflags Imath)" +# Suppress deprecation warnings from TBB; upstream should act on them +# eventually, but they just add noise here. +extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" %cmake \ - -DCMAKE_CXX_FLAGS_RELEASE="${flags}" \ - -DCMAKE_C_FLAGS_RELEASE="${flags}" \ + -DCMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS-} ${extra_flags}" \ + -DCMAKE_C_FLAGS_RELEASE="${CFLAGS-} ${extra_flags}" \ -DCMAKE_CXX_STANDARD=17 \ - -DCMAKE_EXE_LINKER_FLAGS="-pie" \ + -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}" \ + -DCMAKE_SHARED_LINKER_FLAGS="${LDFLAGS}" \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_SKIP_INSTALL_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ From 0e192c5c63bcdc932898a58c19ed6b14ddc2e7b2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 21 Apr 2023 09:51:47 -0400 Subject: [PATCH 048/167] Write the uic-wrapper script in prep, not build --- usd.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 4173997..d7b9a90 100644 --- a/usd.spec +++ b/usd.spec @@ -315,9 +315,6 @@ sed -i 's|plugin/usd|%{_libdir}/usd/plugin|g' \ # Fix cmake directory destination sed -i 's|"${CMAKE_INSTALL_PREFIX}"|%{_libdir}/cmake/pxr|g' pxr/CMakeLists.txt -%build -%set_build_flags - # Fix uic-qt5 use cat > uic-wrapper <<'EOF' #!/bin/sh @@ -325,6 +322,10 @@ exec uic-qt5 -g python "$@" EOF chmod +x uic-wrapper + +%build +%set_build_flags + # Although upstream supports OpenEXR3 / Imath now, the necessary include path # is not set everywhere it’s needed. It’s not immediately clear exactly why # this is happening here or what should be changed upstream. From 55f4734f33d1b790fd6292176d63f57ea5ab8f88 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 17 Apr 2023 10:54:20 -0400 Subject: [PATCH 049/167] Put all the tools and apps in the base package They were not correctly sorted between Python and non-Python anyway. --- usd.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usd.spec b/usd.spec index d7b9a90..11541c0 100644 --- a/usd.spec +++ b/usd.spec @@ -432,6 +432,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdGenSchema %{_bindir}/usdcat %{_bindir}/usdchecker +%if %{with draco} +%{_bindir}/usdcompress +%endif %{_bindir}/usddiff %{_bindir}/usddumpcrate %{_bindir}/usdedit @@ -442,18 +445,15 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdstitchclips %{_bindir}/usdtree %{_bindir}/usdzip - -%files -n python3-%{name} -%{python3_sitearch}/pxr/ -%if %{with draco} -%{_bindir}/usdcompress -%endif %if %{with usdview} %{_datadir}/applications/org.open%{name}.%{name}view.desktop %{_bindir}/testusdview %{_bindir}/usdview %endif +%files -n python3-%{name} +%{python3_sitearch}/pxr/ + %files libs %license LICENSE.txt %doc NOTICE.txt README.md From c54ae0b451321603f30764187d388af574f29a19 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 22 Apr 2023 15:03:52 -0400 Subject: [PATCH 050/167] Add generated man pages These are slightly sloppy in places. For example, there is a warning from _DiscoverPlugins mixed into some of them. However, they are of mostly-good quality, are perfectly usable, and are much better than nothing. --- usd.spec | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 11541c0..49f14b2 100644 --- a/usd.spec +++ b/usd.spec @@ -112,11 +112,16 @@ Patch: %{forgeurl}/pull/1830.patch Patch: %{forgeurl}/pull/1928.patch # Base +BuildRequires: gcc-c++ + +BuildRequires: cmake + +BuildRequires: dos2unix +BuildRequires: help2man + +BuildRequires: pkgconfig(blosc) BuildRequires: boost-devel BuildRequires: boost-program-options -BuildRequires: cmake -BuildRequires: dos2unix -BuildRequires: gcc-c++ BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(tbb) @@ -419,6 +424,21 @@ mv %{buildroot}%{_prefix}/lib/python/pxr/Usdviewq/* \ # https://github.com/PixarAnimationStudios/USD/issues/1088 rm -vrf '%{buildroot}%{_libdir}/cmake' +# Generate and install man pages. While generating the man pages might more +# properly go in %%build, it is generally much easier to do this here in a +# single step, using the entry points installed into the buildroot. This is +# especially true for the entry points that are Python scripts. +install -d '%{buildroot}%{_mandir}/man1' +for cmd in %{buildroot}%{_bindir}/* +do + PYTHONPATH='%{buildroot}%{python3_sitearch}' \ + LD_LIBRARY_PATH='%{buildroot}%{_libdir}' \ + help2man \ + --no-info --no-discard-stderr --version-string='%{version}' \ + --output="%{buildroot}%{_mandir}/man1/$(basename "${cmd}").1" \ + "${cmd}" +done + %check %if %{with usdview} desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{name}view.desktop @@ -427,6 +447,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %files %doc NOTICE.txt README.md + %{_bindir}/sdfdump %{_bindir}/sdffilter %{_bindir}/usdGenSchema @@ -451,6 +472,29 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %{_bindir}/usdview %endif +%{_mandir}/man1/sdfdump.1* +%{_mandir}/man1/sdffilter.1* +%{_mandir}/man1/usdGenSchema.1* +%{_mandir}/man1/usdcat.1* +%{_mandir}/man1/usdchecker.1* +%if %{with draco} +%{_mandir}/man1/usdcompress.1* +%endif +%{_mandir}/man1/usddiff.1* +%{_mandir}/man1/usddumpcrate.1* +%{_mandir}/man1/usdedit.1* +%{_mandir}/man1/usdgenschemafromsdr.1* +%{_mandir}/man1/usdrecord.1* +%{_mandir}/man1/usdresolve.1* +%{_mandir}/man1/usdstitch.1* +%{_mandir}/man1/usdstitchclips.1* +%{_mandir}/man1/usdtree.1* +%{_mandir}/man1/usdzip.1* +%if %{with usdview} +%{_mandir}/man1/testusdview.1* +%{_mandir}/man1/usdview.1* +%endif + %files -n python3-%{name} %{python3_sitearch}/pxr/ From 86a2ce7d3838364527c22f7b3c173ff77acc106d Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 24 Apr 2023 17:19:25 -0400 Subject: [PATCH 051/167] Move codegenTemplates from -devel to -libs While headers normally go in -devel packages, these headers and C++ source files are used as data templates for generated code, and it makes sense to package them with the rest of the library resources. --- usd.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 327c65b..43d0e20 100644 --- a/usd.spec +++ b/usd.spec @@ -513,14 +513,18 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %license LICENSE.txt %doc NOTICE.txt README.md %{_libdir}/libusd_ms.so.%{downstream_so_version} +# While headers normally go in -devel packages, those in +# %%{_libdir}/usd/usd/resources/codegenTemplates/ are used as data (templates +# for generated code), and it makes sense to package them with the rest of the +# library resources. (Technically, these are currently used only by the +# usdGenSchema command-line tool, so they could be moved to the base package, +# but this is probably too fussy.) %{_libdir}/usd/ -%exclude %{_libdir}/usd/usd/resources/codegenTemplates %files devel %doc BUILDING.md CHANGELOG.md VERSIONS.md %{_includedir}/pxr/ %{_libdir}/libusd_ms.so -%{_libdir}/usd/usd/resources/codegenTemplates/ %{_libdir}/cmake/pxr/pxrConfig.cmake %{_libdir}/cmake/pxr/pxrTargets.cmake %{_libdir}/cmake/pxr/pxrTargets-release.cmake From 73336472bf4f01eeb01761fb0c4d66d0c7a9e41b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 24 Apr 2023 17:19:25 -0400 Subject: [PATCH 052/167] Move codegenTemplates from -devel to -libs While headers normally go in -devel packages, these headers and C++ source files are used as data templates for generated code, and it makes sense to package them with the rest of the library resources. --- usd.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 49f14b2..44c40ed 100644 --- a/usd.spec +++ b/usd.spec @@ -502,14 +502,18 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %license LICENSE.txt %doc NOTICE.txt README.md %{_libdir}/lib%{name}_%{name}_ms.so.%{downstream_so_version} -%{_libdir}/%{name} -%exclude %{_libdir}/%{name}/%{name}/resources/codegenTemplates +# While headers normally go in -devel packages, those in +# %%{_libdir}/usd/usd/resources/codegenTemplates/ are used as data (templates +# for generated code), and it makes sense to package them with the rest of the +# library resources. (Technically, these are currently used only by the +# usdGenSchema command-line tool, so they could be moved to the base package, +# but this is probably too fussy.) +%{_libdir}/%{name}/ %files devel %doc BUILDING.md CHANGELOG.md VERSIONS.md %{_includedir}/pxr/ %{_libdir}/lib%{name}_%{name}_ms.so -%{_libdir}/%{name}/%{name}/resources/codegenTemplates/ %if %{with documentation} %files doc From f8e3dafaace3a66ab2aa642f7f501e8a5a91564a Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Sat, 6 May 2023 20:09:05 -0700 Subject: [PATCH 053/167] Symlink libusd_ms.so library This update includes symlink needed for Blender 3.5.1 --- usd.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usd.spec b/usd.spec index 44c40ed..6d5dac9 100644 --- a/usd.spec +++ b/usd.spec @@ -393,6 +393,10 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" %install %cmake_install +# Blender 3.5.1 requires libusd_ms.so +ln -s %{_libdir}/lib%{name}_%{name}_ms.so \ + %{buildroot}%{_libdir}/lib%{name}_ms.so + # Fix python3 files installation mkdir -p %{buildroot}%{python3_sitearch} mv %{buildroot}%{python3_sitelib}/* %{buildroot}%{python3_sitearch} @@ -514,6 +518,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.open%{name}.%{nam %doc BUILDING.md CHANGELOG.md VERSIONS.md %{_includedir}/pxr/ %{_libdir}/lib%{name}_%{name}_ms.so +%{_libdir}/lib%{name}_ms.so %if %{with documentation} %files doc From 8a400489255e940176c30ddce1dfd0b2962c82f4 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 7 May 2023 08:26:41 -0400 Subject: [PATCH 054/167] Rebuild for draco 1.5.6 (close RHBZ#2195997) From 244bffe4e6487dbfc5e58af8ca173fd016acc081 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 7 May 2023 08:26:41 -0400 Subject: [PATCH 055/167] Rebuild for draco 1.5.6 (close RHBZ#2203306) From 42b9d0a4719c2e7663bfa00e7d66b3514209ad3d Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Fri, 12 May 2023 19:11:43 -0700 Subject: [PATCH 056/167] Rebuild for embree 4.1.0 From 4e2670fef847e053521d9f4bc957209cc889c987 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 3 Jun 2023 12:56:41 -0400 Subject: [PATCH 057/167] Remove explicit %set_build_flags, not needed since F36 https://www.fedoraproject.org/wiki/Changes/SetBuildFlagsBuildCheck --- usd.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/usd.spec b/usd.spec index 43d0e20..9534247 100644 --- a/usd.spec +++ b/usd.spec @@ -340,8 +340,6 @@ chmod +x uic-wrapper %build -%set_build_flags - # Although upstream supports OpenEXR3 / Imath now, the necessary include path # is not set everywhere it’s needed. It’s not immediately clear exactly why # this is happening here or what should be changed upstream. From c43cbe099a72f8c479c4c9e14d724357ae61433a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 6 Jul 2023 12:35:20 -0400 Subject: [PATCH 058/167] Use new (rpm 4.17.1+) bcond style --- usd.spec | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/usd.spec b/usd.spec index 9534247..345b49e 100644 --- a/usd.spec +++ b/usd.spec @@ -4,29 +4,29 @@ # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. %global downstream_so_version 0.23.05 -%bcond_without alembic -%bcond_with documentation -%bcond_without draco -%bcond_without embree -%bcond_with jemalloc +%bcond alembic 1 +%bcond documentation 0 +%bcond draco 1 +%bcond embree 1 +%bcond jemalloc 0 # Not yet packaged: https://github.com/AcademySoftwareFoundation/MaterialX -%bcond_with materialx +%bcond materialx 0 # Default "UNIX Makefiles" backend for CMake would also work fine; ninja is a # bit faster. We conditionalize it just in case there are backend-specific # issues in the future. -%bcond_without ninja -%bcond_without openshading -%bcond_without openvdb -%bcond_without ocio -%bcond_without oiio -%bcond_without ptex +%bcond ninja 1 +%bcond openshading 1 +%bcond openvdb 1 +%bcond ocio 1 +%bcond oiio 1 +%bcond ptex 1 # Not yet packaged -%bcond_with pyside6 -%bcond_without usdview +%bcond pyside6 0 +%bcond usdview 1 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the # command-line tools in the buildroot. -%bcond_with test +%bcond test 0 Name: usd Version: 23.05 From edace6d7c585e2855994389e19c271a8b0c46b62 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 18 Jul 2023 11:16:31 -0400 Subject: [PATCH 059/167] Temporarily disable usdview application - Works around python-pyside2 FTBFS/FTI with Python 3.12 --- usd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 345b49e..01ddb89 100644 --- a/usd.spec +++ b/usd.spec @@ -22,7 +22,10 @@ %bcond ptex 1 # Not yet packaged %bcond pyside6 0 -%bcond usdview 1 +# F39FailsToInstall: python3-pyside2, python3-shiboken2, +# python3-shiboken2-devel +# https://bugzilla.redhat.com/show_bug.cgi?id=2220452 +%bcond usdview 0 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the # command-line tools in the buildroot. From efbdec6f3b4201f0e67cd664ec1872111e37a4d8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 18 Jul 2023 11:42:06 -0400 Subject: [PATCH 060/167] Rebuild for Python 3.12 (close RHBZ#2220617) From 39d7d820d0ef2ef255aa2e18f1ae7e2067f7bf91 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 17:17:57 +0000 Subject: [PATCH 061/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering From c825fbe765bbaf7ec52d8550120c027ea52b05c0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 24 Aug 2023 12:41:05 -0400 Subject: [PATCH 062/167] Drop conditional for building documentation --- usd.spec | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/usd.spec b/usd.spec index 01ddb89..2a57a63 100644 --- a/usd.spec +++ b/usd.spec @@ -5,7 +5,6 @@ %global downstream_so_version 0.23.05 %bcond alembic 1 -%bcond documentation 0 %bcond draco 1 %bcond embree 1 %bcond jemalloc 0 @@ -128,11 +127,6 @@ BuildRequires: cmake(Imath) >= 3.0 BuildRequires: cmake(Alembic) %endif -%if %{with documentation} -BuildRequires: doxygen -BuildRequires: graphviz -%endif - %if %{with draco} BuildRequires: draco-devel %endif @@ -271,16 +265,6 @@ Requires: python3dist(pyopengl) %description -n python3-usd Python language bindings for the Universal Scene Description (USD) C++ API - -%if %{with documentation} -%package doc -Summary: Documentation for usd -BuildArch: noarch - -%description doc -Documentation for the Universal Scene Description (USD) C++ API -%endif - %prep %autosetup -p1 -n USD-%{version} @@ -368,7 +352,7 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ \ - -DPXR_BUILD_DOCUMENTATION=%{expr:%{with documentation}?"TRUE":"FALSE"} \ + -DPXR_BUILD_DOCUMENTATION=FALSE \ -DPXR_BUILD_EXAMPLES=OFF \ -DPXR_BUILD_IMAGING=ON \ -DPXR_BUILD_MONOLITHIC=ON \ @@ -530,11 +514,5 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_libdir}/cmake/pxr/pxrTargets.cmake %{_libdir}/cmake/pxr/pxrTargets-release.cmake -%if %{with documentation} -%files doc -%license LICENSE.txt -%{_docdir}/usd/ -%endif - %changelog %autochangelog From 65b6168ddea70468a19ff9e0def5fafd7ed59dc5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 23 Aug 2023 15:49:28 -0400 Subject: [PATCH 063/167] Update to 23.08 (close RHBZ#2224683) --- .gitignore | 1 + USD-23.05-soversion.patch | 52 ----------------------------------- sources | 2 +- usd-23.08-soversion.patch | 35 +++++++++++++++++++++++ usd.spec | 58 +++++++++++++++++++++++++++------------ 5 files changed, 78 insertions(+), 70 deletions(-) delete mode 100644 USD-23.05-soversion.patch create mode 100644 usd-23.08-soversion.patch diff --git a/.gitignore b/.gitignore index 245c757..b2a2bd2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /usd-22.11.tar.gz /usd-23.02.tar.gz /usd-23.05.tar.gz +/OpenUSD-23.08.tar.gz diff --git a/USD-23.05-soversion.patch b/USD-23.05-soversion.patch deleted file mode 100644 index 011bd82..0000000 --- a/USD-23.05-soversion.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 1be919609dfecfd8df2e119d1f489676d2193629 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Mon, 20 Mar 2023 09:59:18 -0400 -Subject: [PATCH] Support downstream .so versioning - ---- - cmake/defaults/Version.cmake | 6 ++++++ - cmake/macros/Private.cmake | 1 + - cmake/macros/Public.cmake | 1 + - 3 files changed, 8 insertions(+) - -diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 647b8aabe..727ce577f 100644 ---- a/cmake/defaults/Version.cmake -+++ b/cmake/defaults/Version.cmake -@@ -27,3 +27,9 @@ set(PXR_MINOR_VERSION "23") - set(PXR_PATCH_VERSION "05") - - math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") -+ -+set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" -+ CACHE -+ STRING -+ "Downstream shared object version" -+) -diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index 23172745e..e3d8fd648 100644 ---- a/cmake/macros/Private.cmake -+++ b/cmake/macros/Private.cmake -@@ -1299,6 +1299,7 @@ function(_pxr_library NAME) - IMPORT_PREFIX "${args_PREFIX}" - PREFIX "${args_PREFIX}" - SUFFIX "${args_SUFFIX}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - - target_compile_definitions(${NAME} -diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index a1734b6a2..24f51ba75 100644 ---- a/cmake/macros/Public.cmake -+++ b/cmake/macros/Public.cmake -@@ -1003,6 +1003,7 @@ function(pxr_toplevel_prologue) - FOLDER "${folder}" - PREFIX "${libPrefix}" - IMPORT_PREFIX "${libPrefix}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - _get_install_dir("lib" libInstallPrefix) - install( --- -2.39.2 - diff --git a/sources b/sources index d5fc7d7..5f70b2e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (usd-23.05.tar.gz) = fd3e7a90f837a5d016d94be34747b2c1daed3f01f252e4b1aa5cb195f32acaecca9373b8f5c7be9c235148f04b0afa47da9462b357ef1dd1e11cf20a7225ae66 +SHA512 (OpenUSD-23.08.tar.gz) = cf5f2bff2b15427bfbac2155be39b17b0f66e50176a567a4c55fa4d220d89e8b7c82753f42cd0e9398b0e567bd90391ea976155d42b343a5168d41f6a3767957 diff --git a/usd-23.08-soversion.patch b/usd-23.08-soversion.patch new file mode 100644 index 0000000..1512a54 --- /dev/null +++ b/usd-23.08-soversion.patch @@ -0,0 +1,35 @@ +diff -Naur OpenUSD-23.08-original/cmake/defaults/Version.cmake OpenUSD-23.08/cmake/defaults/Version.cmake +--- OpenUSD-23.08-original/cmake/defaults/Version.cmake 2023-07-21 17:08:46.000000000 -0400 ++++ OpenUSD-23.08/cmake/defaults/Version.cmake 2023-08-23 15:54:51.498808451 -0400 +@@ -27,3 +27,9 @@ + set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits + + math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") ++ ++set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" ++ CACHE ++ STRING ++ "Downstream shared object version" ++) +diff -Naur OpenUSD-23.08-original/cmake/macros/Private.cmake OpenUSD-23.08/cmake/macros/Private.cmake +--- OpenUSD-23.08-original/cmake/macros/Private.cmake 2023-07-21 17:08:46.000000000 -0400 ++++ OpenUSD-23.08/cmake/macros/Private.cmake 2023-08-23 15:54:51.498808451 -0400 +@@ -1299,6 +1299,7 @@ + IMPORT_PREFIX "${args_PREFIX}" + PREFIX "${args_PREFIX}" + SUFFIX "${args_SUFFIX}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + + target_compile_definitions(${NAME} +diff -Naur OpenUSD-23.08-original/cmake/macros/Public.cmake OpenUSD-23.08/cmake/macros/Public.cmake +--- OpenUSD-23.08-original/cmake/macros/Public.cmake 2023-07-21 17:08:46.000000000 -0400 ++++ OpenUSD-23.08/cmake/macros/Public.cmake 2023-08-23 15:54:51.499808464 -0400 +@@ -1003,6 +1003,7 @@ + FOLDER "${folder}" + PREFIX "${libPrefix}" + IMPORT_PREFIX "${libPrefix}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + _get_install_dir("lib" libInstallPrefix) + install( diff --git a/usd.spec b/usd.spec index 2a57a63..86a4206 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.23.05 +%global downstream_so_version 0.23.8 %bcond alembic 1 %bcond draco 1 @@ -31,7 +31,7 @@ %bcond test 0 Name: usd -Version: 23.05 +Version: 23.08 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -40,16 +40,21 @@ Summary: 3D VFX pipeline interchange file format # BSD-3-Clause: # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ -# - pxr/base/tf/pxrDoubleConversion/ # - pxr/base/tf/pxrCLI11/ +# - pxr/base/tf/pxrDoubleConversion/ +# - pxr/imaging/hio/OpenEXR/OpenEXRCore/ # BSD-2-Clause: # - pxr/base/tf/pxrLZ4/ # MIT: -# - pxr/imaging/garch/khrplatform.h +# - docs/doxygen/doxygen-awesome-css/ (removed in %%prep) # - pxr/base/js/rapidjson/, except pxr/base/js/rapidjson/msinttypes/ -# - third_party/renderman-24/plugin/rmanArgsParser/pugixml/ +# - pxr/base/tf/pxrPEGTL/ # - pxr/base/tf/pxrTslRobinMap/ +# - pxr/imaging/garch/khrplatform.h # - pxr/imaging/hgiVulkan/vk_mem_alloc.h +# - pxr/imaging/hio/EpenEXR/deflate/ +# - pxr/usd/sdf/invoke.hpp +# - third_party/renderman-24/plugin/rmanArgsParser/pugixml/ # MIT OR Unlicense: # - pxr/imaging/hio/stb/ # Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2: @@ -61,8 +66,8 @@ Summary: 3D VFX pipeline interchange file format # do not contribute their license terms to the built RPMs.) License: Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) URL: http://www.openusd.org/ -%global forgeurl https://github.com/PixarAnimationStudios/usd -Source0: %{forgeurl}/archive/v%{version}/usd-%{version}.tar.gz +%global forgeurl https://github.com/PixarAnimationStudios/OpenUSD +Source0: %{forgeurl}/archive/v%{version}/OpenUSD-%{version}.tar.gz Source1: org.openusd.usdview.desktop # Latest stb_image.patch that applies cleanly against 2.27: # %%{forgeurl}/raw/8f9bb9563980b41e7695148b63bf09f7abd38a41/pxr/imaging/hio/stb/stb_image.patch @@ -96,7 +101,7 @@ Source2: stb_image.patch # to be versioned as well, which is undesired. This is not a serious problem # because we do not want to package the built plugin anyway. (It should not be # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) -Patch: USD-23.05-soversion.patch +Patch: usd-23.08-soversion.patch # Port to Embree 4.x # https://github.com/PixarAnimationStudios/USD/pull/2266 @@ -120,7 +125,6 @@ BuildRequires: hdf5-devel BuildRequires: opensubdiv-devel BuildRequires: pkgconfig(tbb) -BuildRequires: cmake(OpenEXR) >= 3.0 BuildRequires: cmake(Imath) >= 3.0 %if %{with alembic} @@ -191,9 +195,12 @@ description for interchange between graphics applications. %package libs Summary: Universal Scene Description library -# Upstream bundles # Filed ticket to convince upstream to use system libraries -# https://github.com/PixarAnimationStudios/USD/issues/1490 +# Use system libraries instead of bundling them when possible +# https://github.com/PixarAnimationStudios/USD/issues/1490 +# See also: +# Path to using external/system copies of OpenEXRCore and libdeflate? +# https://github.com/PixarAnimationStudios/OpenUSD/issues/2619 # Version from: pxr/base/tf/pxrDoubleConversion/README Provides: bundled(double-conversion) = 2.0.0 # Version from: pxr/base/gf/ilmbase_half.README @@ -213,9 +220,21 @@ Provides: bundled(rapidjson) = 1.1.0 Provides: bundled(SPIRV-Reflect) = 1.0 # Version from: pxr/imaging/hgiVulkan/vk_mem_alloc.h (header comment) Provides: bundled(VulkanMemoryAllocator) = 3.0.0~development -# Forked from an unknown version: -# pxr/base/tf/pxrTslRobinMap/ +# Forked from an unknown version: pxr/base/tf/pxrTslRobinMap/ Provides: bundled(robin-map) +# Version from: pxr/base/tf/pxrPEGTL/pegtl.h (TAO_PEGTL_VERSION) +Provides: bundled(PEGTL) = 2.8.3 +# Version from pxr/imaging/hio/OpenEXR/OpenEXRCore/openexr_version.h +Provides: bundled(openexr) = 3.2.0 +# Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h +Provides: bundled(libdeflate) = 1.18 +# Forked from https://github.com/blackmatov/invoke.hpp, which upstream has +# never versioned; however, a copyright statement appears in the header comment +# in pxr/usd/sdf/invoke.hpp with a date of 2023, and the only upstream commit +# with the same date (as of this writing) is +# 2c1eabc2e20ab02961f95c704ff0c0818671ddd1, so we infer that the bundled copy +# was forked from that commit. +Provides: bundled(invoke-hpp) = 0^20230107git2c1eabc %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -266,7 +285,7 @@ Requires: python3dist(pyopengl) Python language bindings for the Universal Scene Description (USD) C++ API %prep -%autosetup -p1 -n USD-%{version} +%autosetup -p1 -n OpenUSD-%{version} # Convert NOTICE.txt from CRNL line encoding dos2unix NOTICE.txt @@ -294,6 +313,10 @@ ln -svf %{_includedir}/stb_image_resize.h \ %{_includedir}/stb_image_write.h ./ popd +# Remove bundled doxygen-awesome-css (CSS and JS files) since we are not +# building Doxygen-generated HTML documentation. +rm -rf docs/doxygen/doxygen-awesome-css/ + # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ cmake/defaults/CXXDefaults.cmake @@ -327,10 +350,11 @@ chmod +x uic-wrapper %build -# Although upstream supports OpenEXR3 / Imath now, the necessary include path -# is not set everywhere it’s needed. It’s not immediately clear exactly why -# this is happening here or what should be changed upstream. +# The necessary include path for Imath is not set everywhere it’s needed. It’s +# not immediately clear exactly why this is happening here or what should be +# changed upstream. extra_flags="${extra_flags-} $(pkgconf --cflags Imath)" + # Suppress deprecation warnings from TBB; upstream should act on them # eventually, but they just add noise here. extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" From fbd57c96cfdf645ac2397677ce03e88e01ccb6b3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 25 Oct 2023 12:24:09 -0400 Subject: [PATCH 064/167] Ensure stb_image contains the latest CVE patches --- usd.spec | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/usd.spec b/usd.spec index 86a4206..0c84fd5 100644 --- a/usd.spec +++ b/usd.spec @@ -167,10 +167,19 @@ BuildRequires: pkgconfig(Ptex) # Header-only library: -static is for tracking per guidelines # -# Enforce the the minimum EVR to contain fixes for all of CVE-2021-28021, -# CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041, plus the null-pointer -# dereference bug https://github.com/nothings/stb/issues/1452. -BuildRequires: stb_image-devel >= 2.28^20230129git5736b15-0.2 +# Enforce the the minimum EVR to contain fixes for all of: +# CVE-2021-28021 +# CVE-2021-42715 +# CVE-2021-42716 +# CVE-2022-28041 +# CVE-2023-43898 +# CVE-2023-45661 +# CVE-2023-45662 +# CVE-2023-45663 +# CVE-2023-45664 +# CVE-2023-45666 +# CVE-2023-45667 +BuildRequires: stb_image-devel >= 2.28^20231011gitbeebb24-12 BuildRequires: stb_image-static BuildRequires: stb_image_write-devel >= 1.16 BuildRequires: stb_image_write-static From ec9a2d0bd6b48dae56ef44dfc12f68c9d72d7e75 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 26 Oct 2023 06:57:42 -0400 Subject: [PATCH 065/167] Add versioned Requires on usd-libs from python3-usd --- usd.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usd.spec b/usd.spec index 0c84fd5..7e6a0f7 100644 --- a/usd.spec +++ b/usd.spec @@ -288,6 +288,9 @@ Requires: python3dist(pyside2) %endif %endif Requires: python3dist(pyopengl) + +Requires: usd-libs%{?_isa} = %{version}-%{release} + %py_provides python3-pxr %description -n python3-usd From 5ff2acbf1be41045549e7bfe2fec5d41e38f97c7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 29 Nov 2022 16:51:06 -0500 Subject: [PATCH 066/167] Update License to SPDX --- usd.spec | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/usd.spec b/usd.spec index 6d5dac9..6ced584 100644 --- a/usd.spec +++ b/usd.spec @@ -25,12 +25,13 @@ Version: 22.05b Release: %autorelease -b 9 Summary: 3D VFX pipeline interchange file format -# The entire source is ASL 2.0 except: +# The entire source is Apache-2.0 except: # -# BSD: +# BSD-3-Clause: # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ # - pxr/base/tf/pxrDoubleConversion/ +# BSD-2-Clause: # - pxr/base/tf/pxrLZ4/ # MIT: # - pxr/imaging/garch/khrplatform.h @@ -38,20 +39,16 @@ Summary: 3D VFX pipeline interchange file format # - third_party/renderman-24/plugin/rmanArgsParser/pugixml/ # - pxr/base/tf/pxrTslRobinMap/ # - pxr/imaging/hgiVulkan/vk_mem_alloc.h -# MIT or Unlicense: +# MIT OR Unlicense: # - pxr/imaging/hio/stb/ -# -# (Certain build system files are also under licenses other than ASL 2.0, but -# do not contribute their license terms to the built RPMs.) -# -# The following files mention GPLv3+, but are distributed under ASL 2.0 due to -# the special exception for Bison parser skeletons. See the comments in their -# headers for details. -# +# Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} # - third_party/renderman-24/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} -License: ASL 2.0 and BSD and MIT and (MIT or Unlicense) +# +# (Certain build system files are also under licenses other than Apache-2.0, but +# do not contribute their license terms to the built RPMs.) +License: Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/%{name} Source0: %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz From 145487ddf11d8467d5c9ebc1f7388f6bfa5ddfb9 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 26 Oct 2023 06:57:42 -0400 Subject: [PATCH 067/167] Add versioned Requires on usd-libs from python3-usd --- usd.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usd.spec b/usd.spec index 6ced584..6325f49 100644 --- a/usd.spec +++ b/usd.spec @@ -254,6 +254,9 @@ Requires: python3dist(jinja2) Requires: python3dist(pyside2) %endif Requires: python3dist(pyopengl) + +Requires: usd-libs%{?_isa} = %{version}-%{release} + %py_provides python3-pxr %description -n python3-%{name} From 084872b62c94497e132dee1b3f877ac0e7b459c2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 25 Oct 2023 12:24:09 -0400 Subject: [PATCH 068/167] Ensure stb_image contains the latest CVE patches --- usd.spec | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/usd.spec b/usd.spec index 6325f49..aecf934 100644 --- a/usd.spec +++ b/usd.spec @@ -167,10 +167,19 @@ BuildRequires: hdf5-devel # Header-only library: -static is for tracking per guidelines # -# Enforce the the minimum EVR to contain fixes for all of CVE-2021-28021, -# CVE-2021-42715, CVE-2021-42716, and CVE-2022-28041, plus the null-pointer -# dereference bug https://github.com/nothings/stb/issues/1452. -BuildRequires: stb_image-devel >= 2.28^20230129git5736b15-0.2 +# Enforce the the minimum EVR to contain fixes for all of: +# CVE-2021-28021 +# CVE-2021-42715 +# CVE-2021-42716 +# CVE-2022-28041 +# CVE-2023-43898 +# CVE-2023-45661 +# CVE-2023-45662 +# CVE-2023-45663 +# CVE-2023-45664 +# CVE-2023-45666 +# CVE-2023-45667 +BuildRequires: stb_image-devel >= 2.28^20231011gitbeebb24-12 BuildRequires: stb_image-static BuildRequires: stb_image_write-devel >= 1.16 BuildRequires: stb_image_write-static From 952ea4b1e398e69d37fbc6c5afcadc7c563aa1da Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 15:15:47 -0400 Subject: [PATCH 069/167] Rebuild for openvdb-10.1.0 (close RHBZ#2246616) From 959bb82b9d52fe7e68b0bc0439f031a1ec2dc735 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 30 Oct 2023 07:24:43 -0400 Subject: [PATCH 070/167] Break a long line in the spec file [skip changelog] --- usd.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 7e6a0f7..ebc0050 100644 --- a/usd.spec +++ b/usd.spec @@ -64,7 +64,14 @@ Summary: 3D VFX pipeline interchange file format # # (Certain build system files are also under licenses other than Apache-2.0, but # do not contribute their license terms to the built RPMs.) -License: Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) +License: %{shrink: + Apache-2.0 AND + BSD-3-Clause AND + BSD-2-Clause AND + MIT AND + (MIT OR Unlicense) AND + (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) + } URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/OpenUSD Source0: %{forgeurl}/archive/v%{version}/OpenUSD-%{version}.tar.gz From eb100cb32c8d621a34fae8812ca331dc93b327ef Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 13:42:55 -0400 Subject: [PATCH 071/167] Update to 23.11 (close RHBZ#2246597) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 79 +++++++++++++++++++ sources | 2 +- usd-23.08-soversion.patch | 35 -------- usd.spec | 8 +- 5 files changed, 86 insertions(+), 39 deletions(-) create mode 100644 0001-Downstream-only-add-an-SONAME-version.patch delete mode 100644 usd-23.08-soversion.patch diff --git a/.gitignore b/.gitignore index b2a2bd2..786e509 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /usd-23.02.tar.gz /usd-23.05.tar.gz /OpenUSD-23.08.tar.gz +/OpenUSD-23.11.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch new file mode 100644 index 0000000..a6d931b --- /dev/null +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -0,0 +1,79 @@ +From 7bb13a999b2d3afe13ddad0a7bd8da1e4f99ff09 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 27 Oct 2023 12:56:58 -0400 +Subject: [PATCH] Downstream-only: add an SONAME version +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream was asked about .so versioning and setting SONAME properly and +seemed unprepared to handle the request: +https://github.com/PixarAnimationStudios/USD/issues/1259#issuecomment-657120216 + +A patch was offered: +https://github.com/PixarAnimationStudios/USD/issues/1387 +but it was not sufficient for the general case, since (1) it only handled the +monolithic build, and (2) it derived the .so version from PXR_MAJOR_VERSION, +which is *not* reliably bumped on API or ABI changes, and currently is still +zero. + +We will therefore probably need to keep doing downstream .so versioning for +the foreseeable future. Currently we are assuming that the ABI is likely to +change on every release (an appropriate assumption for a large C++ project +with no ABI stability policy), so we build the .so version from the project +version. Note that the “hidden” major version is zero, so this complies with +the “0.” prefix recommended in the packaging guidelines. + +https://docs.fedoraproject.org/en-US/packaging-guidelines/#_downstream_so_name_versioning + +A known defect of this patch is that it causes the hdTiny.so example plugin +to be versioned as well, which is undesired. This is not a serious problem +because we do not want to package the built plugin anyway. (It should not be +built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) +--- + cmake/defaults/Version.cmake | 6 ++++++ + cmake/macros/Private.cmake | 1 + + cmake/macros/Public.cmake | 1 + + 3 files changed, 8 insertions(+) + +diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake +index 1406ac2a9..197377ff2 100644 +--- a/cmake/defaults/Version.cmake ++++ b/cmake/defaults/Version.cmake +@@ -27,3 +27,9 @@ set(PXR_MINOR_VERSION "23") + set(PXR_PATCH_VERSION "11") # NOTE: Must not have leading 0 for single digits + + math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") ++ ++set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" ++ CACHE ++ STRING ++ "Downstream shared object version" ++) +diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake +index 21606d4d6..4cf8aeeb6 100644 +--- a/cmake/macros/Private.cmake ++++ b/cmake/macros/Private.cmake +@@ -1299,6 +1299,7 @@ function(_pxr_library NAME) + IMPORT_PREFIX "${args_PREFIX}" + PREFIX "${args_PREFIX}" + SUFFIX "${args_SUFFIX}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + + target_compile_definitions(${NAME} +diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake +index 2080d7a36..2642b603f 100644 +--- a/cmake/macros/Public.cmake ++++ b/cmake/macros/Public.cmake +@@ -1007,6 +1007,7 @@ function(pxr_toplevel_prologue) + FOLDER "${folder}" + PREFIX "${libPrefix}" + IMPORT_PREFIX "${libPrefix}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + ) + _get_install_dir("lib" libInstallPrefix) + install( +-- +2.41.0 + diff --git a/sources b/sources index 5f70b2e..f9f1440 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-23.08.tar.gz) = cf5f2bff2b15427bfbac2155be39b17b0f66e50176a567a4c55fa4d220d89e8b7c82753f42cd0e9398b0e567bd90391ea976155d42b343a5168d41f6a3767957 +SHA512 (OpenUSD-23.11.tar.gz) = a6f718c8c227cabcc467de80bd5197470bcf335aaf1738e49e37d8d0fa4b47a0c0d9dc1518032de8c603e3ef303d22f9960504caeede4c5053ab1d3c84987304 diff --git a/usd-23.08-soversion.patch b/usd-23.08-soversion.patch deleted file mode 100644 index 1512a54..0000000 --- a/usd-23.08-soversion.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -Naur OpenUSD-23.08-original/cmake/defaults/Version.cmake OpenUSD-23.08/cmake/defaults/Version.cmake ---- OpenUSD-23.08-original/cmake/defaults/Version.cmake 2023-07-21 17:08:46.000000000 -0400 -+++ OpenUSD-23.08/cmake/defaults/Version.cmake 2023-08-23 15:54:51.498808451 -0400 -@@ -27,3 +27,9 @@ - set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits - - math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") -+ -+set(PXR_DOWNSTREAM_SOVERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}" -+ CACHE -+ STRING -+ "Downstream shared object version" -+) -diff -Naur OpenUSD-23.08-original/cmake/macros/Private.cmake OpenUSD-23.08/cmake/macros/Private.cmake ---- OpenUSD-23.08-original/cmake/macros/Private.cmake 2023-07-21 17:08:46.000000000 -0400 -+++ OpenUSD-23.08/cmake/macros/Private.cmake 2023-08-23 15:54:51.498808451 -0400 -@@ -1299,6 +1299,7 @@ - IMPORT_PREFIX "${args_PREFIX}" - PREFIX "${args_PREFIX}" - SUFFIX "${args_SUFFIX}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - - target_compile_definitions(${NAME} -diff -Naur OpenUSD-23.08-original/cmake/macros/Public.cmake OpenUSD-23.08/cmake/macros/Public.cmake ---- OpenUSD-23.08-original/cmake/macros/Public.cmake 2023-07-21 17:08:46.000000000 -0400 -+++ OpenUSD-23.08/cmake/macros/Public.cmake 2023-08-23 15:54:51.499808464 -0400 -@@ -1003,6 +1003,7 @@ - FOLDER "${folder}" - PREFIX "${libPrefix}" - IMPORT_PREFIX "${libPrefix}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} - ) - _get_install_dir("lib" libInstallPrefix) - install( diff --git a/usd.spec b/usd.spec index ebc0050..4c1cbf4 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.23.8 +%global downstream_so_version 0.23.11 %bcond alembic 1 %bcond draco 1 @@ -31,7 +31,7 @@ %bcond test 0 Name: usd -Version: 23.08 +Version: 23.11 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -84,6 +84,8 @@ Source1: org.openusd.usdview.desktop # stbi_set_unpremultiply_on_load_thread. Source2: stb_image.patch +# Downstream-only: add an SONAME version +# # Upstream was asked about .so versioning and setting SONAME properly and # seemed unprepared to handle the request: # https://github.com/PixarAnimationStudios/USD/issues/1259#issuecomment-657120216 @@ -108,7 +110,7 @@ Source2: stb_image.patch # to be versioned as well, which is undesired. This is not a serious problem # because we do not want to package the built plugin anyway. (It should not be # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) -Patch: usd-23.08-soversion.patch +Patch: 0001-Downstream-only-add-an-SONAME-version.patch # Port to Embree 4.x # https://github.com/PixarAnimationStudios/USD/pull/2266 From 7cad7d9db958b132580a8d0565fdb05832af54af Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 10 Nov 2023 07:51:48 -0500 Subject: [PATCH 072/167] =?UTF-8?q?Correct=20license=20to=20Pixar=20AND=20?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The “Modified Apache 2.0” license is not really Apache 2.0. https://gitlab.com/fedora/legal/fedora-license-data/-/issues/304 https://github.com/spdx/license-list-XML/issues/2225 https://github.com/spdx/license-list-XML/pull/2247 --- usd.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 4c1cbf4..f0db461 100644 --- a/usd.spec +++ b/usd.spec @@ -35,8 +35,10 @@ Version: 23.11 Release: %autorelease Summary: 3D VFX pipeline interchange file format -# The entire source is Apache-2.0 except: +# The entire source is Pixar except: # +# Apache-2.0: +# - pxr/imaging/hgiVulkan/spirv_reflect.{cpp,h} # BSD-3-Clause: # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ @@ -57,20 +59,31 @@ Summary: 3D VFX pipeline interchange file format # - third_party/renderman-24/plugin/rmanArgsParser/pugixml/ # MIT OR Unlicense: # - pxr/imaging/hio/stb/ -# Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2: +# Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} # - third_party/renderman-24/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} # +# Additionally, the following would be listed above but are removed in %%prep: +# +# Apache-2.0: +# - pxr/usdImaging/usdviewq/fonts/Roboto_Mono/ +# - pxr/usdImaging/usdviewq/fonts/Roboto/ +# MIT: +# - docs/doxygen/doxygen-awesome-css/ (except doxygen-awesome-darkmode-toggle.js) +# MIT AND Apache-2.0: +# - docs/doxygen/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js +# # (Certain build system files are also under licenses other than Apache-2.0, but # do not contribute their license terms to the built RPMs.) License: %{shrink: + Pixar AND Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND - (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) + (Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2) } URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/OpenUSD From 90bb66f821cc99549b6500661356311b082f9ddc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 30 Oct 2023 07:24:43 -0400 Subject: [PATCH 073/167] Break a long line in the spec file [skip changelog] --- usd.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index aecf934..161bcc0 100644 --- a/usd.spec +++ b/usd.spec @@ -48,7 +48,14 @@ Summary: 3D VFX pipeline interchange file format # # (Certain build system files are also under licenses other than Apache-2.0, but # do not contribute their license terms to the built RPMs.) -License: Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) +License: %{shrink: + Apache-2.0 AND + BSD-3-Clause AND + BSD-2-Clause AND + MIT AND + (MIT OR Unlicense) AND + (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) + } URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/%{name} Source0: %{forgeurl}/archive/v%{version}/%{name}-%{version}.tar.gz From c7ee7db80be464e4a70c6848e13ddabaf6c98448 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 10 Nov 2023 07:51:48 -0500 Subject: [PATCH 074/167] =?UTF-8?q?Correct=20license=20to=20Pixar=20AND=20?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The “Modified Apache 2.0” license is not really Apache 2.0. https://gitlab.com/fedora/legal/fedora-license-data/-/issues/304 https://github.com/spdx/license-list-XML/issues/2225 https://github.com/spdx/license-list-XML/pull/2247 --- usd.spec | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 161bcc0..8b59f46 100644 --- a/usd.spec +++ b/usd.spec @@ -25,8 +25,10 @@ Version: 22.05b Release: %autorelease -b 9 Summary: 3D VFX pipeline interchange file format -# The entire source is Apache-2.0 except: +# The entire source is Pixar except: # +# Apache-2.0: +# - pxr/imaging/hgiVulkan/spirv_reflect.{cpp,h} # BSD-3-Clause: # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ @@ -41,20 +43,31 @@ Summary: 3D VFX pipeline interchange file format # - pxr/imaging/hgiVulkan/vk_mem_alloc.h # MIT OR Unlicense: # - pxr/imaging/hio/stb/ -# Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2: +# Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} # - third_party/renderman-24/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} # +# Additionally, the following would be listed above but are removed in %%prep: +# +# Apache-2.0: +# - pxr/usdImaging/usdviewq/fonts/Roboto_Mono/ +# - pxr/usdImaging/usdviewq/fonts/Roboto/ +# MIT: +# - docs/doxygen/doxygen-awesome-css/ (except doxygen-awesome-darkmode-toggle.js) +# MIT AND Apache-2.0: +# - docs/doxygen/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js +# # (Certain build system files are also under licenses other than Apache-2.0, but # do not contribute their license terms to the built RPMs.) License: %{shrink: + Pixar AND Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND MIT AND (MIT OR Unlicense) AND - (Apache-2.0 AND GPL-3.0-or-later WITH Bison-exception-2.2) + (Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2) } URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/%{name} From 1c7e24ea4b24cbac33fcd5e9600db93310a705d3 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 17 Jan 2024 23:11:44 +0000 Subject: [PATCH 075/167] Build against tbb2020.3 instead of tbb (#2036372) --- USD-23.05-tbb2020.3.patch | 22 ++++++++++++++++++++++ usd.spec | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 USD-23.05-tbb2020.3.patch diff --git a/USD-23.05-tbb2020.3.patch b/USD-23.05-tbb2020.3.patch new file mode 100644 index 0000000..0cd0c67 --- /dev/null +++ b/USD-23.05-tbb2020.3.patch @@ -0,0 +1,22 @@ +--- USD-23.05/cmake/modules/FindTBB.cmake~ 2023-06-28 13:02:04.191419402 +0100 ++++ USD-23.05/cmake/modules/FindTBB.cmake 2023-06-28 13:02:06.336423412 +0100 +@@ -197,7 +197,18 @@ + ################################## + + if(TBB_INCLUDE_DIRS) +- file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) ++ # Starting in 2020.1.1, tbb_stddef.h is replaced by version.h ++ set(_version_files "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" ++ "${TBB_INCLUDE_DIRS}/tbb/version.h" ++ "${TBB_INCLUDE_DIRS}/oneapi/tbb/version.h") ++ foreach(f IN ITEMS ${_version_files}) ++ if(EXISTS ${f}) ++ set(_version_file ${f}) ++ endif() ++ endforeach() ++ unset(_version_files) ++ ++ file(READ ${_version_file} _tbb_version_file) + string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" + TBB_VERSION_MAJOR "${_tbb_version_file}") + string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" diff --git a/usd.spec b/usd.spec index f0db461..dbd5a7d 100644 --- a/usd.spec +++ b/usd.spec @@ -129,6 +129,8 @@ Patch: 0001-Downstream-only-add-an-SONAME-version.patch # https://github.com/PixarAnimationStudios/USD/pull/2266 Patch: %{forgeurl}/pull/2266.patch +Patch: USD-23.05-tbb2020.3.patch + # Base BuildRequires: gcc-c++ @@ -145,7 +147,7 @@ BuildRequires: boost-devel BuildRequires: pkgconfig(dri) BuildRequires: hdf5-devel BuildRequires: opensubdiv-devel -BuildRequires: pkgconfig(tbb) +BuildRequires: pkgconfig(tbb) = 2020.3 BuildRequires: cmake(Imath) >= 3.0 From c0837caaffff7a99e6944b809691bee5ce2993e8 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Sun, 21 Jan 2024 14:21:00 -0800 Subject: [PATCH 076/167] Rebuild for draco 1.5.7 From cbeaf5245767133119517c648201f415b5eb73bd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 07:19:30 +0000 Subject: [PATCH 077/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 4dd1d7e818aa1c148b848bc30ff38bae76e77411 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 29 Jan 2024 22:07:04 -0600 Subject: [PATCH 078/167] Rebuild for OpenImageIO 2.5.x. From bf2ba03146ad314e550c82a6a72e9bbe01f1af1d Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 29 Jan 2024 22:08:27 -0600 Subject: [PATCH 079/167] Rebuild for OpenImageIO 2.5.x. --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index dbd5a7d..22ed5c2 100644 --- a/usd.spec +++ b/usd.spec @@ -172,7 +172,7 @@ BuildRequires: cmake(OpenColorIO) %endif %if %{with oiio} -BuildRequires: pkgconfig(OpenImageIO) +BuildRequires: cmake(OpenImageIO) %endif %if %{with openshading} From 64291d3ebda1db572098a54c49dc479b2c7684d5 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 15 Mar 2024 17:47:48 -0400 Subject: [PATCH 080/167] Fix flatpak build stb_image is a header-only library, so it remains buildroot only even in flatpak builds of usd. There is no pkgconfig either, so the /usr prefix must be hardcoded. --- usd.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usd.spec b/usd.spec index 22ed5c2..6420180 100644 --- a/usd.spec +++ b/usd.spec @@ -343,10 +343,10 @@ ln -s %{_datadir}/fonts/google-roboto-mono \ # Unbundle stb_image, stb_image_write, stb_image_resize: pushd pxr/imaging/hio/stb -cp -p %{_includedir}/stb_image.h . +cp -p %{_usr}/include/stb_image.h . patch -p1 < '%{SOURCE2}' -ln -svf %{_includedir}/stb_image_resize.h \ - %{_includedir}/stb_image_write.h ./ +ln -svf %{_usr}/include/stb_image_resize.h \ + %{_usr}/include/stb_image_write.h ./ popd # Remove bundled doxygen-awesome-css (CSS and JS files) since we are not From d2b6fdaf414e48f7ad4da1eaee2be65728823e93 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Fri, 29 Mar 2024 01:40:12 -0700 Subject: [PATCH 081/167] Rebuild for openshadinglanguage 1.13.7.0 From 5a3458e9328852b7db6adff7186ac08ac9cbe2c2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 2 Apr 2024 12:55:54 -0400 Subject: [PATCH 082/167] Rebuild for OpenVDB 11 with backward-compatible ABI (fix RHBZ#2272507) From fa08a84b23417a97791125afd7c82b495169d4ac Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 24 Feb 2024 11:12:07 -0500 Subject: [PATCH 083/167] Update to 24.03 (close RHBZ#2265775) --- .gitignore | 1 + 0001-Downstream-only-add-an-SONAME-version.patch | 14 +++++++------- sources | 2 +- usd.spec | 12 +++++++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 786e509..9be7cd4 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /usd-23.05.tar.gz /OpenUSD-23.08.tar.gz /OpenUSD-23.11.tar.gz +/OpenUSD-24.03.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index a6d931b..97de588 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 7bb13a999b2d3afe13ddad0a7bd8da1e4f99ff09 Mon Sep 17 00:00:00 2001 +From 144bf56aa281390aad13558fe11e190e507ca17c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 8 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 1406ac2a9..197377ff2 100644 +index b9516997a..97c9df203 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake -@@ -27,3 +27,9 @@ set(PXR_MINOR_VERSION "23") - set(PXR_PATCH_VERSION "11") # NOTE: Must not have leading 0 for single digits +@@ -27,3 +27,9 @@ set(PXR_MINOR_VERSION "24") + set(PXR_PATCH_VERSION "3") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -63,10 +63,10 @@ index 21606d4d6..4cf8aeeb6 100644 target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index 2080d7a36..2642b603f 100644 +index 97263d4cd..80abe790c 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake -@@ -1007,6 +1007,7 @@ function(pxr_toplevel_prologue) +@@ -1017,6 +1017,7 @@ function(pxr_toplevel_prologue) FOLDER "${folder}" PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" @@ -75,5 +75,5 @@ index 2080d7a36..2642b603f 100644 _get_install_dir("lib" libInstallPrefix) install( -- -2.41.0 +2.43.2 diff --git a/sources b/sources index f9f1440..40787dd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-23.11.tar.gz) = a6f718c8c227cabcc467de80bd5197470bcf335aaf1738e49e37d8d0fa4b47a0c0d9dc1518032de8c603e3ef303d22f9960504caeede4c5053ab1d3c84987304 +SHA512 (OpenUSD-24.03.tar.gz) = 3dada1fbfbd73a74e45d4e0c53466be1be3dc92140644e56a8d5d04c09d62e11181d760cf5709a9ae9c43f261f18a2c60131bafd996221fe63e22d45975c5f74 diff --git a/usd.spec b/usd.spec index 6420180..5aba881 100644 --- a/usd.spec +++ b/usd.spec @@ -2,13 +2,14 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.23.11 +%global downstream_so_version 0.24.3 %bcond alembic 1 %bcond draco 1 %bcond embree 1 %bcond jemalloc 0 # Not yet packaged: https://github.com/AcademySoftwareFoundation/MaterialX +# https://bugzilla.redhat.com/show_bug.cgi?id=2262694 %bcond materialx 0 # Default "UNIX Makefiles" backend for CMake would also work fine; ninja is a # bit faster. We conditionalize it just in case there are backend-specific @@ -19,7 +20,7 @@ %bcond ocio 1 %bcond oiio 1 %bcond ptex 1 -# Not yet packaged +# Not yet packaged: https://bugzilla.redhat.com/show_bug.cgi?id=2265554 %bcond pyside6 0 # F39FailsToInstall: python3-pyside2, python3-shiboken2, # python3-shiboken2-devel @@ -31,7 +32,7 @@ %bcond test 0 Name: usd -Version: 23.11 +Version: 24.03 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -146,7 +147,7 @@ BuildRequires: pkgconfig(blosc) BuildRequires: boost-devel BuildRequires: pkgconfig(dri) BuildRequires: hdf5-devel -BuildRequires: opensubdiv-devel +BuildRequires: opensubdiv-devel >= 3.6.0 BuildRequires: pkgconfig(tbb) = 2020.3 BuildRequires: cmake(Imath) >= 3.0 @@ -412,7 +413,8 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=ON \ \ - -DPXR_BUILD_DOCUMENTATION=FALSE \ + -DPXR_BUILD_HTML_DOCUMENTATION=FALSE \ + -DPXR_BUILD_PYTHON_DOCUMENTATION=FALSE \ -DPXR_BUILD_EXAMPLES=OFF \ -DPXR_BUILD_IMAGING=ON \ -DPXR_BUILD_MONOLITHIC=ON \ From c9a7a6eb36b915e22a901aff9835e81ad86de824 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Feb 2024 09:59:14 -0500 Subject: [PATCH 084/167] Re-enable usdview with PySide6 --- usd.spec | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/usd.spec b/usd.spec index 5aba881..4e120ac 100644 --- a/usd.spec +++ b/usd.spec @@ -20,12 +20,8 @@ %bcond ocio 1 %bcond oiio 1 %bcond ptex 1 -# Not yet packaged: https://bugzilla.redhat.com/show_bug.cgi?id=2265554 -%bcond pyside6 0 -# F39FailsToInstall: python3-pyside2, python3-shiboken2, -# python3-shiboken2-devel -# https://bugzilla.redhat.com/show_bug.cgi?id=2220452 -%bcond usdview 0 +%bcond pyside6 1 +%bcond usdview 1 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the # command-line tools in the buildroot. From 72d8ee112c156088cd536ed43605bc44406a6dab Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 21 Apr 2024 14:30:55 -0400 Subject: [PATCH 085/167] Rebuild for OpenVDB 11 without backward-compatible ABI From 4442408809b89ae3da5fbf62d420201a8ad309e6 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 25 Apr 2024 08:23:31 -0400 Subject: [PATCH 086/167] Rebuilt for OpenColorIO 2.3.2 See RHBZ#2239262 for discussion. From 470014a4cc17db4144957a4dc142361fbd5191c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cabello?= Date: Thu, 16 May 2024 08:21:12 +0000 Subject: [PATCH 087/167] Update usd.spec Fixes installation path before building. Necessary to work with some USD related projects. --- usd.spec | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/usd.spec b/usd.spec index 4e120ac..b42dd1d 100644 --- a/usd.spec +++ b/usd.spec @@ -355,16 +355,24 @@ sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ cmake/defaults/CXXDefaults.cmake # Fix libdir installation -sed -i 's|lib/usd|%{_libdir}/usd|g' cmake/macros/Private.cmake -sed -i 's|"lib"|%{_libdir}|g' cmake/macros/Private.cmake +sed -i 's|lib/usd|%{_libdir}/usd|g' \ + cmake/macros/{Private,Public}.cmake sed -i 's|plugin/usd|%{_libdir}/usd/plugin|g' \ - cmake/macros/Private.cmake + cmake/macros/{Private,Public}.cmake +sed -i 's|"lib"|%{_libdir}|g' \ + cmake/macros/{Private,Public}.cmake sed -i 's|/python|/python%{python3_version}/site-packages|g' \ - cmake/macros/Private.cmake -sed -i 's|lib/usd|%{_libdir}/usd|g' cmake/macros/Public.cmake -sed -i 's|"lib"|%{_libdir}|g' cmake/macros/Public.cmake -sed -i 's|plugin/usd|%{_libdir}/usd/plugin|g' \ - cmake/macros/Public.cmake + cmake/macros/{Private,Public}.cmake pxr/usdImaging/usdviewq/CMakeLists.txt +sed -i 's|/pxrConfig.cmake|%{_libdir}/cmake/pxr/pxrConfig.cmake|g' \ + pxr/CMakeLists.txt +sed -i 's|"cmake"|"%{_libdir}/cmake/pxr"|g' \ + pxr/CMakeLists.txt +sed -i 's|${PXR_CMAKE_DIR}/cmake|${PXR_CMAKE_DIR}|g' \ + pxr/pxrConfig.cmake.in +sed -i 's|${PXR_CMAKE_DIR}/include|/usr/include|g' \ + pxr/pxrConfig.cmake.in +sed -i 's|EXACT COMPONENTS|COMPONENTS|g' \ + pxr/pxrConfig.cmake.in # Fix cmake directory destination sed -i 's|"${CMAKE_INSTALL_PREFIX}"|%{_libdir}/cmake/pxr|g' pxr/CMakeLists.txt @@ -462,20 +470,6 @@ desktop-file-install \ # -DPXR_BUILD_EXAMPLES=OFF. rm -vrf '%{buildroot}%{_datadir}/usd/examples' -# Fix installation path for some files -mv %{buildroot}%{_prefix}/lib/python/pxr/*.* \ - %{buildroot}%{python3_sitearch}/pxr/ -%if %{with usdview} -mv %{buildroot}%{_prefix}/lib/python/pxr/Usdviewq/* \ - %{buildroot}%{python3_sitearch}/pxr/Usdviewq/ -%endif - -# TODO: Can we figure out how to fix the installation path for -# pxrTargets{,-release}.cmake, instead of moving them after the fact? We choose -# to put them in the same directory as pxrConfig.cmake. -find %{buildroot}%{_prefix}/cmake -mindepth 1 -maxdepth 1 -type f \ - -exec mv -v '{}' '%{buildroot}%{_libdir}/cmake/pxr' ';' - # Generate and install man pages. While generating the man pages might more # properly go in %%build, it is generally much easier to do this here in a # single step, using the entry points installed into the buildroot. This is From 968fc3902897dc2a943e364401ce73266d4bb8d9 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Wed, 12 Jun 2024 08:52:20 -0700 Subject: [PATCH 088/167] Rebuild for openvdb with required tbb2020.3 From a0d38c9d74fa5e7a3c042fb68e3504241f257e6f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 24 Jun 2024 15:17:42 -0400 Subject: [PATCH 089/167] Correct pkgconfig(Ptext) to pkgconfig(ptex) for ptex-2.4.3 --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index b42dd1d..50d4aef 100644 --- a/usd.spec +++ b/usd.spec @@ -182,7 +182,7 @@ BuildRequires: openvdb-devel %endif %if %{with ptex} -BuildRequires: pkgconfig(Ptex) +BuildRequires: pkgconfig(ptex) %endif From f61a75174a8970757dd90fadb659bdfa34c7f63d Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 26 Jun 2024 16:41:47 -0400 Subject: [PATCH 090/167] Rebuilt for Python 3.13 (close RHBZ#2292015) From 0e24d85be8b9d47fcb483cc0c5c43cb4ccd4359f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 08:26:35 +0000 Subject: [PATCH 091/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From af00d39d051dadf53fc4d2f203115cad80460e2e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 30 Jul 2024 13:01:12 -0400 Subject: [PATCH 092/167] Disable usdview again - Without the right UI compiler, it is still broken on PySide6 --- usd.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 50d4aef..f54022b 100644 --- a/usd.spec +++ b/usd.spec @@ -20,8 +20,12 @@ %bcond ocio 1 %bcond oiio 1 %bcond ptex 1 -%bcond pyside6 1 -%bcond usdview 1 +# In order to re-enable usdview with PySide6, we would need to re-generate the +# Python code from .ui files using pyside6-uic, which is not packaged +# (https://bugzilla.redhat.com/show_bug.cgi?id=2301717). This would require +# updating or replacing our uic-wrapper script (see the end of %%prep). +%bcond pyside6 0 +%bcond usdview 0 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the # command-line tools in the buildroot. From fea5e93bc8606cb93af63024d457a3293803ceb5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 30 Jul 2024 13:02:00 -0400 Subject: [PATCH 093/167] Remove the pyside6 build conditional PySide2 is not coming back. --- usd.spec | 9 --------- 1 file changed, 9 deletions(-) diff --git a/usd.spec b/usd.spec index f54022b..f46f7fe 100644 --- a/usd.spec +++ b/usd.spec @@ -24,7 +24,6 @@ # Python code from .ui files using pyside6-uic, which is not packaged # (https://bugzilla.redhat.com/show_bug.cgi?id=2301717). This would require # updating or replacing our uic-wrapper script (see the end of %%prep). -%bcond pyside6 0 %bcond usdview 0 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the @@ -293,11 +292,7 @@ BuildRequires: pkgconfig(Qt5) BuildRequires: python3dist(jinja2) %if %{with usdview} BuildRequires: desktop-file-utils -%if %{with pyside6} BuildRequires: python3dist(pyside6) -%else -BuildRequires: python3dist(pyside2) -%endif %endif BuildRequires: python3dist(pyopengl) Requires: font(roboto) @@ -306,11 +301,7 @@ Requires: font(robotolight) Requires: font(robotomono) Requires: python3dist(jinja2) %if %{with usdview} -%if %{with pyside6} Requires: python3dist(pyside6) -%else -Requires: python3dist(pyside2) -%endif %endif Requires: python3dist(pyopengl) From 9048793b2c8f9f6730de0298d2cc99e55cee5347 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 31 Jul 2024 18:16:04 -0400 Subject: [PATCH 094/167] Re-enable usdview with PySide6 (and pyside6-uic) --- usd.spec | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/usd.spec b/usd.spec index f46f7fe..d4c77c3 100644 --- a/usd.spec +++ b/usd.spec @@ -20,11 +20,7 @@ %bcond ocio 1 %bcond oiio 1 %bcond ptex 1 -# In order to re-enable usdview with PySide6, we would need to re-generate the -# Python code from .ui files using pyside6-uic, which is not packaged -# (https://bugzilla.redhat.com/show_bug.cgi?id=2301717). This would require -# updating or replacing our uic-wrapper script (see the end of %%prep). -%bcond usdview 0 +%bcond usdview 1 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests and, and there are issues with the launchers finding the # command-line tools in the buildroot. @@ -288,11 +284,11 @@ you will need to install usd-devel. Summary: %{summary} BuildRequires: pkgconfig(python3) -BuildRequires: pkgconfig(Qt5) BuildRequires: python3dist(jinja2) %if %{with usdview} BuildRequires: desktop-file-utils BuildRequires: python3dist(pyside6) +BuildRequires: pyside6-tools %endif BuildRequires: python3dist(pyopengl) Requires: font(roboto) @@ -377,13 +373,6 @@ sed -i 's|"${CMAKE_INSTALL_PREFIX}"|%{_libdir}/cmake/pxr|g' pxr/CMakeLists.txt find . -type f -exec gawk '/embree3/ { print FILENAME }' '{}' '+' | xargs -r sed -r -i 's/(embree)3/\14/' -# Fix uic-qt5 use -cat > uic-wrapper <<'EOF' -#!/bin/sh -exec uic-qt5 -g python "$@" -EOF -chmod +x uic-wrapper - %build # The necessary include path for Imath is not set everywhere it’s needed. It’s @@ -442,7 +431,7 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" \ -DPXR_VALIDATE_GENERATED_CODE=OFF \ \ - -DPYSIDEUICBINARY:PATH=${PWD}/uic-wrapper \ + -DPYSIDEUICBINARY:PATH=pyside6-uic \ -DPYSIDE_AVAILABLE=ON \ -DPYTHON_EXECUTABLE=%{python3} %cmake_build From bd415f45bc00aea497b9c83aaa8a5815b3671546 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 22 Apr 2024 12:17:44 -0400 Subject: [PATCH 095/167] Update to 24.08 (close RHBZ#2265775) --- .gitignore | 2 + ...ownstream-only-add-an-SONAME-version.patch | 18 ++--- 2266.patch | 60 ++++++++-------- USD-23.05-tbb2020.3.patch | 22 ------ sources | 2 +- usd.spec | 69 ++++++++++++------- 6 files changed, 87 insertions(+), 86 deletions(-) delete mode 100644 USD-23.05-tbb2020.3.patch diff --git a/.gitignore b/.gitignore index 9be7cd4..2426ed6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ /OpenUSD-23.08.tar.gz /OpenUSD-23.11.tar.gz /OpenUSD-24.03.tar.gz +/OpenUSD-24.05.tar.gz +/OpenUSD-24.08.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index 97de588..dbf0967 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 144bf56aa281390aad13558fe11e190e507ca17c Mon Sep 17 00:00:00 2001 +From 83c22378ffadc7f52081d98a432c65bbd2d79f9c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 8 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index b9516997a..97c9df203 100644 +index 427608ca8..4eca9b076 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake -@@ -27,3 +27,9 @@ set(PXR_MINOR_VERSION "24") - set(PXR_PATCH_VERSION "3") # NOTE: Must not have leading 0 for single digits +@@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "24") + set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -51,10 +51,10 @@ index b9516997a..97c9df203 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index 21606d4d6..4cf8aeeb6 100644 +index 48fe107dd..23ecc44ea 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake -@@ -1299,6 +1299,7 @@ function(_pxr_library NAME) +@@ -1342,6 +1342,7 @@ function(_pxr_library NAME) IMPORT_PREFIX "${args_PREFIX}" PREFIX "${args_PREFIX}" SUFFIX "${args_SUFFIX}" @@ -63,10 +63,10 @@ index 21606d4d6..4cf8aeeb6 100644 target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index 97263d4cd..80abe790c 100644 +index 9f3d35837..478434cbd 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake -@@ -1017,6 +1017,7 @@ function(pxr_toplevel_prologue) +@@ -1004,6 +1004,7 @@ function(pxr_toplevel_prologue) FOLDER "${folder}" PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" @@ -75,5 +75,5 @@ index 97263d4cd..80abe790c 100644 _get_install_dir("lib" libInstallPrefix) install( -- -2.43.2 +2.46.0 diff --git a/2266.patch b/2266.patch index e8f1419..ceb58f0 100644 --- a/2266.patch +++ b/2266.patch @@ -1,4 +1,4 @@ -From 4b6c23d459c602fdac5e0ebc9b7722cbd5475e86 Mon Sep 17 00:00:00 2001 +From c8fec1342e05dca98a1afd4ea93c7a5f0b41e25b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 11 Feb 2023 13:58:42 -0500 Subject: [PATCH] Port to Embree 4.x @@ -18,10 +18,10 @@ Subject: [PATCH] Port to Embree 4.x 11 files changed, 24 insertions(+), 28 deletions(-) diff --git a/cmake/modules/FindEmbree.cmake b/cmake/modules/FindEmbree.cmake -index e12639d6d9..ec13d0f5c4 100644 +index cd52f6b7f5..7c3ecd7cd8 100644 --- a/cmake/modules/FindEmbree.cmake +++ b/cmake/modules/FindEmbree.cmake -@@ -37,11 +37,11 @@ +@@ -20,11 +20,11 @@ #============================================================================= if (APPLE) @@ -36,7 +36,7 @@ index e12639d6d9..ec13d0f5c4 100644 endif() find_library(EMBREE_LIBRARY -@@ -56,7 +56,7 @@ find_library(EMBREE_LIBRARY +@@ -39,7 +39,7 @@ find_library(EMBREE_LIBRARY ) find_path(EMBREE_INCLUDE_DIR @@ -45,7 +45,7 @@ index e12639d6d9..ec13d0f5c4 100644 HINTS "${EMBREE_LOCATION}/include" "$ENV{EMBREE_LOCATION}/include" -@@ -64,12 +64,12 @@ DOC +@@ -47,12 +47,12 @@ DOC "Embree headers path" ) @@ -63,10 +63,10 @@ index e12639d6d9..ec13d0f5c4 100644 set (EMBREE_VERSION ${MAJOR}.${MINOR}.${PATCH}) diff --git a/pxr/imaging/plugin/hdEmbree/context.h b/pxr/imaging/plugin/hdEmbree/context.h -index 7af4ab0d27..fb10e8ceff 100644 +index 4165adb1e6..af9cc4ef5b 100644 --- a/pxr/imaging/plugin/hdEmbree/context.h +++ b/pxr/imaging/plugin/hdEmbree/context.h -@@ -31,7 +31,7 @@ +@@ -14,7 +14,7 @@ #include "pxr/base/gf/matrix4f.h" #include "pxr/base/vt/array.h" @@ -76,10 +76,10 @@ index 7af4ab0d27..fb10e8ceff 100644 PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/mesh.cpp b/pxr/imaging/plugin/hdEmbree/mesh.cpp -index e8e001e1cc..fe0f25b7b8 100644 +index 195f83a633..d3cb949952 100644 --- a/pxr/imaging/plugin/hdEmbree/mesh.cpp +++ b/pxr/imaging/plugin/hdEmbree/mesh.cpp -@@ -220,7 +220,7 @@ void HdEmbreeMesh::_EmbreeCullFaces(const RTCFilterFunctionNArguments* args) +@@ -203,7 +203,7 @@ void HdEmbreeMesh::_EmbreeCullFaces(const RTCFilterFunctionNArguments* args) default: break; } if (cull) { @@ -89,10 +89,10 @@ index e8e001e1cc..fe0f25b7b8 100644 args->valid[i] = 0; } diff --git a/pxr/imaging/plugin/hdEmbree/mesh.h b/pxr/imaging/plugin/hdEmbree/mesh.h -index 4574454368..f83bf5d998 100644 +index 29b0d55029..79d166ac65 100644 --- a/pxr/imaging/plugin/hdEmbree/mesh.h +++ b/pxr/imaging/plugin/hdEmbree/mesh.h -@@ -32,8 +32,8 @@ +@@ -15,8 +15,8 @@ #include "pxr/imaging/plugin/hdEmbree/meshSamplers.h" @@ -104,10 +104,10 @@ index 4574454368..f83bf5d998 100644 PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/meshSamplers.h b/pxr/imaging/plugin/hdEmbree/meshSamplers.h -index bef6f65959..2b481e5694 100644 +index c32c35fffa..3712a9e3ab 100644 --- a/pxr/imaging/plugin/hdEmbree/meshSamplers.h +++ b/pxr/imaging/plugin/hdEmbree/meshSamplers.h -@@ -29,8 +29,8 @@ +@@ -12,8 +12,8 @@ #include "pxr/imaging/hd/meshUtil.h" #include "pxr/base/vt/types.h" @@ -119,27 +119,27 @@ index bef6f65959..2b481e5694 100644 #include diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h -index 7710229804..e8e733bfc4 100644 +index 200633939c..37ffc9be3d 100644 --- a/pxr/imaging/plugin/hdEmbree/pch.h +++ b/pxr/imaging/plugin/hdEmbree/pch.h -@@ -151,9 +151,9 @@ - #include - #include - #include +@@ -83,9 +83,9 @@ + #undef toupper + #endif + #endif // PXR_PYTHON_SUPPORT_ENABLED -#include -#include -#include +#include +#include +#include - #include #include #include + #include diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h -index 20a80487a9..6a6bc9dbf1 100644 +index d4f8f78d54..84af7d8fba 100644 --- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h +++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h -@@ -31,7 +31,7 @@ +@@ -14,7 +14,7 @@ #include "pxr/base/tf/staticTokens.h" #include @@ -149,10 +149,10 @@ index 20a80487a9..6a6bc9dbf1 100644 PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/renderParam.h b/pxr/imaging/plugin/hdEmbree/renderParam.h -index ff61000ab5..d3f903e0f3 100644 +index 206a7458bc..354fed4faa 100644 --- a/pxr/imaging/plugin/hdEmbree/renderParam.h +++ b/pxr/imaging/plugin/hdEmbree/renderParam.h -@@ -28,7 +28,7 @@ +@@ -11,7 +11,7 @@ #include "pxr/imaging/hd/renderDelegate.h" #include "pxr/imaging/hd/renderThread.h" @@ -162,10 +162,10 @@ index ff61000ab5..d3f903e0f3 100644 PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp -index 20ec78c6aa..72a897120d 100644 +index 13956c7b25..cf90a952da 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.cpp +++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp -@@ -650,9 +650,7 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, +@@ -637,9 +637,7 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, rayHit.ray.flags = 0; _PopulateRayHit(&rayHit, origin, dir, 0.0f); { @@ -176,7 +176,7 @@ index 20ec78c6aa..72a897120d 100644 // // there is something odd about how this is used in Embree. Is it reversed // here and then when it it used in -@@ -992,9 +990,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, +@@ -979,9 +977,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, shadow.flags = 0; _PopulateRay(&shadow, position, shadowDir, 0.001f); { @@ -188,10 +188,10 @@ index 20ec78c6aa..72a897120d 100644 // Record this AO ray's contribution to the occlusion factor: a diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h -index 6af8081678..740812fb03 100644 +index 8e727ecba0..798fb5c22e 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.h +++ b/pxr/imaging/plugin/hdEmbree/renderer.h -@@ -32,8 +32,8 @@ +@@ -15,8 +15,8 @@ #include "pxr/base/gf/matrix4d.h" #include "pxr/base/gf/rect2i.h" @@ -203,10 +203,10 @@ index 6af8081678..740812fb03 100644 #include #include diff --git a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -index c361c678bc..8380aebe72 100644 +index 02c2ca69f8..93705b2d28 100644 --- a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp +++ b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -@@ -40,7 +40,7 @@ +@@ -23,7 +23,7 @@ #include "pxr/base/tf/errorMark.h" diff --git a/USD-23.05-tbb2020.3.patch b/USD-23.05-tbb2020.3.patch deleted file mode 100644 index 0cd0c67..0000000 --- a/USD-23.05-tbb2020.3.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- USD-23.05/cmake/modules/FindTBB.cmake~ 2023-06-28 13:02:04.191419402 +0100 -+++ USD-23.05/cmake/modules/FindTBB.cmake 2023-06-28 13:02:06.336423412 +0100 -@@ -197,7 +197,18 @@ - ################################## - - if(TBB_INCLUDE_DIRS) -- file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) -+ # Starting in 2020.1.1, tbb_stddef.h is replaced by version.h -+ set(_version_files "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" -+ "${TBB_INCLUDE_DIRS}/tbb/version.h" -+ "${TBB_INCLUDE_DIRS}/oneapi/tbb/version.h") -+ foreach(f IN ITEMS ${_version_files}) -+ if(EXISTS ${f}) -+ set(_version_file ${f}) -+ endif() -+ endforeach() -+ unset(_version_files) -+ -+ file(READ ${_version_file} _tbb_version_file) - string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" - TBB_VERSION_MAJOR "${_tbb_version_file}") - string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" diff --git a/sources b/sources index 40787dd..b14561f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-24.03.tar.gz) = 3dada1fbfbd73a74e45d4e0c53466be1be3dc92140644e56a8d5d04c09d62e11181d760cf5709a9ae9c43f261f18a2c60131bafd996221fe63e22d45975c5f74 +SHA512 (OpenUSD-24.08.tar.gz) = 7d4404980579c4de3c155386184ca9d2eb96756ef6e090611bae7b4c21ad942c649f73a39b74ad84d0151ce6b9236c4b6c0c555e8e36fdd86304079e1c2e5cbe diff --git a/usd.spec b/usd.spec index d4c77c3..a0ab634 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.24.3 +%global downstream_so_version 0.24.8 %bcond alembic 1 %bcond draco 1 @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 24.03 +Version: 24.08 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -41,24 +41,30 @@ Summary: 3D VFX pipeline interchange file format # - pxr/base/tf/pxrCLI11/ # - pxr/base/tf/pxrDoubleConversion/ # - pxr/imaging/hio/OpenEXR/OpenEXRCore/ +# - pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/ # BSD-2-Clause: # - pxr/base/tf/pxrLZ4/ +# - pxr/imaging/plugin/hioAvif/AVIF/, except +# pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/; +# pxr/imaging/plugin/hioAvif/AVIF/src/avif_obu.c has a different copyright +# - pxr/imaging/plugin/hioAvif/aom/ # MIT: # - docs/doxygen/doxygen-awesome-css/ (removed in %%prep) # - pxr/base/js/rapidjson/, except pxr/base/js/rapidjson/msinttypes/ -# - pxr/base/tf/pxrPEGTL/ +# - pxr/base/pegtl/ # - pxr/base/tf/pxrTslRobinMap/ # - pxr/imaging/garch/khrplatform.h # - pxr/imaging/hgiVulkan/vk_mem_alloc.h # - pxr/imaging/hio/EpenEXR/deflate/ -# - pxr/usd/sdf/invoke.hpp -# - third_party/renderman-24/plugin/rmanArgsParser/pugixml/ +# - third_party/renderman-25/plugin/rmanArgsParser/pugixml/ +# - third_party/renderman-26/plugin/rmanArgsParser/pugixml/ # MIT OR Unlicense: # - pxr/imaging/hio/stb/ # Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} -# - third_party/renderman-24/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} +# - third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} +# - third_party/renderman-26/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} # # Additionally, the following would be listed above but are removed in %%prep: # @@ -72,6 +78,10 @@ Summary: 3D VFX pipeline interchange file format # # (Certain build system files are also under licenses other than Apache-2.0, but # do not contribute their license terms to the built RPMs.) +# +# Note that the license assigned the SPDX identifier Pixar was later officially +# named Tomorrow Open Source Technology License 1.0, TOST-1.0, with no change +# to its terms. License: %{shrink: Pixar AND Apache-2.0 AND @@ -122,11 +132,12 @@ Source2: stb_image.patch Patch: 0001-Downstream-only-add-an-SONAME-version.patch # Port to Embree 4.x +# https://github.com/PixarAnimationStudios/OpenUSD/pull/2266 +# See also: +# hdEmbree: add support for building against embree4 # https://github.com/PixarAnimationStudios/USD/pull/2266 Patch: %{forgeurl}/pull/2266.patch -Patch: USD-23.05-tbb2020.3.patch - # Base BuildRequires: gcc-c++ @@ -143,7 +154,7 @@ BuildRequires: boost-devel BuildRequires: pkgconfig(dri) BuildRequires: hdf5-devel BuildRequires: opensubdiv-devel >= 3.6.0 -BuildRequires: pkgconfig(tbb) = 2020.3 +BuildRequires: pkgconfig(tbb) BuildRequires: cmake(Imath) >= 3.0 @@ -231,7 +242,7 @@ Summary: Universal Scene Description library # Path to using external/system copies of OpenEXRCore and libdeflate? # https://github.com/PixarAnimationStudios/OpenUSD/issues/2619 # Version from: pxr/base/tf/pxrDoubleConversion/README -Provides: bundled(double-conversion) = 2.0.0 +Provides: bundled(double-conversion) = 3.3.0 # Version from: pxr/base/gf/ilmbase_half.README Provides: bundled(ilmbase) = 2.5.3 # Version from: pxr/base/tf/pxrLZ4/lz4.h (LZ4_VERSION_{MAJOR,MINOR_PATCH}) @@ -239,31 +250,39 @@ Provides: bundled(lz4) = 1.9.2 # Version from: pxr/base/tf/pxrCLI11/README.md Provides: bundled(cli11) = 2.3.1 # Version from: -# third_party/renderman-24/plugin/rmanArgsParser/pugixml/pugiconfig.hpp +# third_party/renderman-25/plugin/rmanArgsParser/pugixml/pugiconfig.hpp +# third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # (header comment) Provides: bundled(pugixml) = 1.9 # Version from: pxr/base/js/rapidjson/rapidjson.h # (RAPIDJSON_{MAJOR,MINOR,PATCH}_VERSION) Provides: bundled(rapidjson) = 1.1.0 -# Version from: pxr/imaging/hgiVulkan/spirv_reflect.h (header comment) -Provides: bundled(SPIRV-Reflect) = 1.0 -# Version from: pxr/imaging/hgiVulkan/vk_mem_alloc.h (header comment) -Provides: bundled(VulkanMemoryAllocator) = 3.0.0~development # Forked from an unknown version: pxr/base/tf/pxrTslRobinMap/ Provides: bundled(robin-map) -# Version from: pxr/base/tf/pxrPEGTL/pegtl.h (TAO_PEGTL_VERSION) -Provides: bundled(PEGTL) = 2.8.3 +# Version from: pxr/base/pegtl/pegtl/version.hpp +Provides: bundled(PEGTL) = 3.2.7 # Version from pxr/imaging/hio/OpenEXR/OpenEXRCore/openexr_version.h Provides: bundled(openexr) = 3.2.0 # Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h Provides: bundled(libdeflate) = 1.18 -# Forked from https://github.com/blackmatov/invoke.hpp, which upstream has -# never versioned; however, a copyright statement appears in the header comment -# in pxr/usd/sdf/invoke.hpp with a date of 2023, and the only upstream commit -# with the same date (as of this writing) is -# 2c1eabc2e20ab02961f95c704ff0c0818671ddd1, so we infer that the bundled copy -# was forked from that commit. -Provides: bundled(invoke-hpp) = 0^20230107git2c1eabc +# Version from pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h +# We actually have a post-release snapshot of libavif, because +# AVIF_VERSION_DEVEL is nonzero, but it’s not easy to determine which commit +# hash it was copied from. +Provides: bundled(libavif) = 1.0.1 +# Version from pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/libyuv/version.h +# LIBYUV_VERSION is a “serial number” version, e.g. 1895, that gets incremented +# every time changes are dumped into git from an internal VCS; the libyuv +# package in Fedora is considered to have version 0 and uses snapshot +# versioning. We can dig through +# https://chromium.googlesource.com/libyuv/libyuv and find the commit hash that +# corresponds to a particular serial number. +# LIBYUV_VERSION 1895 = commit a97746349b244efd54ab1eb0c0a7366717b33f39 +Provides: bundled(libyuv) = 0^20240812gita977463 +# Version from pxr/imaging/plugin/hioAvif/aom/config/aom_version.h +Provides: bundled(aom) = 3.0.0 +# Version from pxr/base/pegtl/pegtl/version.hpp +Provides: bundled(PEGTL) = 3.2.7 %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -478,6 +497,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %files %doc NOTICE.txt README.md +%{_bindir}/hdGenSchema %{_bindir}/sdfdump %{_bindir}/sdffilter %{_bindir}/usdGenSchema @@ -503,6 +523,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_bindir}/usdview %endif +%{_mandir}/man1/hdGenSchema.1* %{_mandir}/man1/sdfdump.1* %{_mandir}/man1/sdffilter.1* %{_mandir}/man1/usdGenSchema.1* From 2bcbdb9ba45addd99033f385ff05ead5f99322f1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 09:32:11 -0400 Subject: [PATCH 096/167] Unbundle double-conversion --- ...use-the-system-double-conversion-lib.patch | 143 ++++++++++++++++++ usd.spec | 26 +++- 2 files changed, 165 insertions(+), 4 deletions(-) create mode 100644 0001-Downstream-only-use-the-system-double-conversion-lib.patch diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch new file mode 100644 index 0000000..c3348f0 --- /dev/null +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -0,0 +1,143 @@ +From 6d22693f459e9960e030cf19575e860ad197ab0a Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Wed, 28 Aug 2024 10:42:48 -0400 +Subject: [PATCH] Downstream-only: use the system double-conversion library + +--- + pxr/base/tf/CMakeLists.txt | 23 +++-------------------- + pxr/base/tf/stringUtils.cpp | 22 +++++++++++----------- + 2 files changed, 14 insertions(+), 31 deletions(-) + +diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt +index b236184c4..0527a6295 100644 +--- a/pxr/base/tf/CMakeLists.txt ++++ b/pxr/base/tf/CMakeLists.txt +@@ -110,6 +110,8 @@ function(add_py_dll_link_test) + + endfunction() + ++find_library(double-conversion_LIBRARY NAMES double-conversion REQUIRED) ++ + pxr_library(tf + LIBRARIES + arch +@@ -117,6 +119,7 @@ pxr_library(tf + ${PYTHON_LIBRARIES} + ${Boost_PYTHON_LIBRARY} + ${TBB_tbb_LIBRARY} ++ ${double-conversion_LIBRARY} + + INCLUDE_DIRS + ${PYTHON_INCLUDE_DIRS} +@@ -266,31 +269,11 @@ pxr_library(tf + + PRIVATE_HEADERS + scopeDescriptionPrivate.h +- pxrDoubleConversion/ieee.h +- pxrDoubleConversion/utils.h +- pxrDoubleConversion/double-conversion.h +- pxrDoubleConversion/bignum-dtoa.h +- pxrDoubleConversion/bignum.h +- pxrDoubleConversion/cached-powers.h +- pxrDoubleConversion/diy-fp.h +- pxrDoubleConversion/double-to-string.h +- pxrDoubleConversion/fast-dtoa.h +- pxrDoubleConversion/fixed-dtoa.h +- pxrDoubleConversion/string-to-double.h +- pxrDoubleConversion/strtod.h + pxrLZ4/lz4.h + pyWeakObject.h + + CPPFILES + initConfig.cpp +- pxrDoubleConversion/bignum-dtoa.cc +- pxrDoubleConversion/bignum.cc +- pxrDoubleConversion/cached-powers.cc +- pxrDoubleConversion/double-to-string.cc +- pxrDoubleConversion/fast-dtoa.cc +- pxrDoubleConversion/fixed-dtoa.cc +- pxrDoubleConversion/string-to-double.cc +- pxrDoubleConversion/strtod.cc + pxrLZ4/lz4.cpp + + PYTHON_CPPFILES +diff --git a/pxr/base/tf/stringUtils.cpp b/pxr/base/tf/stringUtils.cpp +index 7110aee3e..8800d28bc 100644 +--- a/pxr/base/tf/stringUtils.cpp ++++ b/pxr/base/tf/stringUtils.cpp +@@ -29,8 +29,8 @@ + #include + #include + +-#include "pxrDoubleConversion/double-conversion.h" +-#include "pxrDoubleConversion/utils.h" ++#include ++#include + + #if defined(ARCH_OS_WINDOWS) + #include +@@ -70,8 +70,8 @@ TfStringPrintf(const char *fmt, ...) + static inline double + _StringToDoubleImpl(const char *ptr, int len) + { +- pxr_double_conversion::StringToDoubleConverter +- strToDouble(pxr_double_conversion::DoubleToStringConverter::NO_FLAGS, ++ double_conversion::StringToDoubleConverter ++ strToDouble(double_conversion::DoubleToStringConverter::NO_FLAGS, + /* empty_string_value */ 0, + /* junk_string_value */ 0, + /* infinity symbol */ "inf", +@@ -914,11 +914,11 @@ TfStringify(std::string const& s) + + static + const +-pxr_double_conversion::DoubleToStringConverter& ++double_conversion::DoubleToStringConverter& + Tf_GetDoubleToStringConverter() + { +- static const pxr_double_conversion::DoubleToStringConverter conv( +- pxr_double_conversion::DoubleToStringConverter::NO_FLAGS, ++ static const double_conversion::DoubleToStringConverter conv( ++ double_conversion::DoubleToStringConverter::NO_FLAGS, + "inf", + "nan", + 'e', +@@ -934,7 +934,7 @@ void + Tf_ApplyDoubleToStringConverter(float val, char* buffer, int bufferSize) + { + const auto& conv = Tf_GetDoubleToStringConverter(); +- pxr_double_conversion::StringBuilder builder(buffer, bufferSize); ++ double_conversion::StringBuilder builder(buffer, bufferSize); + // This should only fail if we provide an insufficient buffer. + TF_VERIFY(conv.ToShortestSingle(val, &builder), + "double_conversion failed"); +@@ -944,7 +944,7 @@ void + Tf_ApplyDoubleToStringConverter(double val, char* buffer, int bufferSize) + { + const auto& conv = Tf_GetDoubleToStringConverter(); +- pxr_double_conversion::StringBuilder builder(buffer, bufferSize); ++ double_conversion::StringBuilder builder(buffer, bufferSize); + // This should only fail if we provide an insufficient buffer. + TF_VERIFY(conv.ToShortest(val, &builder), + "double_conversion failed"); +@@ -966,7 +966,7 @@ TfDoubleToString( + if (bufferSize < 25) { + return false; + } +- using DSC = pxr_double_conversion::DoubleToStringConverter; ++ using DSC = double_conversion::DoubleToStringConverter; + int flags = DSC::NO_FLAGS; + if (emitTrailingZero) { + flags = DSC::EMIT_TRAILING_DECIMAL_POINT +@@ -981,7 +981,7 @@ TfDoubleToString( + /* decimal_in_shortest_high */ 15, + /* max_leading_padding_zeroes_in_precision_mode */ 0, + /* max_trailing_padding_zeroes_in_precision_mode */ 0); +- pxr_double_conversion::StringBuilder builder(buffer, bufferSize); ++ double_conversion::StringBuilder builder(buffer, bufferSize); + // This should only fail if we provide an insufficient buffer. + return conv.ToShortest(val, &builder); + } +-- +2.46.0 + diff --git a/usd.spec b/usd.spec index a0ab634..bd1058a 100644 --- a/usd.spec +++ b/usd.spec @@ -39,7 +39,7 @@ Summary: 3D VFX pipeline interchange file format # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ # - pxr/base/tf/pxrCLI11/ -# - pxr/base/tf/pxrDoubleConversion/ +# - pxr/base/tf/pxrDoubleConversion/ (removed in %%prep) # - pxr/imaging/hio/OpenEXR/OpenEXRCore/ # - pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/ # BSD-2-Clause: @@ -138,6 +138,9 @@ Patch: 0001-Downstream-only-add-an-SONAME-version.patch # https://github.com/PixarAnimationStudios/USD/pull/2266 Patch: %{forgeurl}/pull/2266.patch +# Downstream-only: use the system double-conversion library +Patch: 0001-Downstream-only-use-the-system-double-conversion-lib.patch + # Base BuildRequires: gcc-c++ @@ -155,6 +158,8 @@ BuildRequires: pkgconfig(dri) BuildRequires: hdf5-devel BuildRequires: opensubdiv-devel >= 3.6.0 BuildRequires: pkgconfig(tbb) +# Unbundled: +BuildRequires: cmake(double-conversion) BuildRequires: cmake(Imath) >= 3.0 @@ -195,7 +200,6 @@ BuildRequires: openvdb-devel BuildRequires: pkgconfig(ptex) %endif - # Header-only library: -static is for tracking per guidelines # # Enforce the the minimum EVR to contain fixes for all of: @@ -241,8 +245,6 @@ Summary: Universal Scene Description library # See also: # Path to using external/system copies of OpenEXRCore and libdeflate? # https://github.com/PixarAnimationStudios/OpenUSD/issues/2619 -# Version from: pxr/base/tf/pxrDoubleConversion/README -Provides: bundled(double-conversion) = 3.3.0 # Version from: pxr/base/gf/ilmbase_half.README Provides: bundled(ilmbase) = 2.5.3 # Version from: pxr/base/tf/pxrLZ4/lz4.h (LZ4_VERSION_{MAJOR,MINOR_PATCH}) @@ -284,6 +286,13 @@ Provides: bundled(aom) = 3.0.0 # Version from pxr/base/pegtl/pegtl/version.hpp Provides: bundled(PEGTL) = 3.2.7 +# We are currently able to unbundle these and use system libraries, but we +# retain the virtual Provides, commented out, as documentation and in case we +# ever have to switch back to the bundled versions. +# +# Version from: pxr/base/tf/pxrDoubleConversion/README +# Provides: bundled(double-conversion) = 3.3.0 + %description libs Universal Scene Description (USD) is an efficient, scalable system for authoring, reading, and streaming time-sampled scene description for @@ -360,6 +369,15 @@ popd # building Doxygen-generated HTML documentation. rm -rf docs/doxygen/doxygen-awesome-css/ +# Remove the bundled copy of double-conversion. +# +# From pxr/base/tf/pxrDoubleConversion/README, the upstream double-conversion +# is patched with pxr/base/tf/pxrDoubleConversion/pxr-double-conversion.patch; +# examination of that patch shows that it merely adds namespaces and renames +# symbols, rather than making functional changes, so using the system library +# should be safe. +rm -rv pxr/base/tf/pxrDoubleConversion + # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ cmake/defaults/CXXDefaults.cmake From e7b56c601979ecc7467eab702a980de1e7f706e6 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 12:01:53 -0400 Subject: [PATCH 097/167] Fix a trivial spec-file typo [skip changelog] --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index bd1058a..1b635b5 100644 --- a/usd.spec +++ b/usd.spec @@ -22,7 +22,7 @@ %bcond ptex 1 %bcond usdview 1 # TODO: Figure out how to re-enable the tests. Currently these want to install -# into /usr/tests and, and there are issues with the launchers finding the +# into /usr/tests, and there are issues with the launchers finding the # command-line tools in the buildroot. %bcond test 0 From 43282c86fb50183c16fb87baad296a9f6c5af9f7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:27:04 -0400 Subject: [PATCH 098/167] Add more notes about ilmbase bundling [skip changelog] --- usd.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/usd.spec b/usd.spec index 1b635b5..d884c55 100644 --- a/usd.spec +++ b/usd.spec @@ -246,6 +246,15 @@ Summary: Universal Scene Description library # Path to using external/system copies of OpenEXRCore and libdeflate? # https://github.com/PixarAnimationStudios/OpenUSD/issues/2619 # Version from: pxr/base/gf/ilmbase_half.README +# +# This is difficult to unbundle even in the manner of double-conversion: code +# that uses the half type is compatible with ilmbase version 2 (as packaged in +# openexr2) rather than version 3 (as packaged in the ilmbase package). +# Unfortunately, we need cmake(Imath) elsewhere in the package, and this comes +# from the imath package (version 3), which conflicts with the imath version 2 +# libraries included with openexr2. So this will not be possible until the +# surrounding code is patched (upstream or downstream) for compatibility with +# ilmbase version 3, something we’re currently not willing to attempt. Provides: bundled(ilmbase) = 2.5.3 # Version from: pxr/base/tf/pxrLZ4/lz4.h (LZ4_VERSION_{MAJOR,MINOR_PATCH}) Provides: bundled(lz4) = 1.9.2 From 9a24539f76f0439264465faf8f323b038f8af705 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 16:31:13 -0400 Subject: [PATCH 099/167] Unbundle lz4 --- ...use-the-system-double-conversion-lib.patch | 2 +- ...ream-only-use-the-system-lz4-library.patch | 74 +++++++++++++++++++ usd.spec | 11 ++- 3 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 0002-Downstream-only-use-the-system-lz4-library.patch diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index c3348f0..72d6936 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,7 +1,7 @@ From 6d22693f459e9960e030cf19575e860ad197ab0a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 -Subject: [PATCH] Downstream-only: use the system double-conversion library +Subject: [PATCH 1/2] Downstream-only: use the system double-conversion library --- pxr/base/tf/CMakeLists.txt | 23 +++-------------------- diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch new file mode 100644 index 0000000..e022306 --- /dev/null +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -0,0 +1,74 @@ +From 90d08ced56bce3026c5ac1646c654ab917bb0f1d Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Thu, 29 Aug 2024 13:30:18 -0400 +Subject: [PATCH 2/2] Downstream-only: use the system lz4 library + +--- + pxr/base/tf/CMakeLists.txt | 6 ++++-- + pxr/base/tf/fastCompression.cpp | 4 +--- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt +index 0527a6295..2988e2606 100644 +--- a/pxr/base/tf/CMakeLists.txt ++++ b/pxr/base/tf/CMakeLists.txt +@@ -111,6 +111,8 @@ function(add_py_dll_link_test) + endfunction() + + find_library(double-conversion_LIBRARY NAMES double-conversion REQUIRED) ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(LZ4 REQUIRED liblz4) + + pxr_library(tf + LIBRARIES +@@ -120,11 +122,13 @@ pxr_library(tf + ${Boost_PYTHON_LIBRARY} + ${TBB_tbb_LIBRARY} + ${double-conversion_LIBRARY} ++ ${LZ4_LIBRARIES} + + INCLUDE_DIRS + ${PYTHON_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${TBB_INCLUDE_DIRS} ++ ${LZ4_INCLUDE_DIRS} + + PUBLIC_CLASSES + anyUniquePtr +@@ -269,12 +273,10 @@ pxr_library(tf + + PRIVATE_HEADERS + scopeDescriptionPrivate.h +- pxrLZ4/lz4.h + pyWeakObject.h + + CPPFILES + initConfig.cpp +- pxrLZ4/lz4.cpp + + PYTHON_CPPFILES + moduleDeps.cpp +diff --git a/pxr/base/tf/fastCompression.cpp b/pxr/base/tf/fastCompression.cpp +index 55f455d42..4e7685f23 100644 +--- a/pxr/base/tf/fastCompression.cpp ++++ b/pxr/base/tf/fastCompression.cpp +@@ -11,15 +11,13 @@ + #include "pxr/base/tf/fastCompression.h" + + // XXX: Need to isolate symbols here? +-#include "pxrLZ4/lz4.h" ++#include "lz4.h" + + #include + #include + + PXR_NAMESPACE_OPEN_SCOPE + +-using namespace pxr_lz4; +- + size_t + TfFastCompression::GetMaxInputSize() + { +-- +2.46.0 + diff --git a/usd.spec b/usd.spec index d884c55..09430fc 100644 --- a/usd.spec +++ b/usd.spec @@ -140,6 +140,8 @@ Patch: %{forgeurl}/pull/2266.patch # Downstream-only: use the system double-conversion library Patch: 0001-Downstream-only-use-the-system-double-conversion-lib.patch +# Downstream-only: use the system lz4 library +Patch: 0002-Downstream-only-use-the-system-lz4-library.patch # Base BuildRequires: gcc-c++ @@ -160,6 +162,7 @@ BuildRequires: opensubdiv-devel >= 3.6.0 BuildRequires: pkgconfig(tbb) # Unbundled: BuildRequires: cmake(double-conversion) +BuildRequires: pkgconfig(liblz4) BuildRequires: cmake(Imath) >= 3.0 @@ -256,8 +259,6 @@ Summary: Universal Scene Description library # surrounding code is patched (upstream or downstream) for compatibility with # ilmbase version 3, something we’re currently not willing to attempt. Provides: bundled(ilmbase) = 2.5.3 -# Version from: pxr/base/tf/pxrLZ4/lz4.h (LZ4_VERSION_{MAJOR,MINOR_PATCH}) -Provides: bundled(lz4) = 1.9.2 # Version from: pxr/base/tf/pxrCLI11/README.md Provides: bundled(cli11) = 2.3.1 # Version from: @@ -301,6 +302,8 @@ Provides: bundled(PEGTL) = 3.2.7 # # Version from: pxr/base/tf/pxrDoubleConversion/README # Provides: bundled(double-conversion) = 3.3.0 +# Version from: pxr/base/tf/pxrLZ4/lz4.h (LZ4_VERSION_{MAJOR,MINOR_PATCH}) +# Provides: bundled(lz4) = 1.9.2 %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -386,6 +389,10 @@ rm -rf docs/doxygen/doxygen-awesome-css/ # symbols, rather than making functional changes, so using the system library # should be safe. rm -rv pxr/base/tf/pxrDoubleConversion +# Similarly, remove the bundled copy of lz4. Change in the bundled copy can be +# identified by source-code comments, and appear to be limited to adding +# namespaces and removing C linkage. +rm -rv pxr/base/tf/pxrLZ4 # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ From 0725c67cd1940f0f0b27df7add5843d847938af7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 07:11:14 -0400 Subject: [PATCH 100/167] Unbundle cli11 --- usd.spec | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 09430fc..9849cd3 100644 --- a/usd.spec +++ b/usd.spec @@ -163,6 +163,7 @@ BuildRequires: pkgconfig(tbb) # Unbundled: BuildRequires: cmake(double-conversion) BuildRequires: pkgconfig(liblz4) +BuildRequires: cli11-devel cli11-static BuildRequires: cmake(Imath) >= 3.0 @@ -259,8 +260,6 @@ Summary: Universal Scene Description library # surrounding code is patched (upstream or downstream) for compatibility with # ilmbase version 3, something we’re currently not willing to attempt. Provides: bundled(ilmbase) = 2.5.3 -# Version from: pxr/base/tf/pxrCLI11/README.md -Provides: bundled(cli11) = 2.3.1 # Version from: # third_party/renderman-25/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp @@ -304,6 +303,8 @@ Provides: bundled(PEGTL) = 3.2.7 # Provides: bundled(double-conversion) = 3.3.0 # Version from: pxr/base/tf/pxrLZ4/lz4.h (LZ4_VERSION_{MAJOR,MINOR_PATCH}) # Provides: bundled(lz4) = 1.9.2 +# Version from: pxr/base/tf/pxrCLI11/README.md +# Provides: bundled(cli11) = 2.3.1 %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -393,6 +394,12 @@ rm -rv pxr/base/tf/pxrDoubleConversion # identified by source-code comments, and appear to be limited to adding # namespaces and removing C linkage. rm -rv pxr/base/tf/pxrLZ4 +# Remove the bundled copy of cli11. +rm -v pxr/base/tf/pxrCLI11/* +cat > pxr/base/tf/pxrCLI11/CLI11.h <<'EOF' +#include "CLI/CLI.hpp" +namespace pxr_CLI = CLI; +EOF # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ From 40cf2f17b5893b7034f7aaf695db46107f1cc621 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 08:13:57 -0400 Subject: [PATCH 101/167] Update License comment for unbunded lz4 and cli11 [skip changelog] --- usd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 9849cd3..5275ca3 100644 --- a/usd.spec +++ b/usd.spec @@ -38,12 +38,12 @@ Summary: 3D VFX pipeline interchange file format # BSD-3-Clause: # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ -# - pxr/base/tf/pxrCLI11/ +# - pxr/base/tf/pxrCLI11/ (removed in %%prep) # - pxr/base/tf/pxrDoubleConversion/ (removed in %%prep) # - pxr/imaging/hio/OpenEXR/OpenEXRCore/ # - pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/ # BSD-2-Clause: -# - pxr/base/tf/pxrLZ4/ +# - pxr/base/tf/pxrLZ4/ (removed in %%prep) # - pxr/imaging/plugin/hioAvif/AVIF/, except # pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/; # pxr/imaging/plugin/hioAvif/AVIF/src/avif_obu.c has a different copyright From 73a20616f89665e87b5b4fba9c4c85b184c70839 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 08:14:31 -0400 Subject: [PATCH 102/167] Simplified unbundling patches for double-conversion and lz4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use “stub” headers to avoid patching the call sites --- ...use-the-system-double-conversion-lib.patch | 84 +------------------ ...ream-only-use-the-system-lz4-library.patch | 28 +------ usd.spec | 18 +++- 3 files changed, 21 insertions(+), 109 deletions(-) diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 72d6936..0c8a0b2 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,12 +1,11 @@ -From 6d22693f459e9960e030cf19575e860ad197ab0a Mon Sep 17 00:00:00 2001 +From cf8f5e12d8e2ec2ca2ce6c4dfcaaaa3f2fd30fd7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/2] Downstream-only: use the system double-conversion library --- - pxr/base/tf/CMakeLists.txt | 23 +++-------------------- - pxr/base/tf/stringUtils.cpp | 22 +++++++++++----------- - 2 files changed, 14 insertions(+), 31 deletions(-) + pxr/base/tf/CMakeLists.txt | 23 +++-------------------- + 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt index b236184c4..0527a6295 100644 @@ -61,83 +60,6 @@ index b236184c4..0527a6295 100644 pxrLZ4/lz4.cpp PYTHON_CPPFILES -diff --git a/pxr/base/tf/stringUtils.cpp b/pxr/base/tf/stringUtils.cpp -index 7110aee3e..8800d28bc 100644 ---- a/pxr/base/tf/stringUtils.cpp -+++ b/pxr/base/tf/stringUtils.cpp -@@ -29,8 +29,8 @@ - #include - #include - --#include "pxrDoubleConversion/double-conversion.h" --#include "pxrDoubleConversion/utils.h" -+#include -+#include - - #if defined(ARCH_OS_WINDOWS) - #include -@@ -70,8 +70,8 @@ TfStringPrintf(const char *fmt, ...) - static inline double - _StringToDoubleImpl(const char *ptr, int len) - { -- pxr_double_conversion::StringToDoubleConverter -- strToDouble(pxr_double_conversion::DoubleToStringConverter::NO_FLAGS, -+ double_conversion::StringToDoubleConverter -+ strToDouble(double_conversion::DoubleToStringConverter::NO_FLAGS, - /* empty_string_value */ 0, - /* junk_string_value */ 0, - /* infinity symbol */ "inf", -@@ -914,11 +914,11 @@ TfStringify(std::string const& s) - - static - const --pxr_double_conversion::DoubleToStringConverter& -+double_conversion::DoubleToStringConverter& - Tf_GetDoubleToStringConverter() - { -- static const pxr_double_conversion::DoubleToStringConverter conv( -- pxr_double_conversion::DoubleToStringConverter::NO_FLAGS, -+ static const double_conversion::DoubleToStringConverter conv( -+ double_conversion::DoubleToStringConverter::NO_FLAGS, - "inf", - "nan", - 'e', -@@ -934,7 +934,7 @@ void - Tf_ApplyDoubleToStringConverter(float val, char* buffer, int bufferSize) - { - const auto& conv = Tf_GetDoubleToStringConverter(); -- pxr_double_conversion::StringBuilder builder(buffer, bufferSize); -+ double_conversion::StringBuilder builder(buffer, bufferSize); - // This should only fail if we provide an insufficient buffer. - TF_VERIFY(conv.ToShortestSingle(val, &builder), - "double_conversion failed"); -@@ -944,7 +944,7 @@ void - Tf_ApplyDoubleToStringConverter(double val, char* buffer, int bufferSize) - { - const auto& conv = Tf_GetDoubleToStringConverter(); -- pxr_double_conversion::StringBuilder builder(buffer, bufferSize); -+ double_conversion::StringBuilder builder(buffer, bufferSize); - // This should only fail if we provide an insufficient buffer. - TF_VERIFY(conv.ToShortest(val, &builder), - "double_conversion failed"); -@@ -966,7 +966,7 @@ TfDoubleToString( - if (bufferSize < 25) { - return false; - } -- using DSC = pxr_double_conversion::DoubleToStringConverter; -+ using DSC = double_conversion::DoubleToStringConverter; - int flags = DSC::NO_FLAGS; - if (emitTrailingZero) { - flags = DSC::EMIT_TRAILING_DECIMAL_POINT -@@ -981,7 +981,7 @@ TfDoubleToString( - /* decimal_in_shortest_high */ 15, - /* max_leading_padding_zeroes_in_precision_mode */ 0, - /* max_trailing_padding_zeroes_in_precision_mode */ 0); -- pxr_double_conversion::StringBuilder builder(buffer, bufferSize); -+ double_conversion::StringBuilder builder(buffer, bufferSize); - // This should only fail if we provide an insufficient buffer. - return conv.ToShortest(val, &builder); - } -- 2.46.0 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index e022306..78385ad 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,12 +1,11 @@ -From 90d08ced56bce3026c5ac1646c654ab917bb0f1d Mon Sep 17 00:00:00 2001 +From 93c494376aff2d6dc4ba3f50fd41738a003230d4 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/2] Downstream-only: use the system lz4 library --- - pxr/base/tf/CMakeLists.txt | 6 ++++-- - pxr/base/tf/fastCompression.cpp | 4 +--- - 2 files changed, 5 insertions(+), 5 deletions(-) + pxr/base/tf/CMakeLists.txt | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt index 0527a6295..2988e2606 100644 @@ -48,27 +47,6 @@ index 0527a6295..2988e2606 100644 PYTHON_CPPFILES moduleDeps.cpp -diff --git a/pxr/base/tf/fastCompression.cpp b/pxr/base/tf/fastCompression.cpp -index 55f455d42..4e7685f23 100644 ---- a/pxr/base/tf/fastCompression.cpp -+++ b/pxr/base/tf/fastCompression.cpp -@@ -11,15 +11,13 @@ - #include "pxr/base/tf/fastCompression.h" - - // XXX: Need to isolate symbols here? --#include "pxrLZ4/lz4.h" -+#include "lz4.h" - - #include - #include - - PXR_NAMESPACE_OPEN_SCOPE - --using namespace pxr_lz4; -- - size_t - TfFastCompression::GetMaxInputSize() - { -- 2.46.0 diff --git a/usd.spec b/usd.spec index 5275ca3..8624916 100644 --- a/usd.spec +++ b/usd.spec @@ -389,15 +389,27 @@ rm -rf docs/doxygen/doxygen-awesome-css/ # examination of that patch shows that it merely adds namespaces and renames # symbols, rather than making functional changes, so using the system library # should be safe. -rm -rv pxr/base/tf/pxrDoubleConversion +find pxr/base/tf/pxrDoubleConversion -type f ! -name '*.h' -print -delete +for hdr in pxr/base/tf/pxrDoubleConversion/*.h +do + cat > "${hdr}" < +namespace pxr_double_conversion = double_conversion; +EOF +done # Similarly, remove the bundled copy of lz4. Change in the bundled copy can be # identified by source-code comments, and appear to be limited to adding # namespaces and removing C linkage. -rm -rv pxr/base/tf/pxrLZ4 +rm -v pxr/base/tf/pxrLZ4/* +cat > pxr/base/tf/pxrLZ4/lz4.h <<'EOF' +#include +// System LZ4 has C linkage; this just allows "using namespace" +namespace pxr_lz4 {} +EOF # Remove the bundled copy of cli11. rm -v pxr/base/tf/pxrCLI11/* cat > pxr/base/tf/pxrCLI11/CLI11.h <<'EOF' -#include "CLI/CLI.hpp" +#include namespace pxr_CLI = CLI; EOF From 8ac451a67417ff41c0158ac3f93c11e0e599c6d1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 08:35:40 -0400 Subject: [PATCH 103/167] =?UTF-8?q?Don=E2=80=99t=20patch=20out=20headers?= =?UTF-8?q?=20that=20will=20be=20=E2=80=9Cstubbed=E2=80=9D=20from=20CMake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip changelog] --- ...use-the-system-double-conversion-lib.patch | 27 ++++--------------- ...ream-only-use-the-system-lz4-library.patch | 15 ++++------- 2 files changed, 10 insertions(+), 32 deletions(-) diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 0c8a0b2..9250f90 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,14 +1,14 @@ -From cf8f5e12d8e2ec2ca2ce6c4dfcaaaa3f2fd30fd7 Mon Sep 17 00:00:00 2001 +From 0f786f889eeea75a1983d694bfa168c003009b35 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/2] Downstream-only: use the system double-conversion library --- - pxr/base/tf/CMakeLists.txt | 23 +++-------------------- - 1 file changed, 3 insertions(+), 20 deletions(-) + pxr/base/tf/CMakeLists.txt | 11 +++-------- + 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index b236184c4..0527a6295 100644 +index b236184c4..c1a24a87f 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -110,6 +110,8 @@ function(add_py_dll_link_test) @@ -28,24 +28,7 @@ index b236184c4..0527a6295 100644 INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} -@@ -266,31 +269,11 @@ pxr_library(tf - - PRIVATE_HEADERS - scopeDescriptionPrivate.h -- pxrDoubleConversion/ieee.h -- pxrDoubleConversion/utils.h -- pxrDoubleConversion/double-conversion.h -- pxrDoubleConversion/bignum-dtoa.h -- pxrDoubleConversion/bignum.h -- pxrDoubleConversion/cached-powers.h -- pxrDoubleConversion/diy-fp.h -- pxrDoubleConversion/double-to-string.h -- pxrDoubleConversion/fast-dtoa.h -- pxrDoubleConversion/fixed-dtoa.h -- pxrDoubleConversion/string-to-double.h -- pxrDoubleConversion/strtod.h - pxrLZ4/lz4.h - pyWeakObject.h +@@ -283,14 +286,6 @@ pxr_library(tf CPPFILES initConfig.cpp diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index 78385ad..afa4413 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,14 +1,14 @@ -From 93c494376aff2d6dc4ba3f50fd41738a003230d4 Mon Sep 17 00:00:00 2001 +From 9ace4ea6c8e3a17c9d047f8bd7c5ccd11fb4ffb8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/2] Downstream-only: use the system lz4 library --- - pxr/base/tf/CMakeLists.txt | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) + pxr/base/tf/CMakeLists.txt | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 0527a6295..2988e2606 100644 +index c1a24a87f..56f75ae22 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -111,6 +111,8 @@ function(add_py_dll_link_test) @@ -34,12 +34,7 @@ index 0527a6295..2988e2606 100644 PUBLIC_CLASSES anyUniquePtr -@@ -269,12 +273,10 @@ pxr_library(tf - - PRIVATE_HEADERS - scopeDescriptionPrivate.h -- pxrLZ4/lz4.h - pyWeakObject.h +@@ -286,7 +290,6 @@ pxr_library(tf CPPFILES initConfig.cpp From 26576ba7835be69141c158473da1b95e86881eb8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:41 -0400 Subject: [PATCH 104/167] Unbundle pugixml --- ...use-the-system-double-conversion-lib.patch | 2 +- ...ream-only-use-the-system-lz4-library.patch | 2 +- ...-only-use-the-system-pugixml-library.patch | 67 +++++++++++++++++++ usd.spec | 26 +++++-- 4 files changed, 88 insertions(+), 9 deletions(-) create mode 100644 0003-Downstream-only-use-the-system-pugixml-library.patch diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 9250f90..4b09220 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,7 +1,7 @@ From 0f786f889eeea75a1983d694bfa168c003009b35 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 -Subject: [PATCH 1/2] Downstream-only: use the system double-conversion library +Subject: [PATCH 1/3] Downstream-only: use the system double-conversion library --- pxr/base/tf/CMakeLists.txt | 11 +++-------- diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index afa4413..bbd1b71 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,7 +1,7 @@ From 9ace4ea6c8e3a17c9d047f8bd7c5ccd11fb4ffb8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 -Subject: [PATCH 2/2] Downstream-only: use the system lz4 library +Subject: [PATCH 2/3] Downstream-only: use the system lz4 library --- pxr/base/tf/CMakeLists.txt | 5 ++++- diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch new file mode 100644 index 0000000..8961855 --- /dev/null +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -0,0 +1,67 @@ +From 93d27e7deea9c2a5eadc6257cef90f5eaef13777 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 30 Aug 2024 09:32:08 -0400 +Subject: [PATCH 3/3] Downstream-only: use the system pugixml library + +--- + .../renderman-25/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- + .../renderman-26/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt +index fae498d58..a7587b240 100644 +--- a/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt ++++ b/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt +@@ -1,6 +1,8 @@ + set(PXR_PREFIX "") + set(PXR_PACKAGE rmanArgsParser) + ++find_library(pugixml_LIBRARY NAMES pugixml REQUIRED) ++ + pxr_plugin(rmanArgsParser + LIBRARIES + arch +@@ -10,12 +12,10 @@ pxr_plugin(rmanArgsParser + ar + ndr + sdr ++ ${pugixml_LIBRARY} + + PRIVATE_CLASSES + rmanArgsParser +- +- CPPFILES +- pugixml/pugixml.cpp + + PRIVATE_HEADERS + api.h +diff --git a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt +index fae498d58..a7587b240 100644 +--- a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt ++++ b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt +@@ -1,6 +1,8 @@ + set(PXR_PREFIX "") + set(PXR_PACKAGE rmanArgsParser) + ++find_library(pugixml_LIBRARY NAMES pugixml REQUIRED) ++ + pxr_plugin(rmanArgsParser + LIBRARIES + arch +@@ -10,12 +12,10 @@ pxr_plugin(rmanArgsParser + ar + ndr + sdr ++ ${pugixml_LIBRARY} + + PRIVATE_CLASSES + rmanArgsParser +- +- CPPFILES +- pugixml/pugixml.cpp + + PRIVATE_HEADERS + api.h +-- +2.46.0 + diff --git a/usd.spec b/usd.spec index 8624916..866a8e9 100644 --- a/usd.spec +++ b/usd.spec @@ -56,8 +56,8 @@ Summary: 3D VFX pipeline interchange file format # - pxr/imaging/garch/khrplatform.h # - pxr/imaging/hgiVulkan/vk_mem_alloc.h # - pxr/imaging/hio/EpenEXR/deflate/ -# - third_party/renderman-25/plugin/rmanArgsParser/pugixml/ -# - third_party/renderman-26/plugin/rmanArgsParser/pugixml/ +# - third_party/renderman-25/plugin/rmanArgsParser/pugixml/ (removed in %%prep) +# - third_party/renderman-26/plugin/rmanArgsParser/pugixml/ (removed in %%prep) # MIT OR Unlicense: # - pxr/imaging/hio/stb/ # Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2: @@ -142,6 +142,8 @@ Patch: %{forgeurl}/pull/2266.patch Patch: 0001-Downstream-only-use-the-system-double-conversion-lib.patch # Downstream-only: use the system lz4 library Patch: 0002-Downstream-only-use-the-system-lz4-library.patch +# Downstream-only: use the system pugixml library +Patch: 0003-Downstream-only-use-the-system-pugixml-library.patch # Base BuildRequires: gcc-c++ @@ -164,6 +166,7 @@ BuildRequires: pkgconfig(tbb) BuildRequires: cmake(double-conversion) BuildRequires: pkgconfig(liblz4) BuildRequires: cli11-devel cli11-static +BuildRequires: cmake(pugixml) BuildRequires: cmake(Imath) >= 3.0 @@ -260,11 +263,6 @@ Summary: Universal Scene Description library # surrounding code is patched (upstream or downstream) for compatibility with # ilmbase version 3, something we’re currently not willing to attempt. Provides: bundled(ilmbase) = 2.5.3 -# Version from: -# third_party/renderman-25/plugin/rmanArgsParser/pugixml/pugiconfig.hpp -# third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp -# (header comment) -Provides: bundled(pugixml) = 1.9 # Version from: pxr/base/js/rapidjson/rapidjson.h # (RAPIDJSON_{MAJOR,MINOR,PATCH}_VERSION) Provides: bundled(rapidjson) = 1.1.0 @@ -305,6 +303,11 @@ Provides: bundled(PEGTL) = 3.2.7 # Provides: bundled(lz4) = 1.9.2 # Version from: pxr/base/tf/pxrCLI11/README.md # Provides: bundled(cli11) = 2.3.1 +# Version from: +# third_party/renderman-25/plugin/rmanArgsParser/pugixml/pugiconfig.hpp +# third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp +# (header comment) +# Provides: bundled(pugixml) = 1.9 %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -412,6 +415,15 @@ cat > pxr/base/tf/pxrCLI11/CLI11.h <<'EOF' #include namespace pxr_CLI = CLI; EOF +# Remove the bundled copy of pugixml. +find third_party/renderman-*/plugin/rmanArgsParser/pugixml/ \ + -type f ! -name '*.hpp' -print -delete +for hdr in third_party/renderman-*/plugin/rmanArgsParser/pugixml/*.hpp +do + cat > "${hdr}" < +EOF +done # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ From 6e44f92c07081a7d9d61e67d8874e4bf050f17cb Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:10:27 -0400 Subject: [PATCH 105/167] Unbundle rapidjson --- ...use-the-system-double-conversion-lib.patch | 2 +- ...ream-only-use-the-system-lz4-library.patch | 2 +- ...-only-use-the-system-pugixml-library.patch | 2 +- ...nly-use-the-system-rapidjson-library.patch | 60 +++++++++++++++++++ usd.spec | 17 ++++-- 5 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 0004-Downstream-only-use-the-system-rapidjson-library.patch diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 4b09220..a6238e7 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,7 +1,7 @@ From 0f786f889eeea75a1983d694bfa168c003009b35 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 -Subject: [PATCH 1/3] Downstream-only: use the system double-conversion library +Subject: [PATCH 1/4] Downstream-only: use the system double-conversion library --- pxr/base/tf/CMakeLists.txt | 11 +++-------- diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index bbd1b71..956e21d 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,7 +1,7 @@ From 9ace4ea6c8e3a17c9d047f8bd7c5ccd11fb4ffb8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 -Subject: [PATCH 2/3] Downstream-only: use the system lz4 library +Subject: [PATCH 2/4] Downstream-only: use the system lz4 library --- pxr/base/tf/CMakeLists.txt | 5 ++++- diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 8961855..e401ed1 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,7 +1,7 @@ From 93d27e7deea9c2a5eadc6257cef90f5eaef13777 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 -Subject: [PATCH 3/3] Downstream-only: use the system pugixml library +Subject: [PATCH 3/4] Downstream-only: use the system pugixml library --- .../renderman-25/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch new file mode 100644 index 0000000..d72a6de --- /dev/null +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -0,0 +1,60 @@ +From fa40048ee12fbe5a2cb8ba12ada1a354f1587d1a Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Sat, 31 Aug 2024 11:08:18 -0400 +Subject: [PATCH 4/4] Downstream-only: use the system rapidjson library + +--- + pxr/base/js/CMakeLists.txt | 37 ------------------------------------- + 1 file changed, 37 deletions(-) + +diff --git a/pxr/base/js/CMakeLists.txt b/pxr/base/js/CMakeLists.txt +index f5ac5fb99..102e41151 100644 +--- a/pxr/base/js/CMakeLists.txt ++++ b/pxr/base/js/CMakeLists.txt +@@ -18,43 +18,6 @@ pxr_library(js + converter.h + types.h + +- PRIVATE_HEADERS +- rapidjson/allocators.h +- rapidjson/document.h +- rapidjson/encodedstream.h +- rapidjson/encodings.h +- rapidjson/error/en.h +- rapidjson/error/error.h +- rapidjson/filereadstream.h +- rapidjson/filewritestream.h +- rapidjson/fwd.h +- rapidjson/internal/biginteger.h +- rapidjson/internal/diyfp.h +- rapidjson/internal/dtoa.h +- rapidjson/internal/ieee754.h +- rapidjson/internal/itoa.h +- rapidjson/internal/meta.h +- rapidjson/internal/pow10.h +- rapidjson/internal/regex.h +- rapidjson/internal/stack.h +- rapidjson/internal/strfunc.h +- rapidjson/internal/strtod.h +- rapidjson/internal/swap.h +- rapidjson/istreamwrapper.h +- rapidjson/memorybuffer.h +- rapidjson/memorystream.h +- rapidjson/msinttypes/inttypes.h +- rapidjson/msinttypes/stdint.h +- rapidjson/ostreamwrapper.h +- rapidjson/pointer.h +- rapidjson/prettywriter.h +- rapidjson/rapidjson.h +- rapidjson/reader.h +- rapidjson/schema.h +- rapidjson/stream.h +- rapidjson/stringbuffer.h +- rapidjson/writer.h +- + DOXYGEN_FILES + overview.dox + ) +-- +2.46.0 + diff --git a/usd.spec b/usd.spec index 866a8e9..f0a8e3f 100644 --- a/usd.spec +++ b/usd.spec @@ -37,7 +37,7 @@ Summary: 3D VFX pipeline interchange file format # - pxr/imaging/hgiVulkan/spirv_reflect.{cpp,h} # BSD-3-Clause: # - pxr/base/gf/ilmbase_* -# - pxr/base/js/rapidjson/msinttypes/ +# - pxr/base/js/rapidjson/msinttypes/ (removed in %%prep) # - pxr/base/tf/pxrCLI11/ (removed in %%prep) # - pxr/base/tf/pxrDoubleConversion/ (removed in %%prep) # - pxr/imaging/hio/OpenEXR/OpenEXRCore/ @@ -50,7 +50,8 @@ Summary: 3D VFX pipeline interchange file format # - pxr/imaging/plugin/hioAvif/aom/ # MIT: # - docs/doxygen/doxygen-awesome-css/ (removed in %%prep) -# - pxr/base/js/rapidjson/, except pxr/base/js/rapidjson/msinttypes/ +# - pxr/base/js/rapidjson/, except pxr/base/js/rapidjson/msinttypes/ (both +# removed in %%prep) # - pxr/base/pegtl/ # - pxr/base/tf/pxrTslRobinMap/ # - pxr/imaging/garch/khrplatform.h @@ -144,6 +145,8 @@ Patch: 0001-Downstream-only-use-the-system-double-conversion-lib.patch Patch: 0002-Downstream-only-use-the-system-lz4-library.patch # Downstream-only: use the system pugixml library Patch: 0003-Downstream-only-use-the-system-pugixml-library.patch +# Downstream-only: use the system rapidjson library +Patch: 0004-Downstream-only-use-the-system-rapidjson-library.patch # Base BuildRequires: gcc-c++ @@ -167,6 +170,7 @@ BuildRequires: cmake(double-conversion) BuildRequires: pkgconfig(liblz4) BuildRequires: cli11-devel cli11-static BuildRequires: cmake(pugixml) +BuildRequires: rapidjson-devel rapidjson-static BuildRequires: cmake(Imath) >= 3.0 @@ -263,9 +267,6 @@ Summary: Universal Scene Description library # surrounding code is patched (upstream or downstream) for compatibility with # ilmbase version 3, something we’re currently not willing to attempt. Provides: bundled(ilmbase) = 2.5.3 -# Version from: pxr/base/js/rapidjson/rapidjson.h -# (RAPIDJSON_{MAJOR,MINOR,PATCH}_VERSION) -Provides: bundled(rapidjson) = 1.1.0 # Forked from an unknown version: pxr/base/tf/pxrTslRobinMap/ Provides: bundled(robin-map) # Version from: pxr/base/pegtl/pegtl/version.hpp @@ -308,6 +309,9 @@ Provides: bundled(PEGTL) = 3.2.7 # third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # (header comment) # Provides: bundled(pugixml) = 1.9 +# Version from: pxr/base/js/rapidjson/rapidjson.h +# (RAPIDJSON_{MAJOR,MINOR,PATCH}_VERSION) +# Provides: bundled(rapidjson) = 1.1.0 %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -424,6 +428,9 @@ do #include <$(basename "${hdr}")> EOF done +# Remove the bundled copy of rapidjson. It does not seem to have been modified +# or forked at all. +rm -rv pxr/base/js/rapidjson/ # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ From add7b33a3e4d1fb4d17d98669d55acea8659178f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 17:21:27 -0400 Subject: [PATCH 106/167] Unbundle robin-map --- usd.spec | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index f0a8e3f..cb72cdf 100644 --- a/usd.spec +++ b/usd.spec @@ -171,6 +171,7 @@ BuildRequires: pkgconfig(liblz4) BuildRequires: cli11-devel cli11-static BuildRequires: cmake(pugixml) BuildRequires: rapidjson-devel rapidjson-static +BuildRequires: robin-map-devel robin-map-static BuildRequires: cmake(Imath) >= 3.0 @@ -267,8 +268,6 @@ Summary: Universal Scene Description library # surrounding code is patched (upstream or downstream) for compatibility with # ilmbase version 3, something we’re currently not willing to attempt. Provides: bundled(ilmbase) = 2.5.3 -# Forked from an unknown version: pxr/base/tf/pxrTslRobinMap/ -Provides: bundled(robin-map) # Version from: pxr/base/pegtl/pegtl/version.hpp Provides: bundled(PEGTL) = 3.2.7 # Version from pxr/imaging/hio/OpenEXR/OpenEXRCore/openexr_version.h @@ -312,6 +311,8 @@ Provides: bundled(PEGTL) = 3.2.7 # Version from: pxr/base/js/rapidjson/rapidjson.h # (RAPIDJSON_{MAJOR,MINOR,PATCH}_VERSION) # Provides: bundled(rapidjson) = 1.1.0 +# Forked from an unknown version: pxr/base/tf/pxrTslRobinMap/ +# Provides: bundled(robin-map) %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -431,6 +432,19 @@ done # Remove the bundled copy of rapidjson. It does not seem to have been modified # or forked at all. rm -rv pxr/base/js/rapidjson/ +# Remove the bundled copy of robin-map. There are several macros that are +# renamed from TSL_*/tsl_* to PXR_TSL_*/pxr_tsl_* in the bundled copy, and we +# could “alias” these if necessary to avoid patching call sites, but for now +# are not used outside the library headers and we can get by with merely +# aliasing the namespace. +find pxr/base/tf/pxrTslRobinMap -type f ! -name '*.h' -print -delete +for hdr in pxr/base/tf/pxrTslRobinMap/*.h +do + cat > "${hdr}" < +namespace pxr_tsl = tsl; +EOF +done # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ From dd5ef7aabd2e6829672af462216812b23cb3ea95 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 18:45:36 -0400 Subject: [PATCH 107/167] Improve notes about bundled PEGTL [skip changelog] --- usd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index cb72cdf..e7e647d 100644 --- a/usd.spec +++ b/usd.spec @@ -269,6 +269,8 @@ Summary: Universal Scene Description library # ilmbase version 3, something we’re currently not willing to attempt. Provides: bundled(ilmbase) = 2.5.3 # Version from: pxr/base/pegtl/pegtl/version.hpp +# Currently, Fedora’s PEGTL is too old: +# https://bugzilla.redhat.com/show_bug.cgi?id=1902427 Provides: bundled(PEGTL) = 3.2.7 # Version from pxr/imaging/hio/OpenEXR/OpenEXRCore/openexr_version.h Provides: bundled(openexr) = 3.2.0 @@ -290,8 +292,6 @@ Provides: bundled(libavif) = 1.0.1 Provides: bundled(libyuv) = 0^20240812gita977463 # Version from pxr/imaging/plugin/hioAvif/aom/config/aom_version.h Provides: bundled(aom) = 3.0.0 -# Version from pxr/base/pegtl/pegtl/version.hpp -Provides: bundled(PEGTL) = 3.2.7 # We are currently able to unbundle these and use system libraries, but we # retain the virtual Provides, commented out, as documentation and in case we From 14fbe0314c2505d85c21efd0030523876603bfbe Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 19:50:22 -0400 Subject: [PATCH 108/167] Add a note about not unbundling OpenEXR for now [skip changelog] --- usd.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usd.spec b/usd.spec index e7e647d..87c7dda 100644 --- a/usd.spec +++ b/usd.spec @@ -273,6 +273,13 @@ Provides: bundled(ilmbase) = 2.5.3 # https://bugzilla.redhat.com/show_bug.cgi?id=1902427 Provides: bundled(PEGTL) = 3.2.7 # Version from pxr/imaging/hio/OpenEXR/OpenEXRCore/openexr_version.h +# From pxr/imaging/hio/OpenEXR/README.md: +# A few changes are still in progress to upstreamed to the OpenEXR project, +# but these are minor, and otherwise, almost all differences between the +# interred OpenEXRCore and the official OpenEXR repo are consolidated to the +# openexr_conf.h header. The remaining differences are removing an extern +# marking from the few global data tables. +# This suggests that it may not be entirely safe to unbundle this. Provides: bundled(openexr) = 3.2.0 # Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h Provides: bundled(libdeflate) = 1.18 From 3212a880698f2cd6670badd5e23359a0879ae5bc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 2 Sep 2024 11:51:50 -0400 Subject: [PATCH 109/167] Unbundle libdeflate --- ...use-the-system-double-conversion-lib.patch | 2 +- ...ream-only-use-the-system-lz4-library.patch | 2 +- ...-only-use-the-system-pugixml-library.patch | 2 +- ...nly-use-the-system-rapidjson-library.patch | 2 +- ...tream-only-use-the-system-libdeflate.patch | 77 +++++++++++++++++++ usd.spec | 11 ++- 6 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 0005-Downstream-only-use-the-system-libdeflate.patch diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index a6238e7..649a158 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,7 +1,7 @@ From 0f786f889eeea75a1983d694bfa168c003009b35 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 -Subject: [PATCH 1/4] Downstream-only: use the system double-conversion library +Subject: [PATCH 1/5] Downstream-only: use the system double-conversion library --- pxr/base/tf/CMakeLists.txt | 11 +++-------- diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index 956e21d..7b1ecb7 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,7 +1,7 @@ From 9ace4ea6c8e3a17c9d047f8bd7c5ccd11fb4ffb8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 -Subject: [PATCH 2/4] Downstream-only: use the system lz4 library +Subject: [PATCH 2/5] Downstream-only: use the system lz4 library --- pxr/base/tf/CMakeLists.txt | 5 ++++- diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index e401ed1..c88e702 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,7 +1,7 @@ From 93d27e7deea9c2a5eadc6257cef90f5eaef13777 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 -Subject: [PATCH 3/4] Downstream-only: use the system pugixml library +Subject: [PATCH 3/5] Downstream-only: use the system pugixml library --- .../renderman-25/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index d72a6de..30d1e95 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,7 +1,7 @@ From fa40048ee12fbe5a2cb8ba12ada1a354f1587d1a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 -Subject: [PATCH 4/4] Downstream-only: use the system rapidjson library +Subject: [PATCH 4/5] Downstream-only: use the system rapidjson library --- pxr/base/js/CMakeLists.txt | 37 ------------------------------------- diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch new file mode 100644 index 0000000..9f99cb9 --- /dev/null +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -0,0 +1,77 @@ +From 3953ba8f55501ec3c03f8553af156990f89834f3 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Sun, 1 Sep 2024 21:30:11 -0400 +Subject: [PATCH 5/5] Downstream-only: use the system libdeflate + +--- + pxr/imaging/hio/CMakeLists.txt | 5 +++++ + pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c | 3 +-- + pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h | 12 ------------ + 3 files changed, 6 insertions(+), 14 deletions(-) + +diff --git a/pxr/imaging/hio/CMakeLists.txt b/pxr/imaging/hio/CMakeLists.txt +index 92d1e4fe9..9f30c1209 100644 +--- a/pxr/imaging/hio/CMakeLists.txt ++++ b/pxr/imaging/hio/CMakeLists.txt +@@ -1,6 +1,9 @@ + set(PXR_PREFIX pxr/imaging) + set(PXR_PACKAGE hio) + ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(DEFLATE REQUIRED libdeflate) ++ + pxr_library(hio + LIBRARIES + arch +@@ -11,9 +14,11 @@ pxr_library(hio + trace + ar + hf ++ ${DEFLATE_LIBRARIES} + + INCLUDE_DIRS + ${Boost_INCLUDE_DIRS} ++ ${DEFLATE_INCLUDE_DIRS} + + PUBLIC_CLASSES + fieldTextureData +diff --git a/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c b/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c +index a672e833b..1d2eaea56 100644 +--- a/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c ++++ b/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c +@@ -8,8 +8,7 @@ + #include "internal_memory.h" + #include "internal_structs.h" + +-// pxr #include +-#include "../deflate/libdeflate.h" ++#include + + #if ( \ + LIBDEFLATE_VERSION_MAJOR > 1 || \ +diff --git a/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h b/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h +index 7481a346e..71bdde9cc 100644 +--- a/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h ++++ b/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h +@@ -8,18 +8,6 @@ + + #include "OpenEXRCore/openexr_config.h" + +-#include "deflate/lib/lib_common.h" +-#include "deflate/common_defs.h" +-#include "deflate/lib/utils.c" +-#include "deflate/lib/arm/cpu_features.c" +-#include "deflate/lib/x86/cpu_features.c" +-#include "deflate/lib/deflate_compress.c" +-#undef BITBUF_NBITS +-#include "deflate/lib/deflate_decompress.c" +-#include "deflate/lib/adler32.c" +-#include "deflate/lib/zlib_compress.c" +-#include "deflate/lib/zlib_decompress.c" +- + #include "openexr-c.h" + + #include "OpenEXRCore/attributes.c" +-- +2.46.0 + diff --git a/usd.spec b/usd.spec index 87c7dda..1c2628a 100644 --- a/usd.spec +++ b/usd.spec @@ -56,7 +56,7 @@ Summary: 3D VFX pipeline interchange file format # - pxr/base/tf/pxrTslRobinMap/ # - pxr/imaging/garch/khrplatform.h # - pxr/imaging/hgiVulkan/vk_mem_alloc.h -# - pxr/imaging/hio/EpenEXR/deflate/ +# - pxr/imaging/hio/OpenEXR/deflate/ (removed in %%prep) # - third_party/renderman-25/plugin/rmanArgsParser/pugixml/ (removed in %%prep) # - third_party/renderman-26/plugin/rmanArgsParser/pugixml/ (removed in %%prep) # MIT OR Unlicense: @@ -147,6 +147,8 @@ Patch: 0002-Downstream-only-use-the-system-lz4-library.patch Patch: 0003-Downstream-only-use-the-system-pugixml-library.patch # Downstream-only: use the system rapidjson library Patch: 0004-Downstream-only-use-the-system-rapidjson-library.patch +# Downstream-only: use the system libdeflate library +Patch: 0005-Downstream-only-use-the-system-libdeflate.patch # Base BuildRequires: gcc-c++ @@ -172,6 +174,7 @@ BuildRequires: cli11-devel cli11-static BuildRequires: cmake(pugixml) BuildRequires: rapidjson-devel rapidjson-static BuildRequires: robin-map-devel robin-map-static +BuildRequires: pkgconfig(libdeflate) BuildRequires: cmake(Imath) >= 3.0 @@ -281,8 +284,6 @@ Provides: bundled(PEGTL) = 3.2.7 # marking from the few global data tables. # This suggests that it may not be entirely safe to unbundle this. Provides: bundled(openexr) = 3.2.0 -# Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h -Provides: bundled(libdeflate) = 1.18 # Version from pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h # We actually have a post-release snapshot of libavif, because # AVIF_VERSION_DEVEL is nonzero, but it’s not easy to determine which commit @@ -320,6 +321,8 @@ Provides: bundled(aom) = 3.0.0 # Provides: bundled(rapidjson) = 1.1.0 # Forked from an unknown version: pxr/base/tf/pxrTslRobinMap/ # Provides: bundled(robin-map) +# Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h +# Provides: bundled(libdeflate) = 1.18 %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -452,6 +455,8 @@ do namespace pxr_tsl = tsl; EOF done +# Remove the bundled copy of libdeflate. +rm -rv pxr/imaging/hio/OpenEXR/deflate/ # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ From 472f446e6223824080414eea0f32dd85eb7f596c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:26:33 -0400 Subject: [PATCH 110/167] Unbundle libavif/aom/libyuv --- ...use-the-system-double-conversion-lib.patch | 2 +- ...ream-only-use-the-system-lz4-library.patch | 2 +- ...-only-use-the-system-pugixml-library.patch | 2 +- ...nly-use-the-system-rapidjson-library.patch | 2 +- ...tream-only-use-the-system-libdeflate.patch | 2 +- ...wnstream-only-use-the-system-libavif.patch | 241 ++++++++++++++++++ usd.spec | 40 +-- 7 files changed, 270 insertions(+), 21 deletions(-) create mode 100644 0006-Downstream-only-use-the-system-libavif.patch diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 649a158..22ab01c 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,7 +1,7 @@ From 0f786f889eeea75a1983d694bfa168c003009b35 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 -Subject: [PATCH 1/5] Downstream-only: use the system double-conversion library +Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library --- pxr/base/tf/CMakeLists.txt | 11 +++-------- diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index 7b1ecb7..aae45cc 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,7 +1,7 @@ From 9ace4ea6c8e3a17c9d047f8bd7c5ccd11fb4ffb8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 -Subject: [PATCH 2/5] Downstream-only: use the system lz4 library +Subject: [PATCH 2/6] Downstream-only: use the system lz4 library --- pxr/base/tf/CMakeLists.txt | 5 ++++- diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index c88e702..416bb52 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,7 +1,7 @@ From 93d27e7deea9c2a5eadc6257cef90f5eaef13777 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 -Subject: [PATCH 3/5] Downstream-only: use the system pugixml library +Subject: [PATCH 3/6] Downstream-only: use the system pugixml library --- .../renderman-25/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index 30d1e95..e58c8b6 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,7 +1,7 @@ From fa40048ee12fbe5a2cb8ba12ada1a354f1587d1a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 -Subject: [PATCH 4/5] Downstream-only: use the system rapidjson library +Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library --- pxr/base/js/CMakeLists.txt | 37 ------------------------------------- diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index 9f99cb9..7bcd8ee 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,7 +1,7 @@ From 3953ba8f55501ec3c03f8553af156990f89834f3 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 -Subject: [PATCH 5/5] Downstream-only: use the system libdeflate +Subject: [PATCH 5/6] Downstream-only: use the system libdeflate --- pxr/imaging/hio/CMakeLists.txt | 5 +++++ diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch new file mode 100644 index 0000000..84b62a4 --- /dev/null +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -0,0 +1,241 @@ +From 73424900f3a874b82a3dfefb44ecdfa3a0d1836e Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Wed, 4 Sep 2024 11:09:47 -0400 +Subject: [PATCH 6/6] Downstream-only: use the system libavif + +--- + pxr/imaging/plugin/hioAvif/AVIFImage.cpp | 2 +- + pxr/imaging/plugin/hioAvif/CMakeLists.txt | 195 +--------------------- + 2 files changed, 8 insertions(+), 189 deletions(-) + +diff --git a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp +index 6f625e085..eeb52a281 100644 +--- a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp ++++ b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp +@@ -29,7 +29,7 @@ ARCH_PRAGMA_UNUSED_FUNCTION + #include "pxr/base/tf/stringUtils.h" + #include "pxr/base/tf/type.h" + +-#include "pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h" ++#include + + + #include "pxr/base/arch/export.h" +diff --git a/pxr/imaging/plugin/hioAvif/CMakeLists.txt b/pxr/imaging/plugin/hioAvif/CMakeLists.txt +index 29ffe0fdf..7f1680eaf 100644 +--- a/pxr/imaging/plugin/hioAvif/CMakeLists.txt ++++ b/pxr/imaging/plugin/hioAvif/CMakeLists.txt +@@ -1,6 +1,9 @@ + set(PXR_PREFIX pxr/imaging) + set(PXR_PACKAGE hioAvif) + ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(AVIF REQUIRED libavif) ++ + pxr_plugin(hioAvif + LIBRARIES + ar +@@ -8,196 +11,12 @@ pxr_plugin(hioAvif + gf + hio + tf ++ ${AVIF_LIBRARIES} ++ ++ INCLUDE_DIRS ++ ${AVIF_INCLUDE_DIRS} + +- PRIVATE_HEADERS +- aom/aom.h +- aom/aom_codec.h +- aom/aom_decoder.h +- aom/aom_encoder.h +- aom/aom_frame_buffer.h +- aom/aom_image.h +- aom/aom_integer.h +- aom/aomdx.h +- aom/aom_dsp/binary_codes_reader.h +- aom/aom_dsp/bitreader.h +- aom/aom_dsp/aom_dsp_common.h +- aom/aom_dsp/bitreader_buffer.h +- aom/aom_dsp/blend.h +- aom/aom_dsp/entcode.h +- aom/aom_dsp/entdec.h +- aom/aom_dsp/grain_table.h +- aom/aom_dsp/aom_filter.h +- aom/aom_dsp/grain_synthesis.h +- aom/aom_dsp/intrapred_common.h +- aom/aom_dsp/prob.h +- aom/aom_dsp/recenter.h +- aom/aom_dsp/txfm_common.h +- aom/aom_mem/aom_mem.h +- aom/aom_mem/include/aom_mem_intrnl.h +- aom/aom_ports/bitops.h +- aom/aom_ports/aom_once.h +- aom/aom_ports/mem.h +- aom/aom_ports/mem_ops.h +- aom/aom_ports/mem_ops_aligned.h +- aom/aom_ports/msvc.h +- aom/aom_ports/system_state.h +- aom/aom_ports/aom_timer.h +- aom/aom_scale/aom_scale.h +- aom/aom_scale/yv12config.h +- aom/aom_util/aom_thread.h +- aom/av1/av1_iface_common.h +- aom/av1/common/av1_common_int.h +- aom/av1/common/alloccommon.h +- aom/av1/common/av1_inv_txfm1d.h +- aom/av1/common/av1_inv_txfm1d_cfg.h +- aom/av1/common/av1_loopfilter.h +- aom/av1/common/av1_txfm.h +- aom/av1/common/blockd.h +- aom/av1/common/cdef.h +- aom/av1/common/cdef_block.h +- aom/av1/common/cfl.h +- aom/av1/common/common.h +- aom/av1/common/common_data.h +- aom/av1/common/convolve.h +- aom/av1/common/entropy.h +- aom/av1/common/entropymode.h +- aom/av1/common/entropymv.h +- aom/av1/common/enums.h +- aom/av1/common/filter.h +- aom/av1/common/frame_buffers.h +- aom/av1/common/mv.h +- aom/av1/common/mvref_common.h +- aom/av1/common/idct.h +- aom/av1/common/obmc.h +- aom/av1/common/obu_util.h +- aom/av1/common/odintrin.h +- aom/av1/common/pred_common.h +- aom/av1/common/quant_common.h +- aom/av1/common/reconinter.h +- aom/av1/common/reconintra.h +- aom/av1/common/resize.h +- aom/av1/common/restoration.h +- aom/av1/common/scale.h +- aom/av1/common/scan.h +- aom/av1/common/seg_common.h +- aom/av1/common/thread_common.h +- aom/av1/common/tile_common.h +- aom/av1/common/timing.h +- aom/av1/common/token_cdfs.h +- aom/av1/common/txb_common.h +- aom/av1/common/warped_motion.h +- aom/av1/decoder/decodeframe.h +- aom/av1/decoder/decoder.h +- aom/av1/decoder/decodemv.h +- aom/av1/decoder/decodetxb.h +- aom/av1/decoder/detokenize.h +- aom/av1/decoder/dthread.h +- aom/av1/decoder/obu.h +- aom/config/aom_config.h +- aom/config/aom_dsp_rtcd.h +- aom/config/aom_scale_rtcd.h +- aom/config/aom_version.h +- aom/config/av1_rtcd.h +- aom/internal/aom_codec_internal.h +- aom/internal/aom_image_internal.h +- aom/internal/common/args_helper.h +- AVIF/src/avif/avif.h +- AVIF/src/avif/internal.h +- AVIF/src/src-libyuv/libyuv/basic_types.h +- AVIF/src/src-libyuv/libyuv.h +- AVIF/src/src-libyuv/libyuv/planar_functions.h +- AVIF/src/src-libyuv/libyuv/row.h +- AVIF/src/src-libyuv/libyuv/scale.h +- AVIF/src/src-libyuv/libyuv/scale_row.h +- AVIF/src/src-libyuv/libyuv/version.h +- + CPPFILES +- aom/aom_codec.c +- aom/aom_decoder.c +- aom/aom_image.c +- aom/aom_integer.c +- aom/aom_dsp/aom_convolve.c +- aom/aom_dsp/aom_dsp_rtcd.c +- aom/aom_dsp/binary_codes_reader.c +- aom/aom_dsp/bitreader.c +- aom/aom_dsp/bitreader_buffer.c +- aom/aom_dsp/blend_a64_hmask.c +- aom/aom_dsp/blend_a64_vmask.c +- aom/aom_dsp/blend_a64_mask.c +- aom/aom_dsp/entcode.c +- aom/aom_dsp/entdec.c +- aom/aom_dsp/grain_synthesis.c +- aom/aom_dsp/intrapred.c +- aom/aom_dsp/loopfilter.c +- aom/aom_mem/aom_mem.c +- aom/aom_scale/aom_scale_rtcd.c +- aom/aom_scale/generic/aom_scale.c +- aom/aom_scale/generic/gen_scalers.c +- aom/aom_scale/generic/yv12config.c +- aom/aom_scale/generic/yv12extend.c +- aom/aom_util/aom_thread.c +- aom/av1/av1_dx_iface.c +- aom/av1/common/alloccommon.c +- aom/av1/common/av1_inv_txfm1d.c +- aom/av1/common/av1_inv_txfm2d.c +- aom/av1/common/av1_loopfilter.c +- aom/av1/common/av1_txfm.c +- aom/av1/common/av1_rtcd.c +- aom/av1/common/blockd.c +- aom/av1/common/cdef.c +- aom/av1/common/cdef_block.c +- aom/av1/common/cfl.c +- aom/av1/common/convolve.c +- aom/av1/common/entropymode.c +- aom/av1/common/entropy.c +- aom/av1/common/entropymv.c +- aom/av1/common/frame_buffers.c +- aom/av1/common/idct.c +- aom/av1/common/mvref_common.c +- aom/av1/common/obu_util.c +- aom/av1/common/pred_common.c +- aom/av1/common/quant_common.c +- aom/av1/common/reconinter.c +- aom/av1/common/reconintra.c +- aom/av1/common/resize.c +- aom/av1/common/restoration.c +- aom/av1/common/av1_scale.c +- aom/av1/common/scan.c +- aom/av1/common/seg_common.c +- aom/av1/common/thread_common.c +- aom/av1/common/timing.c +- aom/av1/common/txb_common.c +- aom/av1/common/tile_common.c +- aom/av1/common/warped_motion.c +- aom/av1/decoder/decodeframe.c +- aom/av1/decoder/decodemv.c +- aom/av1/decoder/decoder.c +- aom/av1/decoder/decodetxb.c +- aom/av1/decoder/detokenize.c +- aom/av1/decoder/obu.c +- AVIF/src/alpha.c +- AVIF/src/avif.c +- AVIF/src/codec_aom.c +- AVIF/src/colr.c +- AVIF/src/diag.c +- AVIF/src/exif.c +- AVIF/src/io.c +- AVIF/src/mem.c +- AVIF/src/avif_obu.c +- AVIF/src/rawdata.c +- AVIF/src/read.c +- AVIF/src/reformat.c +- AVIF/src/reformat_libsharpyuv.c +- AVIF/src/reformat_libyuv.c +- AVIF/src/avif-scale.c +- AVIF/src/stream.c +- AVIF/src/utils.c +- AVIF/src/write.c +- AVIF/src/src-libyuv/planar_functions.c +- AVIF/src/src-libyuv/row_common.c +- AVIF/src/src-libyuv/yuv_scale.c +- AVIF/src/src-libyuv/scale_any.c +- AVIF/src/src-libyuv/scale_common.c + AVIFImage.cpp + + RESOURCE_FILES +-- +2.46.0 + diff --git a/usd.spec b/usd.spec index 1c2628a..c98000a 100644 --- a/usd.spec +++ b/usd.spec @@ -149,6 +149,8 @@ Patch: 0003-Downstream-only-use-the-system-pugixml-library.patch Patch: 0004-Downstream-only-use-the-system-rapidjson-library.patch # Downstream-only: use the system libdeflate library Patch: 0005-Downstream-only-use-the-system-libdeflate.patch +# Downstream-only: use the system libavif library +Patch: 0006-Downstream-only-use-the-system-libavif.patch # Base BuildRequires: gcc-c++ @@ -175,6 +177,8 @@ BuildRequires: cmake(pugixml) BuildRequires: rapidjson-devel rapidjson-static BuildRequires: robin-map-devel robin-map-static BuildRequires: pkgconfig(libdeflate) +# Unbundling this means we also use external versions of libaom and libyuv. +BuildRequires: pkgconfig(libavif) BuildRequires: cmake(Imath) >= 3.0 @@ -284,22 +288,6 @@ Provides: bundled(PEGTL) = 3.2.7 # marking from the few global data tables. # This suggests that it may not be entirely safe to unbundle this. Provides: bundled(openexr) = 3.2.0 -# Version from pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h -# We actually have a post-release snapshot of libavif, because -# AVIF_VERSION_DEVEL is nonzero, but it’s not easy to determine which commit -# hash it was copied from. -Provides: bundled(libavif) = 1.0.1 -# Version from pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/libyuv/version.h -# LIBYUV_VERSION is a “serial number” version, e.g. 1895, that gets incremented -# every time changes are dumped into git from an internal VCS; the libyuv -# package in Fedora is considered to have version 0 and uses snapshot -# versioning. We can dig through -# https://chromium.googlesource.com/libyuv/libyuv and find the commit hash that -# corresponds to a particular serial number. -# LIBYUV_VERSION 1895 = commit a97746349b244efd54ab1eb0c0a7366717b33f39 -Provides: bundled(libyuv) = 0^20240812gita977463 -# Version from pxr/imaging/plugin/hioAvif/aom/config/aom_version.h -Provides: bundled(aom) = 3.0.0 # We are currently able to unbundle these and use system libraries, but we # retain the virtual Provides, commented out, as documentation and in case we @@ -323,6 +311,22 @@ Provides: bundled(aom) = 3.0.0 # Provides: bundled(robin-map) # Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h # Provides: bundled(libdeflate) = 1.18 +# Version from pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h +# We actually have a post-release snapshot of libavif, because +# AVIF_VERSION_DEVEL is nonzero, but it’s not easy to determine which commit +# hash it was copied from. +# Provides: bundled(libavif) = 1.0.1 +# Version from pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/libyuv/version.h +# LIBYUV_VERSION is a “serial number” version, e.g. 1895, that gets incremented +# every time changes are dumped into git from an internal VCS; the libyuv +# package in Fedora is considered to have version 0 and uses snapshot +# versioning. We can dig through +# https://chromium.googlesource.com/libyuv/libyuv and find the commit hash that +# corresponds to a particular serial number. +# LIBYUV_VERSION 1895 = commit a97746349b244efd54ab1eb0c0a7366717b33f39 +# Provides: bundled(libyuv) = 0^20240812gita977463 +# Version from pxr/imaging/plugin/hioAvif/aom/config/aom_version.h +# Provides: bundled(aom) = 3.0.0 %description libs Universal Scene Description (USD) is an efficient, scalable system for @@ -457,6 +461,10 @@ EOF done # Remove the bundled copy of libdeflate. rm -rv pxr/imaging/hio/OpenEXR/deflate/ +# Remove the bundled copies of libavif, along with the associated libaom and +# the libyuv that is in the libavif sources. +rm -rv pxr/imaging/plugin/hioAvif/aom/ \ + pxr/imaging/plugin/hioAvif/AVIF/ # Use c++17 standard otherwise build fails sed -i 's|set(CMAKE_CXX_STANDARD 14)|set(CMAKE_CXX_STANDARD 17)|g' \ From fc01dde67d62d0b36743deff12b87f3b55a369fa Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 15:44:28 -0400 Subject: [PATCH 111/167] Add dependencies from -devel on unbundled libraries that are exposed in the API --- usd.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usd.spec b/usd.spec index c98000a..b9bbeef 100644 --- a/usd.spec +++ b/usd.spec @@ -337,6 +337,10 @@ interchange between graphics applications. Summary: Development files for USD Requires: usd-libs%{?_isa} = %{version}-%{release} +# Unbundled, and exposed in the API: +Requires: cli11-devel cli11-static +Requires: robin-map-devel robin-map-static + %description devel This package contains the C++ header files and symbolic links to the shared libraries for usd. If you would like to develop programs using usd, From d4c6d9b92f926fc7573f76f0555a7ba39efcb7de Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Wed, 9 Oct 2024 17:44:25 -0500 Subject: [PATCH 112/167] Rebuild for OpenColorIO 2.4.0. From a21c0aeb47fa6c26bd6d5a955ce5e9577c505f12 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 25 Oct 2024 17:32:32 -0600 Subject: [PATCH 113/167] Rebuild for hdf5 1.14.5 From 5f8486734cba31bc405e1842bb2a291a27b561ff Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 13 Nov 2024 06:30:21 -0500 Subject: [PATCH 114/167] Update to 24.11 (close RHBZ#2321975) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 16 ++++---- ...use-the-system-double-conversion-lib.patch | 16 ++++---- ...ream-only-use-the-system-lz4-library.patch | 14 +++---- ...-only-use-the-system-pugixml-library.patch | 34 ++-------------- ...nly-use-the-system-rapidjson-library.patch | 8 ++-- ...tream-only-use-the-system-libdeflate.patch | 17 ++++---- ...wnstream-only-use-the-system-libavif.patch | 6 +-- 2266.patch | 20 +++++----- sources | 2 +- usd.spec | 39 +++++++++++++++---- 11 files changed, 82 insertions(+), 91 deletions(-) diff --git a/.gitignore b/.gitignore index 2426ed6..4095fbd 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /OpenUSD-24.03.tar.gz /OpenUSD-24.05.tar.gz /OpenUSD-24.08.tar.gz +/OpenUSD-24.11.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index dbf0967..47edf9d 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 83c22378ffadc7f52081d98a432c65bbd2d79f9c Mon Sep 17 00:00:00 2001 +From c9e84b3336cd20276f537c7b0dc31146e5cb5f78 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 8 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 427608ca8..4eca9b076 100644 +index e9657e399..8ca178ed4 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "24") - set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits + set(PXR_PATCH_VERSION "11") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -51,10 +51,10 @@ index 427608ca8..4eca9b076 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index 48fe107dd..23ecc44ea 100644 +index 311524da0..b056486da 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake -@@ -1342,6 +1342,7 @@ function(_pxr_library NAME) +@@ -1370,6 +1370,7 @@ function(_pxr_library NAME) IMPORT_PREFIX "${args_PREFIX}" PREFIX "${args_PREFIX}" SUFFIX "${args_SUFFIX}" @@ -63,10 +63,10 @@ index 48fe107dd..23ecc44ea 100644 target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index 9f3d35837..478434cbd 100644 +index 1b809e738..7b557224d 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake -@@ -1004,6 +1004,7 @@ function(pxr_toplevel_prologue) +@@ -1074,6 +1074,7 @@ function(pxr_toplevel_prologue) FOLDER "${folder}" PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" @@ -75,5 +75,5 @@ index 9f3d35837..478434cbd 100644 _get_install_dir("lib" libInstallPrefix) install( -- -2.46.0 +2.47.0 diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 22ab01c..7d5f53d 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From 0f786f889eeea75a1983d694bfa168c003009b35 Mon Sep 17 00:00:00 2001 +From c000fad5c7b103ac222c2afabc88c145dc42f10a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -8,10 +8,10 @@ Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index b236184c4..c1a24a87f 100644 +index 306419493..f4bfecb16 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt -@@ -110,6 +110,8 @@ function(add_py_dll_link_test) +@@ -110,11 +110,14 @@ function(add_py_dll_link_test) endfunction() @@ -20,15 +20,13 @@ index b236184c4..c1a24a87f 100644 pxr_library(tf LIBRARIES arch -@@ -117,6 +119,7 @@ pxr_library(tf - ${PYTHON_LIBRARIES} - ${Boost_PYTHON_LIBRARY} + ${WINLIBS} ${TBB_tbb_LIBRARY} + ${double-conversion_LIBRARY} INCLUDE_DIRS - ${PYTHON_INCLUDE_DIRS} -@@ -283,14 +286,6 @@ pxr_library(tf + ${TBB_INCLUDE_DIRS} +@@ -281,14 +284,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -44,5 +42,5 @@ index b236184c4..c1a24a87f 100644 PYTHON_CPPFILES -- -2.46.0 +2.47.0 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index aae45cc..c0af3d3 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,4 +1,4 @@ -From 9ace4ea6c8e3a17c9d047f8bd7c5ccd11fb4ffb8 Mon Sep 17 00:00:00 2001 +From 40d98ed4043a5d5426f39a513f1e628e81a79a82 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library @@ -8,7 +8,7 @@ Subject: [PATCH 2/6] Downstream-only: use the system lz4 library 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index c1a24a87f..56f75ae22 100644 +index f4bfecb16..eadd8ba3a 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -111,6 +111,8 @@ function(add_py_dll_link_test) @@ -20,21 +20,19 @@ index c1a24a87f..56f75ae22 100644 pxr_library(tf LIBRARIES -@@ -120,11 +122,13 @@ pxr_library(tf - ${Boost_PYTHON_LIBRARY} +@@ -118,9 +120,11 @@ pxr_library(tf + ${WINLIBS} ${TBB_tbb_LIBRARY} ${double-conversion_LIBRARY} + ${LZ4_LIBRARIES} INCLUDE_DIRS - ${PYTHON_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} + ${LZ4_INCLUDE_DIRS} PUBLIC_CLASSES anyUniquePtr -@@ -286,7 +290,6 @@ pxr_library(tf +@@ -284,7 +288,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -43,5 +41,5 @@ index c1a24a87f..56f75ae22 100644 PYTHON_CPPFILES moduleDeps.cpp -- -2.46.0 +2.47.0 diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 416bb52..aadc144 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,40 +1,12 @@ -From 93d27e7deea9c2a5eadc6257cef90f5eaef13777 Mon Sep 17 00:00:00 2001 +From f2ad73cd2d582ad3929a5f2d70fd1a2b1cb937b4 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library --- - .../renderman-25/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- .../renderman-26/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- - 2 files changed, 6 insertions(+), 6 deletions(-) + 1 file changed, 3 insertions(+), 3 deletions(-) -diff --git a/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt -index fae498d58..a7587b240 100644 ---- a/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt -+++ b/third_party/renderman-25/plugin/rmanArgsParser/CMakeLists.txt -@@ -1,6 +1,8 @@ - set(PXR_PREFIX "") - set(PXR_PACKAGE rmanArgsParser) - -+find_library(pugixml_LIBRARY NAMES pugixml REQUIRED) -+ - pxr_plugin(rmanArgsParser - LIBRARIES - arch -@@ -10,12 +12,10 @@ pxr_plugin(rmanArgsParser - ar - ndr - sdr -+ ${pugixml_LIBRARY} - - PRIVATE_CLASSES - rmanArgsParser -- -- CPPFILES -- pugixml/pugixml.cpp - - PRIVATE_HEADERS - api.h diff --git a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt index fae498d58..a7587b240 100644 --- a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt @@ -63,5 +35,5 @@ index fae498d58..a7587b240 100644 PRIVATE_HEADERS api.h -- -2.46.0 +2.47.0 diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index e58c8b6..e61a488 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,4 +1,4 @@ -From fa40048ee12fbe5a2cb8ba12ada1a354f1587d1a Mon Sep 17 00:00:00 2001 +From 12f95f861d103fb3aa8ea4e4734fb00ee8942da8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library @@ -8,10 +8,10 @@ Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library 1 file changed, 37 deletions(-) diff --git a/pxr/base/js/CMakeLists.txt b/pxr/base/js/CMakeLists.txt -index f5ac5fb99..102e41151 100644 +index d59dc1f6d..086d1bc48 100644 --- a/pxr/base/js/CMakeLists.txt +++ b/pxr/base/js/CMakeLists.txt -@@ -18,43 +18,6 @@ pxr_library(js +@@ -15,43 +15,6 @@ pxr_library(js converter.h types.h @@ -56,5 +56,5 @@ index f5ac5fb99..102e41151 100644 overview.dox ) -- -2.46.0 +2.47.0 diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index 7bcd8ee..a4331f2 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,16 +1,16 @@ -From 3953ba8f55501ec3c03f8553af156990f89834f3 Mon Sep 17 00:00:00 2001 +From c3405db00fe0a74bfbccb1cc6b7d2071a80659af Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate --- - pxr/imaging/hio/CMakeLists.txt | 5 +++++ + pxr/imaging/hio/CMakeLists.txt | 7 +++++++ pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c | 3 +-- pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h | 12 ------------ - 3 files changed, 6 insertions(+), 14 deletions(-) + 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/pxr/imaging/hio/CMakeLists.txt b/pxr/imaging/hio/CMakeLists.txt -index 92d1e4fe9..9f30c1209 100644 +index 75e1e6298..09264c600 100644 --- a/pxr/imaging/hio/CMakeLists.txt +++ b/pxr/imaging/hio/CMakeLists.txt @@ -1,6 +1,9 @@ @@ -23,14 +23,13 @@ index 92d1e4fe9..9f30c1209 100644 pxr_library(hio LIBRARIES arch -@@ -11,9 +14,11 @@ pxr_library(hio +@@ -11,6 +14,10 @@ pxr_library(hio trace ar hf + ${DEFLATE_LIBRARIES} - - INCLUDE_DIRS - ${Boost_INCLUDE_DIRS} ++ ++ INCLUDE_DIRS + ${DEFLATE_INCLUDE_DIRS} PUBLIC_CLASSES @@ -73,5 +72,5 @@ index 7481a346e..71bdde9cc 100644 #include "OpenEXRCore/attributes.c" -- -2.46.0 +2.47.0 diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index 84b62a4..809572e 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,4 +1,4 @@ -From 73424900f3a874b82a3dfefb44ecdfa3a0d1836e Mon Sep 17 00:00:00 2001 +From 2c00aa60c1def4fba4a5498d776019ae75e3e561 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif @@ -9,7 +9,7 @@ Subject: [PATCH 6/6] Downstream-only: use the system libavif 2 files changed, 8 insertions(+), 189 deletions(-) diff --git a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp -index 6f625e085..eeb52a281 100644 +index b902a9806..e83af2acc 100644 --- a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp +++ b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp @@ -29,7 +29,7 @@ ARCH_PRAGMA_UNUSED_FUNCTION @@ -237,5 +237,5 @@ index 29ffe0fdf..7f1680eaf 100644 RESOURCE_FILES -- -2.46.0 +2.47.0 diff --git a/2266.patch b/2266.patch index ceb58f0..eb8ba37 100644 --- a/2266.patch +++ b/2266.patch @@ -1,4 +1,4 @@ -From c8fec1342e05dca98a1afd4ea93c7a5f0b41e25b Mon Sep 17 00:00:00 2001 +From a07a6b4d1da19bfc499db49641d74fb7c1a71e9b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 11 Feb 2023 13:58:42 -0500 Subject: [PATCH] Port to Embree 4.x @@ -89,7 +89,7 @@ index 195f83a633..d3cb949952 100644 args->valid[i] = 0; } diff --git a/pxr/imaging/plugin/hdEmbree/mesh.h b/pxr/imaging/plugin/hdEmbree/mesh.h -index 29b0d55029..79d166ac65 100644 +index bbb006302f..ef1ef07a98 100644 --- a/pxr/imaging/plugin/hdEmbree/mesh.h +++ b/pxr/imaging/plugin/hdEmbree/mesh.h @@ -15,8 +15,8 @@ @@ -119,13 +119,13 @@ index c32c35fffa..3712a9e3ab 100644 #include diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h -index 200633939c..37ffc9be3d 100644 +index 0369fea3a1..2f9f19fa09 100644 --- a/pxr/imaging/plugin/hdEmbree/pch.h +++ b/pxr/imaging/plugin/hdEmbree/pch.h -@@ -83,9 +83,9 @@ +@@ -84,9 +84,9 @@ #undef toupper #endif - #endif // PXR_PYTHON_SUPPORT_ENABLED + #endif // PXR_PYTHON_SUPPORT_ENABLED && !PXR_USE_INTERNAL_BOOST_PYTHON -#include -#include -#include @@ -136,7 +136,7 @@ index 200633939c..37ffc9be3d 100644 #include #include diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h -index d4f8f78d54..84af7d8fba 100644 +index 1d8694daa6..72894b9080 100644 --- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h +++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h @@ -14,7 +14,7 @@ @@ -162,10 +162,10 @@ index 206a7458bc..354fed4faa 100644 PXR_NAMESPACE_OPEN_SCOPE diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp -index 13956c7b25..cf90a952da 100644 +index 88d5e79093..820238c373 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.cpp +++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp -@@ -637,9 +637,7 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, +@@ -667,9 +667,7 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, rayHit.ray.flags = 0; _PopulateRayHit(&rayHit, origin, dir, 0.0f); { @@ -176,7 +176,7 @@ index 13956c7b25..cf90a952da 100644 // // there is something odd about how this is used in Embree. Is it reversed // here and then when it it used in -@@ -979,9 +977,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, +@@ -1005,9 +1003,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, shadow.flags = 0; _PopulateRay(&shadow, position, shadowDir, 0.001f); { @@ -188,7 +188,7 @@ index 13956c7b25..cf90a952da 100644 // Record this AO ray's contribution to the occlusion factor: a diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h -index 8e727ecba0..798fb5c22e 100644 +index 2da9880848..fc3e062dd8 100644 --- a/pxr/imaging/plugin/hdEmbree/renderer.h +++ b/pxr/imaging/plugin/hdEmbree/renderer.h @@ -15,8 +15,8 @@ diff --git a/sources b/sources index b14561f..15bf14b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-24.08.tar.gz) = 7d4404980579c4de3c155386184ca9d2eb96756ef6e090611bae7b4c21ad942c649f73a39b74ad84d0151ce6b9236c4b6c0c555e8e36fdd86304079e1c2e5cbe +SHA512 (OpenUSD-24.11.tar.gz) = 77c9601f4a689248448049660ef0083fc99e2a4c2e7a260814831bdfee8e9844f64b5b2aed88a9f907fe4ebcf6a532bb7dce80bb11c1f54c31066b07aa96b851 diff --git a/usd.spec b/usd.spec index b9bbeef..1f980cf 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.24.8 +%global downstream_so_version 0.24.11 %bcond alembic 1 %bcond draco 1 @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 24.08 +Version: 24.11 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -48,6 +48,8 @@ Summary: 3D VFX pipeline interchange file format # pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/; # pxr/imaging/plugin/hioAvif/AVIF/src/avif_obu.c has a different copyright # - pxr/imaging/plugin/hioAvif/aom/ +# BSL-1.0: +# - pxr/external/boost/ # MIT: # - docs/doxygen/doxygen-awesome-css/ (removed in %%prep) # - pxr/base/js/rapidjson/, except pxr/base/js/rapidjson/msinttypes/ (both @@ -57,14 +59,12 @@ Summary: 3D VFX pipeline interchange file format # - pxr/imaging/garch/khrplatform.h # - pxr/imaging/hgiVulkan/vk_mem_alloc.h # - pxr/imaging/hio/OpenEXR/deflate/ (removed in %%prep) -# - third_party/renderman-25/plugin/rmanArgsParser/pugixml/ (removed in %%prep) # - third_party/renderman-26/plugin/rmanArgsParser/pugixml/ (removed in %%prep) # MIT OR Unlicense: # - pxr/imaging/hio/stb/ # Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} -# - third_party/renderman-25/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} # - third_party/renderman-26/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} # # Additionally, the following would be listed above but are removed in %%prep: @@ -88,6 +88,7 @@ License: %{shrink: Apache-2.0 AND BSD-3-Clause AND BSD-2-Clause AND + BSL-1.0 AND MIT AND (MIT OR Unlicense) AND (Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2) @@ -164,7 +165,6 @@ BuildRequires: dos2unix BuildRequires: help2man BuildRequires: pkgconfig(blosc) -BuildRequires: boost-devel BuildRequires: pkgconfig(dri) BuildRequires: hdf5-devel BuildRequires: opensubdiv-devel >= 3.6.0 @@ -288,6 +288,27 @@ Provides: bundled(PEGTL) = 3.2.7 # marking from the few global data tables. # This suggests that it may not be entirely safe to unbundle this. Provides: bundled(openexr) = 3.2.0 +# Version from the message for the commit +# e7a8d718c7c113e1c653ee31dc52421f17e09b42 that introduced pxr/external/boost/: +# +# python: Initial import of boost::python from boost 1.85.0 +# This change just brings boost::python into the tree as a starting point for +# the pxr_boost::python implementation. The src/ and test/ directories are +# placed next to the public headers since we don't have separate +# public/private directory hierarchies like boost, but the code itself is +# unchanged and not included in the build. +# +# We use boost 1.85.0 as the starting point even though we're currently on +# VFX Reference Platform 2022, which specifies boost 1.76.0. This is because +# later versions of boost are needed for other platforms and versions of +# Python that OpenUSD supports. For example Python 3.11 requires boost +# 1.82.0+. +# +# This is not a candidate for unbundling because upstream has explicitly forked +# boost::python and modified it to work without the rest of Boost as part of an +# effort to remove the Boost dependency. While pxr_boost::python is derived +# from boost::python, it is not intended to remain compatible with it. +Provides: bundled(boost) = 1.85.0 # We are currently able to unbundle these and use system libraries, but we # retain the virtual Provides, commented out, as documentation and in case we @@ -300,15 +321,15 @@ Provides: bundled(openexr) = 3.2.0 # Version from: pxr/base/tf/pxrCLI11/README.md # Provides: bundled(cli11) = 2.3.1 # Version from: -# third_party/renderman-25/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # (header comment) # Provides: bundled(pugixml) = 1.9 # Version from: pxr/base/js/rapidjson/rapidjson.h # (RAPIDJSON_{MAJOR,MINOR,PATCH}_VERSION) # Provides: bundled(rapidjson) = 1.1.0 -# Forked from an unknown version: pxr/base/tf/pxrTslRobinMap/ -# Provides: bundled(robin-map) +# Version from: pxr/base/tf/pxrTslRobinMap/robin_growth_policy.h +# (PXR_TSL_RH_VERSION_{MAJOR,MINOR,PATCH}) +# Provides: bundled(robin-map) = 1.3.0 # Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h # Provides: bundled(libdeflate) = 1.18 # Version from pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h @@ -621,6 +642,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_bindir}/usdedit %{_bindir}/usdfixbrokenpixarschemas %{_bindir}/usdgenschemafromsdr +%{_bindir}/usdmeasureperformance %{_bindir}/usdrecord %{_bindir}/usdresolve %{_bindir}/usdstitch @@ -647,6 +669,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_mandir}/man1/usdedit.1* %{_mandir}/man1/usdfixbrokenpixarschemas.1* %{_mandir}/man1/usdgenschemafromsdr.1* +%{_mandir}/man1/usdmeasureperformance.1* %{_mandir}/man1/usdrecord.1* %{_mandir}/man1/usdresolve.1* %{_mandir}/man1/usdstitch.1* From efebd041f7a54f2050a90fe4685bc5059c6d3d02 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 5 Dec 2024 22:56:53 -0500 Subject: [PATCH 115/167] Patch for tbb 2022.0.0 compatibility --- 3392.patch | 33 +++++++++++++++++++++++++++++++++ usd.spec | 4 ++++ 2 files changed, 37 insertions(+) create mode 100644 3392.patch diff --git a/3392.patch b/3392.patch new file mode 100644 index 0000000..c43bb3a --- /dev/null +++ b/3392.patch @@ -0,0 +1,33 @@ +From 1c51700711915fe2a50079545c23f5320caa7fe3 Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Fri, 1 Nov 2024 15:57:59 -0400 +Subject: [PATCH] work: account for TBB task_group_base interface change in + 2022.0.0 + +The m_wait_ctx member being used in a narrow band of oneTBB versions +was removed in a refactor that went into the most recent release: +https://github.com/oneapi-src/oneTBB/commit/1f52f5093ec7ce23829fe64ab82ac5541fea42ee + +This change accounts for the update in the new version of oneTBB and +uses the newly added m_wait_vertex member to access the same context +as before. +--- + pxr/base/work/dispatcher.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/pxr/base/work/dispatcher.cpp b/pxr/base/work/dispatcher.cpp +index 8cc8dbbfcd..63482d87c1 100644 +--- a/pxr/base/work/dispatcher.cpp ++++ b/pxr/base/work/dispatcher.cpp +@@ -33,7 +33,11 @@ WorkDispatcher::WorkDispatcher() + #if TBB_INTERFACE_VERSION_MAJOR >= 12 + inline tbb::detail::d1::wait_context& + WorkDispatcher::_TaskGroup::_GetInternalWaitContext() { ++#if TBB_INTERFACE_VERSION_MINOR >= 14 ++ return m_wait_vertex.get_context(); ++#else + return m_wait_ctx; ++#endif + } + #endif + diff --git a/usd.spec b/usd.spec index 1f980cf..9d83f33 100644 --- a/usd.spec +++ b/usd.spec @@ -153,6 +153,10 @@ Patch: 0005-Downstream-only-use-the-system-libdeflate.patch # Downstream-only: use the system libavif library Patch: 0006-Downstream-only-use-the-system-libavif.patch +# work: account for task_group_base interface change in oneTBB 2022.0.0 +# https://github.com/PixarAnimationStudios/OpenUSD/pull/3392 +Patch: %{forgeurl}/pull/3392.patch + # Base BuildRequires: gcc-c++ From 9c39c06ad15bba900daa106808717ebe7e140ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cabello?= Date: Sun, 8 Dec 2024 19:52:02 +0000 Subject: [PATCH 116/167] Correct dekstop file comment Change org.openusd.usdview.desktop comment since usdview does not open cbr/cbz files. --- org.openusd.usdview.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.openusd.usdview.desktop b/org.openusd.usdview.desktop index 71aa0d2..4be9905 100644 --- a/org.openusd.usdview.desktop +++ b/org.openusd.usdview.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=USD view GenericName=Universal Scene Description Viewer -Comment=Open .cbr & .cbz files +Comment=Visualize USD files Exec=usdview Icon=applications-graphics Terminal=false From 87db7029f784a174803a11844218b8ed51ebe39b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cabello?= Date: Sun, 29 Dec 2024 15:09:41 +0000 Subject: [PATCH 117/167] Add temporary hack to find OpenGL See: https://github.com/PixarAnimationStudios/OpenUSD/issues/3310 --- usd.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usd.spec b/usd.spec index 9d83f33..0d4d85f 100644 --- a/usd.spec +++ b/usd.spec @@ -604,6 +604,11 @@ desktop-file-install \ %{SOURCE1} %endif +# Little hack until this issue is resolved +# https://github.com/PixarAnimationStudios/OpenUSD/issues/3310 +sed -i 's|OpenGL::GL|${OPENGL_gl_LIBRARY}|g' \ + %{_libdir}/cmake/pxr/pxrConfig.cmake + # Remove examples that were built and installed even though we set # -DPXR_BUILD_EXAMPLES=OFF. rm -vrf '%{buildroot}%{_datadir}/usd/examples' From 30ba938df6785b5798965bc4ddc00892affd8058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cabello?= Date: Sun, 29 Dec 2024 15:57:48 +0000 Subject: [PATCH 118/167] Fixed hack path --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 0d4d85f..eb3962a 100644 --- a/usd.spec +++ b/usd.spec @@ -607,7 +607,7 @@ desktop-file-install \ # Little hack until this issue is resolved # https://github.com/PixarAnimationStudios/OpenUSD/issues/3310 sed -i 's|OpenGL::GL|${OPENGL_gl_LIBRARY}|g' \ - %{_libdir}/cmake/pxr/pxrConfig.cmake + %{buildroot}%{_libdir}/cmake/pxr/pxrConfig.cmake # Remove examples that were built and installed even though we set # -DPXR_BUILD_EXAMPLES=OFF. From 856fb3d568c64be3b04626183fe18ea78126e2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Cabello?= Date: Sun, 29 Dec 2024 20:32:00 +0000 Subject: [PATCH 119/167] Change mistake sed from pxrConfig to pxrTargets --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index eb3962a..ba2b35d 100644 --- a/usd.spec +++ b/usd.spec @@ -607,7 +607,7 @@ desktop-file-install \ # Little hack until this issue is resolved # https://github.com/PixarAnimationStudios/OpenUSD/issues/3310 sed -i 's|OpenGL::GL|${OPENGL_gl_LIBRARY}|g' \ - %{buildroot}%{_libdir}/cmake/pxr/pxrConfig.cmake + %{buildroot}%{_libdir}/cmake/pxr/pxrTargets.cmake # Remove examples that were built and installed even though we set # -DPXR_BUILD_EXAMPLES=OFF. From 7878241bba410e23a596f48f7dec28e65891d7aa Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 13:57:58 +0000 Subject: [PATCH 120/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From e7341f96c250759328a2d9b47f2d0b5fd5b6bd76 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 21 Jan 2025 21:42:10 -0500 Subject: [PATCH 121/167] Update to 25.02 (close RHZ#2339319) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 18 +- ...use-the-system-double-conversion-lib.patch | 8 +- ...ream-only-use-the-system-lz4-library.patch | 10 +- ...-only-use-the-system-pugixml-library.patch | 6 +- ...nly-use-the-system-rapidjson-library.patch | 4 +- ...tream-only-use-the-system-libdeflate.patch | 4 +- ...wnstream-only-use-the-system-libavif.patch | 4 +- 3487.patch | 22 +++ sources | 2 +- stb_image.patch | 155 ------------------ usd.spec | 18 +- 12 files changed, 59 insertions(+), 193 deletions(-) create mode 100644 3487.patch delete mode 100644 stb_image.patch diff --git a/.gitignore b/.gitignore index 4095fbd..ab74e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /OpenUSD-24.05.tar.gz /OpenUSD-24.08.tar.gz /OpenUSD-24.11.tar.gz +/OpenUSD-25.02.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index 47edf9d..962abb0 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From c9e84b3336cd20276f537c7b0dc31146e5cb5f78 Mon Sep 17 00:00:00 2001 +From 0beb6ef89859d29599c159cb52e2b85419adb413 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 8 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index e9657e399..8ca178ed4 100644 +index 6dd5d5f2d..0a20d47c5 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake -@@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "24") - set(PXR_PATCH_VERSION "11") # NOTE: Must not have leading 0 for single digits +@@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "25") + set(PXR_PATCH_VERSION "2") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -51,10 +51,10 @@ index e9657e399..8ca178ed4 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index 311524da0..b056486da 100644 +index 6fe1134c1..692924954 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake -@@ -1370,6 +1370,7 @@ function(_pxr_library NAME) +@@ -1372,6 +1372,7 @@ function(_pxr_library NAME) IMPORT_PREFIX "${args_PREFIX}" PREFIX "${args_PREFIX}" SUFFIX "${args_SUFFIX}" @@ -63,10 +63,10 @@ index 311524da0..b056486da 100644 target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index 1b809e738..7b557224d 100644 +index 2647707ac..1917edf87 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake -@@ -1074,6 +1074,7 @@ function(pxr_toplevel_prologue) +@@ -1115,6 +1115,7 @@ function(pxr_toplevel_prologue) FOLDER "${folder}" PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" @@ -75,5 +75,5 @@ index 1b809e738..7b557224d 100644 _get_install_dir("lib" libInstallPrefix) install( -- -2.47.0 +2.48.1 diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 7d5f53d..9ea057f 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From c000fad5c7b103ac222c2afabc88c145dc42f10a Mon Sep 17 00:00:00 2001 +From 892fffda8fe1e388cb1511889636e80a864bed43 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -8,7 +8,7 @@ Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 306419493..f4bfecb16 100644 +index 438e9af37..749af9a2b 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -110,11 +110,14 @@ function(add_py_dll_link_test) @@ -40,7 +40,7 @@ index 306419493..f4bfecb16 100644 - pxrDoubleConversion/strtod.cc pxrLZ4/lz4.cpp - PYTHON_CPPFILES + PYMODULE_CPPFILES -- -2.47.0 +2.48.1 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index c0af3d3..df41c33 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,4 +1,4 @@ -From 40d98ed4043a5d5426f39a513f1e628e81a79a82 Mon Sep 17 00:00:00 2001 +From 07716964aaf5aab8345e1801a18bcab8a493e5e5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library @@ -8,7 +8,7 @@ Subject: [PATCH 2/6] Downstream-only: use the system lz4 library 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index f4bfecb16..eadd8ba3a 100644 +index 749af9a2b..56ca1fd83 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -111,6 +111,8 @@ function(add_py_dll_link_test) @@ -38,8 +38,8 @@ index f4bfecb16..eadd8ba3a 100644 initConfig.cpp - pxrLZ4/lz4.cpp - PYTHON_CPPFILES - moduleDeps.cpp + PYMODULE_CPPFILES + module.cpp -- -2.47.0 +2.48.1 diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index aadc144..60b2b14 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,4 +1,4 @@ -From f2ad73cd2d582ad3929a5f2d70fd1a2b1cb937b4 Mon Sep 17 00:00:00 2001 +From 6723d17b04358284e46b717da6dd3d9a25fd094d Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library @@ -8,7 +8,7 @@ Subject: [PATCH 3/6] Downstream-only: use the system pugixml library 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt -index fae498d58..a7587b240 100644 +index ad5c1f49e..79b82e3f0 100644 --- a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt +++ b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt @@ -1,6 +1,8 @@ @@ -35,5 +35,5 @@ index fae498d58..a7587b240 100644 PRIVATE_HEADERS api.h -- -2.47.0 +2.48.1 diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index e61a488..658150b 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,4 +1,4 @@ -From 12f95f861d103fb3aa8ea4e4734fb00ee8942da8 Mon Sep 17 00:00:00 2001 +From 69a381db3ad7e0a457fb547eab46d6fdd6532f32 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library @@ -56,5 +56,5 @@ index d59dc1f6d..086d1bc48 100644 overview.dox ) -- -2.47.0 +2.48.1 diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index a4331f2..bb15359 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,4 +1,4 @@ -From c3405db00fe0a74bfbccb1cc6b7d2071a80659af Mon Sep 17 00:00:00 2001 +From 190572d6e81729f7e04ddf50891c7af368ea4995 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate @@ -72,5 +72,5 @@ index 7481a346e..71bdde9cc 100644 #include "OpenEXRCore/attributes.c" -- -2.47.0 +2.48.1 diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index 809572e..58d3140 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,4 +1,4 @@ -From 2c00aa60c1def4fba4a5498d776019ae75e3e561 Mon Sep 17 00:00:00 2001 +From 8173625c157a1cb59c0f5cf8039afde9cce84641 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif @@ -237,5 +237,5 @@ index 29ffe0fdf..7f1680eaf 100644 RESOURCE_FILES -- -2.47.0 +2.48.1 diff --git a/3487.patch b/3487.patch new file mode 100644 index 0000000..2f79179 --- /dev/null +++ b/3487.patch @@ -0,0 +1,22 @@ +From 97151da9044e0fb488b61d664cc56fda0b711bf7 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Tue, 21 Jan 2025 22:05:01 -0500 +Subject: [PATCH] Add missing #include + +Fixes failure to compile with GCC 15 +--- + pxr/usd/usd/zipFile.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/pxr/usd/usd/zipFile.h b/pxr/usd/usd/zipFile.h +index 4356be7ecb..8f22420966 100644 +--- a/pxr/usd/usd/zipFile.h ++++ b/pxr/usd/usd/zipFile.h +@@ -10,6 +10,7 @@ + #include "pxr/pxr.h" + #include "pxr/usd/usd/api.h" + ++#include + #include + #include + #include diff --git a/sources b/sources index 15bf14b..4b4c131 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-24.11.tar.gz) = 77c9601f4a689248448049660ef0083fc99e2a4c2e7a260814831bdfee8e9844f64b5b2aed88a9f907fe4ebcf6a532bb7dce80bb11c1f54c31066b07aa96b851 +SHA512 (OpenUSD-25.02.tar.gz) = 23f5a40c67ce0566cbb61a60a8d14ebb9fde5de0fb4921031f4d4eeb3a5a86d624955840f9f49ee36f32abc48e869d4910073189716e73ba997bb80f1e781d9b diff --git a/stb_image.patch b/stb_image.patch deleted file mode 100644 index a8a3a30..0000000 --- a/stb_image.patch +++ /dev/null @@ -1,155 +0,0 @@ ---- stb/stb_image.h 2021-09-16 11:52:38.284782000 -0700k -+++ stb_image.h 2021-09-16 13:45:48.159770000 -0700 -@@ -488,14 +488,14 @@ - STBIDEF void stbi_image_free (void *retval_from_stbi_load); - - // get image dimensions & components without fully decoding --STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp); --STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp); -+STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, float *gamma); -+STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, float *gamma); - STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len); - STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *clbk, void *user); - - #ifndef STBI_NO_STDIO --STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp); --STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp); -+STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp, float *gamma); -+STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp, float *gamma); - STBIDEF int stbi_is_16_bit (char const *filename); - STBIDEF int stbi_is_16_bit_from_file(FILE *f); - #endif -@@ -911,7 +911,7 @@ - #ifndef STBI_NO_PNG - static int stbi__png_test(stbi__context *s); - static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri); --static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp); -+static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp, float *gamma); - static int stbi__png_is16(stbi__context *s); - #endif - -@@ -4554,6 +4554,7 @@ - stbi__context *s; - stbi_uc *idata, *expanded, *out; - int depth; -+ float gamma = 0; - } stbi__png; - - -@@ -5112,6 +5113,13 @@ - break; - } - -+ case STBI__PNG_TYPE('g','A','M','A'): { -+ if (first) return stbi__err("first not IHDR", "Corrupt PNG"); -+ if (4 != c.length) return stbi__err("invalid gAMA","Corrupt PNG"); -+ z->gamma = stbi__get32be(s) / 100000.0f; -+ break; -+ } -+ - case STBI__PNG_TYPE('I','D','A','T'): { - if (first) return stbi__err("first not IHDR", "Corrupt PNG"); - if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG"); -@@ -5243,7 +5251,7 @@ - return r; - } - --static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp) -+static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp, float *gamma) - { - if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) { - stbi__rewind( p->s ); -@@ -5252,21 +5260,22 @@ - if (x) *x = p->s->img_x; - if (y) *y = p->s->img_y; - if (comp) *comp = p->s->img_n; -+ if (gamma) *gamma = p->gamma; - return 1; - } - --static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp) -+static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp, float *gamma) - { - stbi__png p; - p.s = s; -- return stbi__png_info_raw(&p, x, y, comp); -+ return stbi__png_info_raw(&p, x, y, comp, gamma); - } - - static int stbi__png_is16(stbi__context *s) - { - stbi__png p; - p.s = s; -- if (!stbi__png_info_raw(&p, NULL, NULL, NULL)) -+ if (!stbi__png_info_raw(&p, NULL, NULL, NULL, NULL)) - return 0; - if (p.depth != 16) { - stbi__rewind(p.s); -@@ -7538,14 +7547,14 @@ - } - #endif - --static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp) -+static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp, float *gamma) - { - #ifndef STBI_NO_JPEG - if (stbi__jpeg_info(s, x, y, comp)) return 1; - #endif - - #ifndef STBI_NO_PNG -- if (stbi__png_info(s, x, y, comp)) return 1; -+ if (stbi__png_info(s, x, y, comp, gamma)) return 1; - #endif - - #ifndef STBI_NO_GIF -@@ -7597,23 +7606,23 @@ - } - - #ifndef STBI_NO_STDIO --STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp) -+STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp, float *gamma) - { - FILE *f = stbi__fopen(filename, "rb"); - int result; - if (!f) return stbi__err("can't fopen", "Unable to open file"); -- result = stbi_info_from_file(f, x, y, comp); -+ result = stbi_info_from_file(f, x, y, comp, gamma); - fclose(f); - return result; - } - --STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp) -+STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp, float *gamma) - { - int r; - stbi__context s; - long pos = ftell(f); - stbi__start_file(&s, f); -- r = stbi__info_main(&s,x,y,comp); -+ r = stbi__info_main(&s,x,y,comp, gamma); - fseek(f,pos,SEEK_SET); - return r; - } -@@ -7640,18 +7649,18 @@ - } - #endif // !STBI_NO_STDIO - --STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp) -+STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, float *gamma) - { - stbi__context s; - stbi__start_mem(&s,buffer,len); -- return stbi__info_main(&s,x,y,comp); -+ return stbi__info_main(&s,x,y,comp, gamma); - } - --STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp) -+STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp, float *gamma) - { - stbi__context s; - stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user); -- return stbi__info_main(&s,x,y,comp); -+ return stbi__info_main(&s,x,y,comp, gamma); - } - - STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len) diff --git a/usd.spec b/usd.spec index ba2b35d..7244a0e 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.24.11 +%global downstream_so_version 0.25.2 %bcond alembic 1 %bcond draco 1 @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 24.11 +Version: 25.02 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -97,13 +97,6 @@ URL: http://www.openusd.org/ %global forgeurl https://github.com/PixarAnimationStudios/OpenUSD Source0: %{forgeurl}/archive/v%{version}/OpenUSD-%{version}.tar.gz Source1: org.openusd.usdview.desktop -# Latest stb_image.patch that applies cleanly against 2.27: -# %%{forgeurl}/raw/8f9bb9563980b41e7695148b63bf09f7abd38a41/pxr/imaging/hio/stb/stb_image.patch -# We treat this as a source file because it is applied separately during -# unbundling. It has been hand-edited to apply to 2.28, where -# stbi__unpremultiply_on_load_thread is already renamed to -# stbi_set_unpremultiply_on_load_thread. -Source2: stb_image.patch # Downstream-only: add an SONAME version # @@ -157,6 +150,11 @@ Patch: 0006-Downstream-only-use-the-system-libavif.patch # https://github.com/PixarAnimationStudios/OpenUSD/pull/3392 Patch: %{forgeurl}/pull/3392.patch +# Add missing #include +# https://github.com/PixarAnimationStudios/OpenUSD/pull/3487 +# Fixes failure to compile with GCC 15 +Patch: %{forgeurl}/pull/3487.patch + # Base BuildRequires: gcc-c++ @@ -424,7 +422,7 @@ ln -s %{_datadir}/fonts/google-roboto-mono \ # Unbundle stb_image, stb_image_write, stb_image_resize: pushd pxr/imaging/hio/stb cp -p %{_usr}/include/stb_image.h . -patch -p1 < '%{SOURCE2}' +patch -p1 < stb_image.patch ln -svf %{_usr}/include/stb_image_resize.h \ %{_usr}/include/stb_image_write.h ./ popd From 3d6c109ad7f1e4197d1e12c64514688aca3d61bc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 30 Jan 2025 10:06:54 -0500 Subject: [PATCH 122/167] Update PR#3392 patch URL to the actual merged commit --- ...22c12dc18203ab5b233792debca8bf843b2e.patch | 21 ++++++++++--------- usd.spec | 3 ++- 2 files changed, 13 insertions(+), 11 deletions(-) rename 3392.patch => 534b22c12dc18203ab5b233792debca8bf843b2e.patch (53%) diff --git a/3392.patch b/534b22c12dc18203ab5b233792debca8bf843b2e.patch similarity index 53% rename from 3392.patch rename to 534b22c12dc18203ab5b233792debca8bf843b2e.patch index c43bb3a..7bad957 100644 --- a/3392.patch +++ b/534b22c12dc18203ab5b233792debca8bf843b2e.patch @@ -1,25 +1,26 @@ -From 1c51700711915fe2a50079545c23f5320caa7fe3 Mon Sep 17 00:00:00 2001 +From 534b22c12dc18203ab5b233792debca8bf843b2e Mon Sep 17 00:00:00 2001 From: Matt Johnson -Date: Fri, 1 Nov 2024 15:57:59 -0400 -Subject: [PATCH] work: account for TBB task_group_base interface change in +Date: Fri, 24 Jan 2025 16:17:30 -0800 +Subject: [PATCH] work: account for task_group_base interface change in oneTBB 2022.0.0 -The m_wait_ctx member being used in a narrow band of oneTBB versions -was removed in a refactor that went into the most recent release: +The `m_wait_ctx` member being used in a narrow band of oneTBB versions was removed in a refactor that went into version [v2022.0.0](https://github.com/oneapi-src/oneTBB/releases/tag/v2022.0.0) which was released yesterday: https://github.com/oneapi-src/oneTBB/commit/1f52f5093ec7ce23829fe64ab82ac5541fea42ee -This change accounts for the update in the new version of oneTBB and -uses the newly added m_wait_vertex member to access the same context -as before. +This change accounts for the update in the new version of oneTBB and uses the newly added `m_wait_vertex` member to access the same context as before. + +Closes #3392 + +(Internal change: 2354795) --- pxr/base/work/dispatcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pxr/base/work/dispatcher.cpp b/pxr/base/work/dispatcher.cpp -index 8cc8dbbfcd..63482d87c1 100644 +index 24daa98b5b..45a9f38004 100644 --- a/pxr/base/work/dispatcher.cpp +++ b/pxr/base/work/dispatcher.cpp -@@ -33,7 +33,11 @@ WorkDispatcher::WorkDispatcher() +@@ -34,7 +34,11 @@ WorkDispatcher::WorkDispatcher() #if TBB_INTERFACE_VERSION_MAJOR >= 12 inline tbb::detail::d1::wait_context& WorkDispatcher::_TaskGroup::_GetInternalWaitContext() { diff --git a/usd.spec b/usd.spec index 7244a0e..c74d8d9 100644 --- a/usd.spec +++ b/usd.spec @@ -148,7 +148,8 @@ Patch: 0006-Downstream-only-use-the-system-libavif.patch # work: account for task_group_base interface change in oneTBB 2022.0.0 # https://github.com/PixarAnimationStudios/OpenUSD/pull/3392 -Patch: %{forgeurl}/pull/3392.patch +# Merged as commit 534b22c12dc18203ab5b233792debca8bf843b2e. +Patch: %{forgeurl}/commit/534b22c12dc18203ab5b233792debca8bf843b2e.patch # Add missing #include # https://github.com/PixarAnimationStudios/OpenUSD/pull/3487 From 62186d324119c43cd07c51c20613cbf68371d8dd Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 4 Feb 2025 18:53:02 -0500 Subject: [PATCH 123/167] Update to 25.02a (close RHBZ#2343857) --- .gitignore | 1 + sources | 2 +- usd.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ab74e3c..7000898 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /OpenUSD-24.08.tar.gz /OpenUSD-24.11.tar.gz /OpenUSD-25.02.tar.gz +/OpenUSD-25.02a.tar.gz diff --git a/sources b/sources index 4b4c131..6c6a95c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-25.02.tar.gz) = 23f5a40c67ce0566cbb61a60a8d14ebb9fde5de0fb4921031f4d4eeb3a5a86d624955840f9f49ee36f32abc48e869d4910073189716e73ba997bb80f1e781d9b +SHA512 (OpenUSD-25.02a.tar.gz) = 6369b902d4e84bda7f3b54357915a933f2d3ea7753b9f702350af6d341572d49a0644ccf803a469e9b452aad1f3d81d7cbfab340f2509fba1213ffd575cf402b diff --git a/usd.spec b/usd.spec index c74d8d9..95bde97 100644 --- a/usd.spec +++ b/usd.spec @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 25.02 +Version: 25.02a Release: %autorelease Summary: 3D VFX pipeline interchange file format From 9161f5b9f50aff2dae3a35b3c41ee3616dbf8c89 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 7 Apr 2025 07:26:05 -0400 Subject: [PATCH 124/167] Rebuilt for openvdb 12 From 92bfe4054d71fce95070937fb63a054de437f224 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 15 Apr 2025 11:41:12 -0400 Subject: [PATCH 125/167] Rebuilt for openshadinglanguage 1.14.5.0 From 715b2f905d5b0fe96fa1d1e4e423788952dcac53 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 6 May 2025 07:38:21 -0400 Subject: [PATCH 126/167] Update to 25.05 (close RHBZ#2362828) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 16 ++++----- ...use-the-system-double-conversion-lib.patch | 4 +-- ...ream-only-use-the-system-lz4-library.patch | 4 +-- ...-only-use-the-system-pugixml-library.patch | 10 +++--- ...nly-use-the-system-rapidjson-library.patch | 4 +-- ...tream-only-use-the-system-libdeflate.patch | 4 +-- ...wnstream-only-use-the-system-libavif.patch | 12 +++---- 2266.patch | 12 +++---- 3487.patch | 22 ------------ ...22c12dc18203ab5b233792debca8bf843b2e.patch | 34 ------------------- sources | 2 +- usd.spec | 20 ++++------- 13 files changed, 41 insertions(+), 104 deletions(-) delete mode 100644 3487.patch delete mode 100644 534b22c12dc18203ab5b233792debca8bf843b2e.patch diff --git a/.gitignore b/.gitignore index 7000898..763dbc1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ /OpenUSD-24.11.tar.gz /OpenUSD-25.02.tar.gz /OpenUSD-25.02a.tar.gz +/OpenUSD-25.05.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index 962abb0..18631f1 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 0beb6ef89859d29599c159cb52e2b85419adb413 Mon Sep 17 00:00:00 2001 +From 15b28906c97ddfa24add5e928663d6ccf410b18c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 8 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 6dd5d5f2d..0a20d47c5 100644 +index d94831a64..a5ed513e5 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "25") - set(PXR_PATCH_VERSION "2") # NOTE: Must not have leading 0 for single digits + set(PXR_PATCH_VERSION "5") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -51,29 +51,29 @@ index 6dd5d5f2d..0a20d47c5 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index 6fe1134c1..692924954 100644 +index 6fe1134c1..06aecd083 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake @@ -1372,6 +1372,7 @@ function(_pxr_library NAME) IMPORT_PREFIX "${args_PREFIX}" PREFIX "${args_PREFIX}" SUFFIX "${args_SUFFIX}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} ) target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index 2647707ac..1917edf87 100644 +index 2647707ac..8c6c74724 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -1115,6 +1115,7 @@ function(pxr_toplevel_prologue) FOLDER "${folder}" PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} ) _get_install_dir("lib" libInstallPrefix) install( -- -2.48.1 +2.49.0 diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 9ea057f..20e47bd 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From 892fffda8fe1e388cb1511889636e80a864bed43 Mon Sep 17 00:00:00 2001 +From 8a3d4e524063cb37910dc3fd5c1cf9fd4caafe4f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -42,5 +42,5 @@ index 438e9af37..749af9a2b 100644 PYMODULE_CPPFILES -- -2.48.1 +2.49.0 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index df41c33..ee877fb 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,4 +1,4 @@ -From 07716964aaf5aab8345e1801a18bcab8a493e5e5 Mon Sep 17 00:00:00 2001 +From 004a8a99bd85dae0a017ec17c613f52a4edd9daf Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library @@ -41,5 +41,5 @@ index 749af9a2b..56ca1fd83 100644 PYMODULE_CPPFILES module.cpp -- -2.48.1 +2.49.0 diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 60b2b14..6fdc71f 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,4 +1,4 @@ -From 6723d17b04358284e46b717da6dd3d9a25fd094d Mon Sep 17 00:00:00 2001 +From b06887047009c81108e50662d6b59d8d00375924 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library @@ -8,7 +8,7 @@ Subject: [PATCH 3/6] Downstream-only: use the system pugixml library 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt -index ad5c1f49e..79b82e3f0 100644 +index 244f27aa8..1e00413c4 100644 --- a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt +++ b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt @@ -1,6 +1,8 @@ @@ -20,9 +20,9 @@ index ad5c1f49e..79b82e3f0 100644 pxr_plugin(rmanArgsParser LIBRARIES arch -@@ -10,12 +12,10 @@ pxr_plugin(rmanArgsParser +@@ -9,12 +11,10 @@ pxr_plugin(rmanArgsParser + vt ar - ndr sdr + ${pugixml_LIBRARY} @@ -35,5 +35,5 @@ index ad5c1f49e..79b82e3f0 100644 PRIVATE_HEADERS api.h -- -2.48.1 +2.49.0 diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index 658150b..3258d29 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,4 +1,4 @@ -From 69a381db3ad7e0a457fb547eab46d6fdd6532f32 Mon Sep 17 00:00:00 2001 +From 9e774a0541a72c849f8b85782eb5ea97653799f1 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library @@ -56,5 +56,5 @@ index d59dc1f6d..086d1bc48 100644 overview.dox ) -- -2.48.1 +2.49.0 diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index bb15359..0a87ddf 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,4 +1,4 @@ -From 190572d6e81729f7e04ddf50891c7af368ea4995 Mon Sep 17 00:00:00 2001 +From c93716e28576544aa7de31b4b966aa3fc25e5bb5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate @@ -72,5 +72,5 @@ index 7481a346e..71bdde9cc 100644 #include "OpenEXRCore/attributes.c" -- -2.48.1 +2.49.0 diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index 58d3140..06b3e28 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,4 +1,4 @@ -From 8173625c157a1cb59c0f5cf8039afde9cce84641 Mon Sep 17 00:00:00 2001 +From 015271b7f2428d9c92adf5558362ff59ed5c4290 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif @@ -9,18 +9,18 @@ Subject: [PATCH 6/6] Downstream-only: use the system libavif 2 files changed, 8 insertions(+), 189 deletions(-) diff --git a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp -index b902a9806..e83af2acc 100644 +index 81549fb54..d2dfb1bcd 100644 --- a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp +++ b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp -@@ -29,7 +29,7 @@ ARCH_PRAGMA_UNUSED_FUNCTION +@@ -30,7 +30,7 @@ ARCH_PRAGMA_UNUSED_FUNCTION #include "pxr/base/tf/stringUtils.h" #include "pxr/base/tf/type.h" -#include "pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h" +#include - - #include "pxr/base/arch/export.h" + #if defined(PXR_STATIC) + # define HIOAVIF_API diff --git a/pxr/imaging/plugin/hioAvif/CMakeLists.txt b/pxr/imaging/plugin/hioAvif/CMakeLists.txt index 29ffe0fdf..7f1680eaf 100644 --- a/pxr/imaging/plugin/hioAvif/CMakeLists.txt @@ -237,5 +237,5 @@ index 29ffe0fdf..7f1680eaf 100644 RESOURCE_FILES -- -2.48.1 +2.49.0 diff --git a/2266.patch b/2266.patch index eb8ba37..fed49ac 100644 --- a/2266.patch +++ b/2266.patch @@ -1,4 +1,4 @@ -From a07a6b4d1da19bfc499db49641d74fb7c1a71e9b Mon Sep 17 00:00:00 2001 +From 9ea3bc1ab550ec46c426dab04292d9667ccd2518 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 11 Feb 2023 13:58:42 -0500 Subject: [PATCH] Port to Embree 4.x @@ -119,13 +119,13 @@ index c32c35fffa..3712a9e3ab 100644 #include diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h -index 0369fea3a1..2f9f19fa09 100644 +index 9f613dd069..19bfb2f6d0 100644 --- a/pxr/imaging/plugin/hdEmbree/pch.h +++ b/pxr/imaging/plugin/hdEmbree/pch.h -@@ -84,9 +84,9 @@ - #undef toupper - #endif - #endif // PXR_PYTHON_SUPPORT_ENABLED && !PXR_USE_INTERNAL_BOOST_PYTHON +@@ -76,9 +76,9 @@ + #include + #include + #include -#include -#include -#include diff --git a/3487.patch b/3487.patch deleted file mode 100644 index 2f79179..0000000 --- a/3487.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 97151da9044e0fb488b61d664cc56fda0b711bf7 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Tue, 21 Jan 2025 22:05:01 -0500 -Subject: [PATCH] Add missing #include - -Fixes failure to compile with GCC 15 ---- - pxr/usd/usd/zipFile.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/pxr/usd/usd/zipFile.h b/pxr/usd/usd/zipFile.h -index 4356be7ecb..8f22420966 100644 ---- a/pxr/usd/usd/zipFile.h -+++ b/pxr/usd/usd/zipFile.h -@@ -10,6 +10,7 @@ - #include "pxr/pxr.h" - #include "pxr/usd/usd/api.h" - -+#include - #include - #include - #include diff --git a/534b22c12dc18203ab5b233792debca8bf843b2e.patch b/534b22c12dc18203ab5b233792debca8bf843b2e.patch deleted file mode 100644 index 7bad957..0000000 --- a/534b22c12dc18203ab5b233792debca8bf843b2e.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 534b22c12dc18203ab5b233792debca8bf843b2e Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Fri, 24 Jan 2025 16:17:30 -0800 -Subject: [PATCH] work: account for task_group_base interface change in oneTBB - 2022.0.0 - -The `m_wait_ctx` member being used in a narrow band of oneTBB versions was removed in a refactor that went into version [v2022.0.0](https://github.com/oneapi-src/oneTBB/releases/tag/v2022.0.0) which was released yesterday: -https://github.com/oneapi-src/oneTBB/commit/1f52f5093ec7ce23829fe64ab82ac5541fea42ee - -This change accounts for the update in the new version of oneTBB and uses the newly added `m_wait_vertex` member to access the same context as before. - -Closes #3392 - -(Internal change: 2354795) ---- - pxr/base/work/dispatcher.cpp | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/pxr/base/work/dispatcher.cpp b/pxr/base/work/dispatcher.cpp -index 24daa98b5b..45a9f38004 100644 ---- a/pxr/base/work/dispatcher.cpp -+++ b/pxr/base/work/dispatcher.cpp -@@ -34,7 +34,11 @@ WorkDispatcher::WorkDispatcher() - #if TBB_INTERFACE_VERSION_MAJOR >= 12 - inline tbb::detail::d1::wait_context& - WorkDispatcher::_TaskGroup::_GetInternalWaitContext() { -+#if TBB_INTERFACE_VERSION_MINOR >= 14 -+ return m_wait_vertex.get_context(); -+#else - return m_wait_ctx; -+#endif - } - #endif - diff --git a/sources b/sources index 6c6a95c..6a7dc2f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-25.02a.tar.gz) = 6369b902d4e84bda7f3b54357915a933f2d3ea7753b9f702350af6d341572d49a0644ccf803a469e9b452aad1f3d81d7cbfab340f2509fba1213ffd575cf402b +SHA512 (OpenUSD-25.05.tar.gz) = 9e57198c370315da8f163877d76d213fac3091e4b572c612fe4226df00315bee425a3059028f4db1b13df57a59d0bb7dc8d43d250dcf0909807f4a2a6d8fe42a diff --git a/usd.spec b/usd.spec index 95bde97..f353f50 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.25.2 +%global downstream_so_version 0.25.5 %bcond alembic 1 %bcond draco 1 @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 25.02a +Version: 25.05 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -130,7 +130,7 @@ Patch: 0001-Downstream-only-add-an-SONAME-version.patch # https://github.com/PixarAnimationStudios/OpenUSD/pull/2266 # See also: # hdEmbree: add support for building against embree4 -# https://github.com/PixarAnimationStudios/USD/pull/2266 +# https://github.com/PixarAnimationStudios/USD/pull/2313 Patch: %{forgeurl}/pull/2266.patch # Downstream-only: use the system double-conversion library @@ -146,16 +146,6 @@ Patch: 0005-Downstream-only-use-the-system-libdeflate.patch # Downstream-only: use the system libavif library Patch: 0006-Downstream-only-use-the-system-libavif.patch -# work: account for task_group_base interface change in oneTBB 2022.0.0 -# https://github.com/PixarAnimationStudios/OpenUSD/pull/3392 -# Merged as commit 534b22c12dc18203ab5b233792debca8bf843b2e. -Patch: %{forgeurl}/commit/534b22c12dc18203ab5b233792debca8bf843b2e.patch - -# Add missing #include -# https://github.com/PixarAnimationStudios/OpenUSD/pull/3487 -# Fixes failure to compile with GCC 15 -Patch: %{forgeurl}/pull/3487.patch - # Base BuildRequires: gcc-c++ @@ -170,7 +160,7 @@ BuildRequires: help2man BuildRequires: pkgconfig(blosc) BuildRequires: pkgconfig(dri) BuildRequires: hdf5-devel -BuildRequires: opensubdiv-devel >= 3.6.0 +BuildRequires: cmake(OpenSubdiv) BuildRequires: pkgconfig(tbb) # Unbundled: BuildRequires: cmake(double-conversion) @@ -640,6 +630,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_bindir}/sdfdump %{_bindir}/sdffilter %{_bindir}/usdGenSchema +%{_bindir}/usdInitSchema %{_bindir}/usdcat %{_bindir}/usdchecker %if %{with draco} @@ -667,6 +658,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_mandir}/man1/sdfdump.1* %{_mandir}/man1/sdffilter.1* %{_mandir}/man1/usdGenSchema.1* +%{_mandir}/man1/usdInitSchema.1* %{_mandir}/man1/usdcat.1* %{_mandir}/man1/usdchecker.1* %if %{with draco} From f6370998c7c2ef77c52e9d0cfd61e88bcf9a7383 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 20 May 2025 05:45:16 -0400 Subject: [PATCH 127/167] Update to 25.05.01 (close RHBZ#2367428) --- .gitignore | 1 + sources | 2 +- usd.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 763dbc1..29e9eef 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ /OpenUSD-25.02.tar.gz /OpenUSD-25.02a.tar.gz /OpenUSD-25.05.tar.gz +/OpenUSD-25.05.01.tar.gz diff --git a/sources b/sources index 6a7dc2f..2a14b27 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-25.05.tar.gz) = 9e57198c370315da8f163877d76d213fac3091e4b572c612fe4226df00315bee425a3059028f4db1b13df57a59d0bb7dc8d43d250dcf0909807f4a2a6d8fe42a +SHA512 (OpenUSD-25.05.01.tar.gz) = 66bf75486f09dce7085c5c80cc3e005c02c1dfbbfbd02c8e2e8fd9498030ca49cd6bc0a9b9db930d0559c745cf77ebaf822018de4bf798cce84fdf0aa89f0d84 diff --git a/usd.spec b/usd.spec index f353f50..2941692 100644 --- a/usd.spec +++ b/usd.spec @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 25.05 +Version: 25.05.01 Release: %autorelease Summary: 3D VFX pipeline interchange file format From dafa9d3c046304097bc4a5019296b6cafe38df6a Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 10 Jun 2025 07:21:03 -0400 Subject: [PATCH 128/167] Only depend on PyOpenGL when usdview is enabled --- usd.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usd.spec b/usd.spec index 2941692..2c45cea 100644 --- a/usd.spec +++ b/usd.spec @@ -370,8 +370,8 @@ BuildRequires: python3dist(jinja2) BuildRequires: desktop-file-utils BuildRequires: python3dist(pyside6) BuildRequires: pyside6-tools -%endif BuildRequires: python3dist(pyopengl) +%endif Requires: font(roboto) Requires: font(robotoblack) Requires: font(robotolight) @@ -379,8 +379,8 @@ Requires: font(robotomono) Requires: python3dist(jinja2) %if %{with usdview} Requires: python3dist(pyside6) -%endif Requires: python3dist(pyopengl) +%endif Requires: usd-libs%{?_isa} = %{version}-%{release} From a9d49c6a7e4c3a90f301ae00bd5623447f217f34 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 10 Jun 2025 07:23:23 -0400 Subject: [PATCH 129/167] Disable usdview until python-pyopengl is fixed https://bugzilla.redhat.com/show_bug.cgi?id=2341191 --- usd.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 2c45cea..406b12e 100644 --- a/usd.spec +++ b/usd.spec @@ -20,7 +20,10 @@ %bcond ocio 1 %bcond oiio 1 %bcond ptex 1 -%bcond usdview 1 +# Requires python-pyopengl, which FTBFS in F42+ +# (https://bugzilla.redhat.com/show_bug.cgi?id=2341191) and therefore FTI since +# the Python 3.14 mass rebuild. +%bcond usdview 0 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests, and there are issues with the launchers finding the # command-line tools in the buildroot. From cc7a2f2dbf9834137158427e6e8e458e60059c96 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 10 Jun 2025 07:49:58 -0400 Subject: [PATCH 130/167] Rebuilt for Python 3.14 From bf4f59f2c9a4665a5d92431b3229876112360821 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 6 Jul 2025 08:14:37 -0400 Subject: [PATCH 131/167] Revert "Disable usdview until python-pyopengl is fixed" This reverts commit a9d49c6a7e4c3a90f301ae00bd5623447f217f34. --- usd.spec | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usd.spec b/usd.spec index 406b12e..2c45cea 100644 --- a/usd.spec +++ b/usd.spec @@ -20,10 +20,7 @@ %bcond ocio 1 %bcond oiio 1 %bcond ptex 1 -# Requires python-pyopengl, which FTBFS in F42+ -# (https://bugzilla.redhat.com/show_bug.cgi?id=2341191) and therefore FTI since -# the Python 3.14 mass rebuild. -%bcond usdview 0 +%bcond usdview 1 # TODO: Figure out how to re-enable the tests. Currently these want to install # into /usr/tests, and there are issues with the launchers finding the # command-line tools in the buildroot. From 255804ecbdbbf338a45a0ea5f8a16b17c4fca641 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 19:53:21 +0000 Subject: [PATCH 132/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From a011711941992d6126673924352c228491e58891 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 1 Aug 2025 07:17:11 -0400 Subject: [PATCH 133/167] Update to 25.08 (close RHBZ#2385874) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 12 +- ...use-Valgrind-macro-instead-of-inline.patch | 65 +++ ...use-the-system-double-conversion-lib.patch | 14 +- ...ream-only-use-the-system-lz4-library.patch | 21 +- ...-only-use-the-system-pugixml-library.patch | 4 +- ...nly-use-the-system-rapidjson-library.patch | 4 +- ...tream-only-use-the-system-libdeflate.patch | 4 +- ...wnstream-only-use-the-system-libavif.patch | 308 +++++------ 2266.patch | 217 -------- 2313.patch | 510 ++++++++++++++++++ sources | 2 +- usd.spec | 25 +- 13 files changed, 779 insertions(+), 408 deletions(-) create mode 100644 0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch delete mode 100644 2266.patch create mode 100644 2313.patch diff --git a/.gitignore b/.gitignore index 29e9eef..d0e0d07 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /OpenUSD-25.02a.tar.gz /OpenUSD-25.05.tar.gz /OpenUSD-25.05.01.tar.gz +/OpenUSD-25.08.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index 18631f1..250eae0 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 15b28906c97ddfa24add5e928663d6ccf410b18c Mon Sep 17 00:00:00 2001 +From 483ce5b8e320e89016fff7b3480216ba94c032ff Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 8 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index d94831a64..a5ed513e5 100644 +index 447c74e4d..a990f071b 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "25") - set(PXR_PATCH_VERSION "5") # NOTE: Must not have leading 0 for single digits + set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -63,10 +63,10 @@ index 6fe1134c1..06aecd083 100644 target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index 2647707ac..8c6c74724 100644 +index 807cf7d83..7225af783 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake -@@ -1115,6 +1115,7 @@ function(pxr_toplevel_prologue) +@@ -1121,6 +1121,7 @@ function(pxr_toplevel_prologue) FOLDER "${folder}" PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" @@ -75,5 +75,5 @@ index 2647707ac..8c6c74724 100644 _get_install_dir("lib" libInstallPrefix) install( -- -2.49.0 +2.50.1 diff --git a/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch new file mode 100644 index 0000000..62f0370 --- /dev/null +++ b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch @@ -0,0 +1,65 @@ +From 75d4451fa64e086edd9d621af681df13cebde5eb Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 1 Aug 2025 08:47:41 -0400 +Subject: [PATCH] Downstream-only: use Valgrind macro instead of inline + assembly + +Upstream already has a plan to make this change, but is waiting to be +able to add a build dependency on valgrind-devel. We have no such +obstacle, and this change fixes the inline assembly failing to compile +on aarch64. +--- + pxr/exec/vdf/executorDataVector.cpp | 28 +++------------------------- + 1 file changed, 3 insertions(+), 25 deletions(-) + +diff --git a/pxr/exec/vdf/executorDataVector.cpp b/pxr/exec/vdf/executorDataVector.cpp +index 12f9e517e..7e5625678 100644 +--- a/pxr/exec/vdf/executorDataVector.cpp ++++ b/pxr/exec/vdf/executorDataVector.cpp +@@ -11,40 +11,18 @@ + #include "pxr/base/tf/stl.h" + #include "pxr/base/trace/trace.h" + ++#include ++ + PXR_NAMESPACE_OPEN_SCOPE + + + /// Issue a magic instruction sequence which Valgrind will intercept and mark + /// the specified memory defined for memcheck. + /// +-/// XXX: We should replace this with the VALGRIND_MAKE_MEM_DEFINED macro +-/// from memcheck.h, once we can establish a build dependency on +-/// valgrind-devel. +-/// + static inline void + Vdf_ExecutorDataVector_ValgrindMakeDefined(void *ptr, size_t size) + { +-#if defined(ARCH_OS_LINUX) +- // Pass a result and a pointer to some arguments via registers +- volatile unsigned long long int result; +- volatile unsigned long long int args[6] = { +- 0x4D430002, // Memcheck: MAKE_MEM_DEFINED +- (uintptr_t)(ptr), // Memory address +- size, // Size in bytes +- 0, 0, 0 // Remaining unused arguments +- }; +- +- // Magical instruction sequence which Valgrind will interpret as an +- // annotation (see valgrind.h) +- __asm__ volatile( +- "rolq $3, %%rdi ; rolq $13, %%rdi\n\t" +- "rolq $61, %%rdi ; rolq $51, %%rdi\n\t" +- "xchgq %%rbx, %%rbx" +- : "=d" (result) +- : "a" (&args[0]), "0" (0) +- : "cc", "memory" +- ); +-#endif ++ VALGRIND_MAKE_MEM_DEFINED(ptr, size); + } + + Vdf_ExecutorDataVector::~Vdf_ExecutorDataVector() +-- +2.50.1 + diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 20e47bd..1d2a648 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From 8a3d4e524063cb37910dc3fd5c1cf9fd4caafe4f Mon Sep 17 00:00:00 2001 +From 23bda0e3337d7a27696a000a47eaf36840650c69 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -8,7 +8,7 @@ Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 438e9af37..749af9a2b 100644 +index fade8d559..5d9272087 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -110,11 +110,14 @@ function(add_py_dll_link_test) @@ -21,12 +21,12 @@ index 438e9af37..749af9a2b 100644 LIBRARIES arch ${WINLIBS} - ${TBB_tbb_LIBRARY} + TBB::tbb + ${double-conversion_LIBRARY} - INCLUDE_DIRS - ${TBB_INCLUDE_DIRS} -@@ -281,14 +284,6 @@ pxr_library(tf + PUBLIC_CLASSES + anyUniquePtr +@@ -278,14 +281,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -42,5 +42,5 @@ index 438e9af37..749af9a2b 100644 PYMODULE_CPPFILES -- -2.49.0 +2.50.1 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index ee877fb..c72d25a 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,14 +1,14 @@ -From 004a8a99bd85dae0a017ec17c613f52a4edd9daf Mon Sep 17 00:00:00 2001 +From 3492a9fb0fccfe52ed5258e943381d48d28be3e5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library --- - pxr/base/tf/CMakeLists.txt | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + pxr/base/tf/CMakeLists.txt | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 749af9a2b..56ca1fd83 100644 +index 5d9272087..c4130882c 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -111,6 +111,8 @@ function(add_py_dll_link_test) @@ -20,19 +20,18 @@ index 749af9a2b..56ca1fd83 100644 pxr_library(tf LIBRARIES -@@ -118,9 +120,11 @@ pxr_library(tf +@@ -118,6 +120,10 @@ pxr_library(tf ${WINLIBS} - ${TBB_tbb_LIBRARY} + TBB::tbb ${double-conversion_LIBRARY} + ${LZ4_LIBRARIES} - - INCLUDE_DIRS - ${TBB_INCLUDE_DIRS} ++ ++ INCLUDE_DIRS + ${LZ4_INCLUDE_DIRS} PUBLIC_CLASSES anyUniquePtr -@@ -284,7 +288,6 @@ pxr_library(tf +@@ -281,7 +287,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -41,5 +40,5 @@ index 749af9a2b..56ca1fd83 100644 PYMODULE_CPPFILES module.cpp -- -2.49.0 +2.50.1 diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 6fdc71f..2bab595 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,4 +1,4 @@ -From b06887047009c81108e50662d6b59d8d00375924 Mon Sep 17 00:00:00 2001 +From 98f62852495fb2c86047eff532a3af2a5b88792b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library @@ -35,5 +35,5 @@ index 244f27aa8..1e00413c4 100644 PRIVATE_HEADERS api.h -- -2.49.0 +2.50.1 diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index 3258d29..8d1c7e6 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,4 +1,4 @@ -From 9e774a0541a72c849f8b85782eb5ea97653799f1 Mon Sep 17 00:00:00 2001 +From aa1063129297e469ddd709c7ee4d0406f9bae08f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library @@ -56,5 +56,5 @@ index d59dc1f6d..086d1bc48 100644 overview.dox ) -- -2.49.0 +2.50.1 diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index 0a87ddf..e76eeb6 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,4 +1,4 @@ -From c93716e28576544aa7de31b4b966aa3fc25e5bb5 Mon Sep 17 00:00:00 2001 +From 4b1c527468f9c43e04a1ff773cec6a9f9ca0b5ae Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate @@ -72,5 +72,5 @@ index 7481a346e..71bdde9cc 100644 #include "OpenEXRCore/attributes.c" -- -2.49.0 +2.50.1 diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index 06b3e28..fe06223 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,12 +1,12 @@ -From 015271b7f2428d9c92adf5558362ff59ed5c4290 Mon Sep 17 00:00:00 2001 +From 8ebd20bf9e0e945457215dba1d56a25408f860a6 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif --- pxr/imaging/plugin/hioAvif/AVIFImage.cpp | 2 +- - pxr/imaging/plugin/hioAvif/CMakeLists.txt | 195 +--------------------- - 2 files changed, 8 insertions(+), 189 deletions(-) + pxr/imaging/plugin/hioAvif/CMakeLists.txt | 194 +--------------------- + 2 files changed, 7 insertions(+), 189 deletions(-) diff --git a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp index 81549fb54..d2dfb1bcd 100644 @@ -22,7 +22,7 @@ index 81549fb54..d2dfb1bcd 100644 #if defined(PXR_STATIC) # define HIOAVIF_API diff --git a/pxr/imaging/plugin/hioAvif/CMakeLists.txt b/pxr/imaging/plugin/hioAvif/CMakeLists.txt -index 29ffe0fdf..7f1680eaf 100644 +index f4eaeea15..7f1680eaf 100644 --- a/pxr/imaging/plugin/hioAvif/CMakeLists.txt +++ b/pxr/imaging/plugin/hioAvif/CMakeLists.txt @@ -1,6 +1,9 @@ @@ -35,14 +35,11 @@ index 29ffe0fdf..7f1680eaf 100644 pxr_plugin(hioAvif LIBRARIES ar -@@ -8,196 +11,12 @@ pxr_plugin(hioAvif +@@ -8,197 +11,12 @@ pxr_plugin(hioAvif gf hio tf + ${AVIF_LIBRARIES} -+ -+ INCLUDE_DIRS -+ ${AVIF_INCLUDE_DIRS} - PRIVATE_HEADERS - aom/aom.h @@ -53,89 +50,89 @@ index 29ffe0fdf..7f1680eaf 100644 - aom/aom_image.h - aom/aom_integer.h - aom/aomdx.h -- aom/aom_dsp/binary_codes_reader.h -- aom/aom_dsp/bitreader.h -- aom/aom_dsp/aom_dsp_common.h -- aom/aom_dsp/bitreader_buffer.h -- aom/aom_dsp/blend.h -- aom/aom_dsp/entcode.h -- aom/aom_dsp/entdec.h -- aom/aom_dsp/grain_table.h -- aom/aom_dsp/aom_filter.h -- aom/aom_dsp/grain_synthesis.h -- aom/aom_dsp/intrapred_common.h -- aom/aom_dsp/prob.h -- aom/aom_dsp/recenter.h -- aom/aom_dsp/txfm_common.h -- aom/aom_mem/aom_mem.h -- aom/aom_mem/include/aom_mem_intrnl.h -- aom/aom_ports/bitops.h -- aom/aom_ports/aom_once.h -- aom/aom_ports/mem.h -- aom/aom_ports/mem_ops.h -- aom/aom_ports/mem_ops_aligned.h -- aom/aom_ports/msvc.h -- aom/aom_ports/system_state.h -- aom/aom_ports/aom_timer.h -- aom/aom_scale/aom_scale.h -- aom/aom_scale/yv12config.h -- aom/aom_util/aom_thread.h -- aom/av1/av1_iface_common.h -- aom/av1/common/av1_common_int.h -- aom/av1/common/alloccommon.h -- aom/av1/common/av1_inv_txfm1d.h -- aom/av1/common/av1_inv_txfm1d_cfg.h -- aom/av1/common/av1_loopfilter.h -- aom/av1/common/av1_txfm.h -- aom/av1/common/blockd.h -- aom/av1/common/cdef.h -- aom/av1/common/cdef_block.h -- aom/av1/common/cfl.h -- aom/av1/common/common.h -- aom/av1/common/common_data.h -- aom/av1/common/convolve.h -- aom/av1/common/entropy.h -- aom/av1/common/entropymode.h -- aom/av1/common/entropymv.h -- aom/av1/common/enums.h -- aom/av1/common/filter.h -- aom/av1/common/frame_buffers.h -- aom/av1/common/mv.h -- aom/av1/common/mvref_common.h -- aom/av1/common/idct.h -- aom/av1/common/obmc.h -- aom/av1/common/obu_util.h -- aom/av1/common/odintrin.h -- aom/av1/common/pred_common.h -- aom/av1/common/quant_common.h -- aom/av1/common/reconinter.h -- aom/av1/common/reconintra.h -- aom/av1/common/resize.h -- aom/av1/common/restoration.h -- aom/av1/common/scale.h -- aom/av1/common/scan.h -- aom/av1/common/seg_common.h -- aom/av1/common/thread_common.h -- aom/av1/common/tile_common.h -- aom/av1/common/timing.h -- aom/av1/common/token_cdfs.h -- aom/av1/common/txb_common.h -- aom/av1/common/warped_motion.h -- aom/av1/decoder/decodeframe.h -- aom/av1/decoder/decoder.h -- aom/av1/decoder/decodemv.h -- aom/av1/decoder/decodetxb.h -- aom/av1/decoder/detokenize.h -- aom/av1/decoder/dthread.h -- aom/av1/decoder/obu.h -- aom/config/aom_config.h -- aom/config/aom_dsp_rtcd.h -- aom/config/aom_scale_rtcd.h -- aom/config/aom_version.h -- aom/config/av1_rtcd.h +- aom/aom_external_partition.h - aom/internal/aom_codec_internal.h - aom/internal/aom_image_internal.h -- aom/internal/common/args_helper.h +- aom_dsp/aom_dsp_common.h +- aom_dsp/aom_filter.h +- aom_dsp/binary_codes_reader.h +- aom_dsp/bitreader.h +- aom_dsp/bitreader_buffer.h +- aom_dsp/blend.h +- aom_dsp/entcode.h +- aom_dsp/entdec.h +- aom_dsp/flow_estimation/corner_detect.h +- aom_dsp/flow_estimation/flow_estimation.h +- aom_dsp/grain_params.h +- aom_dsp/grain_table.h +- aom_dsp/intrapred_common.h +- aom_dsp/odintrin.h +- aom_dsp/prob.h +- aom_dsp/pyramid.h +- aom_dsp/recenter.h +- aom_dsp/txfm_common.h +- aom_mem/aom_mem.h +- aom_mem/include/aom_mem_intrnl.h +- aom_ports/aom_once.h +- aom_ports/aom_timer.h +- aom_ports/bitops.h +- aom_ports/mem.h +- aom_ports/mem_ops.h +- aom_ports/mem_ops_aligned.h +- aom_ports/sanitizer.h +- aom_scale/yv12config.h +- aom_util/aom_thread.h +- aom_util/aom_pthread.h +- av1/av1_iface_common.h +- av1/common/alloccommon.h +- av1/common/av1_common_int.h +- av1/common/av1_inv_txfm1d.h +- av1/common/av1_inv_txfm1d_cfg.h +- av1/common/av1_loopfilter.h +- av1/common/av1_txfm.h +- av1/common/blockd.h +- av1/common/cdef.h +- av1/common/cdef_block.h +- av1/common/cfl.h +- av1/common/common.h +- av1/common/common_data.h +- av1/common/convolve.h +- av1/common/entropy.h +- av1/common/entropymode.h +- av1/common/entropymv.h +- av1/common/enums.h +- av1/common/filter.h +- av1/common/frame_buffers.h +- av1/common/idct.h +- av1/common/mv.h +- av1/common/mvref_common.h +- av1/common/obmc.h +- av1/common/obu_util.h +- av1/common/pred_common.h +- av1/common/quant_common.h +- av1/common/reconinter.h +- av1/common/reconinter_template.inc +- av1/common/reconintra.h +- av1/common/resize.h +- av1/common/restoration.h +- av1/common/scale.h +- av1/common/scan.h +- av1/common/seg_common.h +- av1/common/thread_common.h +- av1/common/tile_common.h +- av1/common/timing.h +- av1/common/token_cdfs.h +- av1/common/txb_common.h +- av1/common/warped_motion.h +- av1/decoder/decodeframe.h +- av1/decoder/decodemv.h +- av1/decoder/decoder.h +- av1/decoder/decodetxb.h +- av1/decoder/detokenize.h +- av1/decoder/dthread.h +- av1/decoder/grain_synthesis.h +- av1/decoder/obu.h +- common/args_helper.h - AVIF/src/avif/avif.h - AVIF/src/avif/internal.h - AVIF/src/src-libyuv/libyuv/basic_types.h @@ -145,71 +142,74 @@ index 29ffe0fdf..7f1680eaf 100644 - AVIF/src/src-libyuv/libyuv/scale.h - AVIF/src/src-libyuv/libyuv/scale_row.h - AVIF/src/src-libyuv/libyuv/version.h -- ++ INCLUDE_DIRS ++ ${AVIF_INCLUDE_DIRS} + CPPFILES -- aom/aom_codec.c -- aom/aom_decoder.c -- aom/aom_image.c -- aom/aom_integer.c -- aom/aom_dsp/aom_convolve.c -- aom/aom_dsp/aom_dsp_rtcd.c -- aom/aom_dsp/binary_codes_reader.c -- aom/aom_dsp/bitreader.c -- aom/aom_dsp/bitreader_buffer.c -- aom/aom_dsp/blend_a64_hmask.c -- aom/aom_dsp/blend_a64_vmask.c -- aom/aom_dsp/blend_a64_mask.c -- aom/aom_dsp/entcode.c -- aom/aom_dsp/entdec.c -- aom/aom_dsp/grain_synthesis.c -- aom/aom_dsp/intrapred.c -- aom/aom_dsp/loopfilter.c -- aom/aom_mem/aom_mem.c -- aom/aom_scale/aom_scale_rtcd.c -- aom/aom_scale/generic/aom_scale.c -- aom/aom_scale/generic/gen_scalers.c -- aom/aom_scale/generic/yv12config.c -- aom/aom_scale/generic/yv12extend.c -- aom/aom_util/aom_thread.c -- aom/av1/av1_dx_iface.c -- aom/av1/common/alloccommon.c -- aom/av1/common/av1_inv_txfm1d.c -- aom/av1/common/av1_inv_txfm2d.c -- aom/av1/common/av1_loopfilter.c -- aom/av1/common/av1_txfm.c -- aom/av1/common/av1_rtcd.c -- aom/av1/common/blockd.c -- aom/av1/common/cdef.c -- aom/av1/common/cdef_block.c -- aom/av1/common/cfl.c -- aom/av1/common/convolve.c -- aom/av1/common/entropymode.c -- aom/av1/common/entropy.c -- aom/av1/common/entropymv.c -- aom/av1/common/frame_buffers.c -- aom/av1/common/idct.c -- aom/av1/common/mvref_common.c -- aom/av1/common/obu_util.c -- aom/av1/common/pred_common.c -- aom/av1/common/quant_common.c -- aom/av1/common/reconinter.c -- aom/av1/common/reconintra.c -- aom/av1/common/resize.c -- aom/av1/common/restoration.c -- aom/av1/common/av1_scale.c -- aom/av1/common/scan.c -- aom/av1/common/seg_common.c -- aom/av1/common/thread_common.c -- aom/av1/common/timing.c -- aom/av1/common/txb_common.c -- aom/av1/common/tile_common.c -- aom/av1/common/warped_motion.c -- aom/av1/decoder/decodeframe.c -- aom/av1/decoder/decodemv.c -- aom/av1/decoder/decoder.c -- aom/av1/decoder/decodetxb.c -- aom/av1/decoder/detokenize.c -- aom/av1/decoder/obu.c +- aom/src/aom_codec.c +- aom/src/aom_decoder.c +- aom/src/aom_image.c +- aom/src/aom_integer.c +- aom_dsp/aom_convolve.c +- aom_dsp/aom_dsp_rtcd.c +- aom_dsp/binary_codes_reader.c +- aom_dsp/bitreader.c +- aom_dsp/bitreader_buffer.c +- aom_dsp/blend_a64_hmask.c +- aom_dsp/blend_a64_mask.c +- aom_dsp/blend_a64_vmask.c +- aom_dsp/entcode.c +- aom_dsp/entdec.c +- aom_dsp/intrapred.c +- aom_dsp/loopfilter.c +- aom_dsp/odintrin.c +- aom_dsp/pyramid.c +- aom_mem/aom_mem.c +- aom_scale/aom_scale_rtcd.c +- aom_scale/generic/yv12config.c +- aom_scale/generic/yv12extend.c +- aom_util/aom_thread.c +- av1/av1_dx_iface.c +- av1/common/alloccommon.c +- av1/common/av1_inv_txfm1d.c +- av1/common/av1_inv_txfm2d.c +- av1/common/av1_loopfilter.c +- av1/common/av1_rtcd.c +- av1/common/av1_txfm.c +- av1/common/blockd.c +- av1/common/cdef.c +- av1/common/cdef_block.c +- av1/common/cfl.c +- av1/common/common_data.c +- av1/common/convolve.c +- av1/common/entropy.c +- av1/common/entropymode.c +- av1/common/entropymv.c +- av1/common/frame_buffers.c +- av1/common/idct.c +- av1/common/mvref_common.c +- av1/common/obu_util.c +- av1/common/pred_common.c +- av1/common/quant_common.c +- av1/common/reconinter.c +- av1/common/reconintra.c +- av1/common/resize.c +- av1/common/restoration.c +- av1/common/scale.c +- av1/common/scan.c +- av1/common/seg_common.c +- av1/common/thread_common.c +- av1/common/tile_common.c +- av1/common/timing.c +- av1/common/txb_common.c +- av1/common/warped_motion.c +- av1/decoder/decodeframe.c +- av1/decoder/decodemv.c +- av1/decoder/decoder.c +- av1/decoder/decodetxb.c +- av1/decoder/detokenize.c +- av1/decoder/grain_synthesis.c +- av1/decoder/obu.c - AVIF/src/alpha.c - AVIF/src/avif.c - AVIF/src/codec_aom.c @@ -237,5 +237,5 @@ index 29ffe0fdf..7f1680eaf 100644 RESOURCE_FILES -- -2.49.0 +2.50.1 diff --git a/2266.patch b/2266.patch deleted file mode 100644 index fed49ac..0000000 --- a/2266.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 9ea3bc1ab550ec46c426dab04292d9667ccd2518 Mon Sep 17 00:00:00 2001 -From: "Benjamin A. Beasley" -Date: Sat, 11 Feb 2023 13:58:42 -0500 -Subject: [PATCH] Port to Embree 4.x - ---- - cmake/modules/FindEmbree.cmake | 16 ++++++++-------- - pxr/imaging/plugin/hdEmbree/context.h | 2 +- - pxr/imaging/plugin/hdEmbree/mesh.cpp | 2 +- - pxr/imaging/plugin/hdEmbree/mesh.h | 4 ++-- - pxr/imaging/plugin/hdEmbree/meshSamplers.h | 4 ++-- - pxr/imaging/plugin/hdEmbree/pch.h | 6 +++--- - pxr/imaging/plugin/hdEmbree/renderDelegate.h | 2 +- - pxr/imaging/plugin/hdEmbree/renderParam.h | 2 +- - pxr/imaging/plugin/hdEmbree/renderer.cpp | 8 ++------ - pxr/imaging/plugin/hdEmbree/renderer.h | 4 ++-- - .../plugin/hdEmbree/testenv/testHdEmbree.cpp | 2 +- - 11 files changed, 24 insertions(+), 28 deletions(-) - -diff --git a/cmake/modules/FindEmbree.cmake b/cmake/modules/FindEmbree.cmake -index cd52f6b7f5..7c3ecd7cd8 100644 ---- a/cmake/modules/FindEmbree.cmake -+++ b/cmake/modules/FindEmbree.cmake -@@ -20,11 +20,11 @@ - #============================================================================= - - if (APPLE) -- set (EMBREE_LIB_NAME libembree3.dylib) -+ set (EMBREE_LIB_NAME libembree4.dylib) - elseif (UNIX) -- set (EMBREE_LIB_NAME libembree3.so) -+ set (EMBREE_LIB_NAME libembree4.so) - elseif (WIN32) -- set (EMBREE_LIB_NAME embree3.lib) -+ set (EMBREE_LIB_NAME embree4.lib) - endif() - - find_library(EMBREE_LIBRARY -@@ -39,7 +39,7 @@ find_library(EMBREE_LIBRARY - ) - - find_path(EMBREE_INCLUDE_DIR -- embree3/rtcore.h -+ embree4/rtcore.h - HINTS - "${EMBREE_LOCATION}/include" - "$ENV{EMBREE_LOCATION}/include" -@@ -47,12 +47,12 @@ DOC - "Embree headers path" - ) - --if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" ) -- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") -+if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" ) -+ file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") - string(REGEX MATCHALL "[0-9]+" MAJOR ${TMP}) -- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") -+ file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") - string(REGEX MATCHALL "[0-9]+" MINOR ${TMP}) -- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") -+ file(STRINGS "${EMBREE_INCLUDE_DIR}/embree4/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") - string(REGEX MATCHALL "[0-9]+" PATCH ${TMP}) - - set (EMBREE_VERSION ${MAJOR}.${MINOR}.${PATCH}) -diff --git a/pxr/imaging/plugin/hdEmbree/context.h b/pxr/imaging/plugin/hdEmbree/context.h -index 4165adb1e6..af9cc4ef5b 100644 ---- a/pxr/imaging/plugin/hdEmbree/context.h -+++ b/pxr/imaging/plugin/hdEmbree/context.h -@@ -14,7 +14,7 @@ - #include "pxr/base/gf/matrix4f.h" - #include "pxr/base/vt/array.h" - --#include -+#include - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/mesh.cpp b/pxr/imaging/plugin/hdEmbree/mesh.cpp -index 195f83a633..d3cb949952 100644 ---- a/pxr/imaging/plugin/hdEmbree/mesh.cpp -+++ b/pxr/imaging/plugin/hdEmbree/mesh.cpp -@@ -203,7 +203,7 @@ void HdEmbreeMesh::_EmbreeCullFaces(const RTCFilterFunctionNArguments* args) - default: break; - } - if (cull) { -- // This is how you reject a hit in embree3 instead of setting -+ // This is how you reject a hit in embree3/4 instead of setting - // geomId to invalid on the ray - args->valid[i] = 0; - } -diff --git a/pxr/imaging/plugin/hdEmbree/mesh.h b/pxr/imaging/plugin/hdEmbree/mesh.h -index bbb006302f..ef1ef07a98 100644 ---- a/pxr/imaging/plugin/hdEmbree/mesh.h -+++ b/pxr/imaging/plugin/hdEmbree/mesh.h -@@ -15,8 +15,8 @@ - - #include "pxr/imaging/plugin/hdEmbree/meshSamplers.h" - --#include --#include -+#include -+#include - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/meshSamplers.h b/pxr/imaging/plugin/hdEmbree/meshSamplers.h -index c32c35fffa..3712a9e3ab 100644 ---- a/pxr/imaging/plugin/hdEmbree/meshSamplers.h -+++ b/pxr/imaging/plugin/hdEmbree/meshSamplers.h -@@ -12,8 +12,8 @@ - #include "pxr/imaging/hd/meshUtil.h" - #include "pxr/base/vt/types.h" - --#include --#include -+#include -+#include - - #include - -diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h -index 9f613dd069..19bfb2f6d0 100644 ---- a/pxr/imaging/plugin/hdEmbree/pch.h -+++ b/pxr/imaging/plugin/hdEmbree/pch.h -@@ -76,9 +76,9 @@ - #include - #include - #include --#include --#include --#include -+#include -+#include -+#include - #include - #include - #include -diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h -index 1d8694daa6..72894b9080 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h -+++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h -@@ -14,7 +14,7 @@ - #include "pxr/base/tf/staticTokens.h" - - #include --#include -+#include - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/renderParam.h b/pxr/imaging/plugin/hdEmbree/renderParam.h -index 206a7458bc..354fed4faa 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderParam.h -+++ b/pxr/imaging/plugin/hdEmbree/renderParam.h -@@ -11,7 +11,7 @@ - #include "pxr/imaging/hd/renderDelegate.h" - #include "pxr/imaging/hd/renderThread.h" - --#include -+#include - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp -index 88d5e79093..820238c373 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderer.cpp -+++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp -@@ -667,9 +667,7 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, - rayHit.ray.flags = 0; - _PopulateRayHit(&rayHit, origin, dir, 0.0f); - { -- RTCIntersectContext context; -- rtcInitIntersectContext(&context); -- rtcIntersect1(_scene, &context, &rayHit); -+ rtcIntersect1(_scene, &rayHit); - // - // there is something odd about how this is used in Embree. Is it reversed - // here and then when it it used in -@@ -1005,9 +1003,7 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, - shadow.flags = 0; - _PopulateRay(&shadow, position, shadowDir, 0.001f); - { -- RTCIntersectContext context; -- rtcInitIntersectContext(&context); -- rtcOccluded1(_scene,&context,&shadow); -+ rtcOccluded1(_scene,&shadow); - } - - // Record this AO ray's contribution to the occlusion factor: a -diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h -index 2da9880848..fc3e062dd8 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderer.h -+++ b/pxr/imaging/plugin/hdEmbree/renderer.h -@@ -15,8 +15,8 @@ - #include "pxr/base/gf/matrix4d.h" - #include "pxr/base/gf/rect2i.h" - --#include --#include -+#include -+#include - - #include - #include -diff --git a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -index 02c2ca69f8..93705b2d28 100644 ---- a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -+++ b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -@@ -23,7 +23,7 @@ - - #include "pxr/base/tf/errorMark.h" - --#include -+#include - #include - - PXR_NAMESPACE_USING_DIRECTIVE diff --git a/2313.patch b/2313.patch new file mode 100644 index 0000000..74383c0 --- /dev/null +++ b/2313.patch @@ -0,0 +1,510 @@ +From 97de29467ef3ee2e9f9952b7158f9cbad51dac2a Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Thu, 23 Feb 2023 14:17:02 -0700 +Subject: [PATCH 1/7] build_usd.py: wrap the TBB_ROOT parameter value in double + quotes when building Embree + +This ensures that slash characters are properly escaped on Windows. +--- + build_scripts/build_usd.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py +index 40f6c3296c..ec1a268d78 100644 +--- a/build_scripts/build_usd.py ++++ b/build_scripts/build_usd.py +@@ -1587,7 +1587,7 @@ def InstallMaterialX(context, force, buildArgs): + def InstallEmbree(context, force, buildArgs): + with CurrentWorkingDirectory(DownloadURL(EMBREE_URL, context, force)): + extraArgs = [ +- '-DTBB_ROOT={instDir}'.format(instDir=context.instDir), ++ '-DTBB_ROOT="{instDir}"'.format(instDir=context.instDir), + '-DEMBREE_TUTORIALS=OFF', + '-DEMBREE_ISPC_SUPPORT=OFF' + ] + +From 2679ca564baca476ff7beee448b6d6a85b91a339 Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Thu, 23 Feb 2023 12:20:39 -0700 +Subject: [PATCH 2/7] FindEmbree.cmake: add support for finding Embree versions + 3 or 4 + +--- + cmake/modules/FindEmbree.cmake | 41 +++++++++++++++++++++------------- + 1 file changed, 26 insertions(+), 15 deletions(-) + +diff --git a/cmake/modules/FindEmbree.cmake b/cmake/modules/FindEmbree.cmake +index cd52f6b7f5..4c4ff1cdb2 100644 +--- a/cmake/modules/FindEmbree.cmake ++++ b/cmake/modules/FindEmbree.cmake +@@ -19,12 +19,30 @@ + # + #============================================================================= + ++find_path(EMBREE_INCLUDE_DIR ++ embree4/rtcore.h ++ embree3/rtcore.h ++HINTS ++ "${EMBREE_LOCATION}/include" ++ "$ENV{EMBREE_LOCATION}/include" ++DOC ++ "Embree headers path" ++) ++ ++if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree4/rtcore.h") ++ set(EMBREE_VERSIONED_LIBRARY_NAME "embree4") ++ set(EMBREE_VERSION_HEADER_FILE_NAME "rtcore_config.h") ++else() ++ set(EMBREE_VERSIONED_LIBRARY_NAME "embree3") ++ set(EMBREE_VERSION_HEADER_FILE_NAME "rtcore_version.h") ++endif() ++ + if (APPLE) +- set (EMBREE_LIB_NAME libembree3.dylib) ++ set (EMBREE_LIB_NAME "lib${EMBREE_VERSIONED_LIBRARY_NAME}.dylib") + elseif (UNIX) +- set (EMBREE_LIB_NAME libembree3.so) ++ set (EMBREE_LIB_NAME "lib${EMBREE_VERSIONED_LIBRARY_NAME}.so") + elseif (WIN32) +- set (EMBREE_LIB_NAME embree3.lib) ++ set (EMBREE_LIB_NAME "${EMBREE_VERSIONED_LIBRARY_NAME}.lib") + endif() + + find_library(EMBREE_LIBRARY +@@ -38,21 +56,14 @@ find_library(EMBREE_LIBRARY + "Embree library path" + ) + +-find_path(EMBREE_INCLUDE_DIR +- embree3/rtcore.h +-HINTS +- "${EMBREE_LOCATION}/include" +- "$ENV{EMBREE_LOCATION}/include" +-DOC +- "Embree headers path" +-) ++set(EMBREE_VERSION_HEADER_FILE_PATH "${EMBREE_INCLUDE_DIR}/${EMBREE_VERSIONED_LIBRARY_NAME}/${EMBREE_VERSION_HEADER_FILE_NAME}") + +-if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" ) +- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") ++if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_VERSION_HEADER_FILE_PATH}") ++ file(STRINGS "${EMBREE_VERSION_HEADER_FILE_PATH}" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") + string(REGEX MATCHALL "[0-9]+" MAJOR ${TMP}) +- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") ++ file(STRINGS "${EMBREE_VERSION_HEADER_FILE_PATH}" TMP REGEX "^#define RTC_VERSION_MINOR.*$") + string(REGEX MATCHALL "[0-9]+" MINOR ${TMP}) +- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") ++ file(STRINGS "${EMBREE_VERSION_HEADER_FILE_PATH}" TMP REGEX "^#define RTC_VERSION_PATCH.*$") + string(REGEX MATCHALL "[0-9]+" PATCH ${TMP}) + + set (EMBREE_VERSION ${MAJOR}.${MINOR}.${PATCH}) + +From c3db8a5d3c7040433f845a99b5c1ff57e5003f31 Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Thu, 16 Feb 2023 16:37:11 -0700 +Subject: [PATCH 3/7] hdEmbree: add support for building against Embree + versions 3 or 4 + +This supports upgrading Embree to a major version 4 release, so it includes +handling for the change in file paths between "embree3" and "embree4" and also +accounts for a small change in API in version 4. RTCIntersectContext was +renamed to RTCRayQueryContext, but it was also made part of the optional +RTCIntersectArguments parameter to rtcIntersect and rtcOccluded functions. +Since the context is not used by hdEmbree, it no longer needs to be provided. +--- + pxr/imaging/plugin/hdEmbree/CMakeLists.txt | 6 ++++++ + pxr/imaging/plugin/hdEmbree/context.h | 6 +++++- + pxr/imaging/plugin/hdEmbree/mesh.h | 9 +++++++-- + pxr/imaging/plugin/hdEmbree/meshSamplers.h | 9 +++++++-- + pxr/imaging/plugin/hdEmbree/pch.h | 6 ++++++ + pxr/imaging/plugin/hdEmbree/renderDelegate.h | 7 ++++++- + pxr/imaging/plugin/hdEmbree/renderParam.h | 6 +++++- + pxr/imaging/plugin/hdEmbree/renderer.cpp | 8 ++++++++ + pxr/imaging/plugin/hdEmbree/renderer.h | 9 +++++++-- + pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp | 7 ++++++- + 10 files changed, 63 insertions(+), 10 deletions(-) + +diff --git a/pxr/imaging/plugin/hdEmbree/CMakeLists.txt b/pxr/imaging/plugin/hdEmbree/CMakeLists.txt +index 96ac989d6c..d843804a15 100644 +--- a/pxr/imaging/plugin/hdEmbree/CMakeLists.txt ++++ b/pxr/imaging/plugin/hdEmbree/CMakeLists.txt +@@ -11,6 +11,12 @@ if (NOT ${PXR_BUILD_GPU_SUPPORT}) + return() + endif() + ++if (EMBREE_VERSION VERSION_GREATER_EQUAL 4.0.0) ++ add_definitions(-DPXR_EMBREE_MAJOR_VERSION=4) ++else() ++ add_definitions(-DPXR_EMBREE_MAJOR_VERSION=3) ++endif() ++ + pxr_plugin(hdEmbree + LIBRARIES + plug +diff --git a/pxr/imaging/plugin/hdEmbree/context.h b/pxr/imaging/plugin/hdEmbree/context.h +index 4165adb1e6..7e5c099b74 100644 +--- a/pxr/imaging/plugin/hdEmbree/context.h ++++ b/pxr/imaging/plugin/hdEmbree/context.h +@@ -14,7 +14,11 @@ + #include "pxr/base/gf/matrix4f.h" + #include "pxr/base/vt/array.h" + +-#include ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ #include ++#else ++ #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/mesh.h b/pxr/imaging/plugin/hdEmbree/mesh.h +index bbb006302f..a6f71f110f 100644 +--- a/pxr/imaging/plugin/hdEmbree/mesh.h ++++ b/pxr/imaging/plugin/hdEmbree/mesh.h +@@ -15,8 +15,13 @@ + + #include "pxr/imaging/plugin/hdEmbree/meshSamplers.h" + +-#include +-#include ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ #include ++ #include ++#else ++ #include ++ #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/meshSamplers.h b/pxr/imaging/plugin/hdEmbree/meshSamplers.h +index c32c35fffa..51459a2ed4 100644 +--- a/pxr/imaging/plugin/hdEmbree/meshSamplers.h ++++ b/pxr/imaging/plugin/hdEmbree/meshSamplers.h +@@ -12,8 +12,13 @@ + #include "pxr/imaging/hd/meshUtil.h" + #include "pxr/base/vt/types.h" + +-#include +-#include ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ #include ++ #include ++#else ++ #include ++ #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + + #include + +diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h +index 4e16a844d7..901e93859f 100644 +--- a/pxr/imaging/plugin/hdEmbree/pch.h ++++ b/pxr/imaging/plugin/hdEmbree/pch.h +@@ -76,9 +76,15 @@ + #include + #include + #include ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++#include ++#include ++#include ++#else + #include + #include + #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + #ifdef PXR_PYTHON_SUPPORT_ENABLED + #include "pxr/base/tf/pySafePython.h" + #endif // PXR_PYTHON_SUPPORT_ENABLED +diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h +index 1d8694daa6..826d020e04 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h ++++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h +@@ -13,8 +13,13 @@ + #include "pxr/imaging/plugin/hdEmbree/renderer.h" + #include "pxr/base/tf/staticTokens.h" + ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ #include ++#else ++ #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ + #include +-#include + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/renderParam.h b/pxr/imaging/plugin/hdEmbree/renderParam.h +index 206a7458bc..af94ef10a4 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderParam.h ++++ b/pxr/imaging/plugin/hdEmbree/renderParam.h +@@ -11,7 +11,11 @@ + #include "pxr/imaging/hd/renderDelegate.h" + #include "pxr/imaging/hd/renderThread.h" + +-#include ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ #include ++#else ++ #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + + PXR_NAMESPACE_OPEN_SCOPE + +diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp +index cc8ddb0270..8cbf8d4959 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderer.cpp ++++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp +@@ -709,9 +709,13 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, + rayHit.ray.flags = 0; + _PopulateRayHit(&rayHit, origin, dir, 0.0f); + { ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ rtcIntersect1(_scene, &rayHit); ++#else + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcIntersect1(_scene, &context, &rayHit); ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + // + // there is something odd about how this is used in Embree. Is it reversed + // here and then when it it used in +@@ -1047,9 +1051,13 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, + shadow.flags = 0; + _PopulateRay(&shadow, position, shadowDir, 0.001f); + { ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ rtcOccluded1(_scene, &shadow); ++#else + RTCIntersectContext context; + rtcInitIntersectContext(&context); + rtcOccluded1(_scene,&context,&shadow); ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + } + + // Record this AO ray's contribution to the occlusion factor: a +diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h +index 2da9880848..913b83eccc 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderer.h ++++ b/pxr/imaging/plugin/hdEmbree/renderer.h +@@ -15,8 +15,13 @@ + #include "pxr/base/gf/matrix4d.h" + #include "pxr/base/gf/rect2i.h" + +-#include +-#include ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ #include ++ #include ++#else ++ #include ++ #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 + + #include + #include +diff --git a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp +index 02c2ca69f8..45370dfed0 100644 +--- a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp ++++ b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp +@@ -23,7 +23,12 @@ + + #include "pxr/base/tf/errorMark.h" + +-#include ++#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ #include ++#else ++ #include ++#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 ++ + #include + + PXR_NAMESPACE_USING_DIRECTIVE + +From 9c67986d0a7e76babead0d1fdf5190f264c1a8b9 Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Wed, 24 Jul 2024 10:07:44 -0400 +Subject: [PATCH 4/7] build_usd.py: update Embree URLs to reflect new home in + the RenderKit GitHub organization + +--- + build_scripts/build_usd.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py +index ec1a268d78..afa4763c8d 100644 +--- a/build_scripts/build_usd.py ++++ b/build_scripts/build_usd.py +@@ -1580,9 +1580,9 @@ def InstallMaterialX(context, force, buildArgs): + # For MacOS we use version 3.13.3 to include a fix from Intel + # to build on Apple Silicon. + if MacOS(): +- EMBREE_URL = "https://github.com/embree/embree/archive/v3.13.3.zip" ++ EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.13.3.zip" + else: +- EMBREE_URL = "https://github.com/embree/embree/archive/v3.2.2.zip" ++ EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.2.2.zip" + + def InstallEmbree(context, force, buildArgs): + with CurrentWorkingDirectory(DownloadURL(EMBREE_URL, context, force)): + +From 0e3f0e8b595e74312c7fbd1b378a96d3b5e85723 Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Thu, 23 Feb 2023 12:25:24 -0700 +Subject: [PATCH 5/7] build_usd.py: add an option to choose Embree 3 or Embree + 4 + +The new --embree-major-version option can be given to build_usd.py to select +between Embree 3 or Embree 4. By default, Embree 3 is still used, preserving +the existing behavior. +--- + build_scripts/build_usd.py | 31 ++++++++++++++++++++++++------- + 1 file changed, 24 insertions(+), 7 deletions(-) + +diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py +index afa4763c8d..f932c85b5d 100644 +--- a/build_scripts/build_usd.py ++++ b/build_scripts/build_usd.py +@@ -1577,14 +1577,19 @@ def InstallMaterialX(context, force, buildArgs): + + ############################################################ + # Embree +-# For MacOS we use version 3.13.3 to include a fix from Intel +-# to build on Apple Silicon. +-if MacOS(): +- EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.13.3.zip" +-else: +- EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.2.2.zip" ++ ++EMBREE_DEFAULT_MAJOR_VERSION = 3 + + def InstallEmbree(context, force, buildArgs): ++ if context.embreeMajorVersion >= 4: ++ EMBREE_URL = "https://github.com/RenderKit/embree/archive/refs/tags/v4.4.0.zip" ++ elif MacOS(): ++ # For MacOS we use version 3.13.3 to include a fix from Intel ++ # to build on Apple Silicon. ++ EMBREE_URL = "https://github.com/RenderKit/embree/archive/refs/tags/v3.13.3.zip" ++ else: ++ EMBREE_URL = "https://github.com/RenderKit/embree/archive/refs/tags/v3.2.2.zip" ++ + with CurrentWorkingDirectory(DownloadURL(EMBREE_URL, context, force)): + extraArgs = [ + '-DTBB_ROOT="{instDir}"'.format(instDir=context.instDir), +@@ -1601,7 +1606,9 @@ def InstallEmbree(context, force, buildArgs): + + RunCMake(context, force, extraArgs) + +-EMBREE = Dependency("Embree", InstallEmbree, "include/embree3/rtcore.h") ++EMBREE = Dependency("Embree", InstallEmbree, ++ "include/embree3/rtcore.h", ++ "include/embree4/rtcore.h") + + ############################################################ + # AnimX +@@ -2121,6 +2128,12 @@ def InstallUSD(context, force, buildArgs): + help="Build Embree sample imaging plugin") + subgroup.add_argument("--no-embree", dest="build_embree", action="store_false", + help="Do not build Embree sample imaging plugin (default)") ++group.add_argument("--embree-major-version", ++ default=EMBREE_DEFAULT_MAJOR_VERSION, type=int, ++ choices=[3, 4], ++ help=( ++ "The major version of Embree to build " ++ "(default: {})").format(EMBREE_DEFAULT_MAJOR_VERSION)) + subgroup = group.add_mutually_exclusive_group() + subgroup.add_argument("--prman", dest="build_prman", action="store_true", + default=False, +@@ -2342,6 +2355,7 @@ def __init__(self, args): + + # - Imaging plugins + self.buildEmbree = self.buildImaging and args.build_embree ++ self.embreeMajorVersion = args.embree_major_version + self.buildPrman = self.buildImaging and args.build_prman + self.prmanLocation = (os.path.abspath(args.prman_location) + if args.prman_location else None) +@@ -2656,6 +2670,7 @@ def _JoinVersion(v): + OpenImageIO support: {buildOIIO} + OpenColorIO support: {buildOCIO} + Embree support: {buildEmbree} ++ Embree major version: {embreeMajorVersion} + PRMan support: {buildPrman} + Vulkan support: {enableVulkan} + UsdImaging {buildUsdImaging} +@@ -2738,6 +2753,8 @@ def FormatBuildArguments(buildArgs): + buildOIIO=("On" if context.buildOIIO else "Off"), + buildOCIO=("On" if context.buildOCIO else "Off"), + buildEmbree=("On" if context.buildEmbree else "Off"), ++ embreeMajorVersion=(context.embreeMajorVersion if context.buildEmbree ++ else "N/A"), + buildPrman=("On" if context.buildPrman else "Off"), + buildUsdImaging=("On" if context.buildUsdImaging else "Off"), + buildUsdview=("On" if context.buildUsdview else "Off"), + +From c96c972bc116e46bef477493b86b535f9b115545 Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Thu, 12 Jun 2025 17:46:43 -0400 +Subject: [PATCH 6/7] hdEmbree: use a header common between TBB and oneTBB in + limits workaround + +The TBB header that provides version definitions moved between TBB +(tbb_stddef.h) and oneTBB (version.h), so we use the lowest level +header that is available at the same path in both and let it bring in +the definitions. This allows the hdEmbree plugin to be built with +oneTBB when used in combination with Embree 4. +--- + pxr/imaging/plugin/hdEmbree/renderer.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp +index 8cbf8d4959..381bed73e5 100644 +--- a/pxr/imaging/plugin/hdEmbree/renderer.cpp ++++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp +@@ -28,8 +28,13 @@ + // oneTBB as a min spec. This applies the "Work" thread limit to the + // render thread if "Work" is using old TBB, but won't affect other "Work" + // implementations. Note that it may affect Embree TBB usage as well. ++// ++// The header that provides version definitions moved between TBB ++// (tbb_stddef.h) and oneTBB (version.h), so we use the lowest level header ++// that is available at the same path in both and let it bring in the ++// definitions. + // ------------------------------------------------------------------------- +-#include ++#include + + #if TBB_INTERFACE_VERSION_MAJOR < 12 + + +From a464dc5dcc9a26f552a3ece42dab949ae03d35df Mon Sep 17 00:00:00 2001 +From: Matt Johnson +Date: Wed, 24 Jul 2024 10:17:27 -0400 +Subject: [PATCH 7/7] build_usd.py: allow oneTBB and Embree to be used together + when Embree 4.x or later is selected + +--- + build_scripts/build_usd.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py +index f932c85b5d..949acadb42 100644 +--- a/build_scripts/build_usd.py ++++ b/build_scripts/build_usd.py +@@ -2473,9 +2473,10 @@ def ForceBuildDependency(self, dep): + PrintError("Draco plugin can not be enabled for monolithic build on Windows") + sys.exit(1) + +-# The versions of Embree we currently support do not support oneTBB. +-if context.buildOneTBB and context.buildEmbree: +- PrintError("Embree support cannot be enabled when building against oneTBB") ++# When building with both oneTBB and Embree, a 4.x version of Embree must be ++# used. ++if context.buildOneTBB and (context.buildEmbree and context.embreeMajorVersion < 4): ++ PrintError("Embree 4.x or later must be selected when building against oneTBB") + sys.exit(1) + + # Windows ARM64 requires oneTBB. Since oneTBB is a non-standard option for the diff --git a/sources b/sources index 2a14b27..2a65832 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-25.05.01.tar.gz) = 66bf75486f09dce7085c5c80cc3e005c02c1dfbbfbd02c8e2e8fd9498030ca49cd6bc0a9b9db930d0559c745cf77ebaf822018de4bf798cce84fdf0aa89f0d84 +SHA512 (OpenUSD-25.08.tar.gz) = fbe1e632473883e47f4bfeb16cab314bbbe8a7b404a5c071ca613bbf288526e505edd7a5edfdd9f85dd16da6d0d91fa0d4f8c783882094d3691f77685817fea6 diff --git a/usd.spec b/usd.spec index 2c45cea..c1c00a2 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.25.5 +%global downstream_so_version 0.25.8 %bcond alembic 1 %bcond draco 1 @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 25.05.01 +Version: 25.08 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -126,12 +126,17 @@ Source1: org.openusd.usdview.desktop # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) Patch: 0001-Downstream-only-add-an-SONAME-version.patch -# Port to Embree 4.x -# https://github.com/PixarAnimationStudios/OpenUSD/pull/2266 -# See also: # hdEmbree: add support for building against embree4 # https://github.com/PixarAnimationStudios/USD/pull/2313 -Patch: %{forgeurl}/pull/2266.patch +Patch: %{forgeurl}/pull/2313.patch + +# Downstream-only: use Valgrind macro instead of inline assembly +# +# Upstream already has a plan to make this change, but is waiting to be +# able to add a build dependency on valgrind-devel. We have no such +# obstacle, and this change fixes the inline assembly failing to compile +# on aarch64. +Patch: 0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch # Downstream-only: use the system double-conversion library Patch: 0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -175,6 +180,9 @@ BuildRequires: pkgconfig(libavif) BuildRequires: cmake(Imath) >= 3.0 +# Introduced by 0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch +BuildRequires: valgrind-devel + %if %{with alembic} BuildRequires: cmake(Alembic) %endif @@ -552,6 +560,7 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_BUILD_TESTS=%{expr:%{with test}?"ON":"OFF"} \ -DPXR_BUILD_TUTORIALS=OFF \ -DPXR_BUILD_USD_IMAGING=ON \ + -DPXR_BUILD_EXEC=ON \ -DPXR_BUILD_USD_TOOLS=ON \ -DPXR_BUILD_USDVIEW=%{expr:%{with usdview}?"ON":"OFF"} \ \ @@ -586,6 +595,10 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" mkdir -p %{buildroot}%{python3_sitearch} mv %{buildroot}%{python3_sitelib}/* %{buildroot}%{python3_sitearch} +# Upstream may expect to use this as a script in development, but we install it +# without executable permissions, so we remove the shebang. +sed -r -i '1{/^#!/d}' '%{buildroot}%{python3_sitearch}/pxr/Usd/usdGenSchema.py' + %if %{with usdview} # Install a desktop icon for usdview desktop-file-install \ From 4c4b91fe36e9b9a2c4fcfd79da353aa9f3aaebe4 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 15:21:43 +0200 Subject: [PATCH 134/167] Rebuilt for Python 3.14.0rc2 bytecode From ee49c71c00536135da3f8dfbc8e4508ee6220d33 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 21 Aug 2025 08:26:34 -0600 Subject: [PATCH 135/167] Rebuild for tbb 2022.2.0 From 3721e20bfe0cd4eadb42da7d1153e7d993b6915d Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Tue, 16 Sep 2025 12:02:47 -0500 Subject: [PATCH 136/167] Rebuild for OpenImageIO 3. From 74c20c0fa2f8abefea31a22beef153f54f49dc27 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 15:01:43 +0200 Subject: [PATCH 137/167] Rebuilt for Python 3.14.0rc3 bytecode From bccb5c96c3cc140387c1e1dfd8ea63f1379f0dd7 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Tue, 30 Sep 2025 15:06:28 -0700 Subject: [PATCH 138/167] Rebuild for openvdb 12.1.1 From c8eae5d8a64704e331425dc4a1c3bf9c33c60264 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 27 Oct 2025 18:52:19 +0000 Subject: [PATCH 139/167] Rebuilt for opensubdiv 3.7.0~RC1 (fix RHBZ#2406597) From 734e75b372c6868ab5cbe569061d385a627dd32e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 27 Oct 2025 21:14:39 +0000 Subject: [PATCH 140/167] Add direct build dependency on OpenCL as a workaround --- usd.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usd.spec b/usd.spec index c1c00a2..26e7309 100644 --- a/usd.spec +++ b/usd.spec @@ -167,6 +167,11 @@ BuildRequires: pkgconfig(dri) BuildRequires: hdf5-devel BuildRequires: cmake(OpenSubdiv) BuildRequires: pkgconfig(tbb) +# This seems to be an indirect dependency, probably through OpenSubdiv. +# Ideally, everything would take care of its own dependencies, and we wouldn’t +# have to specify it directly, but we haven’t studied the problem closely +# enough to propose a fix. +BuildRequires: pkgconfig(OpenCL) # Unbundled: BuildRequires: cmake(double-conversion) BuildRequires: pkgconfig(liblz4) From 6172607253b60fcacff4678ace28648ef72cdf4f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 26 Oct 2025 05:12:37 +0000 Subject: [PATCH 141/167] Update to 25.11 (close RHBZ#2406284) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 36 +- ...use-Valgrind-macro-instead-of-inline.patch | 8 +- ...use-the-system-double-conversion-lib.patch | 8 +- ...ream-only-use-the-system-lz4-library.patch | 8 +- ...-only-use-the-system-pugixml-library.patch | 4 +- ...nly-use-the-system-rapidjson-library.patch | 15 +- ...tream-only-use-the-system-libdeflate.patch | 24 +- ...wnstream-only-use-the-system-libavif.patch | 6 +- 2313.patch | 510 ------------------ sources | 2 +- usd.spec | 24 +- 12 files changed, 74 insertions(+), 572 deletions(-) delete mode 100644 2313.patch diff --git a/.gitignore b/.gitignore index d0e0d07..a6f122a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /OpenUSD-25.05.tar.gz /OpenUSD-25.05.01.tar.gz /OpenUSD-25.08.tar.gz +/OpenUSD-25.11.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index 250eae0..aeb48ad 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 483ce5b8e320e89016fff7b3480216ba94c032ff Mon Sep 17 00:00:00 2001 +From 2f2ebd688c7e6804014ea183163954f48e7622af Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -33,15 +33,15 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) --- cmake/defaults/Version.cmake | 6 ++++++ cmake/macros/Private.cmake | 1 + - cmake/macros/Public.cmake | 1 + - 3 files changed, 8 insertions(+) + cmake/macros/Public.cmake | 2 ++ + 3 files changed, 9 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 447c74e4d..a990f071b 100644 +index 20e70edb2..c3e072e1a 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "25") - set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits + set(PXR_PATCH_VERSION "11") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -51,29 +51,37 @@ index 447c74e4d..a990f071b 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index 6fe1134c1..06aecd083 100644 +index b90b743de..7af8b89c2 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake -@@ -1372,6 +1372,7 @@ function(_pxr_library NAME) +@@ -1304,6 +1304,7 @@ function(_pxr_library NAME) + FOLDER "${folder}" + POSITION_INDEPENDENT_CODE ON IMPORT_PREFIX "${args_PREFIX}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} PREFIX "${args_PREFIX}" SUFFIX "${args_SUFFIX}" -+ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} ) - - target_compile_definitions(${NAME} diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index 807cf7d83..7225af783 100644 +index b8e588bf3..cf64607c8 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake -@@ -1121,6 +1121,7 @@ function(pxr_toplevel_prologue) - FOLDER "${folder}" +@@ -414,6 +414,7 @@ function(pxr_library NAME) + TYPE "${args_TYPE}" + PREFIX "${prefix}" + SUFFIX "${suffix}" ++ SOVERSION ${PXR_DOWNSTREAM_SOVERSION} + SUBDIR "${subdir}" + CPPFILES "${args_CPPFILES};${${NAME}_CPPFILES}" + PUBLIC_HEADERS "${args_PUBLIC_HEADERS};${${NAME}_PUBLIC_HEADERS}" +@@ -1152,6 +1153,7 @@ function(pxr_toplevel_prologue) PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" + OUTPUT_NAME ${libName} + SOVERSION ${PXR_DOWNSTREAM_SOVERSION} ) _get_install_dir("lib" libInstallPrefix) install( -- -2.50.1 +2.51.0 diff --git a/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch index 62f0370..4ca709f 100644 --- a/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch +++ b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch @@ -1,4 +1,4 @@ -From 75d4451fa64e086edd9d621af681df13cebde5eb Mon Sep 17 00:00:00 2001 +From bb5d6070945c671d3192e2c6c939b941f50991fc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 1 Aug 2025 08:47:41 -0400 Subject: [PATCH] Downstream-only: use Valgrind macro instead of inline @@ -13,7 +13,7 @@ on aarch64. 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/pxr/exec/vdf/executorDataVector.cpp b/pxr/exec/vdf/executorDataVector.cpp -index 12f9e517e..7e5625678 100644 +index 96dacca06..7e5625678 100644 --- a/pxr/exec/vdf/executorDataVector.cpp +++ b/pxr/exec/vdf/executorDataVector.cpp @@ -11,40 +11,18 @@ @@ -35,7 +35,7 @@ index 12f9e517e..7e5625678 100644 static inline void Vdf_ExecutorDataVector_ValgrindMakeDefined(void *ptr, size_t size) { --#if defined(ARCH_OS_LINUX) +-#if defined(ARCH_OS_LINUX) && defined(ARCH_CPU_INTEL) - // Pass a result and a pointer to some arguments via registers - volatile unsigned long long int result; - volatile unsigned long long int args[6] = { @@ -61,5 +61,5 @@ index 12f9e517e..7e5625678 100644 Vdf_ExecutorDataVector::~Vdf_ExecutorDataVector() -- -2.50.1 +2.51.0 diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 1d2a648..3b8f6e5 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From 23bda0e3337d7a27696a000a47eaf36840650c69 Mon Sep 17 00:00:00 2001 +From 70ca2a5a93b263c1f42502e6b800f46fe1f0d91f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -8,7 +8,7 @@ Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index fade8d559..5d9272087 100644 +index 1b1aa9dbe..f2d58fd15 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -110,11 +110,14 @@ function(add_py_dll_link_test) @@ -26,7 +26,7 @@ index fade8d559..5d9272087 100644 PUBLIC_CLASSES anyUniquePtr -@@ -278,14 +281,6 @@ pxr_library(tf +@@ -277,14 +280,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -42,5 +42,5 @@ index fade8d559..5d9272087 100644 PYMODULE_CPPFILES -- -2.50.1 +2.51.0 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index c72d25a..26affbf 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,4 +1,4 @@ -From 3492a9fb0fccfe52ed5258e943381d48d28be3e5 Mon Sep 17 00:00:00 2001 +From 64a603b9c6278f3287cd2769f0fb5ebd9356ae74 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library @@ -8,7 +8,7 @@ Subject: [PATCH 2/6] Downstream-only: use the system lz4 library 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 5d9272087..c4130882c 100644 +index f2d58fd15..7433f0591 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -111,6 +111,8 @@ function(add_py_dll_link_test) @@ -31,7 +31,7 @@ index 5d9272087..c4130882c 100644 PUBLIC_CLASSES anyUniquePtr -@@ -281,7 +287,6 @@ pxr_library(tf +@@ -280,7 +286,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -40,5 +40,5 @@ index 5d9272087..c4130882c 100644 PYMODULE_CPPFILES module.cpp -- -2.50.1 +2.51.0 diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 2bab595..1051ecd 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,4 +1,4 @@ -From 98f62852495fb2c86047eff532a3af2a5b88792b Mon Sep 17 00:00:00 2001 +From 48a4ad95bbe1e5675922da4eaf863bd208c0167b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library @@ -35,5 +35,5 @@ index 244f27aa8..1e00413c4 100644 PRIVATE_HEADERS api.h -- -2.50.1 +2.51.0 diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index 8d1c7e6..cd90d76 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,22 +1,23 @@ -From aa1063129297e469ddd709c7ee4d0406f9bae08f Mon Sep 17 00:00:00 2001 +From 48c8a77ae5ba717b8651585302939a36126d286c Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library --- - pxr/base/js/CMakeLists.txt | 37 ------------------------------------- - 1 file changed, 37 deletions(-) + pxr/base/js/CMakeLists.txt | 40 -------------------------------------- + 1 file changed, 40 deletions(-) diff --git a/pxr/base/js/CMakeLists.txt b/pxr/base/js/CMakeLists.txt -index d59dc1f6d..086d1bc48 100644 +index 632c061e5..62696a341 100644 --- a/pxr/base/js/CMakeLists.txt +++ b/pxr/base/js/CMakeLists.txt -@@ -15,43 +15,6 @@ pxr_library(js +@@ -15,46 +15,6 @@ pxr_library(js converter.h types.h - PRIVATE_HEADERS - rapidjson/allocators.h +- rapidjson/cursorstreamwrapper.h - rapidjson/document.h - rapidjson/encodedstream.h - rapidjson/encodings.h @@ -26,6 +27,7 @@ index d59dc1f6d..086d1bc48 100644 - rapidjson/filewritestream.h - rapidjson/fwd.h - rapidjson/internal/biginteger.h +- rapidjson/internal/clzll.h - rapidjson/internal/diyfp.h - rapidjson/internal/dtoa.h - rapidjson/internal/ieee754.h @@ -50,11 +52,12 @@ index d59dc1f6d..086d1bc48 100644 - rapidjson/schema.h - rapidjson/stream.h - rapidjson/stringbuffer.h +- rapidjson/uri.h - rapidjson/writer.h - DOXYGEN_FILES overview.dox ) -- -2.50.1 +2.51.0 diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index e76eeb6..5549f98 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,16 +1,16 @@ -From 4b1c527468f9c43e04a1ff773cec6a9f9ca0b5ae Mon Sep 17 00:00:00 2001 +From 614a6a01271cfaaa2421f58289cc1267685c75a9 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate --- - pxr/imaging/hio/CMakeLists.txt | 7 +++++++ - pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c | 3 +-- - pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h | 12 ------------ + pxr/imaging/hio/CMakeLists.txt | 7 +++++++ + .../hioOpenEXR/OpenEXR/OpenEXRCore/compression.c | 3 +-- + .../plugin/hioOpenEXR/OpenEXR/OpenEXRCoreUnity.h | 12 ------------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/pxr/imaging/hio/CMakeLists.txt b/pxr/imaging/hio/CMakeLists.txt -index 75e1e6298..09264c600 100644 +index e61fc7c54..7cfbe9d70 100644 --- a/pxr/imaging/hio/CMakeLists.txt +++ b/pxr/imaging/hio/CMakeLists.txt @@ -1,6 +1,9 @@ @@ -34,10 +34,10 @@ index 75e1e6298..09264c600 100644 PUBLIC_CLASSES fieldTextureData -diff --git a/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c b/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/compression.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/compression.c index a672e833b..1d2eaea56 100644 ---- a/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c -+++ b/pxr/imaging/hio/OpenEXR/OpenEXRCore/compression.c +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/compression.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/compression.c @@ -8,8 +8,7 @@ #include "internal_memory.h" #include "internal_structs.h" @@ -48,10 +48,10 @@ index a672e833b..1d2eaea56 100644 #if ( \ LIBDEFLATE_VERSION_MAJOR > 1 || \ -diff --git a/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h b/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCoreUnity.h b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCoreUnity.h index 7481a346e..71bdde9cc 100644 ---- a/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h -+++ b/pxr/imaging/hio/OpenEXR/OpenEXRCoreUnity.h +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCoreUnity.h ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCoreUnity.h @@ -8,18 +8,6 @@ #include "OpenEXRCore/openexr_config.h" @@ -72,5 +72,5 @@ index 7481a346e..71bdde9cc 100644 #include "OpenEXRCore/attributes.c" -- -2.50.1 +2.51.0 diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index fe06223..e1a6178 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,4 +1,4 @@ -From 8ebd20bf9e0e945457215dba1d56a25408f860a6 Mon Sep 17 00:00:00 2001 +From a7e7a94bed76d6b24bfbf9a2c4aa1cf9d57564ab Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif @@ -22,7 +22,7 @@ index 81549fb54..d2dfb1bcd 100644 #if defined(PXR_STATIC) # define HIOAVIF_API diff --git a/pxr/imaging/plugin/hioAvif/CMakeLists.txt b/pxr/imaging/plugin/hioAvif/CMakeLists.txt -index f4eaeea15..7f1680eaf 100644 +index 1a81d50b1..fd89502a7 100644 --- a/pxr/imaging/plugin/hioAvif/CMakeLists.txt +++ b/pxr/imaging/plugin/hioAvif/CMakeLists.txt @@ -1,6 +1,9 @@ @@ -237,5 +237,5 @@ index f4eaeea15..7f1680eaf 100644 RESOURCE_FILES -- -2.50.1 +2.51.0 diff --git a/2313.patch b/2313.patch deleted file mode 100644 index 74383c0..0000000 --- a/2313.patch +++ /dev/null @@ -1,510 +0,0 @@ -From 97de29467ef3ee2e9f9952b7158f9cbad51dac2a Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Thu, 23 Feb 2023 14:17:02 -0700 -Subject: [PATCH 1/7] build_usd.py: wrap the TBB_ROOT parameter value in double - quotes when building Embree - -This ensures that slash characters are properly escaped on Windows. ---- - build_scripts/build_usd.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py -index 40f6c3296c..ec1a268d78 100644 ---- a/build_scripts/build_usd.py -+++ b/build_scripts/build_usd.py -@@ -1587,7 +1587,7 @@ def InstallMaterialX(context, force, buildArgs): - def InstallEmbree(context, force, buildArgs): - with CurrentWorkingDirectory(DownloadURL(EMBREE_URL, context, force)): - extraArgs = [ -- '-DTBB_ROOT={instDir}'.format(instDir=context.instDir), -+ '-DTBB_ROOT="{instDir}"'.format(instDir=context.instDir), - '-DEMBREE_TUTORIALS=OFF', - '-DEMBREE_ISPC_SUPPORT=OFF' - ] - -From 2679ca564baca476ff7beee448b6d6a85b91a339 Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Thu, 23 Feb 2023 12:20:39 -0700 -Subject: [PATCH 2/7] FindEmbree.cmake: add support for finding Embree versions - 3 or 4 - ---- - cmake/modules/FindEmbree.cmake | 41 +++++++++++++++++++++------------- - 1 file changed, 26 insertions(+), 15 deletions(-) - -diff --git a/cmake/modules/FindEmbree.cmake b/cmake/modules/FindEmbree.cmake -index cd52f6b7f5..4c4ff1cdb2 100644 ---- a/cmake/modules/FindEmbree.cmake -+++ b/cmake/modules/FindEmbree.cmake -@@ -19,12 +19,30 @@ - # - #============================================================================= - -+find_path(EMBREE_INCLUDE_DIR -+ embree4/rtcore.h -+ embree3/rtcore.h -+HINTS -+ "${EMBREE_LOCATION}/include" -+ "$ENV{EMBREE_LOCATION}/include" -+DOC -+ "Embree headers path" -+) -+ -+if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree4/rtcore.h") -+ set(EMBREE_VERSIONED_LIBRARY_NAME "embree4") -+ set(EMBREE_VERSION_HEADER_FILE_NAME "rtcore_config.h") -+else() -+ set(EMBREE_VERSIONED_LIBRARY_NAME "embree3") -+ set(EMBREE_VERSION_HEADER_FILE_NAME "rtcore_version.h") -+endif() -+ - if (APPLE) -- set (EMBREE_LIB_NAME libembree3.dylib) -+ set (EMBREE_LIB_NAME "lib${EMBREE_VERSIONED_LIBRARY_NAME}.dylib") - elseif (UNIX) -- set (EMBREE_LIB_NAME libembree3.so) -+ set (EMBREE_LIB_NAME "lib${EMBREE_VERSIONED_LIBRARY_NAME}.so") - elseif (WIN32) -- set (EMBREE_LIB_NAME embree3.lib) -+ set (EMBREE_LIB_NAME "${EMBREE_VERSIONED_LIBRARY_NAME}.lib") - endif() - - find_library(EMBREE_LIBRARY -@@ -38,21 +56,14 @@ find_library(EMBREE_LIBRARY - "Embree library path" - ) - --find_path(EMBREE_INCLUDE_DIR -- embree3/rtcore.h --HINTS -- "${EMBREE_LOCATION}/include" -- "$ENV{EMBREE_LOCATION}/include" --DOC -- "Embree headers path" --) -+set(EMBREE_VERSION_HEADER_FILE_PATH "${EMBREE_INCLUDE_DIR}/${EMBREE_VERSIONED_LIBRARY_NAME}/${EMBREE_VERSION_HEADER_FILE_NAME}") - --if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" ) -- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") -+if (EMBREE_INCLUDE_DIR AND EXISTS "${EMBREE_VERSION_HEADER_FILE_PATH}") -+ file(STRINGS "${EMBREE_VERSION_HEADER_FILE_PATH}" TMP REGEX "^#define RTC_VERSION_MAJOR.*$") - string(REGEX MATCHALL "[0-9]+" MAJOR ${TMP}) -- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_MINOR.*$") -+ file(STRINGS "${EMBREE_VERSION_HEADER_FILE_PATH}" TMP REGEX "^#define RTC_VERSION_MINOR.*$") - string(REGEX MATCHALL "[0-9]+" MINOR ${TMP}) -- file(STRINGS "${EMBREE_INCLUDE_DIR}/embree3/rtcore_version.h" TMP REGEX "^#define RTC_VERSION_PATCH.*$") -+ file(STRINGS "${EMBREE_VERSION_HEADER_FILE_PATH}" TMP REGEX "^#define RTC_VERSION_PATCH.*$") - string(REGEX MATCHALL "[0-9]+" PATCH ${TMP}) - - set (EMBREE_VERSION ${MAJOR}.${MINOR}.${PATCH}) - -From c3db8a5d3c7040433f845a99b5c1ff57e5003f31 Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Thu, 16 Feb 2023 16:37:11 -0700 -Subject: [PATCH 3/7] hdEmbree: add support for building against Embree - versions 3 or 4 - -This supports upgrading Embree to a major version 4 release, so it includes -handling for the change in file paths between "embree3" and "embree4" and also -accounts for a small change in API in version 4. RTCIntersectContext was -renamed to RTCRayQueryContext, but it was also made part of the optional -RTCIntersectArguments parameter to rtcIntersect and rtcOccluded functions. -Since the context is not used by hdEmbree, it no longer needs to be provided. ---- - pxr/imaging/plugin/hdEmbree/CMakeLists.txt | 6 ++++++ - pxr/imaging/plugin/hdEmbree/context.h | 6 +++++- - pxr/imaging/plugin/hdEmbree/mesh.h | 9 +++++++-- - pxr/imaging/plugin/hdEmbree/meshSamplers.h | 9 +++++++-- - pxr/imaging/plugin/hdEmbree/pch.h | 6 ++++++ - pxr/imaging/plugin/hdEmbree/renderDelegate.h | 7 ++++++- - pxr/imaging/plugin/hdEmbree/renderParam.h | 6 +++++- - pxr/imaging/plugin/hdEmbree/renderer.cpp | 8 ++++++++ - pxr/imaging/plugin/hdEmbree/renderer.h | 9 +++++++-- - pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp | 7 ++++++- - 10 files changed, 63 insertions(+), 10 deletions(-) - -diff --git a/pxr/imaging/plugin/hdEmbree/CMakeLists.txt b/pxr/imaging/plugin/hdEmbree/CMakeLists.txt -index 96ac989d6c..d843804a15 100644 ---- a/pxr/imaging/plugin/hdEmbree/CMakeLists.txt -+++ b/pxr/imaging/plugin/hdEmbree/CMakeLists.txt -@@ -11,6 +11,12 @@ if (NOT ${PXR_BUILD_GPU_SUPPORT}) - return() - endif() - -+if (EMBREE_VERSION VERSION_GREATER_EQUAL 4.0.0) -+ add_definitions(-DPXR_EMBREE_MAJOR_VERSION=4) -+else() -+ add_definitions(-DPXR_EMBREE_MAJOR_VERSION=3) -+endif() -+ - pxr_plugin(hdEmbree - LIBRARIES - plug -diff --git a/pxr/imaging/plugin/hdEmbree/context.h b/pxr/imaging/plugin/hdEmbree/context.h -index 4165adb1e6..7e5c099b74 100644 ---- a/pxr/imaging/plugin/hdEmbree/context.h -+++ b/pxr/imaging/plugin/hdEmbree/context.h -@@ -14,7 +14,11 @@ - #include "pxr/base/gf/matrix4f.h" - #include "pxr/base/vt/array.h" - --#include -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ #include -+#else -+ #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/mesh.h b/pxr/imaging/plugin/hdEmbree/mesh.h -index bbb006302f..a6f71f110f 100644 ---- a/pxr/imaging/plugin/hdEmbree/mesh.h -+++ b/pxr/imaging/plugin/hdEmbree/mesh.h -@@ -15,8 +15,13 @@ - - #include "pxr/imaging/plugin/hdEmbree/meshSamplers.h" - --#include --#include -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ #include -+ #include -+#else -+ #include -+ #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/meshSamplers.h b/pxr/imaging/plugin/hdEmbree/meshSamplers.h -index c32c35fffa..51459a2ed4 100644 ---- a/pxr/imaging/plugin/hdEmbree/meshSamplers.h -+++ b/pxr/imaging/plugin/hdEmbree/meshSamplers.h -@@ -12,8 +12,13 @@ - #include "pxr/imaging/hd/meshUtil.h" - #include "pxr/base/vt/types.h" - --#include --#include -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ #include -+ #include -+#else -+ #include -+ #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - - #include - -diff --git a/pxr/imaging/plugin/hdEmbree/pch.h b/pxr/imaging/plugin/hdEmbree/pch.h -index 4e16a844d7..901e93859f 100644 ---- a/pxr/imaging/plugin/hdEmbree/pch.h -+++ b/pxr/imaging/plugin/hdEmbree/pch.h -@@ -76,9 +76,15 @@ - #include - #include - #include -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+#include -+#include -+#include -+#else - #include - #include - #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - #ifdef PXR_PYTHON_SUPPORT_ENABLED - #include "pxr/base/tf/pySafePython.h" - #endif // PXR_PYTHON_SUPPORT_ENABLED -diff --git a/pxr/imaging/plugin/hdEmbree/renderDelegate.h b/pxr/imaging/plugin/hdEmbree/renderDelegate.h -index 1d8694daa6..826d020e04 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderDelegate.h -+++ b/pxr/imaging/plugin/hdEmbree/renderDelegate.h -@@ -13,8 +13,13 @@ - #include "pxr/imaging/plugin/hdEmbree/renderer.h" - #include "pxr/base/tf/staticTokens.h" - -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ #include -+#else -+ #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ - #include --#include - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/renderParam.h b/pxr/imaging/plugin/hdEmbree/renderParam.h -index 206a7458bc..af94ef10a4 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderParam.h -+++ b/pxr/imaging/plugin/hdEmbree/renderParam.h -@@ -11,7 +11,11 @@ - #include "pxr/imaging/hd/renderDelegate.h" - #include "pxr/imaging/hd/renderThread.h" - --#include -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ #include -+#else -+ #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - - PXR_NAMESPACE_OPEN_SCOPE - -diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp -index cc8ddb0270..8cbf8d4959 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderer.cpp -+++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp -@@ -709,9 +709,13 @@ HdEmbreeRenderer::_TraceRay(unsigned int x, unsigned int y, - rayHit.ray.flags = 0; - _PopulateRayHit(&rayHit, origin, dir, 0.0f); - { -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ rtcIntersect1(_scene, &rayHit); -+#else - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcIntersect1(_scene, &context, &rayHit); -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - // - // there is something odd about how this is used in Embree. Is it reversed - // here and then when it it used in -@@ -1047,9 +1051,13 @@ HdEmbreeRenderer::_ComputeAmbientOcclusion(GfVec3f const& position, - shadow.flags = 0; - _PopulateRay(&shadow, position, shadowDir, 0.001f); - { -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ rtcOccluded1(_scene, &shadow); -+#else - RTCIntersectContext context; - rtcInitIntersectContext(&context); - rtcOccluded1(_scene,&context,&shadow); -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - } - - // Record this AO ray's contribution to the occlusion factor: a -diff --git a/pxr/imaging/plugin/hdEmbree/renderer.h b/pxr/imaging/plugin/hdEmbree/renderer.h -index 2da9880848..913b83eccc 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderer.h -+++ b/pxr/imaging/plugin/hdEmbree/renderer.h -@@ -15,8 +15,13 @@ - #include "pxr/base/gf/matrix4d.h" - #include "pxr/base/gf/rect2i.h" - --#include --#include -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ #include -+ #include -+#else -+ #include -+ #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 - - #include - #include -diff --git a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -index 02c2ca69f8..45370dfed0 100644 ---- a/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -+++ b/pxr/imaging/plugin/hdEmbree/testenv/testHdEmbree.cpp -@@ -23,7 +23,12 @@ - - #include "pxr/base/tf/errorMark.h" - --#include -+#if defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ #include -+#else -+ #include -+#endif // defined(PXR_EMBREE_MAJOR_VERSION) && PXR_EMBREE_MAJOR_VERSION >= 4 -+ - #include - - PXR_NAMESPACE_USING_DIRECTIVE - -From 9c67986d0a7e76babead0d1fdf5190f264c1a8b9 Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Wed, 24 Jul 2024 10:07:44 -0400 -Subject: [PATCH 4/7] build_usd.py: update Embree URLs to reflect new home in - the RenderKit GitHub organization - ---- - build_scripts/build_usd.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py -index ec1a268d78..afa4763c8d 100644 ---- a/build_scripts/build_usd.py -+++ b/build_scripts/build_usd.py -@@ -1580,9 +1580,9 @@ def InstallMaterialX(context, force, buildArgs): - # For MacOS we use version 3.13.3 to include a fix from Intel - # to build on Apple Silicon. - if MacOS(): -- EMBREE_URL = "https://github.com/embree/embree/archive/v3.13.3.zip" -+ EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.13.3.zip" - else: -- EMBREE_URL = "https://github.com/embree/embree/archive/v3.2.2.zip" -+ EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.2.2.zip" - - def InstallEmbree(context, force, buildArgs): - with CurrentWorkingDirectory(DownloadURL(EMBREE_URL, context, force)): - -From 0e3f0e8b595e74312c7fbd1b378a96d3b5e85723 Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Thu, 23 Feb 2023 12:25:24 -0700 -Subject: [PATCH 5/7] build_usd.py: add an option to choose Embree 3 or Embree - 4 - -The new --embree-major-version option can be given to build_usd.py to select -between Embree 3 or Embree 4. By default, Embree 3 is still used, preserving -the existing behavior. ---- - build_scripts/build_usd.py | 31 ++++++++++++++++++++++++------- - 1 file changed, 24 insertions(+), 7 deletions(-) - -diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py -index afa4763c8d..f932c85b5d 100644 ---- a/build_scripts/build_usd.py -+++ b/build_scripts/build_usd.py -@@ -1577,14 +1577,19 @@ def InstallMaterialX(context, force, buildArgs): - - ############################################################ - # Embree --# For MacOS we use version 3.13.3 to include a fix from Intel --# to build on Apple Silicon. --if MacOS(): -- EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.13.3.zip" --else: -- EMBREE_URL = "https://github.com/RenderKit/embree/archive/v3.2.2.zip" -+ -+EMBREE_DEFAULT_MAJOR_VERSION = 3 - - def InstallEmbree(context, force, buildArgs): -+ if context.embreeMajorVersion >= 4: -+ EMBREE_URL = "https://github.com/RenderKit/embree/archive/refs/tags/v4.4.0.zip" -+ elif MacOS(): -+ # For MacOS we use version 3.13.3 to include a fix from Intel -+ # to build on Apple Silicon. -+ EMBREE_URL = "https://github.com/RenderKit/embree/archive/refs/tags/v3.13.3.zip" -+ else: -+ EMBREE_URL = "https://github.com/RenderKit/embree/archive/refs/tags/v3.2.2.zip" -+ - with CurrentWorkingDirectory(DownloadURL(EMBREE_URL, context, force)): - extraArgs = [ - '-DTBB_ROOT="{instDir}"'.format(instDir=context.instDir), -@@ -1601,7 +1606,9 @@ def InstallEmbree(context, force, buildArgs): - - RunCMake(context, force, extraArgs) - --EMBREE = Dependency("Embree", InstallEmbree, "include/embree3/rtcore.h") -+EMBREE = Dependency("Embree", InstallEmbree, -+ "include/embree3/rtcore.h", -+ "include/embree4/rtcore.h") - - ############################################################ - # AnimX -@@ -2121,6 +2128,12 @@ def InstallUSD(context, force, buildArgs): - help="Build Embree sample imaging plugin") - subgroup.add_argument("--no-embree", dest="build_embree", action="store_false", - help="Do not build Embree sample imaging plugin (default)") -+group.add_argument("--embree-major-version", -+ default=EMBREE_DEFAULT_MAJOR_VERSION, type=int, -+ choices=[3, 4], -+ help=( -+ "The major version of Embree to build " -+ "(default: {})").format(EMBREE_DEFAULT_MAJOR_VERSION)) - subgroup = group.add_mutually_exclusive_group() - subgroup.add_argument("--prman", dest="build_prman", action="store_true", - default=False, -@@ -2342,6 +2355,7 @@ def __init__(self, args): - - # - Imaging plugins - self.buildEmbree = self.buildImaging and args.build_embree -+ self.embreeMajorVersion = args.embree_major_version - self.buildPrman = self.buildImaging and args.build_prman - self.prmanLocation = (os.path.abspath(args.prman_location) - if args.prman_location else None) -@@ -2656,6 +2670,7 @@ def _JoinVersion(v): - OpenImageIO support: {buildOIIO} - OpenColorIO support: {buildOCIO} - Embree support: {buildEmbree} -+ Embree major version: {embreeMajorVersion} - PRMan support: {buildPrman} - Vulkan support: {enableVulkan} - UsdImaging {buildUsdImaging} -@@ -2738,6 +2753,8 @@ def FormatBuildArguments(buildArgs): - buildOIIO=("On" if context.buildOIIO else "Off"), - buildOCIO=("On" if context.buildOCIO else "Off"), - buildEmbree=("On" if context.buildEmbree else "Off"), -+ embreeMajorVersion=(context.embreeMajorVersion if context.buildEmbree -+ else "N/A"), - buildPrman=("On" if context.buildPrman else "Off"), - buildUsdImaging=("On" if context.buildUsdImaging else "Off"), - buildUsdview=("On" if context.buildUsdview else "Off"), - -From c96c972bc116e46bef477493b86b535f9b115545 Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Thu, 12 Jun 2025 17:46:43 -0400 -Subject: [PATCH 6/7] hdEmbree: use a header common between TBB and oneTBB in - limits workaround - -The TBB header that provides version definitions moved between TBB -(tbb_stddef.h) and oneTBB (version.h), so we use the lowest level -header that is available at the same path in both and let it bring in -the definitions. This allows the hdEmbree plugin to be built with -oneTBB when used in combination with Embree 4. ---- - pxr/imaging/plugin/hdEmbree/renderer.cpp | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/pxr/imaging/plugin/hdEmbree/renderer.cpp b/pxr/imaging/plugin/hdEmbree/renderer.cpp -index 8cbf8d4959..381bed73e5 100644 ---- a/pxr/imaging/plugin/hdEmbree/renderer.cpp -+++ b/pxr/imaging/plugin/hdEmbree/renderer.cpp -@@ -28,8 +28,13 @@ - // oneTBB as a min spec. This applies the "Work" thread limit to the - // render thread if "Work" is using old TBB, but won't affect other "Work" - // implementations. Note that it may affect Embree TBB usage as well. -+// -+// The header that provides version definitions moved between TBB -+// (tbb_stddef.h) and oneTBB (version.h), so we use the lowest level header -+// that is available at the same path in both and let it bring in the -+// definitions. - // ------------------------------------------------------------------------- --#include -+#include - - #if TBB_INTERFACE_VERSION_MAJOR < 12 - - -From a464dc5dcc9a26f552a3ece42dab949ae03d35df Mon Sep 17 00:00:00 2001 -From: Matt Johnson -Date: Wed, 24 Jul 2024 10:17:27 -0400 -Subject: [PATCH 7/7] build_usd.py: allow oneTBB and Embree to be used together - when Embree 4.x or later is selected - ---- - build_scripts/build_usd.py | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/build_scripts/build_usd.py b/build_scripts/build_usd.py -index f932c85b5d..949acadb42 100644 ---- a/build_scripts/build_usd.py -+++ b/build_scripts/build_usd.py -@@ -2473,9 +2473,10 @@ def ForceBuildDependency(self, dep): - PrintError("Draco plugin can not be enabled for monolithic build on Windows") - sys.exit(1) - --# The versions of Embree we currently support do not support oneTBB. --if context.buildOneTBB and context.buildEmbree: -- PrintError("Embree support cannot be enabled when building against oneTBB") -+# When building with both oneTBB and Embree, a 4.x version of Embree must be -+# used. -+if context.buildOneTBB and (context.buildEmbree and context.embreeMajorVersion < 4): -+ PrintError("Embree 4.x or later must be selected when building against oneTBB") - sys.exit(1) - - # Windows ARM64 requires oneTBB. Since oneTBB is a non-standard option for the diff --git a/sources b/sources index 2a65832..8ea47ed 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-25.08.tar.gz) = fbe1e632473883e47f4bfeb16cab314bbbe8a7b404a5c071ca613bbf288526e505edd7a5edfdd9f85dd16da6d0d91fa0d4f8c783882094d3691f77685817fea6 +SHA512 (OpenUSD-25.11.tar.gz) = 7b78109055773e44af771e99b64ff6a1fcdc5c4984d6d62708491d14ab576344d432dac2377363cae89e47c1a1e55d016bcc7bde2c5c49d5b26550db5ac46304 diff --git a/usd.spec b/usd.spec index 26e7309..e7e7531 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.25.8 +%global downstream_so_version 0.25.11 %bcond alembic 1 %bcond draco 1 @@ -27,7 +27,7 @@ %bcond test 0 Name: usd -Version: 25.08 +Version: 25.11 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -40,7 +40,7 @@ Summary: 3D VFX pipeline interchange file format # - pxr/base/js/rapidjson/msinttypes/ (removed in %%prep) # - pxr/base/tf/pxrCLI11/ (removed in %%prep) # - pxr/base/tf/pxrDoubleConversion/ (removed in %%prep) -# - pxr/imaging/hio/OpenEXR/OpenEXRCore/ +# - pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/ # - pxr/imaging/plugin/hioAvif/AVIF/src/src-libyuv/ # BSD-2-Clause: # - pxr/base/tf/pxrLZ4/ (removed in %%prep) @@ -58,14 +58,16 @@ Summary: 3D VFX pipeline interchange file format # - pxr/base/tf/pxrTslRobinMap/ # - pxr/imaging/garch/khrplatform.h # - pxr/imaging/hgiVulkan/vk_mem_alloc.h -# - pxr/imaging/hio/OpenEXR/deflate/ (removed in %%prep) +# - pxr/imaging/plugin/hioOpenEXR/OpenEXR/deflate/ (removed in %%prep) # - third_party/renderman-26/plugin/rmanArgsParser/pugixml/ (removed in %%prep) +# - third_party/renderman-27/plugin/rmanArgsParser/pugixml/ (removed in %%prep) # MIT OR Unlicense: # - pxr/imaging/hio/stb/ # Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} # - third_party/renderman-26/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} +# - third_party/renderman-27/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} # # Additionally, the following would be listed above but are removed in %%prep: # @@ -126,10 +128,6 @@ Source1: org.openusd.usdview.desktop # built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) Patch: 0001-Downstream-only-add-an-SONAME-version.patch -# hdEmbree: add support for building against embree4 -# https://github.com/PixarAnimationStudios/USD/pull/2313 -Patch: %{forgeurl}/pull/2313.patch - # Downstream-only: use Valgrind macro instead of inline assembly # # Upstream already has a plan to make this change, but is waiting to be @@ -285,8 +283,9 @@ Provides: bundled(ilmbase) = 2.5.3 # Currently, Fedora’s PEGTL is too old: # https://bugzilla.redhat.com/show_bug.cgi?id=1902427 Provides: bundled(PEGTL) = 3.2.7 -# Version from pxr/imaging/hio/OpenEXR/OpenEXRCore/openexr_version.h -# From pxr/imaging/hio/OpenEXR/README.md: +# Version from +# pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/openexr_version.h +# From pxr/imaging/plugin/hioOpenEXR/OpenEXR/README.md: # A few changes are still in progress to upstreamed to the OpenEXR project, # but these are minor, and otherwise, almost all differences between the # interred OpenEXRCore and the official OpenEXR repo are consolidated to the @@ -328,6 +327,7 @@ Provides: bundled(boost) = 1.85.0 # Provides: bundled(cli11) = 2.3.1 # Version from: # third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp +# third_party/renderman-27/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # (header comment) # Provides: bundled(pugixml) = 1.9 # Version from: pxr/base/js/rapidjson/rapidjson.h @@ -336,7 +336,7 @@ Provides: bundled(boost) = 1.85.0 # Version from: pxr/base/tf/pxrTslRobinMap/robin_growth_policy.h # (PXR_TSL_RH_VERSION_{MAJOR,MINOR,PATCH}) # Provides: bundled(robin-map) = 1.3.0 -# Version from pxr/imaging/hio/OpenEXR/deflate/libdeflate.h +# Version from pxr/imaging/plugin/hioOpenEXR/OpenEXR/deflate/libdeflate.h # Provides: bundled(libdeflate) = 1.18 # Version from pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h # We actually have a post-release snapshot of libavif, because @@ -491,7 +491,7 @@ namespace pxr_tsl = tsl; EOF done # Remove the bundled copy of libdeflate. -rm -rv pxr/imaging/hio/OpenEXR/deflate/ +rm -rv pxr/imaging/plugin/hioOpenEXR/OpenEXR/deflate/ # Remove the bundled copies of libavif, along with the associated libaom and # the libyuv that is in the libavif sources. rm -rv pxr/imaging/plugin/hioAvif/aom/ \ From 1fef8f6c7649efcc72e52204bf37784cf90b23c2 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 23 Nov 2025 06:57:09 +0000 Subject: [PATCH 142/167] Rebuilt for OpenVDB 13.0.0 From b804423325927568bd1d3968ba984579c0c3b3e5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 25 Nov 2025 10:58:20 +0000 Subject: [PATCH 143/167] Use macros for supported architectures [skip changelog] --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index e7e7531..e26f915 100644 --- a/usd.spec +++ b/usd.spec @@ -253,7 +253,7 @@ Requires: python3-usd%{?_isa} = %{version}-%{release} # # Note that pxr/base/arch/assumptions.cpp explicitly tests the machine is not # big-endian, and pxr/base/arch/defines.h explicitly enforces x86_64 or ARM64. -ExclusiveArch: aarch64 x86_64 +ExclusiveArch: %{arm64} %{x86_64} %description Universal Scene Description (USD) is a time-sampled scene From 201f8d224f28cae55370d42b5e51d89cddb199d7 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 25 Nov 2025 10:57:29 +0000 Subject: [PATCH 144/167] Rebuilt with stb_image patched for two new security bugs --- usd.spec | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/usd.spec b/usd.spec index e26f915..60884b5 100644 --- a/usd.spec +++ b/usd.spec @@ -237,12 +237,11 @@ BuildRequires: pkgconfig(ptex) # CVE-2023-45664 # CVE-2023-45666 # CVE-2023-45667 -BuildRequires: stb_image-devel >= 2.28^20231011gitbeebb24-12 -BuildRequires: stb_image-static -BuildRequires: stb_image_write-devel >= 1.16 -BuildRequires: stb_image_write-static -BuildRequires: stb_image_resize-devel >= 0.97 -BuildRequires: stb_image_resize-static +# https://github.com/nothings/stb/issues/1860 +# https://github.com/nothings/stb/issues/1861 +BuildRequires: stb_image-static >= 2.30^20251025gitf1c79c0-1 +BuildRequires: stb_image_write-static >= 1.16 +BuildRequires: stb_image_resize-static >= 0.97 Requires: usd-libs%{?_isa} = %{version}-%{release} Requires: python3-usd%{?_isa} = %{version}-%{release} From 97117864dd441dd12986e531fa28838c0fe39a96 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 25 Nov 2025 14:32:01 +0000 Subject: [PATCH 145/167] Correct minimum NVR for stb_image --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 60884b5..7832201 100644 --- a/usd.spec +++ b/usd.spec @@ -239,7 +239,7 @@ BuildRequires: pkgconfig(ptex) # CVE-2023-45667 # https://github.com/nothings/stb/issues/1860 # https://github.com/nothings/stb/issues/1861 -BuildRequires: stb_image-static >= 2.30^20251025gitf1c79c0-1 +BuildRequires: stb_image-static >= 2.30^20251025gitf1c79c0-2 BuildRequires: stb_image_write-static >= 1.16 BuildRequires: stb_image_resize-static >= 0.97 From d4a03cc10dfb30612957d06a00be41456f916f8d Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Tue, 2 Dec 2025 15:42:52 +0100 Subject: [PATCH 146/167] Rebuild (python-pyside6) From ff3482cdbea609f1a35b9e32239d09cc7ad2cc23 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Tue, 2 Dec 2025 14:53:34 +0000 Subject: [PATCH 147/167] Backport fixes for CVE-2025-64181 etc. in OpenEXRCore --- 3903.patch | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ usd.spec | 4 +++ 2 files changed, 87 insertions(+) create mode 100644 3903.patch diff --git a/3903.patch b/3903.patch new file mode 100644 index 0000000..d8fa15b --- /dev/null +++ b/3903.patch @@ -0,0 +1,83 @@ +From 3e51fb244dd264b09179999d29dc7c5afd7e71e3 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Tue, 2 Dec 2025 10:43:31 +0000 +Subject: [PATCH] Backport fixes for CVE-2025-64181 etc. in OpenEXRCore + +--- + .../hioOpenEXR/OpenEXR/OpenEXRCore/chunk.c | 20 ++++++++++++++++--- + .../OpenEXR/OpenEXRCore/internal_util.h | 4 ++-- + .../OpenEXR/OpenEXRCore/parse_header.c | 4 +++- + 3 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/chunk.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/chunk.c +index cfe80b4cd68..e11209fe660 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/chunk.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/chunk.c +@@ -1292,6 +1292,16 @@ exr_read_tile_chunk_info ( + return pctxt->report_error ( + pctxt, EXR_ERR_INVALID_ARGUMENT, "Invalid packed size of 0"); + ++ if (part->comp_type == EXR_COMPRESSION_NONE && ++ cinfo->packed_size != cinfo->unpacked_size) ++ { ++ return pctxt->print_error ( ++ pctxt, ++ EXR_ERR_BAD_CHUNK_LEADER, ++ "Mismatch between unpacked and packed size with uncompressed data: packed is %" PRIu64 "; unpacked is %" PRIu64, ++ cinfo->packed_size, cinfo->unpacked_size); ++ } ++ + return EXR_ERR_SUCCESS; + } + +@@ -1350,11 +1360,15 @@ exr_read_chunk ( + rv = pctxt->do_read ( + pctxt, packed_data, toread, &dataoffset, &nread, rmode); + +- if (rmode == EXR_ALLOW_SHORT_READ && nread < (int64_t) toread) ++ if (rmode == EXR_ALLOW_SHORT_READ && ++ nread >= 0 && ++ nread < (int64_t) toread) ++ { + memset ( + ((uint8_t*) packed_data) + nread, +- 0, +- toread - (uint64_t) (nread)); ++ 0, ++ (size_t)(toread - (uint64_t)nread)); ++ } + } + else + rv = EXR_ERR_SUCCESS; +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_util.h b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_util.h +index 3c6f02786cc..e0fa3933d92 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_util.h ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_util.h +@@ -31,10 +31,10 @@ compute_sampled_height (int height, int y_sampling, int start_y) + else + start = start_y; + end = start_y + height - 1; +- end -= (end < 0) ? (-end % y_sampling) : (end % y_sampling); ++ end -= (end < 0 ? -end : end) % y_sampling; + + if (start > end) +- nlines = 0; ++ nlines = start == start_y ? 1 : 0; + else + nlines = (end - start) / y_sampling + 1; + } +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/parse_header.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/parse_header.c +index d7230392693..8b6cf78cc59 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/parse_header.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/parse_header.c +@@ -2293,7 +2293,9 @@ internal_exr_compute_chunk_offset_size (struct _internal_exr_part* curpart) + + w = (uint64_t) (((int64_t) dw.max.x) - ((int64_t) dw.min.x) + 1); + +- if (curpart->tiles) ++ if (curpart->storage_mode != EXR_STORAGE_SCANLINE && ++ curpart->storage_mode != EXR_STORAGE_DEEP_SCANLINE && ++ curpart->tiles) + { + const exr_attr_tiledesc_t* tiledesc = curpart->tiles->tiledesc; + int64_t tilecount = 0; diff --git a/usd.spec b/usd.spec index 7832201..e363506 100644 --- a/usd.spec +++ b/usd.spec @@ -149,6 +149,10 @@ Patch: 0005-Downstream-only-use-the-system-libdeflate.patch # Downstream-only: use the system libavif library Patch: 0006-Downstream-only-use-the-system-libavif.patch +# Backport fixes for CVE-2025-64181 etc. in OpenEXRCore +# https://github.com/PixarAnimationStudios/OpenUSD/pull/3903 +Patch: %{forgeurl}/pull/3903.patch + # Base BuildRequires: gcc-c++ From 1fe1ef6bbd2d59dc27573bd48ca5059c89688699 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Sun, 7 Dec 2025 14:15:28 -0600 Subject: [PATCH 148/167] Rebuild for OpenImageIO 3.1. From b5e913b0f3de0ea8d2ea2f7b0ab470952c9c78e4 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Wed, 7 Jan 2026 18:38:55 -0800 Subject: [PATCH 149/167] Remove unused MaterialX support This commit removed the unusued materialx support dropped by upstream. --- usd.spec | 4 ---- 1 file changed, 4 deletions(-) diff --git a/usd.spec b/usd.spec index e363506..ebbd7f2 100644 --- a/usd.spec +++ b/usd.spec @@ -8,9 +8,6 @@ %bcond draco 1 %bcond embree 1 %bcond jemalloc 0 -# Not yet packaged: https://github.com/AcademySoftwareFoundation/MaterialX -# https://bugzilla.redhat.com/show_bug.cgi?id=2262694 -%bcond materialx 0 # Default "UNIX Makefiles" backend for CMake would also work fine; ninja is a # bit faster. We conditionalize it just in case there are backend-specific # issues in the future. @@ -575,7 +572,6 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ -DPXR_BUILD_DRACO_PLUGIN=%{expr:%{with draco}?"ON":"OFF"} \ -DPXR_BUILD_EMBREE_PLUGIN=%{expr:%{with embree}?"ON":"OFF"} \ - -DPXR_BUILD_MATERIALX_PLUGIN=%{expr:%{with materialx}?"ON":"OFF"} \ -DPXR_BUILD_OPENCOLORIO_PLUGIN=%{expr:%{with ocio}?"ON":"OFF"} \ -DPXR_BUILD_OPENIMAGEIO_PLUGIN=%{expr:%{with oiio}?"ON":"OFF"} \ -DPXR_BUILD_PRMAN_PLUGIN=OFF \ From d7483c1c0d0f8b6b7fd6a221bb189203a900b779 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Wed, 7 Jan 2026 23:09:08 -0800 Subject: [PATCH 150/167] Revert "Remove unused MaterialX support" This reverts commit b5e913b0f3de0ea8d2ea2f7b0ab470952c9c78e4. --- usd.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usd.spec b/usd.spec index ebbd7f2..e363506 100644 --- a/usd.spec +++ b/usd.spec @@ -8,6 +8,9 @@ %bcond draco 1 %bcond embree 1 %bcond jemalloc 0 +# Not yet packaged: https://github.com/AcademySoftwareFoundation/MaterialX +# https://bugzilla.redhat.com/show_bug.cgi?id=2262694 +%bcond materialx 0 # Default "UNIX Makefiles" backend for CMake would also work fine; ninja is a # bit faster. We conditionalize it just in case there are backend-specific # issues in the future. @@ -572,6 +575,7 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ -DPXR_BUILD_DRACO_PLUGIN=%{expr:%{with draco}?"ON":"OFF"} \ -DPXR_BUILD_EMBREE_PLUGIN=%{expr:%{with embree}?"ON":"OFF"} \ + -DPXR_BUILD_MATERIALX_PLUGIN=%{expr:%{with materialx}?"ON":"OFF"} \ -DPXR_BUILD_OPENCOLORIO_PLUGIN=%{expr:%{with ocio}?"ON":"OFF"} \ -DPXR_BUILD_OPENIMAGEIO_PLUGIN=%{expr:%{with oiio}?"ON":"OFF"} \ -DPXR_BUILD_PRMAN_PLUGIN=OFF \ From fb80c784afbe9d32bb7c4fb025fbc5199b1ea135 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Thu, 8 Jan 2026 08:01:05 -0800 Subject: [PATCH 151/167] Enable materialx support --- usd.spec | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/usd.spec b/usd.spec index e363506..8c7647a 100644 --- a/usd.spec +++ b/usd.spec @@ -8,9 +8,7 @@ %bcond draco 1 %bcond embree 1 %bcond jemalloc 0 -# Not yet packaged: https://github.com/AcademySoftwareFoundation/MaterialX -# https://bugzilla.redhat.com/show_bug.cgi?id=2262694 -%bcond materialx 0 +%bcond materialx 1 # Default "UNIX Makefiles" backend for CMake would also work fine; ninja is a # bit faster. We conditionalize it just in case there are backend-specific # issues in the future. @@ -206,6 +204,13 @@ BuildRequires: embree-devel BuildRequires: pkgconfig(jemalloc) %endif +%if %{with materialx} +BuildRequires: cmake(materialx) +BuildRequires: materialx-data +BuildRequires: pkgconfig(xt) +BuildRequires: python3-materialx +%endif + %if %{with ocio} BuildRequires: cmake(OpenColorIO) %endif @@ -575,7 +580,6 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_BUILD_ALEMBIC_PLUGIN=%{expr:%{with alembic}?"ON":"OFF"} \ -DPXR_BUILD_DRACO_PLUGIN=%{expr:%{with draco}?"ON":"OFF"} \ -DPXR_BUILD_EMBREE_PLUGIN=%{expr:%{with embree}?"ON":"OFF"} \ - -DPXR_BUILD_MATERIALX_PLUGIN=%{expr:%{with materialx}?"ON":"OFF"} \ -DPXR_BUILD_OPENCOLORIO_PLUGIN=%{expr:%{with ocio}?"ON":"OFF"} \ -DPXR_BUILD_OPENIMAGEIO_PLUGIN=%{expr:%{with oiio}?"ON":"OFF"} \ -DPXR_BUILD_PRMAN_PLUGIN=OFF \ @@ -585,6 +589,7 @@ extra_flags="${extra_flags-} -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1" -DPXR_ENABLE_PTEX_SUPPORT=%{expr:%{with ptex}?"ON":"OFF"} \ -DPXR_ENABLE_OSL_SUPPORT=%{expr:%{with openshading}?"ON":"OFF"} \ -DPXR_ENABLE_MALLOCHOOK_SUPPORT=OFF \ + -DPXR_ENABLE_MATERIALX_SUPPORT=%{expr:%{with materialx}?"ON":"OFF"} \ -DPXR_ENABLE_PYTHON_SUPPORT=ON \ \ -DPXR_INSTALL_LOCATION="%{_libdir}/usd/plugin" \ @@ -650,6 +655,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_bindir}/hdGenSchema %{_bindir}/sdfdump %{_bindir}/sdffilter +%if %{with materialx} +%{_bindir}/usdBakeMaterialX +%endif %{_bindir}/usdGenSchema %{_bindir}/usdInitSchema %{_bindir}/usdcat @@ -678,6 +686,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_mandir}/man1/hdGenSchema.1* %{_mandir}/man1/sdfdump.1* %{_mandir}/man1/sdffilter.1* +%if %{with materialx} +%{_bindir}/usdBakeMaterialX.1* +%endif %{_mandir}/man1/usdGenSchema.1* %{_mandir}/man1/usdInitSchema.1* %{_mandir}/man1/usdcat.1* From 099daf1d9a32fff0aa4cd812a42dd78014a6ed38 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Thu, 8 Jan 2026 09:09:41 -0800 Subject: [PATCH 152/167] Fix manpage line --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 8c7647a..3e9b41c 100644 --- a/usd.spec +++ b/usd.spec @@ -687,7 +687,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_mandir}/man1/sdfdump.1* %{_mandir}/man1/sdffilter.1* %if %{with materialx} -%{_bindir}/usdBakeMaterialX.1* +%{_mandir}/usdBakeMaterialX.1* %endif %{_mandir}/man1/usdGenSchema.1* %{_mandir}/man1/usdInitSchema.1* From f764fa904f84c5fe42ceb49f3a6d0eb1867ecd09 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Thu, 8 Jan 2026 15:16:34 -0800 Subject: [PATCH 153/167] Fix path for manterialx manual --- usd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usd.spec b/usd.spec index 3e9b41c..2b4a8f5 100644 --- a/usd.spec +++ b/usd.spec @@ -687,7 +687,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_mandir}/man1/sdfdump.1* %{_mandir}/man1/sdffilter.1* %if %{with materialx} -%{_mandir}/usdBakeMaterialX.1* +%{_mandir}/man1/usdBakeMaterialX.1* %endif %{_mandir}/man1/usdGenSchema.1* %{_mandir}/man1/usdInitSchema.1* From a93ed447d6ef737862161716720397669bb80689 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 19:42:31 +0000 Subject: [PATCH 154/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From ba33ab88f9cbaeceb883011fdf5a1922df95a211 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Mon, 2 Feb 2026 00:57:36 -0800 Subject: [PATCH 155/167] Rebuild for ptex 2.5.1 From d4e3de7a803ccda03b061d27058cc73a74fb9899 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 2 Feb 2026 14:13:58 +0000 Subject: [PATCH 156/167] Rebuilt for ptex 2.5.1 (close RHBZ#2435890) From f168f46d3aa3b150d49a39b04ba421ae9e415ca6 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Sat, 21 Feb 2026 12:24:33 -0700 Subject: [PATCH 157/167] Make devel require cmake(OpenSubdiv) and cmake(materialx) --- usd.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usd.spec b/usd.spec index 2b4a8f5..fc83039 100644 --- a/usd.spec +++ b/usd.spec @@ -375,6 +375,11 @@ Requires: usd-libs%{?_isa} = %{version}-%{release} # Unbundled, and exposed in the API: Requires: cli11-devel cli11-static Requires: robin-map-devel robin-map-static +# Needed by cmake config +Requires: cmake(OpenSubdiv) +%if %{with materialx} +Requires: cmake(materialx) +%endif %description devel This package contains the C++ header files and symbolic links to the shared From 0a6b2117ffe0103efd029a6a119614718c8bae75 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 26 Feb 2026 12:07:15 +0000 Subject: [PATCH 158/167] Update to 26.03 (close RHBZ#2442563) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 18 +++--- ...use-Valgrind-macro-instead-of-inline.patch | 4 +- ...use-the-system-double-conversion-lib.patch | 10 ++-- ...ream-only-use-the-system-lz4-library.patch | 12 ++-- ...-only-use-the-system-pugixml-library.patch | 12 ++-- ...nly-use-the-system-rapidjson-library.patch | 6 +- ...tream-only-use-the-system-libdeflate.patch | 4 +- ...wnstream-only-use-the-system-libavif.patch | 12 ++-- sources | 2 +- usd.spec | 57 +++++++++++++++---- 11 files changed, 86 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index a6f122a..f00caa1 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ /OpenUSD-25.05.01.tar.gz /OpenUSD-25.08.tar.gz /OpenUSD-25.11.tar.gz +/OpenUSD-26.03.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index aeb48ad..7a55eca 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 2f2ebd688c7e6804014ea183163954f48e7622af Mon Sep 17 00:00:00 2001 +From 949707d0bd8ac077fac9763b3b590a016ff4eb6f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 9 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 20e70edb2..c3e072e1a 100644 +index 1cc7fa64a..ebe531ec4 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake -@@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "25") - set(PXR_PATCH_VERSION "11") # NOTE: Must not have leading 0 for single digits +@@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "26") + set(PXR_PATCH_VERSION "3") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -51,10 +51,10 @@ index 20e70edb2..c3e072e1a 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index b90b743de..7af8b89c2 100644 +index e2dccb075..5f6913e22 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake -@@ -1304,6 +1304,7 @@ function(_pxr_library NAME) +@@ -1346,6 +1346,7 @@ function(_pxr_library NAME) FOLDER "${folder}" POSITION_INDEPENDENT_CODE ON IMPORT_PREFIX "${args_PREFIX}" @@ -63,7 +63,7 @@ index b90b743de..7af8b89c2 100644 SUFFIX "${args_SUFFIX}" ) diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index b8e588bf3..cf64607c8 100644 +index b51789f4a..af2f2a805 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake @@ -414,6 +414,7 @@ function(pxr_library NAME) @@ -74,7 +74,7 @@ index b8e588bf3..cf64607c8 100644 SUBDIR "${subdir}" CPPFILES "${args_CPPFILES};${${NAME}_CPPFILES}" PUBLIC_HEADERS "${args_PUBLIC_HEADERS};${${NAME}_PUBLIC_HEADERS}" -@@ -1152,6 +1153,7 @@ function(pxr_toplevel_prologue) +@@ -1195,6 +1196,7 @@ function(pxr_toplevel_prologue) PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" OUTPUT_NAME ${libName} @@ -83,5 +83,5 @@ index b8e588bf3..cf64607c8 100644 _get_install_dir("lib" libInstallPrefix) install( -- -2.51.0 +2.53.0 diff --git a/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch index 4ca709f..876f0e1 100644 --- a/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch +++ b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch @@ -1,4 +1,4 @@ -From bb5d6070945c671d3192e2c6c939b941f50991fc Mon Sep 17 00:00:00 2001 +From 15ea3b68bb15fd6338cbe76ec94eac055dc28c4e Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 1 Aug 2025 08:47:41 -0400 Subject: [PATCH] Downstream-only: use Valgrind macro instead of inline @@ -61,5 +61,5 @@ index 96dacca06..7e5625678 100644 Vdf_ExecutorDataVector::~Vdf_ExecutorDataVector() -- -2.51.0 +2.53.0 diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 3b8f6e5..30a54ef 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From 70ca2a5a93b263c1f42502e6b800f46fe1f0d91f Mon Sep 17 00:00:00 2001 +From 5bc91bdebc42bb3a441c87b706288cea05fcd345 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -8,10 +8,10 @@ Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 1b1aa9dbe..f2d58fd15 100644 +index 6fc9c680e..551b5a3eb 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt -@@ -110,11 +110,14 @@ function(add_py_dll_link_test) +@@ -105,11 +105,14 @@ function(add_py_dll_link_test) endfunction() @@ -26,7 +26,7 @@ index 1b1aa9dbe..f2d58fd15 100644 PUBLIC_CLASSES anyUniquePtr -@@ -277,14 +280,6 @@ pxr_library(tf +@@ -272,14 +275,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -42,5 +42,5 @@ index 1b1aa9dbe..f2d58fd15 100644 PYMODULE_CPPFILES -- -2.51.0 +2.53.0 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index 26affbf..910d576 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,4 +1,4 @@ -From 64a603b9c6278f3287cd2769f0fb5ebd9356ae74 Mon Sep 17 00:00:00 2001 +From 0caa009abce9d66d441cd548f45ca8fef8d4846d Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library @@ -8,10 +8,10 @@ Subject: [PATCH 2/6] Downstream-only: use the system lz4 library 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index f2d58fd15..7433f0591 100644 +index 551b5a3eb..772524a19 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt -@@ -111,6 +111,8 @@ function(add_py_dll_link_test) +@@ -106,6 +106,8 @@ function(add_py_dll_link_test) endfunction() find_library(double-conversion_LIBRARY NAMES double-conversion REQUIRED) @@ -20,7 +20,7 @@ index f2d58fd15..7433f0591 100644 pxr_library(tf LIBRARIES -@@ -118,6 +120,10 @@ pxr_library(tf +@@ -113,6 +115,10 @@ pxr_library(tf ${WINLIBS} TBB::tbb ${double-conversion_LIBRARY} @@ -31,7 +31,7 @@ index f2d58fd15..7433f0591 100644 PUBLIC_CLASSES anyUniquePtr -@@ -280,7 +286,6 @@ pxr_library(tf +@@ -275,7 +281,6 @@ pxr_library(tf CPPFILES initConfig.cpp @@ -40,5 +40,5 @@ index f2d58fd15..7433f0591 100644 PYMODULE_CPPFILES module.cpp -- -2.51.0 +2.53.0 diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 1051ecd..974ff6f 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,16 +1,16 @@ -From 48a4ad95bbe1e5675922da4eaf863bd208c0167b Mon Sep 17 00:00:00 2001 +From d1e032128f9c41a763d9e0535c408ffa6642ae03 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library --- - .../renderman-26/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- + third_party/renderman/plugin/rmanArgsParser/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -diff --git a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt +diff --git a/third_party/renderman/plugin/rmanArgsParser/CMakeLists.txt b/third_party/renderman/plugin/rmanArgsParser/CMakeLists.txt index 244f27aa8..1e00413c4 100644 ---- a/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt -+++ b/third_party/renderman-26/plugin/rmanArgsParser/CMakeLists.txt +--- a/third_party/renderman/plugin/rmanArgsParser/CMakeLists.txt ++++ b/third_party/renderman/plugin/rmanArgsParser/CMakeLists.txt @@ -1,6 +1,8 @@ set(PXR_PREFIX "") set(PXR_PACKAGE rmanArgsParser) @@ -35,5 +35,5 @@ index 244f27aa8..1e00413c4 100644 PRIVATE_HEADERS api.h -- -2.51.0 +2.53.0 diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index cd90d76..090b753 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,4 +1,4 @@ -From 48c8a77ae5ba717b8651585302939a36126d286c Mon Sep 17 00:00:00 2001 +From 8fc7363878d1917d5b3f3513b16d54293463c297 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library @@ -8,7 +8,7 @@ Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library 1 file changed, 40 deletions(-) diff --git a/pxr/base/js/CMakeLists.txt b/pxr/base/js/CMakeLists.txt -index 632c061e5..62696a341 100644 +index 8cbda8c52..ec8f3c249 100644 --- a/pxr/base/js/CMakeLists.txt +++ b/pxr/base/js/CMakeLists.txt @@ -15,46 +15,6 @@ pxr_library(js @@ -59,5 +59,5 @@ index 632c061e5..62696a341 100644 overview.dox ) -- -2.51.0 +2.53.0 diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index 5549f98..cc5de7a 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,4 +1,4 @@ -From 614a6a01271cfaaa2421f58289cc1267685c75a9 Mon Sep 17 00:00:00 2001 +From 30b0460635b46ce71f22586273afb370075d7db8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate @@ -72,5 +72,5 @@ index 7481a346e..71bdde9cc 100644 #include "OpenEXRCore/attributes.c" -- -2.51.0 +2.53.0 diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index e1a6178..cac8a41 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,4 +1,4 @@ -From a7e7a94bed76d6b24bfbf9a2c4aa1cf9d57564ab Mon Sep 17 00:00:00 2001 +From c6639b8f1a8c57b02071426400daa349eed14501 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif @@ -9,7 +9,7 @@ Subject: [PATCH 6/6] Downstream-only: use the system libavif 2 files changed, 7 insertions(+), 189 deletions(-) diff --git a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp -index 81549fb54..d2dfb1bcd 100644 +index b56369ee5..c6fcb4a6c 100644 --- a/pxr/imaging/plugin/hioAvif/AVIFImage.cpp +++ b/pxr/imaging/plugin/hioAvif/AVIFImage.cpp @@ -30,7 +30,7 @@ ARCH_PRAGMA_UNUSED_FUNCTION @@ -19,10 +19,10 @@ index 81549fb54..d2dfb1bcd 100644 -#include "pxr/imaging/plugin/hioAvif/AVIF/src/avif/avif.h" +#include - #if defined(PXR_STATIC) - # define HIOAVIF_API + PXR_NAMESPACE_OPEN_SCOPE + diff --git a/pxr/imaging/plugin/hioAvif/CMakeLists.txt b/pxr/imaging/plugin/hioAvif/CMakeLists.txt -index 1a81d50b1..fd89502a7 100644 +index 1ac2683f6..7d583c137 100644 --- a/pxr/imaging/plugin/hioAvif/CMakeLists.txt +++ b/pxr/imaging/plugin/hioAvif/CMakeLists.txt @@ -1,6 +1,9 @@ @@ -237,5 +237,5 @@ index 1a81d50b1..fd89502a7 100644 RESOURCE_FILES -- -2.51.0 +2.53.0 diff --git a/sources b/sources index 8ea47ed..d2dbf60 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-25.11.tar.gz) = 7b78109055773e44af771e99b64ff6a1fcdc5c4984d6d62708491d14ab576344d432dac2377363cae89e47c1a1e55d016bcc7bde2c5c49d5b26550db5ac46304 +SHA512 (OpenUSD-26.03.tar.gz) = 3d5dae46c7ae096501dc51b373ba05c8603a1cf16e5054728d41d0c2970b59ce3ee5ec83e1c575b92482bc8cf2c59643df093a9e7aa82bcdd53dada05292720d diff --git a/usd.spec b/usd.spec index fc83039..898ff05 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.25.11 +%global downstream_so_version 0.26.3 %bcond alembic 1 %bcond draco 1 @@ -25,7 +25,7 @@ %bcond test 0 Name: usd -Version: 25.11 +Version: 26.03 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -33,6 +33,9 @@ Summary: 3D VFX pipeline interchange file format # # Apache-2.0: # - pxr/imaging/hgiVulkan/spirv_reflect.{cpp,h} +# - pxr/imaging/plugin/hdEmbree/pxrPbrt/pbrtUtils.h +# - pxr/imaging/plugin/hdEmbree/pxrIES/pxr-IES.patch +# - pxr/imaging/plugin/hdEmbree/pxrIES/ies.{cpp,h} # BSD-3-Clause: # - pxr/base/gf/ilmbase_* # - pxr/base/js/rapidjson/msinttypes/ (removed in %%prep) @@ -57,15 +60,13 @@ Summary: 3D VFX pipeline interchange file format # - pxr/imaging/garch/khrplatform.h # - pxr/imaging/hgiVulkan/vk_mem_alloc.h # - pxr/imaging/plugin/hioOpenEXR/OpenEXR/deflate/ (removed in %%prep) -# - third_party/renderman-26/plugin/rmanArgsParser/pugixml/ (removed in %%prep) -# - third_party/renderman-27/plugin/rmanArgsParser/pugixml/ (removed in %%prep) +# - third_party/renderman/plugin/rmanArgsParser/pugixml/ (removed in %%prep) # MIT OR Unlicense: # - pxr/imaging/hio/stb/ # Pixar AND GPL-3.0-or-later WITH Bison-exception-2.2: # - pxr/usd/sdf/path.tab.{cpp,h} # - pxr/usd/sdf/textFileFormat.tab.{cpp,h} -# - third_party/renderman-26/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} -# - third_party/renderman-27/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} +# - third_party/renderman/plugin/hdPrman/virtualStructConditionalGrammar.tab.{cpp,h} # # Additionally, the following would be listed above but are removed in %%prep: # @@ -322,6 +323,39 @@ Provides: bundled(openexr) = 3.2.0 # effort to remove the Boost dependency. While pxr_boost::python is derived # from boost::python, it is not intended to remain compatible with it. Provides: bundled(boost) = 1.85.0 +# From LICENSE.txt: +# =========================================================== +# PBRT (Sampling functions) +# ============================================================ +# USD includes code derived from the pbrt-v4 library, retrieved from +# https://github.com/mmp/pbrt-v4/tree/8c19f304558fd7681e2fef2c395a689d0106fb05, which was +# provided subject to the unmodified Apache 2.0 license. For details, see +# https://github.com/mmp/pbrt-v4/blob/8c19f304558fd7681e2fef2c395a689d0106fb05/LICENSE.txt +# +# The bundled routines in pxr/imaging/plugin/hdEmbree/pxrPbrt/pbrtUtils.h are +# just a handful of small internal utility functions. It would not be +# reasonable to add a dependency on the full pbrt ray tracer even if these were +# exposed in a public API. +Provides: bundled(pbrt-v4) = 4~20251208.8c19f30 +# From LICENSE.txt: +# ============================================================ +# Cycles (IES reader) +# ============================================================ +# USD includes classes from the Blender Foundation's Cycles project, retrieved from +# https://projects.blender.org/blender/cycles/src/commit/0be21d452506ec90259b9063c28b5a6fc1cac6a1, +# which was provided subject to the unmodified Apache 2.0 license. For details, see +# https://projects.blender.org/blender/cycles/src/commit/0be21d452506ec90259b9063c28b5a6fc1cac6a1/LICENSE +# +# These are not a candidate for unbundling because they are internal utility +# functions not available in the public API. There are also some minor +# modifications for OpenUSD, documented in +# pxr/imaging/plugin/hdEmbree/pxrIES/pxr-IES.patch. +# +# Is this commit a post-release snapshot of 4.5.0, or a pre-release snapshot of +# 5.0.0? How can we tell? There doesn’t seem to be a project version number +# embedded in the source tree. Since this commit hash is only two commits ahead +# of the v4.5.0 tag, we consider it a 4.5.0 post-release. +Provides: bundled(cycles) = 4.5.0^20251210.0be21d4 # We are currently able to unbundle these and use system libraries, but we # retain the virtual Provides, commented out, as documentation and in case we @@ -334,8 +368,7 @@ Provides: bundled(boost) = 1.85.0 # Version from: pxr/base/tf/pxrCLI11/README.md # Provides: bundled(cli11) = 2.3.1 # Version from: -# third_party/renderman-26/plugin/rmanArgsParser/pugixml/pugiconfig.hpp -# third_party/renderman-27/plugin/rmanArgsParser/pugixml/pugiconfig.hpp +# third_party/renderman/plugin/rmanArgsParser/pugixml/pugiconfig.hpp # (header comment) # Provides: bundled(pugixml) = 1.9 # Version from: pxr/base/js/rapidjson/rapidjson.h @@ -359,8 +392,8 @@ Provides: bundled(boost) = 1.85.0 # https://chromium.googlesource.com/libyuv/libyuv and find the commit hash that # corresponds to a particular serial number. # LIBYUV_VERSION 1895 = commit a97746349b244efd54ab1eb0c0a7366717b33f39 -# Provides: bundled(libyuv) = 0^20240812gita977463 -# Version from pxr/imaging/plugin/hioAvif/aom/config/aom_version.h +# Provides: bundled(libyuv) = 0^20240812.a977463 +# Version from pxr/imaging/plugin/hioAvif/config/aom_version.h # Provides: bundled(aom) = 3.0.0 %description libs @@ -479,9 +512,9 @@ cat > pxr/base/tf/pxrCLI11/CLI11.h <<'EOF' namespace pxr_CLI = CLI; EOF # Remove the bundled copy of pugixml. -find third_party/renderman-*/plugin/rmanArgsParser/pugixml/ \ +find third_party/renderman/plugin/rmanArgsParser/pugixml/ \ -type f ! -name '*.hpp' -print -delete -for hdr in third_party/renderman-*/plugin/rmanArgsParser/pugixml/*.hpp +for hdr in third_party/renderman/plugin/rmanArgsParser/pugixml/*.hpp do cat > "${hdr}" < From 1165f5708e79ce58d50c347a0b68fdbd40d4cfc0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 6 Apr 2026 13:07:00 +0100 Subject: [PATCH 159/167] Backport fix for CVE-2026-34544 in OpenEXRCore - Fixes RHBZ#2454226 --- 4028.patch | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ usd.spec | 3 +++ 2 files changed, 74 insertions(+) create mode 100644 4028.patch diff --git a/4028.patch b/4028.patch new file mode 100644 index 0000000..9fd2598 --- /dev/null +++ b/4028.patch @@ -0,0 +1,71 @@ +From 83c6cdfa63ad61accec35575f503b629f94dc4af Mon Sep 17 00:00:00 2001 +From: Cary Phillips +Date: Thu, 19 Mar 2026 14:22:40 -0700 +Subject: [PATCH] Fix B44/B44A integer overflow: use uint64_t for row offset + (#2312) + +The B44 and B44A decoder and encoder use channel width (`nx`) and +height (`ny`) in row pointer math. `nx` and `ny` are `int`; the +scratch buffer is correctly sized with `(uint64_t)ny * (uint64_t)nx * +bytes_per_element`, but row bases were computed as: + +``` + row0 = (uint16_t*)scratch; + row0 += y * nx; // int * int -> signed overflow when y*nx > INT_MAX +``` + +For large `nx` (e.g. 268435456), `y*nx` overflows, so `row0`/`row1`/`row2`/`row3` +point before the scratch buffer. + +Fix: compute the row offset in `uint64_t` before pointer arithmetic in both +`uncompress_b44_impl` (decoder) and `compress_b44_impl` (encoder). + +Analysis and solution with the help of Curor / Claude Opus 4.5 + +Signed-off-by: Cary Phillips +--- + .../OpenEXR/OpenEXRCore/internal_b44.c | 23 ++++++++++--------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c +index 8d0c257e658..93279ff2ed5 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c +@@ -390,13 +390,13 @@ compress_b44_impl (exr_encode_pipeline_t* encode, int flat_field) + // rightmost column and the bottom row. + // + uint16_t *row0, *row1, *row2, *row3; ++ /* row offset in elements: use uint64_t so y*nx cannot overflow int */ ++ uint64_t row_off = (uint64_t) (y) * (uint64_t) (nx); + +- row0 = (uint16_t*) scratch; +- row0 += y * nx; +- +- row1 = row0 + nx; +- row2 = row1 + nx; +- row3 = row2 + nx; ++ row0 = (uint16_t*) scratch + row_off; ++ row1 = row0 + (uint64_t) nx; ++ row2 = row1 + (uint64_t) nx; ++ row3 = row2 + (uint64_t) nx; + + if (y + 3 >= ny) + { +@@ -512,11 +512,12 @@ uncompress_b44_impl ( + + for (int y = 0; y < ny; y += 4) + { +- row0 = (uint16_t*) scratch; +- row0 += y * nx; +- row1 = row0 + nx; +- row2 = row1 + nx; +- row3 = row2 + nx; ++ /* row offset in elements: use uint64_t so y*nx cannot overflow int */ ++ uint64_t row_off = (uint64_t) (y) * (uint64_t) (nx); ++ row0 = (uint16_t*) scratch + row_off; ++ row1 = row0 + (uint64_t) nx; ++ row2 = row1 + (uint64_t) nx; ++ row3 = row2 + (uint64_t) nx; + for (int x = 0; x < nx; x += 4) + { + if (bIn + 3 > comp_buf_size) return EXR_ERR_OUT_OF_MEMORY; diff --git a/usd.spec b/usd.spec index 898ff05..f1b273f 100644 --- a/usd.spec +++ b/usd.spec @@ -151,6 +151,9 @@ Patch: 0006-Downstream-only-use-the-system-libavif.patch # Backport fixes for CVE-2025-64181 etc. in OpenEXRCore # https://github.com/PixarAnimationStudios/OpenUSD/pull/3903 Patch: %{forgeurl}/pull/3903.patch +# Backport fix for CVE-2026-34544 in OpenEXRCore +# https://github.com/PixarAnimationStudios/OpenUSD/pull/4028 +Patch: %{forgeurl}/pull/4028.patch # Base BuildRequires: gcc-c++ From 099d5a046b76634d20599150d231fc2f3182ac19 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 8 Apr 2026 11:58:16 +0100 Subject: [PATCH 160/167] Backport several OpenEXRCore security fixes - Fixes CVE-2026-34378 / GHSA-v76p-4qvv-vh4g; closes RHBZ#2455493 - Fixes CVE-2026-34380 / GHSA-q3v8-hw4m-59w5; closes RHBZ#2455534 - Fixes CVE-2026-34588 / GHSA-588r-cr5c-w6hf; closes RHBZ#2455505 - Fixes CVE-2026-34589 / GHSA-p8xc-w3q4-h64x; closes RHBZ#2455501 - Fixes CVE-2026-34379 / GHSA-w88v-vqhq-5p24; closes RHBZ#2455497 --- 4030.patch | 612 +++++++++++++++++++++++++++++++++++++++++++++++++++++ usd.spec | 9 + 2 files changed, 621 insertions(+) create mode 100644 4030.patch diff --git a/4030.patch b/4030.patch new file mode 100644 index 0000000..896f2e3 --- /dev/null +++ b/4030.patch @@ -0,0 +1,612 @@ +From 4f03fb0f488d8f528bdc0f9ecac07eea8f7b63ac Mon Sep 17 00:00:00 2001 +From: Christoph Gohlke +Date: Tue, 17 Mar 2026 20:56:39 -0700 +Subject: [PATCH 1/6] Fix comparison operator for buffer size check (#2307) + +Signed-off-by: Christoph Gohlke +--- + .../plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c +index 628438c5c01..56df6a49c2f 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c +@@ -367,7 +367,7 @@ apply_zip_impl (exr_encode_pipeline_t* encode) + + if (rv == EXR_ERR_SUCCESS) + { +- if (compbufsz > encode->packed_bytes) ++ if (compbufsz >= encode->packed_bytes) + { + memcpy ( + encode->compressed_buffer, + +From 0512b6c41b95e5c0ac9e01b2f87b56acd437d8e9 Mon Sep 17 00:00:00 2001 +From: Cary Phillips +Date: Thu, 26 Mar 2026 16:35:49 -0700 +Subject: [PATCH 2/6] Fix integer overflow in `srcbuffer` pointer arithmetic in + `unpack_*` (#2321) + +Pointer arithmetic involving `srcbuffer` in the `unpack_*` functions +can overflow for very wide images. + +Multiplying `int w` by a bytes-per-element constant (2, 4, 6, or 8) in +`srcbuffer +=` expressions causes signed integer overflow when the +image width is large. + +Promote the leading operand to `int64_t` at every affected multiplication +so pointer arithmetic is performed in 64-bit signed arithmetic throughout, +eliminating the undefined behavior without imposing any image size limit. + +Affected sites: `generic_unpack`, `unpack_16bit`, `unpack_32bit`, and +all 3- and 4-channel interleave/planar specializations. + +Made-with: Cursor + +Signed-off-by: Cary Phillips +--- + .../hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c | 38 +++++++++---------- + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c +index 1324508c5b4..8765bfa50d6 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c +@@ -229,7 +229,7 @@ unpack_16bit_3chan_interleave (exr_decode_pipeline_t* decode) + in1 = in0 + w; + in2 = in1 + w; + +- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + out[0] = one_to_native16 (in0[x]); +@@ -269,7 +269,7 @@ unpack_16bit_3chan_interleave_rev (exr_decode_pipeline_t* decode) + in1 = in0 + w; // G + in2 = in1 + w; // R + +- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + out[0] = one_to_native16 (in2[x]); +@@ -309,7 +309,7 @@ unpack_half_to_float_3chan_interleave (exr_decode_pipeline_t* decode) + in1 = in0 + w; + in2 = in1 + w; + +- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + out[0] = half_to_float (one_to_native16 (in0[x])); +@@ -349,7 +349,7 @@ unpack_half_to_float_3chan_interleave_rev (exr_decode_pipeline_t* decode) + in1 = in0 + w; + in2 = in1 + w; + +- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + out[0] = half_to_float (one_to_native16 (in2[x])); +@@ -390,7 +390,7 @@ unpack_16bit_3chan_planar (exr_decode_pipeline_t* decode) + in0 = (const uint16_t*) srcbuffer; + in1 = in0 + w; + in2 = in1 + w; +- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion + /* specialise to memcpy if we can */ + #if EXR_HOST_IS_NOT_LITTLE_ENDIAN + for (int x = 0; x < w; ++x) +@@ -440,7 +440,7 @@ unpack_half_to_float_3chan_planar (exr_decode_pipeline_t* decode) + in0 = (const uint16_t*) srcbuffer; + in1 = in0 + w; + in2 = in1 + w; +- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion + /* specialise to memcpy if we can */ + half_to_float_buffer ((float*) out0, in0, w); + half_to_float_buffer ((float*) out1, in1, w); +@@ -485,7 +485,7 @@ unpack_16bit_3chan (exr_decode_pipeline_t* decode) + in0 = (const uint16_t*) srcbuffer; + in1 = in0 + w; + in2 = in1 + w; +- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + *((uint16_t*) (out0 + x * inc0)) = one_to_native16 (in0[x]); + for (int x = 0; x < w; ++x) +@@ -539,7 +539,7 @@ unpack_16bit_4chan_interleave (exr_decode_pipeline_t* decode) + in2 = in1 + w; + in3 = in2 + w; + +- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + combined.a = one_to_native16 (in0[x]); +@@ -592,7 +592,7 @@ unpack_16bit_4chan_interleave_rev (exr_decode_pipeline_t* decode) + in2 = in1 + w; + in3 = in2 + w; + +- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + combined.a = one_to_native16 (in0[x]); +@@ -633,7 +633,7 @@ unpack_half_to_float_4chan_interleave (exr_decode_pipeline_t* decode) + in2 = in1 + w; + in3 = in2 + w; + +- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + out[0] = half_to_float (one_to_native16 (in3[x])); +@@ -674,7 +674,7 @@ unpack_half_to_float_4chan_interleave_rev (exr_decode_pipeline_t* decode) + in2 = in1 + w; + in3 = in2 + w; + +- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + { + out[0] = half_to_float (one_to_native16 (in0[x])); +@@ -719,7 +719,7 @@ unpack_16bit_4chan_planar (exr_decode_pipeline_t* decode) + in1 = in0 + w; + in2 = in1 + w; + in3 = in2 + w; +- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion + /* specialize to memcpy if we can */ + #if EXR_HOST_IS_NOT_LITTLE_ENDIAN + for (int x = 0; x < w; ++x) +@@ -775,7 +775,7 @@ unpack_half_to_float_4chan_planar (exr_decode_pipeline_t* decode) + in1 = in0 + w; + in2 = in1 + w; + in3 = in2 + w; +- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion + + half_to_float_buffer ((float*) out0, in0, w); + half_to_float_buffer ((float*) out1, in1, w); +@@ -825,7 +825,7 @@ unpack_16bit_4chan (exr_decode_pipeline_t* decode) + in1 = in0 + w; + in2 = in1 + w; + in3 = in2 + w; +- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion ++ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion + for (int x = 0; x < w; ++x) + *((uint16_t*) (out0 + x * inc0)) = one_to_native16 (in0[x]); + for (int x = 0; x < w; ++x) +@@ -898,7 +898,7 @@ unpack_16bit (exr_decode_pipeline_t* decode) + } + } + #endif +- srcbuffer += w * 2; ++ srcbuffer += (int64_t) w * 2; + } + } + return EXR_ERR_SUCCESS; +@@ -963,7 +963,7 @@ unpack_32bit (exr_decode_pipeline_t* decode) + } + } + #endif +- srcbuffer += w * 4; ++ srcbuffer += (int64_t) w * 4; + } + } + return EXR_ERR_SUCCESS; +@@ -1118,7 +1118,7 @@ generic_unpack (exr_decode_pipeline_t* decode) + (uint64_t) decc->user_line_stride); + else + { +- srcbuffer += w * bpc; ++ srcbuffer += (int64_t) w * bpc; + continue; + } + } +@@ -1128,12 +1128,12 @@ generic_unpack (exr_decode_pipeline_t* decode) + } + else + { +- srcbuffer += w * bpc; ++ srcbuffer += (int64_t) w * bpc; + continue; + } + + UNPACK_SAMPLES (w) +- srcbuffer += w * bpc; ++ srcbuffer += (int64_t) w * bpc; + } + } + return EXR_ERR_SUCCESS; + +From f5f7f32d5761b8d28d61e391e9daf68bd62bc9e5 Mon Sep 17 00:00:00 2001 +From: Cary Phillips +Date: Sun, 29 Mar 2026 19:19:12 -0700 +Subject: [PATCH 3/6] Security: fix signed integer overflow in + `undo_pxr24_impl()` (PXR24 decoder) (#2323) + +In the `EXR_PIXEL_FLOAT` branch of `undo_pxr24_impl()`, the expressions + + (uint64_t)(w * 3) + +compute the signed 32-bit product `w * 3` before the cast to `uint64_t`. +When `w` is large this is undefined behavior under the C standard; on +two's-complement builds without sanitizers the result wraps to a small +positive value, which can cause the bounds check + + if (nDec + (uint64_t)(w * 3) > outSize) + +to pass incorrectly. If the check is bypassed the decode loop proceeds +to write `4*w` bytes through `dout`, potentially far beyond the allocated +output buffer. + +Fix: cast `w` to `uint64_t` before multiplying so that both the bounds +check and the counter update are performed entirely in 64-bit unsigned +arithmetic: + + (uint64_t)w * 3 (cast before multiply, not after) + +The `EXR_PIXEL_UINT` and `EXR_PIXEL_HALF` decode branches are unaffected: +they reuse the pre-computed `nBytes` variable, which is already formed as +`(uint64_t)(w) * (uint64_t)(bytes_per_element)`. + +Also fix the symmetric issue in `apply_pxr24_impl()` (the encoder): + lastIn += w * 4 +advances a pointer by a signed 32-bit product; corrected to + lastIn += (uint64_t)w * 4 + +Made-with: Cursor + +Signed-off-by: Cary Phillips +--- + .../plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c +index 43e52c982cf..30f71f4f846 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c +@@ -182,7 +182,7 @@ apply_pxr24_impl (exr_encode_pipeline_t* encode) + if (nOut + nBytes > encode->scratch_alloc_size_1) + return EXR_ERR_OUT_OF_MEMORY; + nOut += nBytes; +- lastIn += w * 4; ++ lastIn += (uint64_t) w * 4; + + ptr[0] = out; + out += w; +@@ -371,7 +371,7 @@ undo_pxr24_impl ( + ptr[2] = lastIn; + lastIn += w; + +- if (nDec + (uint64_t) (w * 3) > outSize) ++ if (nDec + (uint64_t) w * 3 > outSize) + return EXR_ERR_CORRUPT_CHUNK; + + for (int x = 0; x < w; ++x) +@@ -384,7 +384,7 @@ undo_pxr24_impl ( + unaligned_store32 (dout, pixel); + ++dout; + } +- nDec += (uint64_t) (w * 3); ++ nDec += (uint64_t) w * 3; + break; + } + default: return EXR_ERR_INVALID_ARGUMENT; + +From d578381a503add330b3b96b30cf6a49461989f08 Mon Sep 17 00:00:00 2001 +From: Cary Phillips +Date: Sun, 29 Mar 2026 19:19:49 -0700 +Subject: [PATCH 4/6] fix integer overflow in PIZ wavelet buffer arithmetic + (#2328) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Three classes of signed integer overflow in the PIZ codec path, all +reachable from corrupt `dataWindow` dimensions in the EXR file header. + +**`wav_2D_encode` / `wav_2D_decode` — wavelet loop pointer arithmetic** + +`oy` is passed as `int` (value `wcount * nx`, at most ~INT32_MAX after +the guard below). Inside the hierarchical wavelet loop the expressions + + ey = in + oy * (ny - p2) // pointer end-of-row sentinel + oy1 = oy * p // row stride at level p + oy2 = oy * p2 // row stride at level p2 + +multiply two values that can each approach INT32_MAX, producing a +signed 32-bit product that wraps to a small or negative value. The +wrapped value is used as a pointer offset, causing reads and writes +through `px` / `py` to land outside the allocated wavelet buffer. + +Fix: widen by introducing `int64_t oy64 = oy` and using it for all +three expressions; `oy1` and `oy2` are also declared `int64_t`. + +**`wavbuf += nx * ny * wcount` — per-channel buffer advance** + +`nx`, `ny`, and `wcount` are all `int`. Their triple product overflows +int32 for moderately large images, causing subsequent channels to be +processed at an incorrect (too-small) offset into the wavelet buffer, +corrupting both encode and decode output. + +Fix: cast to `(uint64_t)` before multiplying. + +**`wcount * nx` — call-site argument overflow** + +The fifth argument to `wav_2D_encode` / `wav_2D_decode` is `wcount * nx` +(`oy` = y-stride = elements per row). `wcount` is 1 or 2 +(`bytes_per_element / 2`); for `wcount = 2` the product overflows int32 +when `nx > INT32_MAX / 2`. + +Fix: add an early bounds check `if (wcount > 0 && nx > INT_MAX / wcount)` +that rejects such input as `EXR_ERR_CORRUPT_CHUNK` before any arithmetic +is performed. This also keeps `wcount * nx` within int32 range at the +call site, ensuring `oy` arrives in the wavelet functions with a valid +non-overflowed value. + +Made-with: Cursor + +Signed-off-by: Cary Phillips +--- + .../OpenEXR/OpenEXRCore/internal_piz.c | 39 +++++++++++-------- + 1 file changed, 23 insertions(+), 16 deletions(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c +index 6c2750b166f..787d2752c61 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c +@@ -10,6 +10,7 @@ + #include "internal_huf.h" + #include "internal_xdr.h" + ++#include + #include + + /**************************************/ +@@ -171,10 +172,11 @@ wdec16 (uint16_t l, uint16_t h, uint16_t* a, uint16_t* b) + static void + wav_2D_encode (uint16_t* in, int nx, int ox, int ny, int oy, uint16_t mx) + { +- int w14 = (mx < (1 << 14)) ? 1 : 0; +- int n = (nx > ny) ? ny : nx; +- int p = 1; // == 1 << level +- int p2 = 2; // == 1 << (level+1) ++ int w14 = (mx < (1 << 14)) ? 1 : 0; ++ int n = (nx > ny) ? ny : nx; ++ int p = 1; // == 1 << level ++ int p2 = 2; // == 1 << (level+1) ++ int64_t oy64 = oy; + + // + // Hierarchical loop on smaller dimension n +@@ -183,9 +185,9 @@ wav_2D_encode (uint16_t* in, int nx, int ox, int ny, int oy, uint16_t mx) + while (p2 <= n) + { + uint16_t* py = in; +- uint16_t* ey = in + oy * (ny - p2); +- int oy1 = oy * p; +- int oy2 = oy * p2; ++ uint16_t* ey = in + oy64 * (ny - p2); ++ int64_t oy1 = oy64 * p; ++ int64_t oy2 = oy64 * p2; + int ox1 = ox * p; + int ox2 = ox * p2; + uint16_t i00, i01, i10, i11; +@@ -284,10 +286,11 @@ wav_2D_decode ( + int oy, // i : y offset + uint16_t mx) // i : maximum in[x][y] value + { +- int w14 = (mx < (1 << 14)) ? 1 : 0; +- int n = (nx > ny) ? ny : nx; +- int p = 1; +- int p2; ++ int w14 = (mx < (1 << 14)) ? 1 : 0; ++ int n = (nx > ny) ? ny : nx; ++ int p = 1; ++ int p2; ++ int64_t oy64 = oy; + + // + // Search max level +@@ -307,9 +310,9 @@ wav_2D_decode ( + while (p >= 1) + { + uint16_t* py = in; +- uint16_t* ey = in + oy * (ny - p2); +- int oy1 = oy * p; +- int oy2 = oy * p2; ++ uint16_t* ey = in + oy64 * (ny - p2); ++ int64_t oy1 = oy64 * p; ++ int64_t oy2 = oy64 * p2; + int ox1 = ox * p; + int ox2 = ox * p2; + uint16_t i00, i01, i10, i11; +@@ -502,11 +505,13 @@ internal_exr_apply_piz (exr_encode_pipeline_t* encode) + nx = curc->width; + ny = curc->height; + wcount = (int) (curc->bytes_per_element / 2); ++ if (wcount > 0 && nx > INT_MAX / wcount) ++ return EXR_ERR_CORRUPT_CHUNK; + for (int j = 0; j < wcount; ++j) + { + wav_2D_encode (wavbuf + j, nx, wcount, ny, wcount * nx, maxValue); + } +- wavbuf += nx * ny * wcount; ++ wavbuf += (uint64_t) nx * ny * wcount; + } + + nBytes = 0; +@@ -655,11 +660,13 @@ internal_exr_undo_piz ( + nx = curc->width; + ny = curc->height; + wcount = (int) (curc->bytes_per_element / 2); ++ if (wcount > 0 && nx > INT_MAX / wcount) ++ return EXR_ERR_CORRUPT_CHUNK; + for (int j = 0; j < wcount; ++j) + { + wav_2D_decode (wavbuf + j, nx, wcount, ny, wcount * nx, maxValue); + } +- wavbuf += nx * ny * wcount; ++ wavbuf += (uint64_t) nx * ny * wcount; + } + + // + +From a76474285ddc24e9956b5e12fab658b908912ed4 Mon Sep 17 00:00:00 2001 +From: Cary Phillips +Date: Sun, 29 Mar 2026 19:20:52 -0700 +Subject: [PATCH 5/6] Fix signed integer overflow in + `LossyDctDecoder_execute()` pointer arithmetic (#2329) + +`numBlocksX` and `numBlocksY` are declared as `int`. Two pointer-offset +expressions in `LossyDctDecoder_execute()` multiplied them as signed +32-bit integers before using the result as a pointer offset: + + rowBlock[comp] = rowBlock[comp - 1] + numBlocksX * 64; + currDcComp[comp] = currDcComp[comp - 1] + numBlocksX * numBlocksY; + +`dataWindow.max.x` is a signed 32-bit value in the EXR file format, so +`numBlocksX` can reach `(INT32_MAX + 7) / 8 = 268,435,456`. At that +point `numBlocksX * 64 = 17,179,869,184` overflows `int32`, and +`numBlocksX * numBlocksY` overflows even sooner. The wraparound +produces a small or negative pointer offset, causing `rowBlock[comp]` +and `currDcComp[comp]` to point into already-used or pre-buffer memory +rather than the intended component stride. + +Fix: cast `numBlocksX` to `size_t` before multiplying so the +arithmetic is performed in pointer-sized unsigned arithmetic: + + rowBlock[comp] = rowBlock[comp - 1] + (size_t) numBlocksX * 64; + currDcComp[comp] = currDcComp[comp - 1] + (size_t) numBlocksX * numBlocksY; + +This is consistent with the allocation on the line above, which already +uses `(size_t) numComp * (size_t) numBlocksX * 64 * sizeof(uint16_t)`, +and with the packed-DC count check, which uses explicit `uint64_t` casts. + +Made-with: Cursor + +Signed-off-by: Cary Phillips +--- + .../hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h +index bcdebd985f9..e289b064dac 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h +@@ -265,7 +265,7 @@ LossyDctDecoder_execute ( + } + + for (int comp = 1; comp < numComp; ++comp) +- rowBlock[comp] = rowBlock[comp - 1] + numBlocksX * 64; ++ rowBlock[comp] = rowBlock[comp - 1] + (size_t) numBlocksX * 64; + + // + // Pack DC components together by common plane, so we can get +@@ -275,7 +275,7 @@ LossyDctDecoder_execute ( + + currDcComp[0] = (uint16_t*) d->_packedDc; + for (int comp = 1; comp < numComp; ++comp) +- currDcComp[comp] = currDcComp[comp - 1] + numBlocksX * numBlocksY; ++ currDcComp[comp] = currDcComp[comp - 1] + (size_t) numBlocksX * numBlocksY; + + for (int blocky = 0; blocky < numBlocksY; ++blocky) + { + +From 219a0870506f80c7353016800e467ad0de923424 Mon Sep 17 00:00:00 2001 +From: Cary Phillips +Date: Tue, 31 Mar 2026 07:49:09 -0700 +Subject: [PATCH 6/6] =?UTF-8?q?Fix=20misaligned=20memory=20access=20in=20`?= + =?UTF-8?q?LossyDctDecoder=5Fexecute`=20HALF=E2=86=92FLOAT=20expansion=20(?= + =?UTF-8?q?#2324)?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +* Fix misaligned memory access in `LossyDctDecoder_execute` HALF→FLOAT expansion + +After DCT decoding, `LossyDctDecoder_execute()` expands FLOAT-type channels +from their intermediate HALF (16-bit) XDR representation back to FLOAT (32-bit) +XDR in place. The expansion was done by casting `_rows[y]` (a `uint8_t *`) +directly to `float *` and `uint16_t *`, then reading and writing through those +typed pointers. + +Because row buffers are assigned by advancing a byte pointer with no alignment +padding (`outBufferEnd += chan->width * chan->bytes_per_element` in +`internal_dwa_compressor.h`), a FLOAT channel that follows a HALF channel of +odd width receives a `_rows[y]` pointer that is 2-byte aligned but not 4-byte +aligned. Dereferencing a `float *` cast from such a pointer is undefined +behavior under the C standard: + +- On ARM, RISC-V, and MIPS (strict alignment) this crashes immediately. +- On x86 it is silently tolerated at the hardware level but remains UB: + auto-vectorizing compilers (SSE/AVX) may assume aligned access and generate + incorrect code. +- UBSan reports: `store to misaligned address ... for type 'float', which + requires 4 byte alignment` at `internal_dwa_decoder.h:749`. + +Fix: replace the cast-and-dereference pattern with the `unaligned_load16` / +`memcpy` / `unaligned_store32` helpers already used throughout the rest of +OpenEXRCore (`internal_xdr.h`, `unpack.c`, `pack.c`, `internal_pxr24.c`). +These helpers use `memcpy` internally, which the C standard guarantees is safe +for unaligned addresses and which compilers compile to a single load/store +instruction on architectures that support it. + +The byte-order handling is preserved correctly: +- `unaligned_load16` reads 2 bytes via `memcpy` and applies `one_to_native16` + (XDR → native), returning a native-endian HALF value. +- `half_to_float` converts native HALF → native float. +- `memcpy(&bits, &f, 4)` reinterprets the float's bit pattern as `uint32_t` + without numeric conversion (the correct type-pun idiom in C). +- `unaligned_store32` applies `one_from_native32` (native → XDR) and writes + 4 bytes via `memcpy`, storing the result in XDR float format. + +Made-with: Cursor +Signed-off-by: Cary Phillips + +* add TODO comment + +Signed-off-by: Cary Phillips + +--------- + +Signed-off-by: Cary Phillips +--- + .../OpenEXR/OpenEXRCore/internal_dwa_decoder.h | 17 +++++++++++++---- + 1 file changed, 13 insertions(+), 4 deletions(-) + +diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h +index e289b064dac..046615ec5b8 100644 +--- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h ++++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h +@@ -651,13 +651,22 @@ LossyDctDecoder_execute ( + /* process in place in reverse to avoid temporary buffer */ + for (int y = 0; y < d->_height; ++y) + { +- float* floatXdrPtr = (float*) chanData[chan]->_rows[y]; +- uint16_t* halfXdr = (uint16_t*) floatXdrPtr; ++ uint8_t* rowBytes = chanData[chan]->_rows[y]; + + for (int x = d->_width - 1; x >= 0; --x) + { +- floatXdrPtr[x] = one_from_native_float ( +- half_to_float (one_to_native16 (halfXdr[x]))); ++ // TODO: make an unaligned_store32f that takes the float and ++ // packages up a one_from_native_float and calls memcpy ++ // instead of the two memcpy. We should look at the metrics ++ // for dwa and see if there's a performance difference to do ++ // so at some point. See: ++ // https://github.com/AcademySoftwareFoundation/openexr/pull/2324 ++ ++ uint16_t h = unaligned_load16 (rowBytes + x * sizeof (uint16_t)); ++ float f = half_to_float (h); ++ uint32_t bits; ++ memcpy (&bits, &f, sizeof (bits)); ++ unaligned_store32 (rowBytes + x * sizeof (float), bits); + } + } + } diff --git a/usd.spec b/usd.spec index f1b273f..e2186c4 100644 --- a/usd.spec +++ b/usd.spec @@ -154,6 +154,15 @@ Patch: %{forgeurl}/pull/3903.patch # Backport fix for CVE-2026-34544 in OpenEXRCore # https://github.com/PixarAnimationStudios/OpenUSD/pull/4028 Patch: %{forgeurl}/pull/4028.patch +# Backport several OpenEXRCore security fixes +# https://github.com/PixarAnimationStudios/OpenUSD/pull/4030 +# Fixes: +# - CVE-2026-34378 / GHSA-v76p-4qvv-vh4g / RHBZ#2455493 +# - CVE-2026-34380 / GHSA-q3v8-hw4m-59w5 / RHBZ#2455534 +# - CVE-2026-34588 / GHSA-588r-cr5c-w6hf / RHBZ#2455505 +# - CVE-2026-34589 / GHSA-p8xc-w3q4-h64x / RHBZ#2455501 +# - CVE-2026-34379 / GHSA-w88v-vqhq-5p24 / RHBZ#2455497 +Patch: %{forgeurl}/pull/4030.patch # Base BuildRequires: gcc-c++ From d7db70a14df648ce58955e0982c55f3418473233 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 16 Apr 2026 19:30:30 -0600 Subject: [PATCH 161/167] Rebuild for hdf5 2.1 From b8ae07c43dfa649205413bf5f376d0b78af430be Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 27 Apr 2026 11:43:09 +0100 Subject: [PATCH 162/167] Update to 26.05 (close RHBZ#2461650) --- .gitignore | 1 + ...ownstream-only-add-an-SONAME-version.patch | 6 +- ...use-the-system-double-conversion-lib.patch | 6 +- ...ream-only-use-the-system-lz4-library.patch | 6 +- ...-only-use-the-system-pugixml-library.patch | 2 +- ...nly-use-the-system-rapidjson-library.patch | 2 +- ...tream-only-use-the-system-libdeflate.patch | 2 +- ...wnstream-only-use-the-system-libavif.patch | 2 +- 4028.patch | 71 -- 4030.patch | 612 ------------------ sources | 2 +- usd.spec | 18 +- 12 files changed, 18 insertions(+), 712 deletions(-) delete mode 100644 4028.patch delete mode 100644 4030.patch diff --git a/.gitignore b/.gitignore index f00caa1..cf961b4 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /OpenUSD-25.08.tar.gz /OpenUSD-25.11.tar.gz /OpenUSD-26.03.tar.gz +/OpenUSD-26.05.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index 7a55eca..c86bdb4 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 949707d0bd8ac077fac9763b3b590a016ff4eb6f Mon Sep 17 00:00:00 2001 +From 330d176f208baadd2db58f8797bc492f2d81c03f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 9 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 1cc7fa64a..ebe531ec4 100644 +index 3efcd4e82..e8f37af98 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "26") - set(PXR_PATCH_VERSION "3") # NOTE: Must not have leading 0 for single digits + set(PXR_PATCH_VERSION "5") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 30a54ef..51614ec 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From 5bc91bdebc42bb3a441c87b706288cea05fcd345 Mon Sep 17 00:00:00 2001 +From ea7f51376f03620c6187f3672dad12951669ecb5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -8,7 +8,7 @@ Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 6fc9c680e..551b5a3eb 100644 +index 8c0f8e4a1..3afc2edaf 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -105,11 +105,14 @@ function(add_py_dll_link_test) @@ -26,7 +26,7 @@ index 6fc9c680e..551b5a3eb 100644 PUBLIC_CLASSES anyUniquePtr -@@ -272,14 +275,6 @@ pxr_library(tf +@@ -276,14 +279,6 @@ pxr_library(tf CPPFILES initConfig.cpp diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index 910d576..a61e7fb 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,4 +1,4 @@ -From 0caa009abce9d66d441cd548f45ca8fef8d4846d Mon Sep 17 00:00:00 2001 +From cb323e80b560cbebf49c0e199804965b472274b0 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library @@ -8,7 +8,7 @@ Subject: [PATCH 2/6] Downstream-only: use the system lz4 library 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 551b5a3eb..772524a19 100644 +index 3afc2edaf..8ae85b5eb 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -106,6 +106,8 @@ function(add_py_dll_link_test) @@ -31,7 +31,7 @@ index 551b5a3eb..772524a19 100644 PUBLIC_CLASSES anyUniquePtr -@@ -275,7 +281,6 @@ pxr_library(tf +@@ -279,7 +285,6 @@ pxr_library(tf CPPFILES initConfig.cpp diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 974ff6f..6f0a13a 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,4 +1,4 @@ -From d1e032128f9c41a763d9e0535c408ffa6642ae03 Mon Sep 17 00:00:00 2001 +From de61621ccbee32776ea9e330384f6275c4237259 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index 090b753..d9e2dcf 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,4 +1,4 @@ -From 8fc7363878d1917d5b3f3513b16d54293463c297 Mon Sep 17 00:00:00 2001 +From a83325f12491456b6ad9cb40fa09f0155377263f Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index cc5de7a..c97e35f 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,4 +1,4 @@ -From 30b0460635b46ce71f22586273afb370075d7db8 Mon Sep 17 00:00:00 2001 +From 91b0341364b986e051a150a9f33e98a12bc3f20d Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index cac8a41..5b5fc40 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,4 +1,4 @@ -From c6639b8f1a8c57b02071426400daa349eed14501 Mon Sep 17 00:00:00 2001 +From 81ac0ca314d66e96f43ed904204b63be302e0743 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif diff --git a/4028.patch b/4028.patch deleted file mode 100644 index 9fd2598..0000000 --- a/4028.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 83c6cdfa63ad61accec35575f503b629f94dc4af Mon Sep 17 00:00:00 2001 -From: Cary Phillips -Date: Thu, 19 Mar 2026 14:22:40 -0700 -Subject: [PATCH] Fix B44/B44A integer overflow: use uint64_t for row offset - (#2312) - -The B44 and B44A decoder and encoder use channel width (`nx`) and -height (`ny`) in row pointer math. `nx` and `ny` are `int`; the -scratch buffer is correctly sized with `(uint64_t)ny * (uint64_t)nx * -bytes_per_element`, but row bases were computed as: - -``` - row0 = (uint16_t*)scratch; - row0 += y * nx; // int * int -> signed overflow when y*nx > INT_MAX -``` - -For large `nx` (e.g. 268435456), `y*nx` overflows, so `row0`/`row1`/`row2`/`row3` -point before the scratch buffer. - -Fix: compute the row offset in `uint64_t` before pointer arithmetic in both -`uncompress_b44_impl` (decoder) and `compress_b44_impl` (encoder). - -Analysis and solution with the help of Curor / Claude Opus 4.5 - -Signed-off-by: Cary Phillips ---- - .../OpenEXR/OpenEXRCore/internal_b44.c | 23 ++++++++++--------- - 1 file changed, 12 insertions(+), 11 deletions(-) - -diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c -index 8d0c257e658..93279ff2ed5 100644 ---- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c -+++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_b44.c -@@ -390,13 +390,13 @@ compress_b44_impl (exr_encode_pipeline_t* encode, int flat_field) - // rightmost column and the bottom row. - // - uint16_t *row0, *row1, *row2, *row3; -+ /* row offset in elements: use uint64_t so y*nx cannot overflow int */ -+ uint64_t row_off = (uint64_t) (y) * (uint64_t) (nx); - -- row0 = (uint16_t*) scratch; -- row0 += y * nx; -- -- row1 = row0 + nx; -- row2 = row1 + nx; -- row3 = row2 + nx; -+ row0 = (uint16_t*) scratch + row_off; -+ row1 = row0 + (uint64_t) nx; -+ row2 = row1 + (uint64_t) nx; -+ row3 = row2 + (uint64_t) nx; - - if (y + 3 >= ny) - { -@@ -512,11 +512,12 @@ uncompress_b44_impl ( - - for (int y = 0; y < ny; y += 4) - { -- row0 = (uint16_t*) scratch; -- row0 += y * nx; -- row1 = row0 + nx; -- row2 = row1 + nx; -- row3 = row2 + nx; -+ /* row offset in elements: use uint64_t so y*nx cannot overflow int */ -+ uint64_t row_off = (uint64_t) (y) * (uint64_t) (nx); -+ row0 = (uint16_t*) scratch + row_off; -+ row1 = row0 + (uint64_t) nx; -+ row2 = row1 + (uint64_t) nx; -+ row3 = row2 + (uint64_t) nx; - for (int x = 0; x < nx; x += 4) - { - if (bIn + 3 > comp_buf_size) return EXR_ERR_OUT_OF_MEMORY; diff --git a/4030.patch b/4030.patch deleted file mode 100644 index 896f2e3..0000000 --- a/4030.patch +++ /dev/null @@ -1,612 +0,0 @@ -From 4f03fb0f488d8f528bdc0f9ecac07eea8f7b63ac Mon Sep 17 00:00:00 2001 -From: Christoph Gohlke -Date: Tue, 17 Mar 2026 20:56:39 -0700 -Subject: [PATCH 1/6] Fix comparison operator for buffer size check (#2307) - -Signed-off-by: Christoph Gohlke ---- - .../plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c -index 628438c5c01..56df6a49c2f 100644 ---- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c -+++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_zip.c -@@ -367,7 +367,7 @@ apply_zip_impl (exr_encode_pipeline_t* encode) - - if (rv == EXR_ERR_SUCCESS) - { -- if (compbufsz > encode->packed_bytes) -+ if (compbufsz >= encode->packed_bytes) - { - memcpy ( - encode->compressed_buffer, - -From 0512b6c41b95e5c0ac9e01b2f87b56acd437d8e9 Mon Sep 17 00:00:00 2001 -From: Cary Phillips -Date: Thu, 26 Mar 2026 16:35:49 -0700 -Subject: [PATCH 2/6] Fix integer overflow in `srcbuffer` pointer arithmetic in - `unpack_*` (#2321) - -Pointer arithmetic involving `srcbuffer` in the `unpack_*` functions -can overflow for very wide images. - -Multiplying `int w` by a bytes-per-element constant (2, 4, 6, or 8) in -`srcbuffer +=` expressions causes signed integer overflow when the -image width is large. - -Promote the leading operand to `int64_t` at every affected multiplication -so pointer arithmetic is performed in 64-bit signed arithmetic throughout, -eliminating the undefined behavior without imposing any image size limit. - -Affected sites: `generic_unpack`, `unpack_16bit`, `unpack_32bit`, and -all 3- and 4-channel interleave/planar specializations. - -Made-with: Cursor - -Signed-off-by: Cary Phillips ---- - .../hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c | 38 +++++++++---------- - 1 file changed, 19 insertions(+), 19 deletions(-) - -diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c -index 1324508c5b4..8765bfa50d6 100644 ---- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c -+++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/unpack.c -@@ -229,7 +229,7 @@ unpack_16bit_3chan_interleave (exr_decode_pipeline_t* decode) - in1 = in0 + w; - in2 = in1 + w; - -- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - out[0] = one_to_native16 (in0[x]); -@@ -269,7 +269,7 @@ unpack_16bit_3chan_interleave_rev (exr_decode_pipeline_t* decode) - in1 = in0 + w; // G - in2 = in1 + w; // R - -- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - out[0] = one_to_native16 (in2[x]); -@@ -309,7 +309,7 @@ unpack_half_to_float_3chan_interleave (exr_decode_pipeline_t* decode) - in1 = in0 + w; - in2 = in1 + w; - -- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - out[0] = half_to_float (one_to_native16 (in0[x])); -@@ -349,7 +349,7 @@ unpack_half_to_float_3chan_interleave_rev (exr_decode_pipeline_t* decode) - in1 = in0 + w; - in2 = in1 + w; - -- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - out[0] = half_to_float (one_to_native16 (in2[x])); -@@ -390,7 +390,7 @@ unpack_16bit_3chan_planar (exr_decode_pipeline_t* decode) - in0 = (const uint16_t*) srcbuffer; - in1 = in0 + w; - in2 = in1 + w; -- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion - /* specialise to memcpy if we can */ - #if EXR_HOST_IS_NOT_LITTLE_ENDIAN - for (int x = 0; x < w; ++x) -@@ -440,7 +440,7 @@ unpack_half_to_float_3chan_planar (exr_decode_pipeline_t* decode) - in0 = (const uint16_t*) srcbuffer; - in1 = in0 + w; - in2 = in1 + w; -- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion - /* specialise to memcpy if we can */ - half_to_float_buffer ((float*) out0, in0, w); - half_to_float_buffer ((float*) out1, in1, w); -@@ -485,7 +485,7 @@ unpack_16bit_3chan (exr_decode_pipeline_t* decode) - in0 = (const uint16_t*) srcbuffer; - in1 = in0 + w; - in2 = in1 + w; -- srcbuffer += w * 6; // 3 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 6; // 3 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - *((uint16_t*) (out0 + x * inc0)) = one_to_native16 (in0[x]); - for (int x = 0; x < w; ++x) -@@ -539,7 +539,7 @@ unpack_16bit_4chan_interleave (exr_decode_pipeline_t* decode) - in2 = in1 + w; - in3 = in2 + w; - -- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - combined.a = one_to_native16 (in0[x]); -@@ -592,7 +592,7 @@ unpack_16bit_4chan_interleave_rev (exr_decode_pipeline_t* decode) - in2 = in1 + w; - in3 = in2 + w; - -- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - combined.a = one_to_native16 (in0[x]); -@@ -633,7 +633,7 @@ unpack_half_to_float_4chan_interleave (exr_decode_pipeline_t* decode) - in2 = in1 + w; - in3 = in2 + w; - -- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - out[0] = half_to_float (one_to_native16 (in3[x])); -@@ -674,7 +674,7 @@ unpack_half_to_float_4chan_interleave_rev (exr_decode_pipeline_t* decode) - in2 = in1 + w; - in3 = in2 + w; - -- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - { - out[0] = half_to_float (one_to_native16 (in0[x])); -@@ -719,7 +719,7 @@ unpack_16bit_4chan_planar (exr_decode_pipeline_t* decode) - in1 = in0 + w; - in2 = in1 + w; - in3 = in2 + w; -- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion - /* specialize to memcpy if we can */ - #if EXR_HOST_IS_NOT_LITTLE_ENDIAN - for (int x = 0; x < w; ++x) -@@ -775,7 +775,7 @@ unpack_half_to_float_4chan_planar (exr_decode_pipeline_t* decode) - in1 = in0 + w; - in2 = in1 + w; - in3 = in2 + w; -- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion - - half_to_float_buffer ((float*) out0, in0, w); - half_to_float_buffer ((float*) out1, in1, w); -@@ -825,7 +825,7 @@ unpack_16bit_4chan (exr_decode_pipeline_t* decode) - in1 = in0 + w; - in2 = in1 + w; - in3 = in2 + w; -- srcbuffer += w * 8; // 4 * sizeof(uint16_t), avoid type conversion -+ srcbuffer += (int64_t) w * 8; // 4 * sizeof(uint16_t), avoid type conversion - for (int x = 0; x < w; ++x) - *((uint16_t*) (out0 + x * inc0)) = one_to_native16 (in0[x]); - for (int x = 0; x < w; ++x) -@@ -898,7 +898,7 @@ unpack_16bit (exr_decode_pipeline_t* decode) - } - } - #endif -- srcbuffer += w * 2; -+ srcbuffer += (int64_t) w * 2; - } - } - return EXR_ERR_SUCCESS; -@@ -963,7 +963,7 @@ unpack_32bit (exr_decode_pipeline_t* decode) - } - } - #endif -- srcbuffer += w * 4; -+ srcbuffer += (int64_t) w * 4; - } - } - return EXR_ERR_SUCCESS; -@@ -1118,7 +1118,7 @@ generic_unpack (exr_decode_pipeline_t* decode) - (uint64_t) decc->user_line_stride); - else - { -- srcbuffer += w * bpc; -+ srcbuffer += (int64_t) w * bpc; - continue; - } - } -@@ -1128,12 +1128,12 @@ generic_unpack (exr_decode_pipeline_t* decode) - } - else - { -- srcbuffer += w * bpc; -+ srcbuffer += (int64_t) w * bpc; - continue; - } - - UNPACK_SAMPLES (w) -- srcbuffer += w * bpc; -+ srcbuffer += (int64_t) w * bpc; - } - } - return EXR_ERR_SUCCESS; - -From f5f7f32d5761b8d28d61e391e9daf68bd62bc9e5 Mon Sep 17 00:00:00 2001 -From: Cary Phillips -Date: Sun, 29 Mar 2026 19:19:12 -0700 -Subject: [PATCH 3/6] Security: fix signed integer overflow in - `undo_pxr24_impl()` (PXR24 decoder) (#2323) - -In the `EXR_PIXEL_FLOAT` branch of `undo_pxr24_impl()`, the expressions - - (uint64_t)(w * 3) - -compute the signed 32-bit product `w * 3` before the cast to `uint64_t`. -When `w` is large this is undefined behavior under the C standard; on -two's-complement builds without sanitizers the result wraps to a small -positive value, which can cause the bounds check - - if (nDec + (uint64_t)(w * 3) > outSize) - -to pass incorrectly. If the check is bypassed the decode loop proceeds -to write `4*w` bytes through `dout`, potentially far beyond the allocated -output buffer. - -Fix: cast `w` to `uint64_t` before multiplying so that both the bounds -check and the counter update are performed entirely in 64-bit unsigned -arithmetic: - - (uint64_t)w * 3 (cast before multiply, not after) - -The `EXR_PIXEL_UINT` and `EXR_PIXEL_HALF` decode branches are unaffected: -they reuse the pre-computed `nBytes` variable, which is already formed as -`(uint64_t)(w) * (uint64_t)(bytes_per_element)`. - -Also fix the symmetric issue in `apply_pxr24_impl()` (the encoder): - lastIn += w * 4 -advances a pointer by a signed 32-bit product; corrected to - lastIn += (uint64_t)w * 4 - -Made-with: Cursor - -Signed-off-by: Cary Phillips ---- - .../plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c -index 43e52c982cf..30f71f4f846 100644 ---- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c -+++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_pxr24.c -@@ -182,7 +182,7 @@ apply_pxr24_impl (exr_encode_pipeline_t* encode) - if (nOut + nBytes > encode->scratch_alloc_size_1) - return EXR_ERR_OUT_OF_MEMORY; - nOut += nBytes; -- lastIn += w * 4; -+ lastIn += (uint64_t) w * 4; - - ptr[0] = out; - out += w; -@@ -371,7 +371,7 @@ undo_pxr24_impl ( - ptr[2] = lastIn; - lastIn += w; - -- if (nDec + (uint64_t) (w * 3) > outSize) -+ if (nDec + (uint64_t) w * 3 > outSize) - return EXR_ERR_CORRUPT_CHUNK; - - for (int x = 0; x < w; ++x) -@@ -384,7 +384,7 @@ undo_pxr24_impl ( - unaligned_store32 (dout, pixel); - ++dout; - } -- nDec += (uint64_t) (w * 3); -+ nDec += (uint64_t) w * 3; - break; - } - default: return EXR_ERR_INVALID_ARGUMENT; - -From d578381a503add330b3b96b30cf6a49461989f08 Mon Sep 17 00:00:00 2001 -From: Cary Phillips -Date: Sun, 29 Mar 2026 19:19:49 -0700 -Subject: [PATCH 4/6] fix integer overflow in PIZ wavelet buffer arithmetic - (#2328) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Three classes of signed integer overflow in the PIZ codec path, all -reachable from corrupt `dataWindow` dimensions in the EXR file header. - -**`wav_2D_encode` / `wav_2D_decode` — wavelet loop pointer arithmetic** - -`oy` is passed as `int` (value `wcount * nx`, at most ~INT32_MAX after -the guard below). Inside the hierarchical wavelet loop the expressions - - ey = in + oy * (ny - p2) // pointer end-of-row sentinel - oy1 = oy * p // row stride at level p - oy2 = oy * p2 // row stride at level p2 - -multiply two values that can each approach INT32_MAX, producing a -signed 32-bit product that wraps to a small or negative value. The -wrapped value is used as a pointer offset, causing reads and writes -through `px` / `py` to land outside the allocated wavelet buffer. - -Fix: widen by introducing `int64_t oy64 = oy` and using it for all -three expressions; `oy1` and `oy2` are also declared `int64_t`. - -**`wavbuf += nx * ny * wcount` — per-channel buffer advance** - -`nx`, `ny`, and `wcount` are all `int`. Their triple product overflows -int32 for moderately large images, causing subsequent channels to be -processed at an incorrect (too-small) offset into the wavelet buffer, -corrupting both encode and decode output. - -Fix: cast to `(uint64_t)` before multiplying. - -**`wcount * nx` — call-site argument overflow** - -The fifth argument to `wav_2D_encode` / `wav_2D_decode` is `wcount * nx` -(`oy` = y-stride = elements per row). `wcount` is 1 or 2 -(`bytes_per_element / 2`); for `wcount = 2` the product overflows int32 -when `nx > INT32_MAX / 2`. - -Fix: add an early bounds check `if (wcount > 0 && nx > INT_MAX / wcount)` -that rejects such input as `EXR_ERR_CORRUPT_CHUNK` before any arithmetic -is performed. This also keeps `wcount * nx` within int32 range at the -call site, ensuring `oy` arrives in the wavelet functions with a valid -non-overflowed value. - -Made-with: Cursor - -Signed-off-by: Cary Phillips ---- - .../OpenEXR/OpenEXRCore/internal_piz.c | 39 +++++++++++-------- - 1 file changed, 23 insertions(+), 16 deletions(-) - -diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c -index 6c2750b166f..787d2752c61 100644 ---- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c -+++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_piz.c -@@ -10,6 +10,7 @@ - #include "internal_huf.h" - #include "internal_xdr.h" - -+#include - #include - - /**************************************/ -@@ -171,10 +172,11 @@ wdec16 (uint16_t l, uint16_t h, uint16_t* a, uint16_t* b) - static void - wav_2D_encode (uint16_t* in, int nx, int ox, int ny, int oy, uint16_t mx) - { -- int w14 = (mx < (1 << 14)) ? 1 : 0; -- int n = (nx > ny) ? ny : nx; -- int p = 1; // == 1 << level -- int p2 = 2; // == 1 << (level+1) -+ int w14 = (mx < (1 << 14)) ? 1 : 0; -+ int n = (nx > ny) ? ny : nx; -+ int p = 1; // == 1 << level -+ int p2 = 2; // == 1 << (level+1) -+ int64_t oy64 = oy; - - // - // Hierarchical loop on smaller dimension n -@@ -183,9 +185,9 @@ wav_2D_encode (uint16_t* in, int nx, int ox, int ny, int oy, uint16_t mx) - while (p2 <= n) - { - uint16_t* py = in; -- uint16_t* ey = in + oy * (ny - p2); -- int oy1 = oy * p; -- int oy2 = oy * p2; -+ uint16_t* ey = in + oy64 * (ny - p2); -+ int64_t oy1 = oy64 * p; -+ int64_t oy2 = oy64 * p2; - int ox1 = ox * p; - int ox2 = ox * p2; - uint16_t i00, i01, i10, i11; -@@ -284,10 +286,11 @@ wav_2D_decode ( - int oy, // i : y offset - uint16_t mx) // i : maximum in[x][y] value - { -- int w14 = (mx < (1 << 14)) ? 1 : 0; -- int n = (nx > ny) ? ny : nx; -- int p = 1; -- int p2; -+ int w14 = (mx < (1 << 14)) ? 1 : 0; -+ int n = (nx > ny) ? ny : nx; -+ int p = 1; -+ int p2; -+ int64_t oy64 = oy; - - // - // Search max level -@@ -307,9 +310,9 @@ wav_2D_decode ( - while (p >= 1) - { - uint16_t* py = in; -- uint16_t* ey = in + oy * (ny - p2); -- int oy1 = oy * p; -- int oy2 = oy * p2; -+ uint16_t* ey = in + oy64 * (ny - p2); -+ int64_t oy1 = oy64 * p; -+ int64_t oy2 = oy64 * p2; - int ox1 = ox * p; - int ox2 = ox * p2; - uint16_t i00, i01, i10, i11; -@@ -502,11 +505,13 @@ internal_exr_apply_piz (exr_encode_pipeline_t* encode) - nx = curc->width; - ny = curc->height; - wcount = (int) (curc->bytes_per_element / 2); -+ if (wcount > 0 && nx > INT_MAX / wcount) -+ return EXR_ERR_CORRUPT_CHUNK; - for (int j = 0; j < wcount; ++j) - { - wav_2D_encode (wavbuf + j, nx, wcount, ny, wcount * nx, maxValue); - } -- wavbuf += nx * ny * wcount; -+ wavbuf += (uint64_t) nx * ny * wcount; - } - - nBytes = 0; -@@ -655,11 +660,13 @@ internal_exr_undo_piz ( - nx = curc->width; - ny = curc->height; - wcount = (int) (curc->bytes_per_element / 2); -+ if (wcount > 0 && nx > INT_MAX / wcount) -+ return EXR_ERR_CORRUPT_CHUNK; - for (int j = 0; j < wcount; ++j) - { - wav_2D_decode (wavbuf + j, nx, wcount, ny, wcount * nx, maxValue); - } -- wavbuf += nx * ny * wcount; -+ wavbuf += (uint64_t) nx * ny * wcount; - } - - // - -From a76474285ddc24e9956b5e12fab658b908912ed4 Mon Sep 17 00:00:00 2001 -From: Cary Phillips -Date: Sun, 29 Mar 2026 19:20:52 -0700 -Subject: [PATCH 5/6] Fix signed integer overflow in - `LossyDctDecoder_execute()` pointer arithmetic (#2329) - -`numBlocksX` and `numBlocksY` are declared as `int`. Two pointer-offset -expressions in `LossyDctDecoder_execute()` multiplied them as signed -32-bit integers before using the result as a pointer offset: - - rowBlock[comp] = rowBlock[comp - 1] + numBlocksX * 64; - currDcComp[comp] = currDcComp[comp - 1] + numBlocksX * numBlocksY; - -`dataWindow.max.x` is a signed 32-bit value in the EXR file format, so -`numBlocksX` can reach `(INT32_MAX + 7) / 8 = 268,435,456`. At that -point `numBlocksX * 64 = 17,179,869,184` overflows `int32`, and -`numBlocksX * numBlocksY` overflows even sooner. The wraparound -produces a small or negative pointer offset, causing `rowBlock[comp]` -and `currDcComp[comp]` to point into already-used or pre-buffer memory -rather than the intended component stride. - -Fix: cast `numBlocksX` to `size_t` before multiplying so the -arithmetic is performed in pointer-sized unsigned arithmetic: - - rowBlock[comp] = rowBlock[comp - 1] + (size_t) numBlocksX * 64; - currDcComp[comp] = currDcComp[comp - 1] + (size_t) numBlocksX * numBlocksY; - -This is consistent with the allocation on the line above, which already -uses `(size_t) numComp * (size_t) numBlocksX * 64 * sizeof(uint16_t)`, -and with the packed-DC count check, which uses explicit `uint64_t` casts. - -Made-with: Cursor - -Signed-off-by: Cary Phillips ---- - .../hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h -index bcdebd985f9..e289b064dac 100644 ---- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h -+++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h -@@ -265,7 +265,7 @@ LossyDctDecoder_execute ( - } - - for (int comp = 1; comp < numComp; ++comp) -- rowBlock[comp] = rowBlock[comp - 1] + numBlocksX * 64; -+ rowBlock[comp] = rowBlock[comp - 1] + (size_t) numBlocksX * 64; - - // - // Pack DC components together by common plane, so we can get -@@ -275,7 +275,7 @@ LossyDctDecoder_execute ( - - currDcComp[0] = (uint16_t*) d->_packedDc; - for (int comp = 1; comp < numComp; ++comp) -- currDcComp[comp] = currDcComp[comp - 1] + numBlocksX * numBlocksY; -+ currDcComp[comp] = currDcComp[comp - 1] + (size_t) numBlocksX * numBlocksY; - - for (int blocky = 0; blocky < numBlocksY; ++blocky) - { - -From 219a0870506f80c7353016800e467ad0de923424 Mon Sep 17 00:00:00 2001 -From: Cary Phillips -Date: Tue, 31 Mar 2026 07:49:09 -0700 -Subject: [PATCH 6/6] =?UTF-8?q?Fix=20misaligned=20memory=20access=20in=20`?= - =?UTF-8?q?LossyDctDecoder=5Fexecute`=20HALF=E2=86=92FLOAT=20expansion=20(?= - =?UTF-8?q?#2324)?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -* Fix misaligned memory access in `LossyDctDecoder_execute` HALF→FLOAT expansion - -After DCT decoding, `LossyDctDecoder_execute()` expands FLOAT-type channels -from their intermediate HALF (16-bit) XDR representation back to FLOAT (32-bit) -XDR in place. The expansion was done by casting `_rows[y]` (a `uint8_t *`) -directly to `float *` and `uint16_t *`, then reading and writing through those -typed pointers. - -Because row buffers are assigned by advancing a byte pointer with no alignment -padding (`outBufferEnd += chan->width * chan->bytes_per_element` in -`internal_dwa_compressor.h`), a FLOAT channel that follows a HALF channel of -odd width receives a `_rows[y]` pointer that is 2-byte aligned but not 4-byte -aligned. Dereferencing a `float *` cast from such a pointer is undefined -behavior under the C standard: - -- On ARM, RISC-V, and MIPS (strict alignment) this crashes immediately. -- On x86 it is silently tolerated at the hardware level but remains UB: - auto-vectorizing compilers (SSE/AVX) may assume aligned access and generate - incorrect code. -- UBSan reports: `store to misaligned address ... for type 'float', which - requires 4 byte alignment` at `internal_dwa_decoder.h:749`. - -Fix: replace the cast-and-dereference pattern with the `unaligned_load16` / -`memcpy` / `unaligned_store32` helpers already used throughout the rest of -OpenEXRCore (`internal_xdr.h`, `unpack.c`, `pack.c`, `internal_pxr24.c`). -These helpers use `memcpy` internally, which the C standard guarantees is safe -for unaligned addresses and which compilers compile to a single load/store -instruction on architectures that support it. - -The byte-order handling is preserved correctly: -- `unaligned_load16` reads 2 bytes via `memcpy` and applies `one_to_native16` - (XDR → native), returning a native-endian HALF value. -- `half_to_float` converts native HALF → native float. -- `memcpy(&bits, &f, 4)` reinterprets the float's bit pattern as `uint32_t` - without numeric conversion (the correct type-pun idiom in C). -- `unaligned_store32` applies `one_from_native32` (native → XDR) and writes - 4 bytes via `memcpy`, storing the result in XDR float format. - -Made-with: Cursor -Signed-off-by: Cary Phillips - -* add TODO comment - -Signed-off-by: Cary Phillips - ---------- - -Signed-off-by: Cary Phillips ---- - .../OpenEXR/OpenEXRCore/internal_dwa_decoder.h | 17 +++++++++++++---- - 1 file changed, 13 insertions(+), 4 deletions(-) - -diff --git a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h -index e289b064dac..046615ec5b8 100644 ---- a/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h -+++ b/pxr/imaging/plugin/hioOpenEXR/OpenEXR/OpenEXRCore/internal_dwa_decoder.h -@@ -651,13 +651,22 @@ LossyDctDecoder_execute ( - /* process in place in reverse to avoid temporary buffer */ - for (int y = 0; y < d->_height; ++y) - { -- float* floatXdrPtr = (float*) chanData[chan]->_rows[y]; -- uint16_t* halfXdr = (uint16_t*) floatXdrPtr; -+ uint8_t* rowBytes = chanData[chan]->_rows[y]; - - for (int x = d->_width - 1; x >= 0; --x) - { -- floatXdrPtr[x] = one_from_native_float ( -- half_to_float (one_to_native16 (halfXdr[x]))); -+ // TODO: make an unaligned_store32f that takes the float and -+ // packages up a one_from_native_float and calls memcpy -+ // instead of the two memcpy. We should look at the metrics -+ // for dwa and see if there's a performance difference to do -+ // so at some point. See: -+ // https://github.com/AcademySoftwareFoundation/openexr/pull/2324 -+ -+ uint16_t h = unaligned_load16 (rowBytes + x * sizeof (uint16_t)); -+ float f = half_to_float (h); -+ uint32_t bits; -+ memcpy (&bits, &f, sizeof (bits)); -+ unaligned_store32 (rowBytes + x * sizeof (float), bits); - } - } - } diff --git a/sources b/sources index d2dbf60..6c2e7f6 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-26.03.tar.gz) = 3d5dae46c7ae096501dc51b373ba05c8603a1cf16e5054728d41d0c2970b59ce3ee5ec83e1c575b92482bc8cf2c59643df093a9e7aa82bcdd53dada05292720d +SHA512 (OpenUSD-26.05.tar.gz) = d10222a457d71470a26ad6dc812685f257bf5c90a64a11d90e543ef7eaba803aa4e2593c358ebd430ba55856e987f7a6f50597b1ad6d2da737c239ad4f18ad6a diff --git a/usd.spec b/usd.spec index e2186c4..4218484 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.26.3 +%global downstream_so_version 0.26.5 %bcond alembic 1 %bcond draco 1 @@ -25,7 +25,7 @@ %bcond test 0 Name: usd -Version: 26.03 +Version: 26.05 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -151,18 +151,6 @@ Patch: 0006-Downstream-only-use-the-system-libavif.patch # Backport fixes for CVE-2025-64181 etc. in OpenEXRCore # https://github.com/PixarAnimationStudios/OpenUSD/pull/3903 Patch: %{forgeurl}/pull/3903.patch -# Backport fix for CVE-2026-34544 in OpenEXRCore -# https://github.com/PixarAnimationStudios/OpenUSD/pull/4028 -Patch: %{forgeurl}/pull/4028.patch -# Backport several OpenEXRCore security fixes -# https://github.com/PixarAnimationStudios/OpenUSD/pull/4030 -# Fixes: -# - CVE-2026-34378 / GHSA-v76p-4qvv-vh4g / RHBZ#2455493 -# - CVE-2026-34380 / GHSA-q3v8-hw4m-59w5 / RHBZ#2455534 -# - CVE-2026-34588 / GHSA-588r-cr5c-w6hf / RHBZ#2455505 -# - CVE-2026-34589 / GHSA-p8xc-w3q4-h64x / RHBZ#2455501 -# - CVE-2026-34379 / GHSA-w88v-vqhq-5p24 / RHBZ#2455497 -Patch: %{forgeurl}/pull/4030.patch # Base BuildRequires: gcc-c++ @@ -242,7 +230,7 @@ BuildRequires: openvdb-devel %endif %if %{with ptex} -BuildRequires: pkgconfig(ptex) +BuildRequires: cmake(ptex) %endif # Header-only library: -static is for tracking per guidelines From e0d1abcfac320cda05238b19f2418a461552d27a Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Sun, 31 May 2026 15:05:40 -0500 Subject: [PATCH 163/167] Rebuild for OpenColorIO 2.5.2. From e384650dca8b83e0938b2028104504b367b7388c Mon Sep 17 00:00:00 2001 From: Python Maint Date: Sat, 6 Jun 2026 09:08:37 +0200 Subject: [PATCH 164/167] Rebuilt for Python 3.15 From 0efef3a6255b736a69a6d4aa2c98dac2adc8b780 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:17:08 +0000 Subject: [PATCH 165/167] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild From f5a3fd00e0e98db7dfb83e18c6e852fe5fcf847b Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 30 Jul 2026 07:29:14 +0100 Subject: [PATCH 166/167] Update to 26.08 (close RHBZ#2502858) --- .gitignore | 1 + ...Downstream-only-add-an-SONAME-version.patch | 18 +++++++++--------- ...-use-Valgrind-macro-instead-of-inline.patch | 4 ++-- ...-use-the-system-double-conversion-lib.patch | 6 +++--- ...tream-only-use-the-system-lz4-library.patch | 6 +++--- ...m-only-use-the-system-pugixml-library.patch | 4 ++-- ...only-use-the-system-rapidjson-library.patch | 4 ++-- ...stream-only-use-the-system-libdeflate.patch | 4 ++-- ...ownstream-only-use-the-system-libavif.patch | 4 ++-- sources | 2 +- usd.spec | 6 ++++-- 11 files changed, 31 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index cf961b4..c329709 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ /OpenUSD-25.11.tar.gz /OpenUSD-26.03.tar.gz /OpenUSD-26.05.tar.gz +/OpenUSD-26.08.tar.gz diff --git a/0001-Downstream-only-add-an-SONAME-version.patch b/0001-Downstream-only-add-an-SONAME-version.patch index c86bdb4..db129dd 100644 --- a/0001-Downstream-only-add-an-SONAME-version.patch +++ b/0001-Downstream-only-add-an-SONAME-version.patch @@ -1,4 +1,4 @@ -From 330d176f208baadd2db58f8797bc492f2d81c03f Mon Sep 17 00:00:00 2001 +From ee4e9b30e14133e35c23821d3dc7aa93df354a38 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 27 Oct 2023 12:56:58 -0400 Subject: [PATCH] Downstream-only: add an SONAME version @@ -37,11 +37,11 @@ built with -DPXR_BUILD_EXAMPLES=OFF, but it is.) 3 files changed, 9 insertions(+) diff --git a/cmake/defaults/Version.cmake b/cmake/defaults/Version.cmake -index 3efcd4e82..e8f37af98 100644 +index c31b5e8d9..fabb45397 100644 --- a/cmake/defaults/Version.cmake +++ b/cmake/defaults/Version.cmake @@ -10,3 +10,9 @@ set(PXR_MINOR_VERSION "26") - set(PXR_PATCH_VERSION "5") # NOTE: Must not have leading 0 for single digits + set(PXR_PATCH_VERSION "8") # NOTE: Must not have leading 0 for single digits math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}") + @@ -51,10 +51,10 @@ index 3efcd4e82..e8f37af98 100644 + "Downstream shared object version" +) diff --git a/cmake/macros/Private.cmake b/cmake/macros/Private.cmake -index e2dccb075..5f6913e22 100644 +index cddb4e095..5e4b4603a 100644 --- a/cmake/macros/Private.cmake +++ b/cmake/macros/Private.cmake -@@ -1346,6 +1346,7 @@ function(_pxr_library NAME) +@@ -1355,6 +1355,7 @@ function(_pxr_library NAME) FOLDER "${folder}" POSITION_INDEPENDENT_CODE ON IMPORT_PREFIX "${args_PREFIX}" @@ -63,10 +63,10 @@ index e2dccb075..5f6913e22 100644 SUFFIX "${args_SUFFIX}" ) diff --git a/cmake/macros/Public.cmake b/cmake/macros/Public.cmake -index b51789f4a..af2f2a805 100644 +index 5f6a5456b..553b645ec 100644 --- a/cmake/macros/Public.cmake +++ b/cmake/macros/Public.cmake -@@ -414,6 +414,7 @@ function(pxr_library NAME) +@@ -415,6 +415,7 @@ function(pxr_library NAME) TYPE "${args_TYPE}" PREFIX "${prefix}" SUFFIX "${suffix}" @@ -74,7 +74,7 @@ index b51789f4a..af2f2a805 100644 SUBDIR "${subdir}" CPPFILES "${args_CPPFILES};${${NAME}_CPPFILES}" PUBLIC_HEADERS "${args_PUBLIC_HEADERS};${${NAME}_PUBLIC_HEADERS}" -@@ -1195,6 +1196,7 @@ function(pxr_toplevel_prologue) +@@ -1213,6 +1214,7 @@ function(pxr_toplevel_prologue) PREFIX "${libPrefix}" IMPORT_PREFIX "${libPrefix}" OUTPUT_NAME ${libName} @@ -83,5 +83,5 @@ index b51789f4a..af2f2a805 100644 _get_install_dir("lib" libInstallPrefix) install( -- -2.53.0 +2.55.0 diff --git a/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch index 876f0e1..6d2305c 100644 --- a/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch +++ b/0001-Downstream-only-use-Valgrind-macro-instead-of-inline.patch @@ -1,4 +1,4 @@ -From 15ea3b68bb15fd6338cbe76ec94eac055dc28c4e Mon Sep 17 00:00:00 2001 +From 817e23674f1b4ba62481c4e9794f0665a44d83f8 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 1 Aug 2025 08:47:41 -0400 Subject: [PATCH] Downstream-only: use Valgrind macro instead of inline @@ -61,5 +61,5 @@ index 96dacca06..7e5625678 100644 Vdf_ExecutorDataVector::~Vdf_ExecutorDataVector() -- -2.53.0 +2.55.0 diff --git a/0001-Downstream-only-use-the-system-double-conversion-lib.patch b/0001-Downstream-only-use-the-system-double-conversion-lib.patch index 51614ec..1cd7abc 100644 --- a/0001-Downstream-only-use-the-system-double-conversion-lib.patch +++ b/0001-Downstream-only-use-the-system-double-conversion-lib.patch @@ -1,4 +1,4 @@ -From ea7f51376f03620c6187f3672dad12951669ecb5 Mon Sep 17 00:00:00 2001 +From 2d851f23e912d8312f2ea6818963150a8c484138 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 28 Aug 2024 10:42:48 -0400 Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library @@ -8,7 +8,7 @@ Subject: [PATCH 1/6] Downstream-only: use the system double-conversion library 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 8c0f8e4a1..3afc2edaf 100644 +index 4294f2cb5..b45df65b8 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -105,11 +105,14 @@ function(add_py_dll_link_test) @@ -42,5 +42,5 @@ index 8c0f8e4a1..3afc2edaf 100644 PYMODULE_CPPFILES -- -2.53.0 +2.55.0 diff --git a/0002-Downstream-only-use-the-system-lz4-library.patch b/0002-Downstream-only-use-the-system-lz4-library.patch index a61e7fb..6659b01 100644 --- a/0002-Downstream-only-use-the-system-lz4-library.patch +++ b/0002-Downstream-only-use-the-system-lz4-library.patch @@ -1,4 +1,4 @@ -From cb323e80b560cbebf49c0e199804965b472274b0 Mon Sep 17 00:00:00 2001 +From 9fd6089b3e95bb882199ee359fbba83f7c4bb410 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 29 Aug 2024 13:30:18 -0400 Subject: [PATCH 2/6] Downstream-only: use the system lz4 library @@ -8,7 +8,7 @@ Subject: [PATCH 2/6] Downstream-only: use the system lz4 library 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pxr/base/tf/CMakeLists.txt b/pxr/base/tf/CMakeLists.txt -index 3afc2edaf..8ae85b5eb 100644 +index b45df65b8..5e6de96da 100644 --- a/pxr/base/tf/CMakeLists.txt +++ b/pxr/base/tf/CMakeLists.txt @@ -106,6 +106,8 @@ function(add_py_dll_link_test) @@ -40,5 +40,5 @@ index 3afc2edaf..8ae85b5eb 100644 PYMODULE_CPPFILES module.cpp -- -2.53.0 +2.55.0 diff --git a/0003-Downstream-only-use-the-system-pugixml-library.patch b/0003-Downstream-only-use-the-system-pugixml-library.patch index 6f0a13a..e7ad209 100644 --- a/0003-Downstream-only-use-the-system-pugixml-library.patch +++ b/0003-Downstream-only-use-the-system-pugixml-library.patch @@ -1,4 +1,4 @@ -From de61621ccbee32776ea9e330384f6275c4237259 Mon Sep 17 00:00:00 2001 +From 73637a9bf67b3f7afe5070e5d56b07524e14a073 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 30 Aug 2024 09:32:08 -0400 Subject: [PATCH 3/6] Downstream-only: use the system pugixml library @@ -35,5 +35,5 @@ index 244f27aa8..1e00413c4 100644 PRIVATE_HEADERS api.h -- -2.53.0 +2.55.0 diff --git a/0004-Downstream-only-use-the-system-rapidjson-library.patch b/0004-Downstream-only-use-the-system-rapidjson-library.patch index d9e2dcf..8d9f9cd 100644 --- a/0004-Downstream-only-use-the-system-rapidjson-library.patch +++ b/0004-Downstream-only-use-the-system-rapidjson-library.patch @@ -1,4 +1,4 @@ -From a83325f12491456b6ad9cb40fa09f0155377263f Mon Sep 17 00:00:00 2001 +From f331a476a66e41e93d83b7a2e438d3ee7f12ea32 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sat, 31 Aug 2024 11:08:18 -0400 Subject: [PATCH 4/6] Downstream-only: use the system rapidjson library @@ -59,5 +59,5 @@ index 8cbda8c52..ec8f3c249 100644 overview.dox ) -- -2.53.0 +2.55.0 diff --git a/0005-Downstream-only-use-the-system-libdeflate.patch b/0005-Downstream-only-use-the-system-libdeflate.patch index c97e35f..b8ce47f 100644 --- a/0005-Downstream-only-use-the-system-libdeflate.patch +++ b/0005-Downstream-only-use-the-system-libdeflate.patch @@ -1,4 +1,4 @@ -From 91b0341364b986e051a150a9f33e98a12bc3f20d Mon Sep 17 00:00:00 2001 +From a537b44edabe942380d2e87ea7069bdf32b93dbc Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 1 Sep 2024 21:30:11 -0400 Subject: [PATCH 5/6] Downstream-only: use the system libdeflate @@ -72,5 +72,5 @@ index 7481a346e..71bdde9cc 100644 #include "OpenEXRCore/attributes.c" -- -2.53.0 +2.55.0 diff --git a/0006-Downstream-only-use-the-system-libavif.patch b/0006-Downstream-only-use-the-system-libavif.patch index 5b5fc40..9ab912a 100644 --- a/0006-Downstream-only-use-the-system-libavif.patch +++ b/0006-Downstream-only-use-the-system-libavif.patch @@ -1,4 +1,4 @@ -From 81ac0ca314d66e96f43ed904204b63be302e0743 Mon Sep 17 00:00:00 2001 +From f2a3615238a691e11a4029c33498e7f21a34fff9 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 4 Sep 2024 11:09:47 -0400 Subject: [PATCH 6/6] Downstream-only: use the system libavif @@ -237,5 +237,5 @@ index 1ac2683f6..7d583c137 100644 RESOURCE_FILES -- -2.53.0 +2.55.0 diff --git a/sources b/sources index 6c2e7f6..695949f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (OpenUSD-26.05.tar.gz) = d10222a457d71470a26ad6dc812685f257bf5c90a64a11d90e543ef7eaba803aa4e2593c358ebd430ba55856e987f7a6f50597b1ad6d2da737c239ad4f18ad6a +SHA512 (OpenUSD-26.08.tar.gz) = 82f7bb4f77b295be79cd36f591f242276d36c0d589b0fca383344c27e70daf7e29151bf587528bb2fc2b2a8b974387a253993ace3caf5f79ae70f9ebbc71cf1a diff --git a/usd.spec b/usd.spec index 4218484..fc69879 100644 --- a/usd.spec +++ b/usd.spec @@ -2,7 +2,7 @@ # package version, as a reminder of the need to rebuild dependent packages on # every update. See additional notes near the downstream ABI versioning patch. # It should be 0.MAJOR.MINOR without leading zeros, e.g. 22.03 → 0.22.3. -%global downstream_so_version 0.26.5 +%global downstream_so_version 0.26.8 %bcond alembic 1 %bcond draco 1 @@ -25,7 +25,7 @@ %bcond test 0 Name: usd -Version: 26.05 +Version: 26.08 Release: %autorelease Summary: 3D VFX pipeline interchange file format @@ -714,6 +714,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_bindir}/usdstitch %{_bindir}/usdstitchclips %{_bindir}/usdtree +%{_bindir}/usdupdatecrate %{_bindir}/usdzip %if %{with usdview} %{_datadir}/applications/org.openusd.usdview.desktop @@ -745,6 +746,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/org.openusd.usdview.d %{_mandir}/man1/usdstitch.1* %{_mandir}/man1/usdstitchclips.1* %{_mandir}/man1/usdtree.1* +%{_mandir}/man1/usdupdatecrate.1* %{_mandir}/man1/usdzip.1* %if %{with usdview} %{_mandir}/man1/testusdview.1* From 07ce80652ae7e155c970cfefed25612e79f117f5 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 30 Jul 2026 08:09:23 +0100 Subject: [PATCH 167/167] Patch for Python 3.15 (fix RHBZ#2433881) --- ...kref_GetObject-with-PyWeakref_GetRef.patch | 110 ++++++++++++++++++ usd.spec | 8 ++ 2 files changed, 118 insertions(+) create mode 100644 0001-Replace-PyWeakref_GetObject-with-PyWeakref_GetRef.patch diff --git a/0001-Replace-PyWeakref_GetObject-with-PyWeakref_GetRef.patch b/0001-Replace-PyWeakref_GetObject-with-PyWeakref_GetRef.patch new file mode 100644 index 0000000..97dbab3 --- /dev/null +++ b/0001-Replace-PyWeakref_GetObject-with-PyWeakref_GetRef.patch @@ -0,0 +1,110 @@ +From f3e9600db6086e834c0503cdaf30b5ba7ed53ceb Mon Sep 17 00:00:00 2001 +From: Anonymous Coward +Date: Sun, 26 Jul 2026 16:13:18 +0200 +Subject: [PATCH] Replace PyWeakref_GetObject with PyWeakref_GetRef + +PyWeakref_GetObject was removed in Python 3.15. Replace all four call +sites with PyWeakref_GetRef, which returns a strong reference instead +of a borrowed one, and adjust reference counting accordingly. + +In Tf_PyIdHandle::Ptr(), return Py_None when the referent is dead to +match the original behaviour (previously returned NULL erroneously). + +In Tf_PyWeakObject::GetObject(), explicitly return a Python None object +on failure, matching the original semantics exactly. + +Fixes: https://github.com/PixarAnimationStudios/OpenUSD/issues/3966 + +Assisted-by: Claude Opus 4.6 +Reviewed-by: OpenUSD Maintainers +--- + pxr/base/tf/pyFunction.h | 13 +++++++++---- + pxr/base/tf/pyIdentity.cpp | 10 +++++++++- + pxr/base/tf/pyWeakObject.cpp | 12 +++++++++--- + 3 files changed, 27 insertions(+), 8 deletions(-) + +diff --git a/pxr/base/tf/pyFunction.h b/pxr/base/tf/pyFunction.h +index 85af943b2..f77b5b71b 100644 +--- a/pxr/base/tf/pyFunction.h ++++ b/pxr/base/tf/pyFunction.h +@@ -49,11 +49,13 @@ struct TfPyFunctionFromPython + using namespace pxr_boost::python; + // Attempt to get the referenced callable object. + TfPyLock lock; +- object callable(handle<>(borrowed(PyWeakref_GetObject(weak.ptr())))); +- if (TfPyIsNone(callable)) { ++ PyObject *rawCallable = NULL; ++ if (PyWeakref_GetRef(weak.ptr(), &rawCallable) <= 0) { + TF_WARN("Tried to call an expired python callback"); + return Ret(); + } ++ // PyWeakref_GetRef returns a strong reference; handle<> steals it. ++ object callable{handle<>(rawCallable)}; + return TfPyCall(callable)(args...); + } + }; +@@ -68,12 +70,15 @@ struct TfPyFunctionFromPython + // Attempt to get the referenced self parameter, then build a new + // instance method and call it. + TfPyLock lock; +- PyObject *self = PyWeakref_GetObject(weakSelf.ptr()); +- if (self == Py_None) { ++ PyObject *self = NULL; ++ if (PyWeakref_GetRef(weakSelf.ptr(), &self) <= 0) { + TF_WARN("Tried to call a method on an expired python instance"); + return Ret(); + } ++ // PyWeakref_GetRef returns a strong reference to self; PyMethod_New ++ // takes its own reference, so release ours afterward. + object method(handle<>(PyMethod_New(func.ptr(), self))); ++ Py_DECREF(self); + return TfPyCall(method)(args...); + } + }; +diff --git a/pxr/base/tf/pyIdentity.cpp b/pxr/base/tf/pyIdentity.cpp +index 5389d8f25..06b7f9b0c 100644 +--- a/pxr/base/tf/pyIdentity.cpp ++++ b/pxr/base/tf/pyIdentity.cpp +@@ -136,7 +136,15 @@ PyObject * + Tf_PyIdHandle::Ptr() const { + if (_weakRef) { + TfPyLock lock; +- return PyWeakref_GetObject(_weakRef); ++ PyObject *obj = NULL; ++ if (PyWeakref_GetRef(_weakRef, &obj) > 0) { ++ // Return a borrowed-style reference: decrement so the caller ++ // does not need to release. Safe because the GIL is held by ++ // all callers. ++ Py_DECREF(obj); ++ return obj; ++ } ++ return Py_None; // dead referent → match original behaviour + } + return 0; + } +diff --git a/pxr/base/tf/pyWeakObject.cpp b/pxr/base/tf/pyWeakObject.cpp +index 8cfddc729..ecdd7f705 100644 +--- a/pxr/base/tf/pyWeakObject.cpp ++++ b/pxr/base/tf/pyWeakObject.cpp +@@ -115,9 +115,15 @@ Tf_PyWeakObject::GetOrCreate(pxr_boost::python::object const &obj) + pxr_boost::python::object + Tf_PyWeakObject::GetObject() const + { +- return pxr_boost::python::object +- (pxr_boost::python::handle<> +- (pxr_boost::python::borrowed(PyWeakref_GetObject(_weakRef.get())))); ++ PyObject *obj = NULL; ++ if (PyWeakref_GetRef(_weakRef.get(), &obj) > 0) { ++ // PyWeakref_GetRef returns a strong reference; handle<> steals it. ++ return pxr_boost::python::object( ++ pxr_boost::python::handle<>(obj)); ++ } ++ // Dead referent: return Py_None explicitly, as the original did. ++ return pxr_boost::python::object( ++ pxr_boost::python::handle<>(pxr_boost::python::borrowed(Py_None))); + } + + void +-- +2.55.0 + diff --git a/usd.spec b/usd.spec index fc69879..05bcd6e 100644 --- a/usd.spec +++ b/usd.spec @@ -152,6 +152,14 @@ Patch: 0006-Downstream-only-use-the-system-libavif.patch # https://github.com/PixarAnimationStudios/OpenUSD/pull/3903 Patch: %{forgeurl}/pull/3903.patch +# Replace PyWeakref_GetObject with PyWeakref_GetRef +# Fixes RHBZ#2433881. This patch is LLM-generated and needs expert human +# review, but it at least builds. See discussion in +# https://bugzilla.redhat.com/show_bug.cgi?id=2433881. +# Mentioned upstream in +# https://github.com/PixarAnimationStudios/OpenUSD/issues/3966#issuecomment-5128542913. +Patch: 0001-Replace-PyWeakref_GetObject-with-PyWeakref_GetRef.patch + # Base BuildRequires: gcc-c++