diff --git a/graphics/openusd/Makefile b/graphics/openusd/Makefile index bf7870f7f99c..788895a9c21c 100644 --- a/graphics/openusd/Makefile +++ b/graphics/openusd/Makefile @@ -1,69 +1,69 @@ PORTNAME= openusd DISTVERSIONPREFIX= v DISTVERSION= 26.05 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics MAINTAINER= yuri@FreeBSD.org COMMENT= Universal Scene Description is a scene description management system WWW= http://www.openusd.org/ LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE.txt ONLY_FOR_ARCHS= aarch64 amd64 ONLY_FOR_ARCHS_REASON= CMakeLists.txt fails for non-64-bit architectures: Compiler does not support 64-bit builds; also: pxr/base/arch/defines.h:69:2: error: "Unsupported architecture. x86_64 or ARM64 required." BROKEN_aarch64= fails to build: see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293845 LIB_DEPENDS= libtbb.so:devel/onetbb USES= cmake python:test USE_GITHUB= yes GH_ACCOUNT= PixarAnimationStudios GH_PROJECT= OpenUSD USE_LDCONFIG= yes CMAKE_OFF= PXR_BUILD_EXAMPLES PXR_BUILD_TESTS PXR_BUILD_TUTORIALS \ PXR_ENABLE_PYTHON_SUPPORT OPTIONS_DEFINE= IMAGING MONOLITHIC PYTHON TOOLS OPTIONS_DEFAULT= IMAGING MONOLITHIC TOOLS OPTIONS_SUB= yes IMAGING_DESC= Build imaging components MONOLITHIC_DESC= Build a monolithic library (required for blender) PYTHON_DESC= Build Python bindings for testing TOOLS_DESC= Build commandline tools IMAGING_LIB_DEPENDS= libosdCPU.so:graphics/opensubdiv \ libosdGPU.so:graphics/opensubdiv IMAGING_USES= gl xorg IMAGING_USE= GL=gl XORG=ice,sm,x11,xext IMAGING_CMAKE_BOOL= PXR_BUILD_IMAGING IMAGING_CMAKE_ON= -DPTEX_INCLUDE_DIR=${LOCALBASE}/include MONOLITHIC_CMAKE_BOOL= PXR_BUILD_MONOLITHIC PYTHON_CMAKE_BOOL= PXR_ENABLE_PYTHON_SUPPORT TOOLS_CMAKE_BOOL= PXR_BUILD_USD_TOOLS TEST_ENV= ${MAKE_ENV} \ DISPLAY=${DISPLAY} \ XAUTHORITY=${XAUTHORITY} \ LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib:${LOCALBASE}/lib \ PXR_PLUGINPATH_NAME=${STAGEDIR}${PREFIX}/plugin/usd:${STAGEDIR}${PREFIX}/lib/usd do-test: install # tests are expected to be installed, see https://github.com/PixarAnimationStudios/USD/issues/1707 @${MKDIR} ${BUILD_WRKSRC} && \ cd ${BUILD_WRKSRC} && \ ${SETENV} ${CONFIGURE_ENV} ${TEST_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} \ -DPXR_BUILD_TESTS=ON -DPXR_BUILD_IMAGING=OFF -DPYTHON_EXECUTABLE=${PYTHON_CMD} ${CMAKE_SOURCE_PATH} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} install && \ ${FIND} ${BUILD_WRKSRC} -name CTestTestfile.cmake -type f -exec \ ${REINPLACE_CMD} -e 's|${PREFIX}/tests|${STAGEDIR}${PREFIX}/tests|g' {} + && \ ${SETENV} ${TEST_ENV} ctest -C ${CMAKE_BUILD_TYPE} ${BUILD_WRKSRC} --output-on-failure # tests as of 26.05: 91% tests passed, 27 tests failed out of 312 (TODO: investigate failures) .include diff --git a/graphics/openusd/files/patch-pxr_base_arch_fileSystem.h b/graphics/openusd/files/patch-pxr_base_arch_fileSystem.h index c74a1f4bc931..c493d2d6ea0a 100644 --- a/graphics/openusd/files/patch-pxr_base_arch_fileSystem.h +++ b/graphics/openusd/files/patch-pxr_base_arch_fileSystem.h @@ -1,12 +1,12 @@ ---- pxr/base/arch/fileSystem.h.orig 2025-10-24 16:21:56 UTC +--- pxr/base/arch/fileSystem.h.orig 2026-04-24 18:55:54 UTC +++ pxr/base/arch/fileSystem.h -@@ -28,6 +28,9 @@ +@@ -29,6 +29,9 @@ #include #include #include +#elif defined(ARCH_OS_FREEBSD) +#include +#include #elif defined(ARCH_OS_DARWIN) #include #include diff --git a/graphics/openusd/files/patch-pxr_base_arch_stackTrace.cpp b/graphics/openusd/files/patch-pxr_base_arch_stackTrace.cpp index 580851784f08..cd8b67c06797 100644 --- a/graphics/openusd/files/patch-pxr_base_arch_stackTrace.cpp +++ b/graphics/openusd/files/patch-pxr_base_arch_stackTrace.cpp @@ -1,43 +1,43 @@ ---- pxr/base/arch/stackTrace.cpp.orig 2025-10-24 16:21:56 UTC +--- pxr/base/arch/stackTrace.cpp.orig 2026-04-24 18:55:54 UTC +++ pxr/base/arch/stackTrace.cpp @@ -58,11 +58,11 @@ /* Darwin/ppc did not do stack traces. Darwin/i386 still needs some work, this has been stubbed out for now. */ -#if defined(ARCH_OS_LINUX) +#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_FREEBSD) #include #endif -#if defined(ARCH_OS_LINUX) && defined(ARCH_BITS_64) +#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_FREEBSD) && defined(ARCH_BITS_64) #include #endif @@ -93,7 +93,7 @@ ForkFunc Arch_nonLockingFork = // total hack -- no idea if this will work if we die in malloc... typedef int (*ForkFunc)(void); ForkFunc Arch_nonLockingFork = -#if defined(ARCH_OS_LINUX) +#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_FREEBSD) (ForkFunc)dlsym(RTLD_DEFAULT, "_Fork"); #elif defined(ARCH_OS_DARWIN) || defined(ARCH_OS_WASM_VM) NULL; -@@ -626,7 +626,7 @@ nonLockingFork() +@@ -638,7 +638,7 @@ nonLockingFork() } #endif -#if defined(ARCH_OS_LINUX) +#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_FREEBSD) static int nonLockingLinux__execve (const char *file, char *const argv[], -@@ -1392,7 +1392,7 @@ ArchGetStackFrames(size_t maxDepth, size_t skip, vecto +@@ -1404,7 +1404,7 @@ ArchGetStackFrames(size_t maxDepth, size_t skip, vecto frames->resize(ArchGetStackFrames(maxDepth, skip, frames->data())); } -#if defined(ARCH_OS_LINUX) && defined(ARCH_BITS_64) +#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_FREEBSD) && defined(ARCH_BITS_64) struct Arch_UnwindContext { public: Arch_UnwindContext(size_t maxdepth, size_t skip, uintptr_t* frames) : diff --git a/graphics/openusd/files/patch-pxr_base_arch_systemInfo.cpp b/graphics/openusd/files/patch-pxr_base_arch_systemInfo.cpp index aec6ff8461cf..23743a42dee9 100644 --- a/graphics/openusd/files/patch-pxr_base_arch_systemInfo.cpp +++ b/graphics/openusd/files/patch-pxr_base_arch_systemInfo.cpp @@ -1,64 +1,64 @@ ---- pxr/base/arch/systemInfo.cpp.orig 2025-10-24 16:21:56 UTC +--- pxr/base/arch/systemInfo.cpp.orig 2026-04-24 18:55:54 UTC +++ pxr/base/arch/systemInfo.cpp @@ -15,7 +15,7 @@ #include #include -#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_WASM_VM) +#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_WASM_VM) || defined(ARCH_OS_FREEBSD) #include #include @@ -96,16 +96,23 @@ ArchGetExecutablePath() std::string ArchGetExecutablePath() { -#if defined(ARCH_OS_LINUX) +#if defined(ARCH_OS_LINUX) || defined(ARCH_OS_FREEBSD) +#if defined(ARCH_OS_LINUX) // On Linux the executable path is retrieved from the /proc/self/exe // symlink. +#define SELF_PATHNAME "/proc/self/exe"; +#else + // On FreeBSD the executable path is retrieved from the /proc/curproc/file + // symlink. +#define SELF_PATHNAME "/proc/curproc/file" +#endif return _DynamicSizedRead(ARCH_PATH_MAX, [](char* buffer, size_t* size) { - const ssize_t n = readlink("/proc/self/exe", buffer, *size); + const ssize_t n = readlink(SELF_PATHNAME, buffer, *size); if (n == -1) { - ARCH_WARNING("Unable to read /proc/self/exe to obtain " + ARCH_WARNING("Unable to read " SELF_PATHNAME " to obtain " "executable path"); *size = std::numeric_limits::max(); return false; @@ -113,7 +120,7 @@ ArchGetExecutablePath() else if (static_cast(n) >= *size) { // Find out how much space we need. struct stat sb; - if (lstat("/proc/self/exe", &sb) == 0) { + if (lstat(SELF_PATHNAME, &sb) == 0) { *size = sb.st_size + 1; } else { @@ -127,6 +134,7 @@ ArchGetExecutablePath() return true; } }); +#undef SELF_PATHNAME #elif defined(ARCH_OS_DARWIN) -@@ -177,7 +185,7 @@ ArchGetPageSize() +@@ -180,7 +188,7 @@ ArchGetPageSize() ArchGetPageSize() { #if defined(ARCH_OS_LINUX) || defined(ARCH_OS_DARWIN) || \ - defined(ARCH_OS_WASM_VM) + defined(ARCH_OS_WASM_VM) || defined(ARCH_OS_FREEBSD) return sysconf(_SC_PAGE_SIZE); #elif defined(ARCH_OS_WINDOWS) SYSTEM_INFO info; diff --git a/graphics/openusd/files/patch-pxr_base_tf_diagnostic.cpp b/graphics/openusd/files/patch-pxr_base_tf_diagnostic.cpp index 0c6baa237618..c18d0e10066d 100644 --- a/graphics/openusd/files/patch-pxr_base_tf_diagnostic.cpp +++ b/graphics/openusd/files/patch-pxr_base_tf_diagnostic.cpp @@ -1,10 +1,10 @@ ---- pxr/base/tf/diagnostic.cpp.orig 2025-10-24 16:21:56 UTC +--- pxr/base/tf/diagnostic.cpp.orig 2026-04-24 18:55:54 UTC +++ pxr/base/tf/diagnostic.cpp @@ -20,6 +20,7 @@ #include #include #include +#include - using std::string; - + #if defined(ARCH_OS_WASM_VM) + #include diff --git a/graphics/openusd/files/patch-pxr_imaging_hgi_hgi.cpp b/graphics/openusd/files/patch-pxr_imaging_hgi_hgi.cpp index ec765351b1ac..38e3327e248a 100644 --- a/graphics/openusd/files/patch-pxr_imaging_hgi_hgi.cpp +++ b/graphics/openusd/files/patch-pxr_imaging_hgi_hgi.cpp @@ -1,11 +1,11 @@ ---- pxr/imaging/hgi/hgi.cpp.orig 2025-10-24 16:21:56 UTC +--- pxr/imaging/hgi/hgi.cpp.orig 2026-04-24 18:55:54 UTC +++ pxr/imaging/hgi/hgi.cpp -@@ -54,7 +54,7 @@ _MakeNewPlatformDefaultHgi() +@@ -187,7 +187,7 @@ _MakeNewPlatformDefaultHgi() PlugRegistry& plugReg = PlugRegistry::GetInstance(); const char* hgiType = - #if defined(ARCH_OS_LINUX) + #if defined(ARCH_OS_LINUX) || defined(ARCH_OS_FREEBSD) "HgiGL"; #elif defined(ARCH_OS_DARWIN) "HgiMetal"; diff --git a/graphics/openusd/files/patch-pxr_pxrConfig.cmake.in b/graphics/openusd/files/patch-pxr_pxrConfig.cmake.in new file mode 100644 index 000000000000..020d80e1965d --- /dev/null +++ b/graphics/openusd/files/patch-pxr_pxrConfig.cmake.in @@ -0,0 +1,18 @@ +--- pxr/pxrConfig.cmake.in.orig 2026-04-24 18:55:54 UTC ++++ pxr/pxrConfig.cmake.in +@@ -90,9 +90,14 @@ endif() + find_dependency(MaterialX) + endif() + ++# See https://github.com/PixarAnimationStudios/OpenUSD/issues/3310 ++if(@PXR_ENABLE_GL_SUPPORT@) ++ find_dependency(OpenGL) ++endif() ++ + # Similar to MaterialX above, we are using Imath's cmake package config, so set + # the Imath_DIR accordingly to find the associated import targets which were +-# used for this USD build. ++# used for this USD build. + # Note that we only need to do this, when it is determined by Imath is being + # used instead of OpenExr (refer Packages.cmake) + if(@Imath_FOUND@) diff --git a/graphics/openusd/files/patch-pxr_usd_usd_clip.cpp b/graphics/openusd/files/patch-pxr_usd_usd_clip.cpp index f1e6ecc863e7..d991ed9c4fde 100644 --- a/graphics/openusd/files/patch-pxr_usd_usd_clip.cpp +++ b/graphics/openusd/files/patch-pxr_usd_usd_clip.cpp @@ -1,10 +1,10 @@ ---- pxr/usd/usd/clip.cpp.orig 2025-10-24 16:21:56 UTC +--- pxr/usd/usd/clip.cpp.orig 2026-04-24 18:55:54 UTC +++ pxr/usd/usd/clip.cpp -@@ -28,6 +28,7 @@ - #include "pxr/base/tf/stringUtils.h" +@@ -30,6 +30,7 @@ + #include "pxr/base/vt/arrayEdit.h" #include +#include #include #include #include