[packages/OpenCASCADE] - added draco patch (fix for PLD cmake build type), enabled draco and rapidjson

qboosh qboosh at pld-linux.org
Thu Mar 30 22:32:23 CEST 2023


commit ed18f05bfdacde8150b5249b58939aaada38d2bf
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Mar 30 22:34:49 2023 +0200

    - added draco patch (fix for PLD cmake build type), enabled draco and rapidjson

 OpenCASCADE-draco.patch | 42 ++++++++++++++++++++++++++++++++++++++++++
 OpenCASCADE.spec        | 11 ++++++++---
 2 files changed, 50 insertions(+), 3 deletions(-)
---
diff --git a/OpenCASCADE.spec b/OpenCASCADE.spec
index 23057ae..8642bda 100644
--- a/OpenCASCADE.spec
+++ b/OpenCASCADE.spec
@@ -10,8 +10,6 @@
 
 # TODO: - separate libs-x (80% of libraries), follow Fedora split or split packages as suggested by Jason Kraftcheck in Debian
 #	- OpenVR? (USE_OPENVR=ON) https://github.com/ValveSoftware/openvr
-#	- USE_RAPIDJSON=ON?
-#	- USE_DRACO=ON? https://github.com/google/draco
 
 # Conditional build:
 %bcond_without	apidocs		# API documentation
@@ -35,12 +33,14 @@ Source0:	https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=ffce0d6
 # Source0-md5:	3e803b63a5b3b8780baceb6eeb2e88a8
 Patch0:		%{name}-cmake.patch
 Patch1:		%{name}-inspector-data.patch
+Patch2:		%{name}-draco.patch
 URL:		https://www.opencascade.com/open-cascade-technology/
 %{?with_freeimage:BuildRequires:	FreeImage-devel}
 BuildRequires:	OpenGL-GLU-devel
 BuildRequires:	bison
 BuildRequires:	cmake >= 3.1
 BuildRequires:	doxygen >= 1:1.8.4
+BuildRequires:	draco-devel
 BuildRequires:	eigen3
 # avcodec avformat avutil swscale
 %{?with_ffmpeg:BuildRequires:	ffmpeg-devel}
@@ -217,6 +217,7 @@ Przykłady do OpenCASCADE.
 %setup -q -n occt-ffce0d6
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %{__sed} -i -e '/set (CMAKE_CONFIGURATION_TYPES/ { s/INTERNAL/STRING/;s/ FORCE// }' CMakeLists.txt
 %{__sed} -i -e 's/IMPORTED_LOCATION_RELEASE/IMPORTED_LOCATION_PLD/' adm/cmake/tbb.cmake
@@ -225,15 +226,19 @@ Przykłady do OpenCASCADE.
 install -d build
 cd build
 %cmake .. \
+	-D3RDPARTY_DRACO_INCLUDE_DIR=%{_includedir}/draco \
+	-D3RDPARTY_DRACO_LIBRARY=%{_libdir}/libdraco.so \
 	%{?with_qt:-D3RDPARTY_QT_DIR=/usr} \
 	%{?with_qt:-DBUILD_Inspector=ON} \
 	-DBUILD_YACCLEX=ON \
 	-DCMAKE_CONFIGURATION_TYPES=%{?debug:Debug}%{!?debug:PLD} \
 	-DINSTALL_DIR_CMAKE=%{_lib}/cmake/opencascade \
 	-DINSTALL_DIR_LIB=%{_lib} \
+	-DUSE_DRACO=ON \
 	-DUSE_EIGEN=ON \
 	%{?with_ffmpeg:-DUSE_FFMPEG=ON} \
 	%{?with_freeimage:-DUSE_FREEIMAGE=ON} \
+	-DUSE_RAPIDJSON=ON \
 	%{?with_tbb:-DUSE_TBB=ON} \
 	%{?with_vtk:-DUSE_VTK=ON}
 
