View | Details | Raw Unified | Return to bug 259503
Collapse All | Expand All

(-)b/cad/py-ocp/Makefile (-22 / +40 lines)
Lines 1-42 Link Here
1
PORTNAME=	ocp
1
PORTNAME=	ocp
2
DISTVERSION=	7.4-RC2
2
DISTVERSION=	7.5.2
3
PORTREVISION=	3
3
CATEGORIES=	cad python
4
CATEGORIES=	cad
5
# Direct access to github is needed because the release added an extra archive which
6
# we need to build from, rather than the initial release.
7
MASTER_SITES=	https://github.com/CadQuery/OCP/releases/download/${DISTVERSION}/
8
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
4
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
9
DISTNAME=	OCP_src_Linux
10
5
11
MAINTAINER=	ports@nicandneal.net
6
MAINTAINER=	ports@nicandneal.net
12
COMMENT=	Python wrapper for OCCT generated using pywrap
7
COMMENT=	Python wrapper for OCCT generated using pywrap
13
8
14
BROKEN=		Mismatch between OpenCascase (7.5) and py-ocp (7.4)
15
16
LICENSE=	APACHE20
9
LICENSE=	APACHE20
17
10
18
PATCH_DEPENDS=	${LOCALBASE}/include/OpenCASCADE/OpenGl_HaltonSampler.hxx:cad/opencascade
11
EXTRACT_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cadquery-pywrap>0:devel/py-cadquery-pywrap@${PY_FLAVOR}
19
LIB_DEPENDS=	libTKernel.so:cad/opencascade
12
LIB_DEPENDS=	libTKernel.so:cad/opencascade \
20
BUILD_DEPENDS=	${LOCALBASE}/share/cmake/pybind11/pybind11Config.cmake:devel/pybind11 \
13
		libvtksys-${VTKVER}.so:math/vtk9
21
		${PYTHON_SITELIBDIR}/pybind11:devel/py-pybind11@${PY_FLAVOR}
14
BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pybind11>0:devel/py-pybind11@${PY_FLAVOR} \
15
		pybind11>0:devel/pybind11 \
16
		rapidjson>0:devel/rapidjson \
17
		${PYTHON_PKGNAMEPREFIX}path>0:devel/py-path@${PY_FLAVOR} \
18
		${PYTHON_PKGNAMEPREFIX}lief>0:devel/py-lief@${PY_FLAVOR}
22
19
23
USES=		cmake compiler:c++11-lang gl python:3.6+ zip
20
USES=		python:3.6+ cmake gl compiler:c++11-lang
24
USE_GL=		gl glu glut
21
USE_GL=		gl glu glut
25
22
26
WRKSRC=		${WRKDIR}/OCP_src_Ubuntu-16.04
23
USE_GITHUB=	yes
24
GH_ACCOUNT=	CadQuery
25
GH_PROJECT=	OCP
26
GH_TAGNAME=	52c15d8
27
28
VTKVER=         9.0
29
30
CONFIG_FILE=	${WRKSRC}/ocp.toml
31
32
OCCT=           ${LOCALBASE}/include/OpenCASCADE
33
34
CMAKE_ARGS+=	-DPYTHON_EXECUTABLE=${PYTHON_CMD} \
35
		-DOPENCASCADE_INCLUDE_DIR=${OCCT} \
36
		-DVTK_DIR:PATH=${LOCALBASE}/lib/vtk-${VTKVER}/cmake/vtk-${VTKVER}
37
CMAKE_SOURCE_PATH=	${WRKSRC}/OCP
27
38
28
OCCT=		${LOCALBASE}/include/OpenCASCADE
39
PLIST_FILES=    ${PYTHON_SITELIBDIR}/OCP.so
29
OCCT_LOCAL=	${WRKSRC}/OCCT
30
40
31
CMAKE_ARGS=	-DOPENCASCADE_INCLUDE_DIR=${OCCT} \
41
export CONDA_PREFIX=	${LOCALBASE}
32
		-DPYTHON_EXECUTABLE=${PYTHON_CMD}
33
42
34
USE_PYTHON=	flavors
43
post-patch:
44
	@${REINPLACE_CMD} -e 's|input_folder = "./opencascade"|input_folder = "${OCCT}"|g' ${WRKSRC}/ocp.toml
