Skip site navigation (1)Skip section navigation (2)


| raw e-mail | index | archive | help
The branch main has been updated by vvd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f251a78efa6eb44e9d97fd520247d3494754f7c8

commit f251a78efa6eb44e9d97fd520247d3494754f7c8
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2024-06-03 10:46:50 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2024-06-03 10:46:50 +0000

    graphics/opensubdiv: sort out Makefile, pet portclippy, fix build on 32bit
    
    - Remove unnecessary libs from USE_GL and add required.
    - Fix build on 32bit ARCHS, upstream issue:
    https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1198#issuecomment-2143940211
    - Make options OPENMP (for supported ARCHS) and PTEX default.
    - EXAMPLES and OPENCL can build together without errors.
    - Remove NO_GL_TESTS - upstream removed it.
    - Sort options and pet portclippy.
    
    PR:             279472
    Approved by:    Shane <FreeBSD@ShaneWare.Biz> (maintainer)
---
 graphics/opensubdiv/Makefile                       | 51 +++++++++++-----------
 .../opensubdiv/files/patch-examples_CMakeLists.txt | 12 -----
 .../opensubdiv/files/patch-opensubdiv_hbr_mesh.h   | 11 +++++
 .../files/patch-opensubdiv_osd_CMakeLists.txt      |  8 ++--
 .../files/patch-regression_CMakeLists.txt          | 22 ----------
 .../files/patch-tutorials_CMakeLists.txt           | 12 -----
 graphics/opensubdiv/pkg-plist                      | 20 ++++-----
 7 files changed, 51 insertions(+), 85 deletions(-)

diff --git a/graphics/opensubdiv/Makefile b/graphics/opensubdiv/Makefile
index ce5302b8356f..227f215263ab 100644
--- a/graphics/opensubdiv/Makefile
+++ b/graphics/opensubdiv/Makefile
@@ -1,7 +1,8 @@
 PORTNAME=	opensubdiv
 DISTVERSIONPREFIX=	v
 DISTVERSION=	3_6_0
-CATEGORIES?=	graphics
+PORTREVISION=	1
+CATEGORIES=	graphics
 
 MAINTAINER=	FreeBSD@Shaneware.biz
 COMMENT=	High performance subdivision surface libraries
@@ -12,64 +13,64 @@ LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
 BUILD_DEPENDS=	glfw>3.0.0:graphics/glfw
 
-USES=		cmake gl localbase
+USES=		cmake gl localbase:ldflags
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	PixarAnimationStudios
 GH_PROJECT=	OpenSubdiv
 
-USE_GL=		egl gl glu glew
+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=	TBB
+OPTIONS_DEFAULT=	PTEX TBB
+OPTIONS_DEFAULT_armv6=
+OPTIONS_DEFAULT_armv7=
+OPTIONS_DEFAULT_OTHER_ARCHS=	OPENMP
 OPTIONS_SUB=		yes
 
-DOCS_CMAKE_BOOL_OFF=	NO_DOC
+PTEX_DESC=		ptex support
+TBB_DESC=		Intel threading building blocks
+TUTORIALS_DESC=		Install tutorial programs
+
 DOCS_BUILD_DEPENDS=	rst2html.py:textproc/py-docutils \
 			doxygen>=1.8.4:devel/doxygen
 DOCS_USES=		python:build
+DOCS_CMAKE_BOOL_OFF=	NO_DOC
 DOCS_PORTDOCS=		*
 
-EXAMPLES_CMAKE_BOOL_OFF=	NO_EXAMPLES
+EXAMPLES_LIB_DEPENDS=	libglfw.so:graphics/glfw
 EXAMPLES_USES=		xorg
 EXAMPLES_USE=		xorg=ice,sm,x11,xcursor,xext,xi,xinerama,xrandr,xxf86vm
-EXAMPLES_LIB_DEPENDS=	libglfw.so:graphics/glfw
+EXAMPLES_CMAKE_BOOL_OFF=	NO_EXAMPLES
 
-OPENCL_CMAKE_BOOL_OFF=	NO_OPENCL
-OPENCL_CFLAGS=		-pthread
 OPENCL_BUILD_DEPENDS=	${LOCALBASE}/include/CL/cl.h:devel/opencl
 OPENCL_LIB_DEPENDS=	libOpenCL.so:devel/ocl-icd
-OPENCL_PREVENTS=	EXAMPLES
+OPENCL_USE=		gl=gl
+OPENCL_CMAKE_BOOL_OFF=	NO_OPENCL
+OPENCL_CFLAGS=		-pthread
+OPENCL_LDFLAGS=		-lGLX
 
 OPENMP_CMAKE_BOOL_OFF=	NO_OMP
 
-PTEX_DESC=		ptex support
-PTEX_CMAKE_BOOL_OFF=	NO_PTEX
-PTEX_CMAKE_ON=		-DPTEX_LOCATION:STRING=${LOCALBASE} \
-			-DPTEX_INCLUDE_DIR:STRING=${LOCALBASE}/include/ptex
 PTEX_LIB_DEPENDS=	libPtex.so:graphics/ptex