@@ -394,7 +399,7 @@ rm -rf $RPM_BUILD_ROOT
 # R: libTKBO libTKBRep libTKBin libTKBinL libTKBinXCAF libTKBool libTKCAF libTKCDF libTKDCAF libTKDraw libTKFeat libTKFillet libTKG2d libTKG3d libTKGeomAlgo libTKGeomBase libTKHLR libTKIGES libTKLCAF libTKMath libTKMesh libTKOffset libTKPrim libTKService libTKShHealing libTKStd libTKStdL libTKTObj libTKTopAlgo libTKV3d libTKVCAF libTKViewerTest libTKXCAF libTKXDESTEP libTKXSBase libTKXml libTKXmlL libTKernel
 %attr(755,root,root) %{_libdir}/libTKQADraw.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libTKQADraw.so.7.7
-# R: libTKBRep libTKG3d liBTKLCAF libTKMath libTKMesh libTKService libTKXCAF libTKXDE libTKernel
+# R: libTKBRep libTKG3d liBTKLCAF libTKMath libTKMesh libTKService libTKXCAF libTKXDE libTKernel %{?with_draco:draco}
 %attr(755,root,root) %{_libdir}/libTKRWMesh.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libTKRWMesh.so.7.7
 # R: libTKBRep libTKG2d libTKG3d libTKGeomBase libTKMath libTKSTEP209 libTKSTEPAttr libTKSTEPBase libTKShHealing libTKTopAlgo libTKXSBase libTKernel
diff --git a/OpenCASCADE-draco.patch b/OpenCASCADE-draco.patch
new file mode 100644
index 0000000..abd5342
--- /dev/null
+++ b/OpenCASCADE-draco.patch
@@ -0,0 +1,42 @@
+--- occt-ffce0d6/adm/cmake/occt_toolkit.cmake.orig	2023-03-21 13:36:52.000000000 +0100
++++ occt-ffce0d6/adm/cmake/occt_toolkit.cmake	2023-03-30 19:08:14.199142733 +0200
+@@ -370,10 +370,6 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_
+             add_definitions (-DHAVE_GLES2)
+           endif()
+ 
+-          if ("${CURRENT_CSF}" STREQUAL "${CSF_Draco}")
+-            set (CURRENT_CSF "")
+-            set (USED_DRACO 1)
+-          endif()
+           set (LIBRARY_FROM_CACHE 0)
+           separate_arguments (CURRENT_CSF)
+           foreach (CSF_LIBRARY ${CURRENT_CSF})
+@@ -412,28 +408,6 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_
+   endif()
+ endforeach()
+ 
+-if (USE_DRACO)
+-  if (USED_DRACO)
+-    set (USED_LIB_RELEASE ${3RDPARTY_DRACO_LIBRARY})
+-    if (WIN32)
+-      set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY_DEBUG})
+-    else()
+-      set (USED_LIB_DEBUG ${3RDPARTY_DRACO_LIBRARY})
+-    endif()
+-    set (USED_LIB_CONF)
+-    if (EXISTS ${USED_LIB_DEBUG})
+-      set (USED_LIB_CONF "$<$<CONFIG:DEBUG>:${USED_LIB_DEBUG}>;${USED_LIB_CONF}")
+-    endif()
+-    if (EXISTS ${USED_LIB_RELEASE})
+-      set (USED_LIB_CONF "$<$<CONFIG:RELEASE>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
+-      set (USED_LIB_CONF "$<$<CONFIG:RELWITHDEBINFO>:${USED_LIB_RELEASE}>;${USED_LIB_CONF}")
+-    endif()
+-    if (DEFINED USED_LIB_CONF)
+-      set_property (TARGET ${PROJECT_NAME} APPEND PROPERTY LINK_LIBRARIES "${USED_LIB_CONF}")
+-    endif()
+-  endif()
+-endif()
+-
+ if (APPLE)
+   list (FIND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT X11 IS_X11_FOUND)
+   if (NOT ${IS_X11_FOUND} EQUAL -1)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/OpenCASCADE.git/commitdiff/ed18f05bfdacde8150b5249b58939aaada38d2bf



More information about the pld-cvs-commit mailing list