diff --git a/graphics/opensubdiv/Makefile b/graphics/opensubdiv/Makefile index b88fe3ca6844..4cdc6d7a03b7 100644 --- a/graphics/opensubdiv/Makefile +++ b/graphics/opensubdiv/Makefile @@ -1,84 +1,85 @@ PORTNAME= opensubdiv DISTVERSIONPREFIX= v DISTVERSION= 3_7_0 +PORTREVISION= 1 CATEGORIES= graphics MAINTAINER= FreeBSD@Shaneware.biz COMMENT= High performance subdivision surface libraries WWW= https://graphics.pixar.com/opensubdiv LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE.txt BUILD_DEPENDS= glfw>3.0.0:graphics/glfw USES= cmake gl localbase:ldflags USE_GITHUB= yes GH_ACCOUNT= PixarAnimationStudios GH_PROJECT= OpenSubdiv USE_GL= opengl USE_LDCONFIG= yes CMAKE_ON= NO_CLEW NO_CUDA NO_DX NO_METAL PLIST_SUB+= LIBVERS=${PORTVERSION} OPTIONS_DEFINE= DOCS EXAMPLES OPENCL OPENMP PTEX TBB TEST TUTORIALS OPTIONS_DEFAULT= PTEX TBB OPTIONS_DEFAULT_armv6= OPTIONS_DEFAULT_armv7= OPTIONS_DEFAULT_powerpc= OPTIONS_DEFAULT_OTHER_ARCHS= OPENMP OPTIONS_SUB= yes PTEX_DESC= ptex support TBB_DESC= Intel threading building blocks TUTORIALS_DESC= Install tutorial programs DOCS_BUILD_DEPENDS= rst2html:textproc/py-docutils \ doxygen>=1.8.4:devel/doxygen DOCS_USES= python:build DOCS_CMAKE_BOOL_OFF= NO_DOC DOCS_PORTDOCS= * EXAMPLES_LIB_DEPENDS= libglfw.so:graphics/glfw EXAMPLES_USES= xorg EXAMPLES_USE= xorg=ice,sm,x11,xcursor,xext,xi,xinerama,xrandr,xxf86vm EXAMPLES_CMAKE_BOOL_OFF= NO_EXAMPLES OPENCL_BUILD_DEPENDS= ${LOCALBASE}/include/CL/cl.h:devel/opencl OPENCL_LIB_DEPENDS= libOpenCL.so:devel/ocl-icd OPENCL_USE= gl=gl OPENCL_CMAKE_BOOL_OFF= NO_OPENCL OPENCL_CFLAGS= -pthread OPENCL_LDFLAGS= -lGLX OPENMP_CMAKE_BOOL_OFF= NO_OMP PTEX_LIB_DEPENDS= libPtex.so:graphics/ptex PTEX_USES= compiler:c++17-lang PTEX_CMAKE_BOOL_OFF= NO_PTEX PTEX_CMAKE_ON= -DPTEX_INCLUDE_DIR:STRING=${LOCALBASE}/include/ptex \ -DPTEX_LOCATION:STRING=${LOCALBASE} \ -DCMAKE_CXX_STANDARD:INTEGER=17 TBB_LIB_DEPENDS= libtbb.so:devel/onetbb TBB_CMAKE_BOOL_OFF= NO_TBB TEST_LIB_DEPENDS= libglfw.so:graphics/glfw TEST_USES= xorg TEST_USE= xorg=ice,sm,x11,xcursor,xext,xi,xinerama,xrandr,xxf86vm TEST_CMAKE_BOOL_OFF= NO_REGRESSION NO_TESTS TUTORIALS_CMAKE_BOOL_OFF= NO_TUTORIALS -post-patch: +pre-configure: ${FIND} ${WRKSRC}/tutorials -name CMakeLists.txt -exec \ ${REINPLACE_CMD} -e 's|{CMAKE_BINDIR_BASE}/tutorials|{CMAKE_INSTALL_PREFIX}/${DATADIR_REL}/tutorials|g' {} + ${FIND} ${WRKSRC}/examples -name CMakeLists.txt -exec \ ${REINPLACE_CMD} -e 's|{CMAKE_BINDIR_BASE}|{CMAKE_INSTALL_PREFIX}/${EXAMPLESDIR_REL}|g' {} + ${FIND} ${WRKSRC}/regression -name CMakeLists.txt -exec \ ${REINPLACE_CMD} -e 's|{CMAKE_BINDIR_BASE}|{CMAKE_INSTALL_PREFIX}/tests/${PORTNAME}|g' {} + .include diff --git a/graphics/opensubdiv/files/patch-cmake_FindGLFW.cmake b/graphics/opensubdiv/files/patch-cmake_FindGLFW.cmake index 0b82688b43ae..c77e6135f3b8 100644 --- a/graphics/opensubdiv/files/patch-cmake_FindGLFW.cmake +++ b/graphics/opensubdiv/files/patch-cmake_FindGLFW.cmake @@ -1,11 +1,11 @@ ---- cmake/FindGLFW.cmakeorig 2018-02-08 09:39:46 UTC +--- cmake/FindGLFW.cmake.orig 2025-10-24 17:23:59 UTC +++ cmake/FindGLFW.cmake -@@ -174,7 +174,7 @@ else () +@@ -157,7 +157,7 @@ else () message(FATAL_ERROR "Xi library not found - required for GLFW") endif() - list(APPEND GLFW_x11_LIBRARY "${X11_Xrandr_LIB}" "${X11_Xxf86vm_LIB}" "${X11_Xcursor_LIB}" "${X11_Xinerama_LIB}" "${X11_Xi_LIB}" "${X11_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}" -lrt -ldl) + list(APPEND GLFW_x11_LIBRARY "${X11_Xrandr_LIB}" "${X11_Xxf86vm_LIB}" "${X11_Xcursor_LIB}" "${X11_Xinerama_LIB}" "${X11_Xi_LIB}" "${X11_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}" -lrt ${CMAKE_DL_LIBS}) endif (NOT NO_GLFW_X11) find_library( GLFW_glfw_LIBRARY diff --git a/graphics/opensubdiv/files/patch-opensubdiv-config.cmake.in b/graphics/opensubdiv/files/patch-opensubdiv-config.cmake.in new file mode 100644 index 000000000000..bce95772dc9f --- /dev/null +++ b/graphics/opensubdiv/files/patch-opensubdiv-config.cmake.in @@ -0,0 +1,13 @@ +--- opensubdiv-config.cmake.in.orig 2025-10-24 17:23:59 UTC ++++ opensubdiv-config.cmake.in +@@ -3,4 +3,10 @@ set_and_check(OpenSubdiv_LIB_DIR "${PACKAGE_PREFIX_DIR + set_and_check(OpenSubdiv_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") + set_and_check(OpenSubdiv_LIB_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@") + ++include(CMakeFindDependencyMacro) ++ ++if(NOT NO_OMP) ++ find_dependency(OpenMP) ++endif() ++ + include("${CMAKE_CURRENT_LIST_DIR}/OpenSubdivTargets.cmake") diff --git a/graphics/opensubdiv/files/patch-opensubdiv_CMakeLists.txt b/graphics/opensubdiv/files/patch-opensubdiv_CMakeLists.txt index b47916caa6bb..925680c16d40 100644 --- a/graphics/opensubdiv/files/patch-opensubdiv_CMakeLists.txt +++ b/graphics/opensubdiv/files/patch-opensubdiv_CMakeLists.txt @@ -1,11 +1,11 @@ ---- opensubdiv/CMakeLists.txt.orig 2022-09-26 18:17:44 UTC +--- opensubdiv/CMakeLists.txt.orig 2025-10-24 17:23:59 UTC +++ opensubdiv/CMakeLists.txt -@@ -45,6 +45,8 @@ if (NOT NO_LIB) +@@ -28,6 +28,8 @@ if (NOT NO_LIB) if( OPENMP_FOUND ) if (CMAKE_COMPILER_IS_GNUCXX) list(APPEND PLATFORM_CPU_LIBRARIES gomp) + else() + list(APPEND PLATFORM_CPU_LIBRARIES OpenMP::OpenMP_CXX) endif() endif() diff --git a/graphics/opensubdiv/files/patch-opensubdiv_hbr_mesh.h b/graphics/opensubdiv/files/patch-opensubdiv_hbr_mesh.h index 3fde42177d7c..5f626c920d92 100644 --- a/graphics/opensubdiv/files/patch-opensubdiv_hbr_mesh.h +++ b/graphics/opensubdiv/files/patch-opensubdiv_hbr_mesh.h @@ -1,11 +1,11 @@ ---- opensubdiv/hbr/mesh.h.orig 2023-09-14 19:19:06 UTC +--- opensubdiv/hbr/mesh.h.orig 2025-10-24 17:23:59 UTC +++ opensubdiv/hbr/mesh.h -@@ -215,7 +215,7 @@ template class HbrMesh { (public) +@@ -198,7 +198,7 @@ template class HbrMesh { (public) void SetFVarPropagateCorners(bool p) { fvarpropagatecorners = p; } // Register routines for keeping track of memory usage - void RegisterMemoryRoutines(void (*increment)(unsigned long bytes), void (*decrement)(unsigned long bytes)) { + void RegisterMemoryRoutines(void (*increment)(size_t bytes), void (*decrement)(size_t bytes)) { m_faceAllocator.SetMemStatsIncrement(increment); m_faceAllocator.SetMemStatsDecrement(decrement); m_vertexAllocator.SetMemStatsIncrement(increment); diff --git a/graphics/opensubdiv/files/patch-opensubdiv_osd_CMakeLists.txt b/graphics/opensubdiv/files/patch-opensubdiv_osd_CMakeLists.txt index 192d3e2a9dc8..ab52557bc7b3 100644 --- a/graphics/opensubdiv/files/patch-opensubdiv_osd_CMakeLists.txt +++ b/graphics/opensubdiv/files/patch-opensubdiv_osd_CMakeLists.txt @@ -1,22 +1,22 @@ ---- opensubdiv/osd/CMakeLists.txt.orig 2023-09-14 19:19:06 UTC +--- opensubdiv/osd/CMakeLists.txt.orig 2025-10-24 17:23:59 UTC +++ opensubdiv/osd/CMakeLists.txt -@@ -81,6 +81,8 @@ if(OPENMP_FOUND ) +@@ -128,6 +128,8 @@ if(OPENMP_FOUND ) if (CMAKE_COMPILER_IS_GNUCXX) list(APPEND PLATFORM_CPU_LIBRARIES gomp) + else() + list(APPEND PLATFORM_CPU_LIBRARIES OpenMP::OpenMP_CXX) endif() endif() -@@ -99,10 +101,6 @@ if( TBB_FOUND ) +@@ -146,10 +148,6 @@ if( TBB_FOUND ) ) list(APPEND PUBLIC_HEADER_FILES ${TBB_PUBLIC_HEADERS}) - - if (CMAKE_COMPILER_IS_GNUCXX) - list(APPEND PLATFORM_CPU_LIBRARIES gomp) - endif() list(APPEND PLATFORM_CPU_LIBRARIES TBB::tbb