sync some packaging changes from Fedora

renamed from occt to opencascade [release 7.8.1-2mamba;Fri Oct 25 2024]
This commit is contained in:
Silvan Calarco 2024-10-27 09:47:59 +01:00
parent e02f0ae796
commit d06108540d
7 changed files with 379 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# opencascade # opencascade
Open CASCADE Technology (OCCT) full-scale 3D geometry library.

View File

@ -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()

View File

@ -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}\")

View File

@ -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()

113
occt-7.8.1-vtk-7.3.1.patch Normal file
View File

@ -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 <NCollection_List.hxx>
#include <NCollection_DataMap.hxx>
#include <TopTools_DataMapOfIntegerShape.hxx>
-#include <OpenGl_GraphicDriver.hxx>
#include <V3d.hxx>
#include <V3d_TypeOfOrientation.hxx>
-#include <Aspect_DisplayConnection.hxx>
#include <IVtk_Types.hxx>
#include <IVtkVTK_ShapeData.hxx>
@@ -75,6 +73,9 @@
#include <vtkSmartPointer.h>
#include <vtkTIFFWriter.h>
#include <vtkWindowToImageFilter.h>
+// Move X11 including files after vtk
+#include <OpenGl_GraphicDriver.hxx>
+#include <Aspect_DisplayConnection.hxx>
#ifndef _WIN32
#include <X11/X.h>
#include <X11/Shell.h>
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 <Standard_Macro.hxx>
#include <Standard_Transient.hxx>
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Shell.h>
-#include <X11/Xutil.h>
-#include <tk.h>
-#endif
-
// prevent disabling some MSVC warning messages by VTK headers
#include <Standard_WarningsDisable.hxx>
#include <vtkRenderWindowInteractor.h>
@@ -40,6 +30,17 @@
#include <IVtkDraw_HighlightAndSelectionPipeline.hxx>
#include <Aspect_Window.hxx>
+// Include X11 headers after VTK for 9.2
+#ifdef _WIN32
+#include <windows.h>
+#else
+#include <X11/X.h>
+#include <X11/Xlib.h>
+#include <X11/Shell.h>
+#include <X11/Xutil.h>
+#include <tk.h>
+#endif
+
class vtkWin32RenderWindowInteractor;
typedef vtkSmartPointer<IVtkTools_ShapePicker> 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 <Standard_WarningsDisable.hxx>
-#ifdef _WIN32
-#include <vtkWin32RenderWindowInteractor.h>
-#include <vtkWin32OpenGLRenderWindow.h>
-#else
-#include <GL/glx.h>
-
-// 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 <vtkXRenderWindowInteractor.h>
-#include <vtkXOpenGLRenderWindow.h>
-#endif
#include <vtkActor.h>
#include <vtkActorCollection.h>
#include <vtkCommand.h>
@@ -54,6 +40,16 @@
#include <IVtkTools_ShapeObject.hxx>
#include <IVtkTools_ShapeDataSource.hxx>
+// Include X11 headers after VTK for VTK 9.2.5
+#ifdef _WIN32
+#include <vtkWin32RenderWindowInteractor.h>
+#include <vtkWin32OpenGLRenderWindow.h>
+#else
+#include <GL/glx.h>
+#include <vtkXRenderWindowInteractor.h>
+#include <vtkXOpenGLRenderWindow.h>
+#endif
+
#include <Message.hxx>
#include <Message_Messenger.hxx>

View File

@ -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;

166
opencascade.spec Normal file
View File

@ -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 <silvan.calarco@mambasoft.it>
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 <silvan.calarco@mambasoft.it> 7.8.1-2mamba
- sync some packaging changes from Fedora
- renamed from occt to opencascade
* Wed May 15 2024 Silvan Calarco <silvan.calarco@mambasoft.it> 7.8.1-1mamba
- update to 7.8.1
* Sun Jul 31 2022 Automatic Build System <autodist@mambasoft.it> 7.6.3-1mamba
- automatic version update by autodist
* Wed Jun 01 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 7.6.2-1mamba
- update to 7.6.2
* Sun Jan 23 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 7.6.0-1mamba
- package created using the webbuild interface