From 2d1c5481ee0d012f347b35cdce651c569497fd9d Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 19 Aug 2025 01:26:08 +0000 Subject: [PATCH 1/4] Update usd to v25.08 --- packages/u/usd/xmake.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/u/usd/xmake.lua b/packages/u/usd/xmake.lua index 7544df962c2..8974aeadb57 100644 --- a/packages/u/usd/xmake.lua +++ b/packages/u/usd/xmake.lua @@ -6,6 +6,7 @@ package("usd") add_urls("https://github.com/PixarAnimationStudios/USD/archive/refs/tags/$(version).tar.gz", "https://github.com/PixarAnimationStudios/USD.git") + add_versions("v25.08", "2a93c2390ae35a3e312f3fb66e6f403a0e046893e3f0d706be82963345a08cb3") add_versions("v25.05.01", "f424e8db26e063a1b005423ee52142e75c38185bbd4b8126ef64173e906dd50f") add_versions("v25.05", "231faca9ab71fa63d6c1e0da18bda0c365f82d9bef1cfd4b3d3d6784c8d5fb96") add_versions("v24.08", "6640bb184bf602c6df14fa4a83af6ac5ae1ab8d1d38cf7bb7decfaa9a7ad5d06") From f08587a68da672bb62249a608519f0caa5e1f628 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 26 Aug 2025 11:41:04 +0800 Subject: [PATCH 2/4] add check --- packages/u/usd/xmake.lua | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/u/usd/xmake.lua b/packages/u/usd/xmake.lua index 8974aeadb57..f876c2d9cb1 100644 --- a/packages/u/usd/xmake.lua +++ b/packages/u/usd/xmake.lua @@ -15,9 +15,6 @@ package("usd") add_versions("v23.02", "a8eefff722db0964ce5b11b90bcdc957f3569f1cf1d44c46026ecd229ce7535d") add_versions("v22.11", "f34826475bb9385a9e94e2fe272cc713f517b987cbea15ee6bbc6b21db19aaae") - if is_plat("windows") then - add_configs("debug", {description = "Enable debug symbols.", default = false, type = "boolean", readonly = true}) - end add_configs("shared", {description = "Build shared binaries.", default = true, type = "boolean", readonly = true}) add_configs("monolithic", {description = "Build single shared library", default = false, type = "boolean"}) @@ -36,6 +33,16 @@ package("usd") add_defines("NOMINMAX") end + if on_check then + on_check(function (package) + if package:version() and package:version():eq("25.08") and + is_plat("linux") and package:has_tool("cxx", "clang") then + + raise("package(usd v25.08) unsupported clang toolchain") + end + end) + end + on_load(function (package) if package:version() and package:version():ge("v25.05") then package:add("deps", "tbb") @@ -84,6 +91,9 @@ package("usd") table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release")) table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) table.insert(configs, "-DPXR_BUILD_MONOLITHIC=" .. (package:config("monolithic") and "ON" or "OFF")) + if package:is_plat("windows") then + table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=") + end table.insert(configs, "-DPXR_BUILD_IMAGING=" .. (package:config("image") and "ON" or "OFF")) table.insert(configs, "-DPXR_BUILD_USD_IMAGING=" .. (package:config("image") and "ON" or "OFF")) From e8ca1fe7c4398422bb9c58553b4031fd6c75459b Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 26 Aug 2025 11:41:48 +0800 Subject: [PATCH 3/4] Fix condition check for clang toolchain support --- packages/u/usd/xmake.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/u/usd/xmake.lua b/packages/u/usd/xmake.lua index f876c2d9cb1..12cef735688 100644 --- a/packages/u/usd/xmake.lua +++ b/packages/u/usd/xmake.lua @@ -36,7 +36,7 @@ package("usd") if on_check then on_check(function (package) if package:version() and package:version():eq("25.08") and - is_plat("linux") and package:has_tool("cxx", "clang") then + package:is_plat("linux") and package:has_tool("cxx", "clang") then raise("package(usd v25.08) unsupported clang toolchain") end From 1cd84075caefcda5cebaa15ecc8887f8a9718e41 Mon Sep 17 00:00:00 2001 From: star9029 Date: Tue, 26 Aug 2025 15:19:31 +0800 Subject: [PATCH 4/4] Add MaterialX support configuration --- packages/u/usd/xmake.lua | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/u/usd/xmake.lua b/packages/u/usd/xmake.lua index 12cef735688..3e579a70425 100644 --- a/packages/u/usd/xmake.lua +++ b/packages/u/usd/xmake.lua @@ -21,6 +21,7 @@ package("usd") add_configs("image", {description = "Build imaging components", default = false, type = "boolean"}) add_configs("openimageio", {description = "Build OpenImageIO plugin", default = false, type = "boolean"}) add_configs("opencolorio", {description = "Build OpenColorIO plugin", default = false, type = "boolean"}) + add_configs("materialx", {description = "Enable MaterialX support", default = false, type = "boolean"}) add_configs("vulkan", {description = "Enable Vulkan based components", default = false, type = "boolean"}) add_configs("python", {description = "Enable Python based components for USD", default = false, type = "boolean"}) @@ -35,6 +36,7 @@ package("usd") if on_check then on_check(function (package) + assert(package:is_arch("x64", "x86_64"), "package(usd) only support x86") if package:version() and package:version():eq("25.08") and package:is_plat("linux") and package:has_tool("cxx", "clang") then @@ -65,6 +67,10 @@ package("usd") if package:config("opencolorio") then package:add("deps", "opencolorio") end + if package:config("materialx") then + package:add("deps", "materialx") + end + if package:config("python") then package:add("deps", "python >=3.9") package:addenv("PYTHONPATH", "lib/python") @@ -75,9 +81,12 @@ package("usd") if package:config("tools") then package:addenv("PATH", "bin") end + package:addenv("PATH", "lib") + package:mark_as_pathenv("PXR_PLUGINPATH_NAME") + package:addenv("PXR_PLUGINPATH_NAME", "lib/usd") end) - on_install("linux", "macosx|x86_64", "windows|x64", function (package) + on_install("linux", "macosx", "windows", function (package) local configs = { "-DPXR_BUILD_TESTS=OFF", "-DPXR_BUILD_EXAMPLES=OFF", @@ -99,6 +108,7 @@ package("usd") table.insert(configs, "-DPXR_BUILD_USD_IMAGING=" .. (package:config("image") and "ON" or "OFF")) table.insert(configs, "-DPXR_BUILD_OPENIMAGEIO_PLUGIN=" .. (package:config("openimageio") and "ON" or "OFF")) table.insert(configs, "-DPXR_BUILD_OPENCOLORIO_PLUGIN=" .. (package:config("opencolorio") and "ON" or "OFF")) + table.insert(configs, "-DPXR_ENABLE_MATERIALX_SUPPORT=" .. (package:config("materialx") and "ON" or "OFF")) table.insert(configs, "-DPXR_ENABLE_VULKAN_SUPPORT=" .. (package:config("vulkan") and "ON" or "OFF")) table.insert(configs, "-DPXR_ENABLE_PYTHON_SUPPORT=" .. (package:config("python") and "ON" or "OFF")) @@ -110,8 +120,6 @@ package("usd") opt.cxflags = "-D__TBB_NO_IMPLICIT_LINKAGE" end import("package.tools.cmake").install(package, configs, opt) - -- If use mv, we need to fix `xxx.cmake` file - os.cp(package:installdir("lib/*.dll"), package:installdir("bin")) end) on_test(function (package)