+PTEX_CMAKE_BOOL_OFF=	NO_PTEX
+PTEX_CMAKE_ON=		-DPTEX_INCLUDE_DIR:STRING=${LOCALBASE}/include/ptex \
+			-DPTEX_LOCATION:STRING=${LOCALBASE}
 
-TBB_DESC=		Intel threading building blocks
-TBB_CMAKE_BOOL_OFF=	NO_TBB
 TBB_LIB_DEPENDS=	libtbb.so:devel/onetbb
+TBB_CMAKE_BOOL_OFF=	NO_TBB
 
-TEST_CMAKE_BOOL_OFF=	NO_REGRESSION NO_TESTS NO_GL_TESTS
 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
 
-# the tutorials and tests include use of deprecated parts of the library
-# using clang 10 on 32 bit fails to build all tutorials and tests
-# currently 12.1 still works - 11.4 and current fail
-# CMake files and pkg-plist are patched to prevent failing builds
-
-TUTORIALS_DESC=		Install tutorial programs
 TUTORIALS_CMAKE_BOOL_OFF=	NO_TUTORIALS
 
-PLIST_SUB+=		LIBVERS=${PORTVERSION}
-
 post-patch:
 	${FIND} ${WRKSRC}/tutorials -name CMakeLists.txt -exec \
 		${REINPLACE_CMD} -e 's|{CMAKE_BINDIR_BASE}/tutorials|{CMAKE_INSTALL_PREFIX}/${DATADIR_REL}/tutorials|g' {} +
diff --git a/graphics/opensubdiv/files/patch-examples_CMakeLists.txt b/graphics/opensubdiv/files/patch-examples_CMakeLists.txt
deleted file mode 100644
index 980d4c45437e..000000000000
--- a/graphics/opensubdiv/files/patch-examples_CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
---- examples/CMakeLists.txt.orig	2020-06-30 16:05:15 UTC
-+++ examples/CMakeLists.txt
-@@ -32,7 +32,8 @@ if (OPENGL_FOUND AND GLFW_FOUND)
-     add_subdirectory(glFVarViewer)
-     add_subdirectory(glStencilViewer)
-     add_subdirectory(glImaging)
--    add_subdirectory(farViewer)
-+# uses deprecated api
-+#    add_subdirectory(farViewer)
- 
-     if (OPENGL_4_2_FOUND)
-         add_subdirectory(glPaintTest)
diff --git a/graphics/opensubdiv/files/patch-opensubdiv_hbr_mesh.h b/graphics/opensubdiv/files/patch-opensubdiv_hbr_mesh.h
new file mode 100644
index 000000000000..3fde42177d7c
--- /dev/null
+++ b/graphics/opensubdiv/files/patch-opensubdiv_hbr_mesh.h
@@ -0,0 +1,11 @@
+--- opensubdiv/hbr/mesh.h.orig	2023-09-14 19:19:06 UTC
++++ opensubdiv/hbr/mesh.h
+@@ -215,7 +215,7 @@ template <class T> 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 8b02e0d7f6a0..192d3e2a9dc8 100644
--- a/graphics/opensubdiv/files/patch-opensubdiv_osd_CMakeLists.txt
+++ b/graphics/opensubdiv/files/patch-opensubdiv_osd_CMakeLists.txt
@@ -1,6 +1,6 @@
---- opensubdiv/osd/CMakeLists.txt.orig	2022-09-26 18:17:44 UTC
+--- opensubdiv/osd/CMakeLists.txt.orig	2023-09-14 19:19:06 UTC
 +++ opensubdiv/osd/CMakeLists.txt
-@@ -76,6 +76,8 @@ if(OPENMP_FOUND )
+@@ -81,6 +81,8 @@ if(OPENMP_FOUND )
  
      if (CMAKE_COMPILER_IS_GNUCXX)
          list(APPEND PLATFORM_CPU_LIBRARIES gomp)
@@ -9,7 +9,7 @@
      endif()
  endif()
  
-@@ -96,10 +98,6 @@ if( TBB_FOUND )
+@@ -99,10 +101,6 @@ if( TBB_FOUND )
      )
  
      list(APPEND PUBLIC_HEADER_FILES ${TBB_PUBLIC_HEADERS})
