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