#!/bin/bash # # opencascade.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # opencascade.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="opencascade" PACKAGE_EXT="gz" VERSION=${VERSION:=7.6.3} BUILD=${BUILD:=1} CVERSION=$(echo $VERSION | tr '.' '_' ) if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc elif [ -f ../../source/runtime/slackbuildrc ]; then . ../../source/runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V$CVERSION.tar.gz" get_source $SRC $URL unpack_source $SRC OCCT-$CVERSION # There is an OCCT_UPDATE_TARGET_FILE cmake macro that fails due to some # assumptions it makes about installation paths. Rather than fixing it, just # get rid of the mechanism altogether - its purpose is to allow a # side-by-side installation of release and debug libraries. sed -e 's|\\${OCCT_INSTALL_BIN_LETTER}||' -i adm/cmake/occt_toolkit.cmake || die mkdir -p build cd build # Note: on current, turn FFMPEG off. Doesn't build with ffmpeg-5.1.2. cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_DOC_Overview=OFF \ -DBUILD_Inspector=OFF \ -DBUILD_MODULE_Draw=OFF \ -DBUILD_RELEASE_DISABLE_EXCEPTIONS=OFF \ -DINSTALL_DIR_CMAKE="$LIBDIR/cmake/$PACKAGE" \ -DINSTALL_DIR_DATA="/usr/share/$PACKAGE/data" \ -DINSTALL_DIR_DOC="/usr/doc/$PACKAGE-$VERSION" \ -DINSTALL_DIR_LIB="$LIBDIR" \ -DINSTALL_DIR_RESOURCE="/usr/share/$PACKAGE/resources" \ -DINSTALL_DIR_SAMPLES="/usr/share/$PACKAGE/samples" \ -DINSTALL_DIR_WITH_VERSION=OFF \ -DINSTALL_SAMPLES=OFF \ -DINSTALL_TEST_CASES=NO \ -DUSE_D3D=NO \ -DUSE_DRACO=OFF \ -DUSE_EIGEN=ON \ -DUSE_FFMPEG=OFF \ -DUSE_FREEIMAGE=OFF \ -DUSE_FREETYPE=ON \ -DUSE_GLES2=OFF \ -DUSE_OPENVR=OFF \ -DUSE_RAPIDJSON=OFF \ -DUSE_TBB=OFF \ -DUSE_VTK=OFF \ -DUSE_XLIB=ON \ -Wno-dev \ .. make ${NUMJOBS} make install DESTDIR=$PKG cd .. mkdir -p $PKG/etc/profile.d cat $CWD/profile.sh > $PKG/etc/profile.d/$PACKAGE.sh cat $CWD/profile.csh > $PKG/etc/profile.d/$PACKAGE.csh chmod 755 $PKG/etc/profile.d/$PACKAGE.* # Useless scrips rm -f $PKG/usr/bin/*.sh #mkdir -p $DOCS cp -a README.txt $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi