[skip-ci] opencascade: update to 7.3.0

This commit is contained in:
Francesco Marinucci 2018-09-26 16:56:46 +02:00
parent be776147ea
commit 300e960635
6 changed files with 173 additions and 30 deletions

View File

@ -1,45 +1,60 @@
# Maintainer: UtG <utg[dot]chakra.linux[at]gmail[dot]com>
pkgname=opencascade
pkgver=6.7.1
pkgver=7.3.0
_pkgver=V${pkgver//./_}
pkgrel=1
pkgdesc="Open CASCADE Technology, 3D modeling & numerical simulation"
arch=('x86_64')
url="http://www.opencascade.org"
license=('custom')
depends=('tk' 'mesa' 'java-runtime' 'libxmu' 'ftgl')
makedepends=('java-environment')
license=('LGPL')
depends=('tk' 'vtk' 'gl2ps' 'intel-tbb' 'freeimage' 'ffmpeg')
makedepends=('cmake' 'qt5-base')
options=(!libtool)
source=("http://files.opencascade.com/OCCT/OCC_${pkgver}_release/$pkgname-${pkgver}.tgz" "env.sh" "opencascade.sh" "opencascade.conf")
md5sums=('9316150af298a5608d74785c25491fd4'
'ccdd8d16055d77bf99bbd46ba9dcb848'
'd9368b8d348ced3ec4462012977552d2'
'2924ecf57c95d25888f51071fdc72ad0')
source=("opencascade-${pkgver}.tgz::http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/${_pkgver};sf=tgz"
'opencascade.sh' 'fix-install-dir-references.patch'
'vtk7.patch' 'ffmpeg4.patch' 'cmake-fix-variable.patch')
sha256sums=('7298c5eadc6dd0aeb6265ff2958e8e742d6e3aa65227acce8094f96f1bf6d2ac'
'2064536a85d46fee368a8f1a712b2c6c77ca79c5bffcc68cba79d70d36efa2f4'
'afb584aa453993ae8d9e2b983594558531ede735a5892754b812be30650c9fb5'
'bd230962173a80a971c8da9d3dc07238f249544bb67ee834be7d6466391d0315'
'461c44a1b635c09f23283c0b8f583a0d38079a1e20338c009776a621d0ed6efe'
'c7427082400b2d1ac58c59549d4dd1ee5b27d06847b7907842e9e2f2b68980fa')
prepare() {
cd "occt-${_pkgver}"
patch -Np1 -i "$srcdir/fix-install-dir-references.patch"
patch -Np1 -i "$srcdir/vtk7.patch"
patch -Np1 -i "$srcdir/ffmpeg4.patch"
patch -Np1 -i "$srcdir/cmake-fix-variable.patch"
}
build() {
cd "$srcdir/$pkgname-$pkgver"
if [ ! -d $JAVA_HOME/include ]; then
[ -e /etc/profile.d/openjdk6.sh ] && source /etc/profile.d/openjdk6.sh
[ -e /etc/profile.d/jdk.sh ] && source /etc/profile.d/jdk.sh
fi
cd "occt-${_pkgver}"
mkdir -p build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_GL2PS=ON \
-DUSE_FREEIMAGE=ON \
-DUSE_FFMPEG=ON \
-DUSE_VTK=ON \
-DUSE_TBB=ON
# fix for automake 1.13
sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac
./build_configure
./configure --disable-debug --enable-production \
--with-java-include=${JAVA_HOME}/include --prefix="$pkgdir/opt/$pkgname"
make
}
package() {
cd "$srcdir/$pkgname-$pkgver"
cd "occt-${_pkgver}/build"
make install
cp -r src/UnitsAPI/ "${pkgdir}/opt/$pkgname/src"
install -D -m644 "${srcdir}/opencascade.conf" "${pkgdir}/etc/ld.so.conf.d/opencascade.conf"
install -D -m 755 "${srcdir}/opencascade.sh" "${pkgdir}/etc/profile.d/opencascade.sh"
install -m 755 "${srcdir}/env.sh" "${pkgdir}/opt/$pkgname"
make DESTDIR="$pkgdir" install
cd ..
install -Dm755 "$srcdir/opencascade.sh" "$pkgdir/etc/profile.d/opencascade.sh"
install -dm755 "$pkgdir/usr/share/licenses/$pkgname/"
install -m644 LICENSE_LGPL_21.txt OCCT_LGPL_EXCEPTION.txt "$pkgdir/usr/share/licenses/$pkgname"
mv "$pkgdir/usr/share/doc/opencascade/"* "$pkgdir/usr/share/licenses/$pkgname"
rm -r "$pkgdir/usr/share/doc"
rm "$pkgdir/usr/bin/"*.sh
}

View File

@ -0,0 +1,12 @@
diff -Naur occt-V7_3_0/adm/templates/OpenCASCADEConfig.cmake.in occt-V7_3_0_new/adm/templates/OpenCASCADEConfig.cmake.in
--- occt-V7_3_0/adm/templates/OpenCASCADEConfig.cmake.in 2018-05-29 12:14:02.000000000 +0200
+++ occt-V7_3_0.new/adm/templates/OpenCASCADEConfig.cmake.in 2018-05-29 12:14:02.000000000 +0200
@@ -26,7 +26,7 @@
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(64)?$")
get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif()

22
opencascade/ffmpeg4.patch Normal file
View File

@ -0,0 +1,22 @@
diff -Naur a/src/Image/Image_VideoRecorder.cxx b/src/Image/Image_VideoRecorder.cxx
--- a/src/Image/Image_VideoRecorder.cxx 2017-10-04 14:26:07.000000000 +0200
+++ b/src/Image/Image_VideoRecorder.cxx 2017-10-04 14:26:07.000000000 +0200
@@ -276,7 +276,7 @@
// some formats want stream headers to be separate
if (myAVContext->oformat->flags & AVFMT_GLOBALHEADER)
{
- aCodecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
+ aCodecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}
return Standard_True;
#else
@@ -449,8 +449,7 @@
AVPacket aPacket;
memset (&aPacket, 0, sizeof(aPacket));
av_init_packet (&aPacket);
- if ((myAVContext->oformat->flags & AVFMT_RAWPICTURE) != 0
- && !theToFlush)
+ if (0)
{
// raw video case - directly store the picture in the packet
aPacket.flags |= AV_PKT_FLAG_KEY;

View File

@ -0,0 +1,24 @@
diff -aur occt-V7_1_0/CMakeLists.txt occt-V7_1_0.new/CMakeLists.txt
--- occt-V7_1_0/CMakeLists.txt 2016-11-25 11:50:18.000000000 +0100
+++ occt-V7_1_0.new/CMakeLists.txt 2017-03-18 08:44:10.406668714 +0100
@@ -906,7 +906,7 @@
endforeach()
# install OpenCASCADE config file with compile definitions and C/C++ flags ONLY for current configuration
install (CODE "string (TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" CMAKE_INSTALL_CONFIG_NAME_LOWER)")
-install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
+install (CODE "configure_file(\"${CMAKE_BINARY_DIR}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" \"\$ENV{DESTDIR}${INSTALL_DIR}/${INSTALL_DIR_CMAKE}/OpenCASCADECompileDefinitionsAndFlags-\${CMAKE_INSTALL_CONFIG_NAME_LOWER}.cmake\" COPYONLY)")
foreach (OCCT_MODULE ${OCCT_MODULES})
if (BUILD_MODULE_${OCCT_MODULE})
diff -aur occt-V7_1_0/adm/cmake/occt_macros.cmake occt-V7_1_0.new/adm/cmake/occt_macros.cmake
--- occt-V7_1_0/adm/cmake/occt_macros.cmake 2016-11-25 11:50:18.000000000 +0100
+++ occt-V7_1_0.new/adm/cmake/occt_macros.cmake 2017-03-18 08:44:10.406668714 +0100
@@ -558,7 +558,7 @@
"cmake_policy(PUSH)
cmake_policy(SET CMP0007 NEW)
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

@ -1,2 +1,24 @@
export CASROOT=/opt/opencascade
source /opt/opencascade/env.sh
export CASROOT=/usr
export CSF_LANGUAGE=us
export MMGT_CLEAR=1
export CSF_EXCEPTION_PROMPT=1
export CSF_OCCTResourcePath=$CASROOT/share/opencascade/resources
export CSF_SHMessage=$CSF_OCCTResourcePath/SHMessage
export CSF_MDTVTexturesDirectory=$CSF_OCCTResourcePath/Textures
export CSF_ShadersDirectory=$CSF_OCCTResourcePath/Shaders
export CSF_XSMessage=$CSF_OCCTResourcePath/XSMessage
export CSF_TObjMessage=$CSF_OCCTResourcePath/TObj
export CSF_StandardDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_PluginDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_XCAFDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_TObjDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_StandardLiteDefaults=$CSF_OCCTResourcePath/StdResource
export CSF_IGESDefaults=$CSF_OCCTResourcePath/XSTEPResource
export CSF_STEPDefaults=$CSF_OCCTResourcePath/XSTEPResource
export CSF_XmlOcafResource=$CSF_OCCTResourcePath/XmlOcafResource
export CSF_MIGRATION_TYPES=$CSF_OCCTResourcePath/StdResource/MigrationSheet.txt
export CSF_DrawPluginDefaults=$CSF_OCCTResourcePath/DrawResources
export DRAWHOME=$CSF_OCCTResourcePath/DrawResources
export DRAWDEFAULT=$CSF_OCCTResourcePath/DrawResources/DrawDefault

48
opencascade/vtk7.patch Normal file
View File

@ -0,0 +1,48 @@
--- a/src/IVtkVTK/IVtkVTK_ShapeData.cxx 2017-10-04 14:26:07.000000000 +0200
+++ b/src/IVtkVTK/IVtkVTK_ShapeData.cxx 2018-04-07 14:43:32.920435032 +0200
@@ -80,9 +80,9 @@
vtkIdType aPointIdVTK = thePointId;
myPolyData->InsertNextCell (VTK_VERTEX, 1, &aPointIdVTK);
const vtkIdType aShapeIDVTK = theShapeID;
- mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
+ mySubShapeIDs->InsertNextTypedTuple (&aShapeIDVTK);
const vtkIdType aType = theMeshType;
- myMeshTypes->InsertNextTupleValue (&aType);
+ myMeshTypes->InsertNextTypedTuple (&aType);
}
//================================================================
@@ -97,9 +97,9 @@
vtkIdType aPoints[2] = { thePointId1, thePointId2 };
myPolyData->InsertNextCell (VTK_LINE, 2, aPoints);
const vtkIdType aShapeIDVTK = theShapeID;
- mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
+ mySubShapeIDs->InsertNextTypedTuple (&aShapeIDVTK);
const vtkIdType aType = theMeshType;
- myMeshTypes->InsertNextTupleValue (&aType);
+ myMeshTypes->InsertNextTypedTuple (&aType);
}
//================================================================
@@ -124,9 +124,9 @@
myPolyData->InsertNextCell (VTK_POLY_LINE, anIdList);
const vtkIdType aShapeIDVTK = theShapeID;
- mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
+ mySubShapeIDs->InsertNextTypedTuple (&aShapeIDVTK);
const vtkIdType aType = theMeshType;
- myMeshTypes->InsertNextTupleValue (&aType);
+ myMeshTypes->InsertNextTypedTuple (&aType);
}
}
@@ -143,7 +143,7 @@
vtkIdType aPoints[3] = { thePointId1, thePointId2, thePointId3 };
myPolyData->InsertNextCell (VTK_TRIANGLE, 3, aPoints);
const vtkIdType aShapeIDVTK = theShapeID;
- mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
+ mySubShapeIDs->InsertNextTypedTuple (&aShapeIDVTK);
const vtkIdType aType = theMeshType;
- myMeshTypes->InsertNextTupleValue (&aType);
+ myMeshTypes->InsertNextTypedTuple (&aType);
}