Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pkg-scripts/freecad-0.20-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
515 lines (397 sloc)
10.9 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
PKG=freecad | |
VERSION=0.20 | |
VERSIONP=${VERSION/-/+} # just brilliant ! | |
BUILD=0 | |
NPROC=$(( $(nproc) * 4 / 5 + 1 )) | |
PREFIX=/pkg/$PKG-$VERSION-$BUILD | |
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi | |
#B_XERCES=1 | |
#B_OCCT=1 | |
#B_VTK=1 | |
#B_MED=1 | |
#B_QT5=1 | |
#B_PYTHON=1 | |
B_PYSIDE2=1 | |
#B_SIX=1 | |
#B_COIN=1 | |
B_QUARTER=1 | |
B_PIVY=1 | |
#B_BOOST=1 | |
B_FREECAD=1 | |
set -xe | |
umask 022 | |
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.$USER.build.tmp | |
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) | |
mkdir -p $BUILD_TMPDIR/home | |
export TMPDIR=$BUILD_TMPDIR | |
export HOME=$BUILD_TMPDIR/home | |
mkdir -p $PREFIX | |
cat >$PREFIX/profile <<-EOF | |
PATH=$PREFIX/bin:\$PATH:/usr/local/package/bin | |
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi | |
EOF | |
. $PREFIX/profile | |
B=$PREFIX/build | |
mkdir -p $B | |
cd $B | |
(( $B_XERCES )) && { | |
# | |
# Xerces | |
# | |
# https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-3.2.3.tar.gz | |
SRCURL="https://beehive.molgen.mpg.de/a5fa4d920fce31c9ca3bfef241644494/xerces-c-3.2.3.tar.gz" | |
test -e xerces-c-3.2.3.tar.gz || wget -nv ${SRCURL} | |
test -d xerces-c-3.2.3 || tar -xf xerces-c-3.2.3.tar.gz | |
cd xerces-c-3.2.3 | |
CFLAGS="-O2 -fPIC" ./configure \ | |
--prefix=$PREFIX | |
make -j $NPROC | |
make install | |
cd $B | |
} | |
(( $B_OCCT )) && { | |
# | |
# OCCT | |
# | |
# https://dev.opencascade.org/system/files/occt/OCC_7.6.0_release/opencascade-7.6.0.tgz | |
# git clone gitolite@git.dev.opencascade.org:occt occt | |
SRCURL="https://beehive.molgen.mpg.de/e0faf187321d72d15c5bc438215e5605/occt-94748ad.tar.gz" | |
test -e occt-94748ad.tar.gz || wget -nv ${SRCURL} | |
test -d occt-94748ad || tar -xf occt-94748ad.tar.gz | |
cd occt-94748ad | |
mkdir build || true | |
cd build | |
cmake \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DCMAKE_PREFIX_PATH=$PREFIX \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
.. | |
make -j $NPROC | |
make install | |
cd $B | |
} | |
(( $B_VTK )) && { | |
# | |
# VTK | |
# | |
# https://www.vtk.org/files/release/9.1/VTK-9.1.0.tar.gz | |
SRCURL="https://beehive.molgen.mpg.de/96508e51d7c3764cd5aba06fffd9864e/VTK-9.1.0.tar.gz" | |
test -e VTK-9.1.0.tar.gz || wget -nv ${SRCURL} | |
test -d VTK-9.1.0 || tar -xf VTK-9.1.0.tar.gz | |
cd VTK-9.1.0 | |
mkdir build || true | |
cd build | |
cmake \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DCMAKE_PREFIX_PATH=$PREFIX \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
.. | |
make -j $NPROC | |
make install | |
cd $B | |
} | |
(( ${B_MED} )) && { | |
# | |
# libMED | |
# | |
# https://github.com/vejmarie/libMED/archive/refs/heads/master.zip | |
SRCURL="https://beehive.molgen.mpg.de/b734f36c30f66b2f3e2f45ae3ae99fee/libMED-master.zip" | |
test -e libMED-master.zip || wget -nv ${SRCURL} | |
test -d libMED-master || unzip libMED-master.zip | |
cd libMED-master | |
mkdir build || true | |
cd build | |
cmake \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DCMAKE_PREFIX_PATH=$PREFIX \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
.. | |
make -j $NPROC | |
make install | |
cd $B | |
} | |
(( $B_QT5 )) && { | |
#SRCURL="https://beehive.molgen.mpg.de/e1447db4f06c841d8947f0a6ce83a7b5/qt-everywhere-src-5.15.2.tar.xz" | |
# https://download.qt.io/archive/qt/5.15/5.15.4/single/qt-everywhere-opensource-src-5.15.4.tar.xz | |
SRCURL="https://beehive.molgen.mpg.de/5b6bba4f5f2749ed259e734a082e3b4e/qt-everywhere-opensource-src-5.15.4.tar.xz" | |
PATCHURL[0]="https://beehive.molgen.mpg.de/3613046beccc11da5b3ce0ea07a9600e/qt-everywhere-opensource-src-5.15.4-kf5-1.patch" | |
PATCHFILE[0]=${PATCHURL[0]##*/} | |
PATCHURL[1]="https://beehive.molgen.mpg.de/0d17b8b6e93cb8c53c4027c0d0757e5c/qt5.15.4-webengine-glibc-2.33.patch" | |
PATCHFILE[1]=${PATCHURL[1]##*/} | |
test -e qt-everywhere-opensource-src-5.15.4.tar.xz || wget -nv ${SRCURL} | |
test -d qt-everywhere-src-5.15.4 || tar xf qt-everywhere-opensource-src-5.15.4.tar.xz | |
test -e ${PATCHFILE[0]} || wget -nv ${PATCHURL[0]} | |
test -e ${PATCHFILE[1]} || wget -nv ${PATCHURL[1]} | |
cd qt-everywhere-src-5.15.4 | |
patch -p1 -N < ${B}/${PATCHFILE[0]} || true | |
cd qtwebengine | |
patch -p1 -N < ${B}/${PATCHFILE[1]} || true | |
cd .. | |
sed -e '/webengine-system-libevent/ s/=true\s*$/=false/' -i qtwebengine/src/core/config/linux.pri | |
./configure \ | |
-prefix ${PREFIX}/qt5 \ | |
-nomake examples \ | |
-nomake tests \ | |
-opensource \ | |
-confirm-license \ | |
-no-strip \ | |
-no-pch \ | |
-verbose \ | |
-xcb \ | |
-qpa xcb \ | |
-opengl | |
make -j $NPROC | |
make install | |
cd $B | |
} | |
# | |
# eigenes python ( muss noch nach oben ) | |
# | |
PYTHONVERSION=3.9.7 | |
PYTHONVERMAIN=${PYTHONVERSION%.*} | |
(( ${B_PYTHON} )) && { | |
SRCURL=https://beehive.molgen.mpg.de/fddb060b483bc01850a3f412eea1d954/Python-3.9.7.tar.xz | |
test -e Python-$PYTHONVERSION.tar.xz || wget -nv $SRCURL | |
test -d Python-$PYTHONVERSION || tar -xf Python-$PYTHONVERSION.tar.xz | |
cd Python-$PYTHONVERSION | |
LDFLAGS="-Wl,-rpath=$PREFIX/lib" \ | |
./configure \ | |
--prefix=$PREFIX \ | |
--enable-shared | |
make -j $NPROC | |
make install | |
pip3 install --upgrade pip | |
#pip3 install PySide2 | |
#pip3 install Cython | |
#pip3 install lxml | |
#pip3 install numpy | |
#pip3 install scour | |
#pip3 install serial | |
#pip3 install pytest | |
cd $B | |
} | |
# | |
# PYSIDE2 | |
# | |
(( ${B_PYSIDE2} )) && { | |
# git clone https://code.qt.io/pyside/pyside-setup | |
# cd pyside-setupg | |
# git branch --track 5.12 origin/5.12 | |
# git checkout 5.12 | |
SRCURL="https://beehive.molgen.mpg.de/44781c5c3c25c7ec0b19c4730999e828/pyside-setup-5.15.2.1.tar" | |
test -e pyside-setup-5.15.2.1.tar || wget -nv $SRCURL | |
test -d pyside-setup || tar -xf pyside-setup-5.15.2.1.tar | |
cd pyside-setup | |
python3 setup.py install \ | |
--qmake=${PREFIX}/qt5/bin/qmake \ | |
--parallel=$NPROC \ | |
--build-tests | |
cd $B | |
} | |
# | |
# SIX | |
# | |
(( ${B_SIX} )) && { | |
# git clone https://github.com/benjaminp/six | |
# cd six | |
# git checkout 5.12 | |
SRCURL="https://beehive.molgen.mpg.de/edec07c9f1e6be600e3baa65a1d258b6/six-git-1.16.0.tar" | |
test -e six-git-1.16.0.tar || wget -nv $SRCURL | |
test -d six || tar -xf six-git-1.16.0.tar | |
cd six | |
python3 setup.py install | |
cd $B | |
} | |
(( ${B_COIN} )) && { | |
# | |
# Coin3D | |
# | |
# https://github.com/coin3d/coin/releases/download/Coin-4.0.0/coin-4.0.0-src.tar.gz | |
# SRCURL="https://beehive.molgen.mpg.de/2377d11b38c8eddd92d8bb240f5bf4ee/coin-4.0.0-src.tar.gz" | |
# git clone --recurse-submodules https://github.com/coin3d/coin | |
SRCURL="https://beehive.molgen.mpg.de/3dd594519dfb98d141d890e26da5715c/coin-git-37b973ac.tar" | |
PKGARC=${SRCURL##*/} | |
test -e ${PKGARC} || wget -nv $SRCURL | |
test -d coin || tar -xf ${PKGARC} | |
cmake \ | |
-Hcoin \ | |
-Bcoin_build \ | |
-G "Unix Makefiles" \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCOIN_BUILD_DOCUMENTATION=OFF \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DBOOST_ROOT=$PREFIX | |
cmake \ | |
--build coin_build \ | |
--target all \ | |
--config Release \ | |
-- -j${NPROC} | |
cmake \ | |
--build coin_build \ | |
--target install \ | |
--config Release \ | |
-- -j${NPROC} | |
chmod 755 ${PREFIX}/bin/coin-config | |
cd $B | |
} | |
(( ${B_QUARTER} )) && { | |
# | |
# Quarter | |
# | |
# bee download https://github.com/coin3d/quarter.git | |
SRCURL="https://beehive.molgen.mpg.de/1502531d13fd3d4b4ff849ccddde3115/quarter-builds_p46_6297049.tar.bz2" | |
PKGARC=${SRCURL##*/} | |
test -e ${PKGARC} || wget -nv $SRCURL | |
test -d ${PKGARC%%.*} || tar -xf ${PKGARC} | |
# cd ${PKGARC%%.*} | |
# mkdir -pv soqt_build || true | |
# sed -i -e '/^add_subdirectory(data)/ s/add/#add/;/^add_subdirectory(src)/ s/add/#add/' ${PKGARC%%.*}/CMakeLists.txt | |
cmake \ | |
--trace-expand \ | |
-H${PKGARC%%.*} \ | |
-Bquarter_build \ | |
-G "Unix Makefiles" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
-DCMAKE_PREFIX_PATH=$PREFIX \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DSOQT_BUILD_DOCUMENTATION=OFF \ | |
-DSOQT_BUILD_TESTS=OFF | |
cd quarter_build | |
make clean | |
make -j${NPROC} | |
make install | |
cd $B | |
} | |
# | |
# SOQT | |
# | |
(( ${B_SOQT_NONO} )) && { | |
# bee download https://github.com/coin3d/soqt.git | |
# cd pivy-0.6.7_p3_3a344e1 | |
PKGARC=soqt-builds_p62_b607c58e.tar.bz2 | |
SRCURL="https://beehive.molgen.mpg.de/55e7fa71948c71cda76247a96c9bb953/${PKGARC}" | |
test -e ${PKGARC} || wget -nv $SRCURL | |
test -d ${PKGARC%%.*} || tar -xf ${PKGARC} | |
cd ${PKGARC%%.*} | |
mkdir -pv build || true | |
cmake \ | |
-H. -Bbuild \ | |
-G "Unix Makefiles" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
-DCMAKE_PREFIX_PATH=$PREFIX \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DSOQT_BUILD_DOCUMENTATION=OFF | |
cmake \ | |
--build build \ | |
--target all \ | |
--config Release \ | |
-- -j${NPROC} | |
cmake \ | |
--build build \ | |
--target install \ | |
--config Release \ | |
-- -j${NPROC} | |
cd $B | |
} | |
# | |
# PIVY | |
# | |
(( ${B_PIVY} )) && { | |
# bee download https://github.com/coin3d/pivy.git | |
# cd pivy-0.6.7_p3_3a344e1 | |
SRCURL="https://beehive.molgen.mpg.de/6922534116c5feeeb735b05535c8e66b/pivy-0.6.7_p3_3a344e1.tar.bz2" | |
test -e pivy-0.6.7_p3_3a344e1.tar.bz2 || wget -nv $SRCURL | |
test -d pivy-0.6.7_p3_3a344e1 || tar -xf pivy-0.6.7_p3_3a344e1.tar.bz2 | |
cd pivy-0.6.7_p3_3a344e1 | |
# python3 setup.py install | |
mkdir -pv build || true | |
cd build | |
cmake \ | |
--trace-expand \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
.. | |
cmake \ | |
--build . \ | |
--target all \ | |
--config Release \ | |
-- -j${NPROC} | |
make | |
make install | |
cd $B | |
} | |
(( ${B_BOOST} )) && { | |
# | |
# boost_* | |
# | |
BOOSTVERSION=1.75.0 | |
BOOSTVERSION_USCORED=1_75_0 | |
PKGCFLAGS="-O2 -fPIC" | |
SRCURL=https://beehive.molgen.mpg.de//38813f6feb40387dfe90160debd71251/boost_1_75_0.tar.gz | |
test -e boost_$BOOSTVERSION_USCORED.tar.gz || wget -nv ${SRCURL} | |
test -d boost_$BOOSTVERSION_USCORED || tar -xf boost_$BOOSTVERSION_USCORED.tar.gz | |
cd boost_$BOOSTVERSION_USCORED | |
# sed -e "/using python/ s|;|: ${PREFIX}/include/python${PYTHONVERMAIN} ;|" -i bootstrap.sh | |
# aus freecad-source/cMake/FreeCAD_Helpers/SetupBoost.cmake : | |
# filesystem,program_options,regex,system,thread,date_time,pthread | |
./bootstrap.sh \ | |
--with-toolset=gcc \ | |
--with-icu \ | |
--with-python=$PREFIX/bin/python3 \ | |
--with-python-root=$PREFIX \ | |
--with-libraries=filesystem,program_options,regex,system,thread,date_time,python || exit 1 | |
./b2 \ | |
-j $NPROC \ | |
--layout=system \ | |
--build-dir=build-python3 \ | |
--prefix=$PREFIX \ | |
--libdir=$PREFIX/lib \ | |
--build-type=minimal \ | |
toolset=gcc \ | |
variant=release \ | |
debug-symbols=off \ | |
link=shared \ | |
threading=multi \ | |
runtime-link=shared \ | |
python=$PYTHONVERMAIN \ | |
cflags="$PKGCFLAGS" \ | |
cxxflags="$PKGCFLAGS" \ | |
install || exit 1 | |
cd $B | |
} | |
(( ${B_FREECAD} )) && { | |
# test -d freecad-source || git clone https://github.com/FreeCAD/FreeCAD.git freecad-source | |
SRCTAR=freecad-source-35919e2a-git.tar | |
test -e ${SRCTAR} || wget "https://beehive.molgen.mpg.de/a8c1ac24d7827b170095e6d05ee0ec94/${SRCTAR}" | |
test -d freecad-source || tar xf ${SRCTAR} | |
mkdir freecad-build || true | |
cd freecad-build | |
cmake \ | |
--trace-expand \ | |
-DCMAKE_INSTALL_PREFIX=$PREFIX \ | |
-DCMAKE_VERBOSE_MAKEFILE=ON \ | |
-DCMAKE_PREFIX_PATH="${PREFIX};${PREFIX}/qt5" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_EXE_LINKER_FLAGS="-L${PREFIX}/lib" \ | |
-DCMAKE_SHARED_LINKER_FLAGS="-L${PREFIX}/lib" \ | |
-DCMAKE_INSTALL_RPATH="${PREFIX}/lib;${PREFIX}/qt5/lib" \ | |
-DPySide2_DIR=$PREFIX \ | |
-Wno-dev \ | |
../freecad-source | |
make clean | |
make -j $NPROC | |
make install | |
} | |
cd $PREFIX/bin/ | |
cat >qt.conf<<_EOC_ | |
[Paths] | |
Prefix = /pkg/freecad-0.20-0/qt5 | |
#Translations = i18n | |
_EOC_ | |
cd $B |