From d06108540da1c5336df322a211298dfdc4a8f308 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sun, 27 Oct 2024 09:47:59 +0100 Subject: [PATCH] sync some packaging changes from Fedora renamed from occt to opencascade [release 7.8.1-2mamba;Fri Oct 25 2024] --- README.md | 2 + occt-7.6.2-cmake-fix2.patch | 18 +++ occt-7.8.1-cmake-install.patch | 11 ++ occt-7.8.1-tbb-2021.12.0.patch | 58 +++++++++ occt-7.8.1-vtk-7.3.1.patch | 113 ++++++++++++++++ opencascade-7.8.1-freetype-2.13.3.patch | 11 ++ opencascade.spec | 166 ++++++++++++++++++++++++ 7 files changed, 379 insertions(+) create mode 100644 occt-7.6.2-cmake-fix2.patch create mode 100644 occt-7.8.1-cmake-install.patch create mode 100644 occt-7.8.1-tbb-2021.12.0.patch create mode 100644 occt-7.8.1-vtk-7.3.1.patch create mode 100644 opencascade-7.8.1-freetype-2.13.3.patch create mode 100644 opencascade.spec diff --git a/README.md b/README.md index da540e5..f3c0fea 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # opencascade +Open CASCADE Technology (OCCT) full-scale 3D geometry library. + diff --git a/occt-7.6.2-cmake-fix2.patch b/occt-7.6.2-cmake-fix2.patch new file mode 100644 index 0000000..73cfd72 --- /dev/null +++ b/occt-7.6.2-cmake-fix2.patch @@ -0,0 +1,18 @@ +--- occt-7.6.0/CMakeLists.txt.orig 2022-06-02 15:37:32.868338814 +0200 ++++ occt-7.6.0/CMakeLists.txt 2022-06-02 15:37:42.915275211 +0200 +@@ -979,12 +979,12 @@ + endif() + + # change custom.bat/sh +-if (EXISTS "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}") +- file (READ "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT) ++if (EXISTS "${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}") ++ file (READ "${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT) + + set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}") + +- file (WRITE "${INSTALL_DIR}/${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}") ++ file (WRITE "${INSTALL_DIR_SCRIPT}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}") + else() + OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR_SCRIPT}") + endif() diff --git a/occt-7.8.1-cmake-install.patch b/occt-7.8.1-cmake-install.patch new file mode 100644 index 0000000..bf6f1b2 --- /dev/null +++ b/occt-7.8.1-cmake-install.patch @@ -0,0 +1,11 @@ +--- occt-7.8.1/adm/cmake/occt_macros.cmake.orig 2024-05-15 18:36:35.231032184 +0200 ++++ occt-7.8.1/adm/cmake/occt_macros.cmake 2024-05-15 19:12:39.169620421 +0200 +@@ -592,7 +592,7 @@ + + install (CODE + "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWERCASE) +- file (GLOB ALL_OCCT_TARGET_FILES \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\") ++ file (GLOB ALL_OCCT_TARGET_FILES \"$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADE*Targets-\${CMAKE_INSTALL_CONFIG_NAME_LOWERCASE}.cmake\") + foreach(TARGET_FILENAME \${ALL_OCCT_TARGET_FILES}) + file (STRINGS \"\${TARGET_FILENAME}\" TARGET_FILE_CONTENT) + file (REMOVE \"\${TARGET_FILENAME}\") diff --git a/occt-7.8.1-tbb-2021.12.0.patch b/occt-7.8.1-tbb-2021.12.0.patch new file mode 100644 index 0000000..9e9c66a --- /dev/null +++ b/occt-7.8.1-tbb-2021.12.0.patch @@ -0,0 +1,58 @@ +Index: occt-V7_8_0/CMakeLists.txt +=================================================================== +--- occt-V7_8_0.orig/CMakeLists.txt ++++ occt-V7_8_0/CMakeLists.txt +@@ -739,7 +739,8 @@ endif() + if (NOT DEFINED ANDROID AND CAN_USE_TBB) + if (USE_TBB) + add_definitions (-DHAVE_TBB) +- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") ++ #OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") ++ find_package(TBB CONFIG REQUIRED) + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC") +Index: occt-V7_8_0/adm/templates/OpenCASCADEConfig.cmake.in +=================================================================== +--- occt-V7_8_0.orig/adm/templates/OpenCASCADEConfig.cmake.in ++++ occt-V7_8_0/adm/templates/OpenCASCADEConfig.cmake.in +@@ -27,7 +27,7 @@ get_filename_component (OpenCASCADE_INST + if (OpenCASCADE_INSTALL_PREFIX MATCHES "/cmake$") + get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH) + endif() +-if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$") ++if (OpenCASCADE_INSTALL_PREFIX MATCHES "/lib$" OR OpenCASCADE_INSTALL_PREFIX MATCHES "/lib64$") + get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH) + endif() + if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$") +Index: occt-V7_8_0/adm/cmake/tbb.cmake +=================================================================== +--- occt-V7_8_0.orig/adm/cmake/tbb.cmake ++++ occt-V7_8_0/adm/cmake/tbb.cmake +@@ -153,21 +153,21 @@ else () + if ((NOT "${3RDPARTY_TBB_DIR}" STREQUAL "") AND (EXISTS "${3RDPARTY_TBB_DIR}")) + # Find TBB 2021.5 in existing directory. + find_package ( +- TBB 2021.5 ++ TBB + PATHS "${3RDPARTY_TBB_DIR}" NO_DEFAULT_PATH + REQUIRED + CONFIG) + else() +- # Find TBB 2021.5 in system directory. ++ # Find TBB 2021 in system directory. + find_package ( +- TBB 2021.5 ++ TBB + REQUIRED + CONFIG) + endif() + else() +- # Find TBB 2021.5 in system directory. ++ # Find TBB 2021 in system directory. + find_package ( +- TBB 2021.5 ++ TBB + REQUIRED + CONFIG) + endif() diff --git a/occt-7.8.1-vtk-7.3.1.patch b/occt-7.8.1-vtk-7.3.1.patch new file mode 100644 index 0000000..9e99d06 --- /dev/null +++ b/occt-7.8.1-vtk-7.3.1.patch @@ -0,0 +1,113 @@ +Index: occt-V7_7_2/src/IVtkDraw/IVtkDraw.cxx +=================================================================== +--- occt-V7_7_2.orig/src/IVtkDraw/IVtkDraw.cxx ++++ occt-V7_7_2/src/IVtkDraw/IVtkDraw.cxx +@@ -31,10 +31,8 @@ + #include + #include + #include +-#include + #include + #include +-#include + + #include + #include +@@ -75,6 +73,9 @@ + #include + #include + #include ++// Move X11 including files after vtk ++#include ++#include + #ifndef _WIN32 + #include + #include +Index: occt-V7_7_2/src/IVtkDraw/IVtkDraw_Interactor.hxx +=================================================================== +--- occt-V7_7_2.orig/src/IVtkDraw/IVtkDraw_Interactor.hxx ++++ occt-V7_7_2/src/IVtkDraw/IVtkDraw_Interactor.hxx +@@ -20,16 +20,6 @@ + #include + #include + +-#ifdef _WIN32 +-#include +-#else +-#include +-#include +-#include +-#include +-#include +-#endif +- + // prevent disabling some MSVC warning messages by VTK headers + #include + #include +@@ -40,6 +30,17 @@ + #include + #include + ++// Include X11 headers after VTK for 9.2 ++#ifdef _WIN32 ++#include ++#else ++#include ++#include ++#include ++#include ++#include ++#endif ++ + class vtkWin32RenderWindowInteractor; + typedef vtkSmartPointer PSelector; + +Index: occt-V7_7_2/src/IVtkDraw/IVtkDraw_Interactor.cxx +=================================================================== +--- occt-V7_7_2.orig/src/IVtkDraw/IVtkDraw_Interactor.cxx ++++ occt-V7_7_2/src/IVtkDraw/IVtkDraw_Interactor.cxx +@@ -15,17 +15,6 @@ + + // prevent disabling some MSVC warning messages by VTK headers + #include +-#ifdef _WIN32 +-#include +-#include +-#else +-#include +- +-// Preventing naming collisions between +-// GLX and VTK versions 9.0 and above +-#ifdef AllValues +-#undef AllValues +-#endif + + // Resolve name collisions with X11 headers + #ifdef Status +@@ -36,9 +25,6 @@ + #undef Success + #endif + +-#include +-#include +-#endif + #include + #include + #include +@@ -54,6 +40,16 @@ + #include + #include + ++// Include X11 headers after VTK for VTK 9.2.5 ++#ifdef _WIN32 ++#include ++#include ++#else ++#include ++#include ++#include ++#endif ++ + #include + #include + diff --git a/opencascade-7.8.1-freetype-2.13.3.patch b/opencascade-7.8.1-freetype-2.13.3.patch new file mode 100644 index 0000000..c37751f --- /dev/null +++ b/opencascade-7.8.1-freetype-2.13.3.patch @@ -0,0 +1,11 @@ +--- occt-7.8.1/src/StdPrs/StdPrs_BRepFont.cxx.orig 2024-10-25 12:33:57.230234509 +0200 ++++ occt-7.8.1/src/StdPrs/StdPrs_BRepFont.cxx 2024-10-25 12:34:41.493338095 +0200 +@@ -457,7 +457,7 @@ + for (short aContour = 0, aStartIndex = 0; aContour < anOutline->n_contours; ++aContour) + { + const FT_Vector* aPntList = &anOutline->points[aStartIndex]; +- const char* aTags = &anOutline->tags[aStartIndex]; ++ auto aTags = &anOutline->tags[aStartIndex]; + const short anEndIndex = anOutline->contours[aContour]; + const short aPntsNb = (anEndIndex - aStartIndex) + 1; + aStartIndex = anEndIndex + 1; diff --git a/opencascade.spec b/opencascade.spec new file mode 100644 index 0000000..7832656 --- /dev/null +++ b/opencascade.spec @@ -0,0 +1,166 @@ +%define gitver %(echo %version | tr . _) +Name: opencascade +Version: 7.8.1 +Release: 2mamba +Summary: Open CASCADE Technology (OCCT) full-scale 3D geometry library +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://dev.opencascade.org/ +Source: https://git.dev.opencascade.org/repos/occt.git/V%{gitver}/occt-%{version}.tar.bz2 +Patch1: occt-7.6.2-cmake-fix2.patch +Patch2: occt-7.8.1-cmake-install.patch +Patch3: occt-7.8.1-tbb-2021.12.0.patch +Patch4: occt-7.8.1-vtk-7.3.1.patch +Patch5: opencascade-7.8.1-freetype-2.13.3.patch +License: GPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libX11-devel +BuildRequires: libfontconfig-devel +BuildRequires: libfreetype-devel +BuildRequires: libgcc +BuildRequires: libglew-devel +BuildRequires: libglvnd-devel +BuildRequires: libgomp-devel +BuildRequires: libstdc++6-devel +BuildRequires: libtbb-devel +BuildRequires: libtcl-devel +BuildRequires: libtk-devel +BuildRequires: libvtk-devel +## AUTOBUILDREQ-END +BuildRequires: libvtk-devel >= 9.3.0-2mamba +BuildRequires: cmake +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +Provides: oce +Obsoletes: oce <= 0.17.2 +Provides: occt +Obsoletes: occt < 7.8.1-2mamba + +%description +Open CASCADE Technology (OCCT) full-scale 3D geometry library. + +%package -n lib%{name} +Group: System/Libraries +Summary: Shared libraries for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} +Provides: liboce +Obsoletes: liboce <= 0.17.2 +Provides: libocct +Obsoletes: libocct < 7.8.1-2mamba + +%description -n lib%{name} +This package contains shared libraries for %{name}. + +%package -n lib%{name}-devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} +Provides: liboce-devel +Obsoletes: liboce-devel <= 0.17.2 +Provides: libocct-devel +Obsoletes: libocct-devel < 7.8.1-2mamba + +%description -n lib%{name}-devel +This package contains libraries and header files for developing applications that use %{name}. + +%debug_package + +%prep +%setup -q -n occt-%{version} +#-D -T +#:<< _EOF +%patch 1 -p1 -b .cmake-fix2 +%patch 2 -p1 -b .cmake-install +%patch 3 -p1 -b .tbb-2021.12.0 +%patch 4 -p1 -b .vtk-7.3.1 +%patch 5 -p1 -b .freetype-2.13.3 + +%build +#:<< _EOF +# cmake uses $ENV{DESTDIR} to create cmake_install file +export DESTDIR=%{buildroot} + +%cmake -d build \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DUSE_RAPIDJSON=True \ + -DUSE_TBB=ON \ + -D3RDPARTY_TBB_LIBRARY_DIR=%{_libdir} \ + -D3RDPARTY_TBB_INCLUDE_DIR=%{_includedir} \ + -DUSE_VTK=ON \ + -DINSTALL_VTK=OFF \ + -D3RDPARTY_VTK_LIBRARY_DIR=%{_libdir} \ + -D3RDPARTY_VTK_INCLUDE_DIR=%{_includedir}/vtk \ + -DINSTALL_DIR_LIB=%{_lib} \ + -DINSTALL_DIR_CMAKE=%{_lib}/cmake/opencascade \ + -Wno-dev + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall -C build + +# Draw binary should not be versioned. +mv %{buildroot}%{_bindir}/DRAWEXE-* \ + %{buildroot}%{_bindir}/DRAWEXE + +# Remove license files so they can be included by %%license +rm -rf %{buildroot}%{_datadir}/doc/opencascade + +# Fix non-executable shell scripts +chmod 0755 %{buildroot}%{_bindir}/*.sh + +# Fix library target manipulation attempt by upstream +sed -i "s/\\\\\${OCCT_INSTALL_BIN_LETTER}//g" %{buildroot}%{_libdir}/cmake/opencascade/*.cmake + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -n lib%{name} -p /sbin/ldconfig +%postun -n lib%{name} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_bindir}/DRAWEXE* +%{_bindir}/ExpToCasExe* +%dir %{_datadir}/opencascade +%dir %{_datadir}/opencascade/data +%{_datadir}/opencascade/data/* +%dir %{_datadir}/opencascade/resources +%{_datadir}/opencascade/resources/* +%dir %{_datadir}/opencascade/samples +%{_datadir}/opencascade/samples/* + +%files -n lib%{name} +%defattr(-,root,root) +%{_libdir}/libTK*.so.* +%license LICENSE_LGPL_21.txt OCCT_LGPL_EXCEPTION.txt + +%files -n lib%{name}-devel +%defattr(-,root,root) +%{_bindir}/*.sh +%dir %{_includedir}/opencascade/ +%{_includedir}/opencascade/* +%{_libdir}/libTK*.so +%dir %{_libdir}/cmake/opencascade +%{_libdir}/cmake/opencascade/OpenCASCADE*.cmake +%doc README.txt + +%changelog +* Fri Oct 25 2024 Silvan Calarco 7.8.1-2mamba +- sync some packaging changes from Fedora +- renamed from occt to opencascade + +* Wed May 15 2024 Silvan Calarco 7.8.1-1mamba +- update to 7.8.1 + +* Sun Jul 31 2022 Automatic Build System 7.6.3-1mamba +- automatic version update by autodist + +* Wed Jun 01 2022 Silvan Calarco 7.6.2-1mamba +- update to 7.6.2 + +* Sun Jan 23 2022 Silvan Calarco 7.6.0-1mamba +- package created using the webbuild interface