@@ -19,4 +19,4 @@
 -    endif()
  
      list(APPEND PLATFORM_CPU_LIBRARIES
-         ${TBB_LIBRARIES}
+         TBB::tbb
diff --git a/graphics/opensubdiv/files/patch-regression_CMakeLists.txt b/graphics/opensubdiv/files/patch-regression_CMakeLists.txt
deleted file mode 100644
index f43ec0abe32f..000000000000
--- a/graphics/opensubdiv/files/patch-regression_CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
---- regression/CMakeLists.txt.orig	2022-09-26 18:17:44 UTC
-+++ regression/CMakeLists.txt
-@@ -28,14 +28,16 @@ if (NOT NO_REGRESSION)
- 
-     add_subdirectory(bfr_evaluate)
- 
--    add_subdirectory(hbr_regression)
-+# uses deprecated api
-+#    add_subdirectory(hbr_regression)
- 
--    add_subdirectory(far_regression)
-+#    add_subdirectory(far_regression)
- 
-     add_subdirectory(far_perf)
- 
-     if(OPENGL_FOUND AND GLFW_FOUND)
--        add_subdirectory(osd_regression)
-+# uses deprecated api
-+#        add_subdirectory(osd_regression)
-     endif()
- 
- endif()
diff --git a/graphics/opensubdiv/files/patch-tutorials_CMakeLists.txt b/graphics/opensubdiv/files/patch-tutorials_CMakeLists.txt
deleted file mode 100644
index ed49630dccc1..000000000000
--- a/graphics/opensubdiv/files/patch-tutorials_CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
---- tutorials/CMakeLists.txt.orig	2020-06-30 16:03:59 UTC
-+++ tutorials/CMakeLists.txt
-@@ -27,7 +27,8 @@ include_directories(
-     "${OPENSUBDIV_INCLUDE_DIR}/"
- )
- 
--add_subdirectory(hbr)
-+# uses deprecated api
-+#add_subdirectory(hbr)
- 
- add_subdirectory(far)
- 
diff --git a/graphics/opensubdiv/pkg-plist b/graphics/opensubdiv/pkg-plist
index 35210bb87985..4191927a8491 100644
--- a/graphics/opensubdiv/pkg-plist
+++ b/graphics/opensubdiv/pkg-plist
@@ -59,8 +59,8 @@ include/opensubdiv/osd/glXFBEvaluator.h
 include/opensubdiv/osd/glslPatchShaderSource.h
 include/opensubdiv/osd/mesh.h
 include/opensubdiv/osd/nonCopyable.h
-@comment include/opensubdiv/osd/ompEvaluator.h
-@comment include/opensubdiv/osd/ompKernel.h
+%%OPENMP%%include/opensubdiv/osd/ompEvaluator.h
+%%OPENMP%%include/opensubdiv/osd/ompKernel.h
 %%OPENCL%%include/opensubdiv/osd/opencl.h
 include/opensubdiv/osd/opengl.h
 include/opensubdiv/osd/patchBasis.h
@@ -95,7 +95,7 @@ lib/libosdCPU.so.%%LIBVERS%%
 lib/libosdGPU.a
 lib/libosdGPU.so
 lib/libosdGPU.so.%%LIBVERS%%
-@comment %%EXAMPLES%%%%EXAMPLESDIR%%/farViewer
+%%EXAMPLES%%%%EXAMPLESDIR%%/farViewer
 %%EXAMPLES%%%%EXAMPLESDIR%%/glEvalLimit
 %%EXAMPLES%%%%EXAMPLESDIR%%/glFVarViewer
 %%EXAMPLES%%%%EXAMPLESDIR%%/glImaging
@@ -106,10 +106,10 @@ lib/libosdGPU.so.%%LIBVERS%%
 %%EXAMPLES%%%%EXAMPLESDIR%%/glViewer
 %%TEST%%tests/opensubdiv/bfr_evaluate
 %%TEST%%tests/opensubdiv/far_perf
-@comment %%TEST%%tests/opensubdiv/far_regression
-@comment %%TEST%%tests/opensubdiv/hbr_baseline
-@comment %%TEST%%tests/opensubdiv/hbr_regression
-@comment %%TEST%%tests/opensubdiv/osd_regression
+%%TEST%%tests/opensubdiv/far_regression
+%%TEST%%tests/opensubdiv/hbr_baseline
+%%TEST%%tests/opensubdiv/hbr_regression
+%%TEST%%tests/opensubdiv/osd_regression
 %%TUTORIALS%%%%DATADIR%%/tutorials/bfr_tutorial_1_1
 %%TUTORIALS%%%%DATADIR%%/tutorials/bfr_tutorial_1_2
 %%TUTORIALS%%%%DATADIR%%/tutorials/bfr_tutorial_1_3
@@ -131,7 +131,7 @@ lib/libosdGPU.so.%%LIBVERS%%
 %%TUTORIALS%%%%DATADIR%%/tutorials/far_tutorial_5_1
 %%TUTORIALS%%%%DATADIR%%/tutorials/far_tutorial_5_2
 %%TUTORIALS%%%%DATADIR%%/tutorials/far_tutorial_5_3
-@comment %%TUTORIALS%%%%DATADIR%%/tutorials/hbr_tutorial_0
-@comment %%TUTORIALS%%%%DATADIR%%/tutorials/hbr_tutorial_1
-@comment %%TUTORIALS%%%%DATADIR%%/tutorials/hbr_tutorial_2
+%%TUTORIALS%%%%DATADIR%%/tutorials/hbr_tutorial_0
+%%TUTORIALS%%%%DATADIR%%/tutorials/hbr_tutorial_1
+%%TUTORIALS%%%%DATADIR%%/tutorials/hbr_tutorial_2
 %%TUTORIALS%%%%DATADIR%%/tutorials/osd_tutorial_0



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>