35
45
36
PLIST_FILES=	${PYTHON_SITELIBDIR}/OCP.so
46
pre-configure:
47
	# Generate the header files.
48
	(cd ${WRKSRC} && ${PYTHON_CMD} dump_symbols.py ${LOCALBASE})
49
	(cd ${WRKSRC} && CONDA_PREFIX=${LOCALBASE}; \
50
	 ${PYTHON_CMD} -m bindgen -n ${MAKE_JOBS_NUMBER} \
51
	 --libclang=${LOCALBASE}/llvm90/lib/libclang.so \
52
	 --include=${LOCALBASE}/include \
53
	 --include=${LOCALBASE}/include/vtk-${VTKVER} \
54
	 all ${CONFIG_FILE})
37
55
38
do-install:
56
do-install:
39
	@${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/
57
	@${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/
40
	${INSTALL_LIB} ${BUILD_WRKSRC}/OCP.so ${STAGEDIR}${PYTHON_SITELIBDIR}
58
	${INSTALL_LIB} ${BUILD_WRKSRC}/OCP.cpython-${PYTHON_VER:S/.//}.so ${STAGEDIR}${PYTHON_SITELIBDIR}/OCP.so
41
59
42
.include <bsd.port.mk>
60
.include <bsd.port.mk>
(-)b/cad/py-ocp/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1595488164
1
TIMESTAMP = 1635415821
2
SHA256 (OCP_src_Linux.zip) = 126953106d7e52d3ec6c606ff3a34ecde5c6598899ab0c31279e185771304192
2
SHA256 (CadQuery-OCP-7.5.2-52c15d8_GH0.tar.gz) = 9919ebcad16077d311e3be2b943e1290e05ac66e0aa992fa5a8836b39d03187a
3
SIZE (OCP_src_Linux.zip) = 50341316
3
SIZE (CadQuery-OCP-7.5.2-52c15d8_GH0.tar.gz) = 5571420
(-)b/cad/py-ocp/files/cpatch-OCCT_OpenGl__HaltonSampler.hxx (+11 lines)
Added Link Here
1
--- OCCT/OpenGl_HaltonSampler.hxx.orig	2020-06-15 08:29:45 UTC
2
+++ OCCT/OpenGl_HaltonSampler.hxx
3
@@ -180,7 +180,7 @@ void OpenGl_HaltonSampler::initRandom (Random_number_g
4
     {
5
       aPerms[aBase][i] = i;
6
     }
7
-    std::random_shuffle (aPerms[aBase].begin(), aPerms[aBase].end(), theRand);
8
+    std::shuffle (aPerms[aBase].begin(), aPerms[aBase].end(), theRand);
9
   }
10
   initTables (aPerms);
11
 }
(-)b/cad/py-ocp/files/patch-FindOpenCascade.cmake (-8 / +4 lines)
Lines 1-12 Link Here
1
--- FindOpenCascade.cmake.orig	2020-06-12 09:48:04 UTC
1
--- FindOpenCascade.cmake.orig	2021-04-19 17:00:03 UTC
2
+++ FindOpenCascade.cmake
2
+++ FindOpenCascade.cmake
3
@@ -69,6 +69,6 @@ foreach( MOD ${OCCT_MODULES})
3
@@ -76,4 +76,4 @@ endforeach()
4
 
4
 
5
 endforeach()
5
 target_include_directories( OPENCASCADE INTERFACE ${OPENCASCADE_INCLUDE_DIR})
6
 
7
-target_include_directories( OPENCASCADE INTERFACE ${OPENCASCADE_INCLUDE_DIR})
8
+target_include_directories( OPENCASCADE INTERFACE OCCT ${OPENCASCADE_INCLUDE_DIR})
9
 
6
 
10
-find_package_handle_standard_args( OPENCASCADE DEFAULT_MSG OPENCASCADE_LIBRARIES OPENCASCADE_INCLUDE_DIR )
7
-find_package_handle_standard_args( OPENCASCADE DEFAULT_MSG OPENCASCADE_LIBRARIES OPENCASCADE_INCLUDE_DIR )
11
\ No newline at end of file
8
+find_package_handle_standard_args( OpenCascade DEFAULT_MSG OPENCASCADE_LIBRARIES OPENCASCADE_INCLUDE_DIR )
12
+find_package_handle_standard_args( OPENCASCADE DEFAULT_MSG OPENCASCADE_LIBRARIES OPENCASCADE_INCLUDE_DIR )
(-)a/cad/py-ocp/files/patch-Standard.cpp (-17 lines)
Removed Link Here
1
--- Standard.cpp.orig	2020-05-29 13:26:32 UTC
2
+++ Standard.cpp
3
@@ -902,10 +902,10 @@ py::module m = static_cast<py::module>(main_module.att
4
           R"#(None)#"  , py::arg("theOne"),  py::arg("theTwo")
5
           );
6
 // ./opencascade/Standard_Time.hxx
7
-    m.def("IsEqual",
8
-          (Standard_Boolean (*)( const Standard_Time ,  const Standard_Time  ))  static_cast<Standard_Boolean (*)( const Standard_Time ,  const Standard_Time  )>(&IsEqual),
9
-          R"#(None)#"  , py::arg("theOne"),  py::arg("theTwo")
10
-          );
11
+//    m.def("IsEqual",
12
+//          (Standard_Boolean (*)( const Standard_Time ,  const Standard_Time  ))  static_cast<Standard_Boolean (*)( const Standard_Time ,  const Standard_Time  )>(&IsEqual),
13
+//          R"#(None)#"  , py::arg("theOne"),  py::arg("theTwo")
14
+//          );
15
 // ./opencascade/Standard_NullValue.hxx
16
 // ./opencascade/Standard_DefineHandle.hxx
17
 // ./opencascade/Standard_Mutex.hxx
(-)b/cad/py-ocp/files/patch-dump__symbols.py (+29 lines)
Added Link Here
1
--- dump_symbols.py.orig	2021-05-24 10:47:30 UTC
2
+++ dump_symbols.py
3
@@ -4,22 +4,15 @@ from path import Path
4
 
5
 prefix = sys.argv[1]
6
 
7
-prefix_mac = (Path(prefix) / 'lib_mac').expand()
8
-libs_mac = prefix_mac.glob('**/libTK*.7.5.1.dylib')
9
+prefix_freebsd = (Path(prefix) / 'lib').expand()
10
+libs_freebsd = prefix_freebsd.glob('libTK*.so')
11
 
12
-prefix_linux = (Path(prefix) / 'lib_linux').expand()
13
-libs_linux = prefix_linux.glob('**/libTK*.so.7.5.1')
14
+for name,libs in {'freebsd' : libs_freebsd}.items():
15
 
16
-prefix_win = (Path(prefix) / 'lib_win').expand()
17
-libs_win = prefix_win.glob('**/**/TK*.dll')
18
-
19
-
20
-for name,libs in {'linux' : libs_linux,'mac' : libs_mac, 'win' : libs_win}.items():
21
-
22
     exported_symbols = []
23
     
24
     for lib in libs:
25
-        p = lief.parse(lib)
26
+        p = lief.parse(str(lib))
27
         
28
         if name=='linux':
29
             for s in p.exported_symbols:
(-)b/cad/py-ocp/files/patch-ocp.toml (+30 lines)
Added Link Here
1
--- ocp.toml.orig	2021-05-24 10:47:30 UTC
2
+++ ocp.toml
3
@@ -361,6 +361,10 @@ parsing_header = '''#pragma clang diagnostic ignored "
4
     modules = ["Xw"]
5
     symbols = "symbols_mangled_linux.dat"
6
 
7
+[FreeBSD]
8
+    modules = ["Xw"]
9
+    symbols = "symbols_mangled_freebsd.dat"
10
+
11
 [Windows]
12
     modules = ["WNT"]
13
     exclude_classes = ["Handle_*"]
14
@@ -632,7 +636,8 @@ parsing_header = '''#pragma clang diagnostic ignored "
15
 struct NSOpenGLContext {};"""
16
         include_body_pre = 'py::class_<NSOpenGLContext>(m, "NSOpenGLContext");'
17
         exclude_methods = ["OpenGl_GlCore11::glGetPointerv","OpenGl_RaytraceGeometry::Clear",
18
-                           "OpenGl_View::ChangeGraduatedTrihedron","OpenGl_View::LayerList"]
19
+                           "OpenGl_View::ChangeGraduatedTrihedron","OpenGl_View::LayerList",
20
+                           "OpenGl_VertexBuffer::unbindFixedColor"]
21
         exclude_typedefs = ["OpenGl_SequenceOfLayers","OpenGl_SetterList","OpenGl_MapOfHatchStylesAndIds","OpenGl_MapOfZLayerSettings","OpenGl_IndexedMapOfStructure","OpenGl_MapOfShaderPrograms","OpenGl_IndexedMapOfStructure","OpenGl_LayerSeqIds"]
22
         exclude_classes = ["OpenGl_GraduatedTrihedron","OpenGl_LayerList","OpenGl_VariableSetterSelector","OpenGl_RaytraceGeometry"]
23
         
24
@@ -1089,4 +1094,4 @@ using rapidjson::BasicOStreamWrapper;"""
25
         
26
     [Modules.IVtkOCC]
27
 
28
-        exclude_methods = ["IVtkOCC_ShapePickerAlgo::Pick", "IVtkOCC_ViewerSelector::Pick"]
29
\ No newline at end of file
30
+        exclude_methods = ["IVtkOCC_ShapePickerAlgo::Pick", "IVtkOCC_ViewerSelector::Pick"]
(-)b/cad/py-ocp/files/patch-opencascade_Standard__Time.hxx (+19 lines)
Added Link Here
1
--- opencascade/Standard_Time.hxx.orig	2021-04-14 15:24:46 UTC
2
+++ opencascade/Standard_Time.hxx
3
@@ -26,11 +26,11 @@
4
 // ------------------------------------------------------------------
5
 // IsEqual : Returns Standard_True if two time values are equal
6
 // ------------------------------------------------------------------
7
-inline Standard_Boolean IsEqual (const Standard_Time theOne,
8
-                                 const Standard_Time theTwo)
9
-{
10
-  return theOne == theTwo;
11
-}
12
+//inline Standard_Boolean IsEqual (const Standard_Time theOne,
13
+//                                 const Standard_Time theTwo)
14
+//{
15
+//  return theOne == theTwo;
16
+//}
17
 
18
 #endif
19
 
(-)b/cad/py-ocp/files/patch-templates_CMakeLists.j2 (+19 lines)
Added Link Here
1
--- templates/CMakeLists.j2.orig	2021-03-03 18:11:14 UTC
2
+++ templates/CMakeLists.j2
3
@@ -17,7 +17,8 @@ endif()
4
 
5
 find_package( pybind11 REQUIRED )
6
 find_package( OpenCascade REQUIRED COMPONENTS OPENCASCADE )
7
 find_package( VTK 9.0 REQUIRED COMPONENTS WrappingPythonCore RenderingCore CommonDataModel CommonExecutionModel)
8
+find_package(OpenGL REQUIRED COMPONENTS OpenGL )
9
 
10
 #clang-cl related workaround
11
 if(WIN32)
12
@@ -30,6 +31,7 @@ file( GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/*.cpp )
13
 add_library( {{ name }} MODULE ${CPP_FILES} )
14
 
15
 target_link_libraries( {{ name }} PRIVATE OPENCASCADE pybind11::pybind11 VTK::WrappingPythonCore VTK::RenderingCore VTK::CommonDataModel VTK::CommonExecutionModel)
16
+target_link_libraries( {{ name }} PRIVATE ${OPENGL_gl_LIBRARY} )
17
 set_target_properties( {{ name }}
18
                        PROPERTIES
19
                        CXX_STANDARD 17
(-)b/cad/py-ocp/pkg-message (+4 lines)
Added Link Here
1
It is essential for the correct operation of this library for the
2
cad/opencascade port to be built with the VIS option disabled. Unfortunately
3
the current default is enabled, so if missing symbols are encounted, then
4
it will be necessary to rebuild cad/opencascade without the VIS option.

Return to bug 259503