aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarian Buschsieweke <marian.buschsieweke@ovgu.de>2019-10-15 10:22:15 +0200
committerMilan P. Stanić <mps@arvanta.net>2019-10-22 22:41:30 +0200
commitcc09448dc3b0ed20643dbc894c515c88407ebc37 (patch)
tree4334c4d252419f989ca9294f5d3ce6090d409a1d
parentbd5f040a849d08e2ef29f742e34d6a601adac682 (diff)
downloadaports-cc09448dc3b0ed20643dbc894c515c88407ebc37.tar.bz2
aports-cc09448dc3b0ed20643dbc894c515c88407ebc37.tar.xz
testing/opencascade: new aport
-rw-r--r--testing/opencascade/APKBUILD61
-rw-r--r--testing/opencascade/cmake_fix_install_dir.patch27
-rw-r--r--testing/opencascade/fix_ffmpeg.patch34
-rw-r--r--testing/opencascade/no_feenableexcept.patch40
-rw-r--r--testing/opencascade/no_mallinfo.patch28
-rw-r--r--testing/opencascade/vtk7.patch49
6 files changed, 239 insertions, 0 deletions
diff --git a/testing/opencascade/APKBUILD b/testing/opencascade/APKBUILD
new file mode 100644
index 0000000000..f2e3f1b94a
--- /dev/null
+++ b/testing/opencascade/APKBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
+# Contributor: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
+pkgname=opencascade
+pkgver=7.3.0p3
+pkgrel=0
+pkgdesc="An SDK for development of applications dealing with 3D CAD data"
+url="https://dev.opencascade.org/"
+arch="x86_64" # Dependency vtk is x86_64 only
+license="LGPL-2.1-only"
+makedepends="
+ cmake
+ doxygen
+ ffmpeg-dev
+ freeimage-dev
+ freetype-dev
+ libtbb
+ libtbb-dev
+ libxi-dev
+ libxmu-dev
+ mesa-dev
+ tk
+ tk-dev
+ vtk-dev
+ "
+subpackages="$pkgname-doc $pkgname-dev"
+source="
+ opencascade-$pkgver.tar.gz::https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=refs/tags/V${pkgver//./_};sf=tgz
+ no_mallinfo.patch
+ no_feenableexcept.patch
+ fix_ffmpeg.patch
+ vtk7.patch
+ cmake_fix_install_dir.patch
+ "
+builddir="$srcdir/occt-V${pkgver//./_}"
+options="!check" # No tests provided :-/
+
+build() {
+ mkdir -p build
+ cd build
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DUSE_GL2PS=OFF \
+ -DUSE_FREEIMAGE=ON \
+ -DUSE_FFMPEG=ON \
+ -DUSE_VTK=ON \
+ -DUSE_TBB=ON
+ make
+}
+
+package() {
+ cd build
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="f821d0f8b813c069fd0d9cf7f814a236fbcd95c674760de3396155c0050f593cc5e9ceda6828495951f79faa482342d36561f525253f11a5488df08f2c56825b opencascade-7.3.0p3.tar.gz
+01ee778de7ef95a479c87445d1d062e5d858879e211d2c312f801133e35f768cc70d00e3f3fae00f39c60473641c78517d16d63425dd2dd7e19f3079d2cf1a51 no_mallinfo.patch
+15936b8601f06dabd2b84b892220acba67201a91091f38d9e44a4505bb934de2b3c657d3469434b7d3297fd1fadaa96aa673cde86ddc7a5f65e69baf80fb0220 no_feenableexcept.patch
+533436132b058305c86f1b77b388f37fe93f9ec17c1aa74813c29e6e1c80a287309659d806c6d010801f9659dfeddacae488949cf84cc76966c350ade9c75a04 fix_ffmpeg.patch
+61f20a5c5628d2a40de68e9a4990cfef3ff70878968f4b1b59363287ece43bfe875d300b139492a8b7052970587369294cf6290135b6aea6493173e4882b338c vtk7.patch
+432cd1d1e08d7d27a8d20808cdb67bc976c189d4fa9001576d6cdf3b0891dcf3c91890916ee281b34007ca02a7eed913d33e85b7613e5b77f25892e950217e6a cmake_fix_install_dir.patch"
diff --git a/testing/opencascade/cmake_fix_install_dir.patch b/testing/opencascade/cmake_fix_install_dir.patch
new file mode 100644
index 0000000000..12d1d1b697
--- /dev/null
+++ b/testing/opencascade/cmake_fix_install_dir.patch
@@ -0,0 +1,27 @@
+Fixes:
+> CMake Error at cmake_install.cmake:8340 (configure_file):
+> configure_file Problem configuring file
+First posted on Arch Linux
+--- 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}\")
diff --git a/testing/opencascade/fix_ffmpeg.patch b/testing/opencascade/fix_ffmpeg.patch
new file mode 100644
index 0000000000..0ec810701d
--- /dev/null
+++ b/testing/opencascade/fix_ffmpeg.patch
@@ -0,0 +1,34 @@
+In current version of ffmpeg the flag CODEC_FLAG_GLOBAL_HEADER has been renamed
+and the deprecated raw picture API has been removed. This patch renames
+CODEC_FLAG_GLOBAL_HEADER to AV_CODEC_FLAG_GLOBAL_HEADER and removes the use of
+the dropped API.
+--- occt-V7_3_0p3.bin/src/Image/Image_VideoRecorder.cxx
++++ occt-V7_3_0p3/src/Image/Image_VideoRecorder.cxx
+@@ -283,7 +283,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
+@@ -456,18 +456,6 @@
+ AVPacket aPacket;
+ memset (&aPacket, 0, sizeof(aPacket));
+ av_init_packet (&aPacket);
+- if ((myAVContext->oformat->flags & AVFMT_RAWPICTURE) != 0
+- && !theToFlush)
+- {
+- // raw video case - directly store the picture in the packet
+- aPacket.flags |= AV_PKT_FLAG_KEY;
+- aPacket.stream_index = myVideoStream->index;
+- aPacket.data = myFrame->data[0];
+- aPacket.size = sizeof(AVPicture);
+-
+- aResAv = av_interleaved_write_frame (myAVContext, &aPacket);
+- }
+- else
+ {
+ // encode the image
+ myFrame->pts = myFrameCount;
diff --git a/testing/opencascade/no_feenableexcept.patch b/testing/opencascade/no_feenableexcept.patch
new file mode 100644
index 0000000000..f524008151
--- /dev/null
+++ b/testing/opencascade/no_feenableexcept.patch
@@ -0,0 +1,40 @@
+musl does not provice feenableexcept and fedisableexcept. Those calls have
+only been used on linux so far. This patch extends the #ifdef logic to only use
+them on Linux if additionally glibc is used.
+--- occt-V7_3_0p3.old/src/OSD/OSD_signal.cxx
++++ occt-V7_3_0p3/src/OSD/OSD_signal.cxx
+@@ -687,7 +687,7 @@
+ // cout << "OSD::Handler: signal " << (int) theSignal << " occured inside a try block " << endl ;
+ if ( ADR_ACT_SIGIO_HANDLER != NULL )
+ (*ADR_ACT_SIGIO_HANDLER)() ;
+-#ifdef __linux__
++#if defined(__linux__) && defined(__GLIBC__)
+ if (fFltExceptions)
+ feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
+ //feenableexcept (FE_INVALID | FE_DIVBYZERO);
+@@ -805,7 +805,7 @@
+ (void)theSignal; // silence GCC warnings
+ (void)theContext;
+
+-#ifdef __linux__
++#if defined(__linux__) && defined(__GLIBC__)
+ if (fFltExceptions)
+ feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
+ //feenableexcept (FE_INVALID | FE_DIVBYZERO);
+@@ -891,14 +891,14 @@
+ cerr << "ieee_handler does not work !!! KO " << endl;
+ #endif
+ }
+-#elif defined (__linux__)
++#elif defined(__linux__) && defined(__GLIBC__)
+ feenableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
+ fFltExceptions = Standard_True;
+ #endif
+ }
+ else
+ {
+-#if defined (__linux__)
++#if defined(__linux__) && defined(__GLIBC__)
+ fedisableexcept (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
+ fFltExceptions = Standard_False;
+ #endif
diff --git a/testing/opencascade/no_mallinfo.patch b/testing/opencascade/no_mallinfo.patch
new file mode 100644
index 0000000000..6aef939aed
--- /dev/null
+++ b/testing/opencascade/no_mallinfo.patch
@@ -0,0 +1,28 @@
+mallinfo() is not provided in musl. This patch uses getrusage() instead to use
+the maximum resident set size as a (poor) approximation of the heap usage.
+--- occt-V7_3_0p3.bin/src/OSD/OSD_MemInfo.cxx
++++ occt-V7_3_0p3/src/OSD/OSD_MemInfo.cxx
+@@ -35,6 +35,9 @@
+ #include <sstream>
+ #include <fstream>
+
++#include <sys/time.h>
++#include <sys/resource.h>
++
+ #include <OSD_MemInfo.hxx>
+
+ // =======================================================================
+@@ -147,8 +150,11 @@
+ }
+ aFile.close();
+
+- struct mallinfo aMI = mallinfo();
+- myCounters[MemHeapUsage] = aMI.uordblks;
++ // mallinfo() not available with musl. We use getrusage to approximate it
++ // with the maximum resident set size
++ struct rusage ru = { .ru_maxrss = 0 };
++ getrusage(RUSAGE_SELF, &ru);
++ myCounters[MemHeapUsage] = ru.ru_maxrss;
+
+ #elif (defined(__APPLE__))
+ struct task_basic_info aTaskInfo;
diff --git a/testing/opencascade/vtk7.patch b/testing/opencascade/vtk7.patch
new file mode 100644
index 0000000000..5d9f293cea
--- /dev/null
+++ b/testing/opencascade/vtk7.patch
@@ -0,0 +1,49 @@
+Updated calls to VTK to new API. This patch was first posted in Arch Linux
+--- 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);
+ }