2017-11-22 19:40:17 +01:00
|
|
|
TERMUX_PKG_HOMEPAGE=https://www.openfoam.com
|
|
|
|
TERMUX_PKG_DESCRIPTION="OpenFOAM is a CFD software written in C++"
|
|
|
|
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
|
|
|
|
TERMUX_PKG_LICENSE="GPL-3.0"
|
2022-02-08 18:28:59 +01:00
|
|
|
TERMUX_PKG_VERSION=2112
|
2020-07-12 09:15:11 +02:00
|
|
|
TERMUX_PKG_SRCURL=https://develop.openfoam.com/Development/openfoam/-/archive/OpenFOAM-v${TERMUX_PKG_VERSION}/openfoam-OpenFOAM-v${TERMUX_PKG_VERSION}.tar.gz
|
2022-02-08 18:28:59 +01:00
|
|
|
TERMUX_PKG_SHA256=ede3e2f6d7aed50969e5b9dbc06a0667f6d69b0d76adfc53f474d9ba5bf42272
|
2020-07-12 09:15:11 +02:00
|
|
|
TERMUX_PKG_DEPENDS="openmpi, flex, boost, cgal, fftw, readline, libc++"
|
2022-03-01 15:16:18 +01:00
|
|
|
TERMUX_PKG_BUILD_DEPENDS="boost-headers"
|
2021-12-27 15:41:02 +01:00
|
|
|
TERMUX_PKG_GROUPS="science"
|
2017-11-22 19:40:17 +01:00
|
|
|
TERMUX_PKG_RM_AFTER_INSTALL="opt/OpenFOAM-v${TERMUX_PKG_VERSION}/build"
|
|
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
2019-10-25 11:41:47 +02:00
|
|
|
TERMUX_PKG_HOSTBUILD=true
|
2017-11-22 19:40:17 +01:00
|
|
|
|
|
|
|
termux_step_host_build() {
|
|
|
|
(
|
|
|
|
cd $TERMUX_PKG_SRCDIR
|
|
|
|
set +u
|
|
|
|
source etc/bashrc WM_ARCH_OPTION=32 || true
|
|
|
|
cd wmake/src
|
|
|
|
make
|
|
|
|
source ../../etc/bashrc WM_ARCH_OPTION=64 || true
|
|
|
|
set -u
|
|
|
|
make
|
|
|
|
)
|
2020-07-12 09:15:11 +02:00
|
|
|
mkdir -p platforms/tools
|
|
|
|
mv $TERMUX_PKG_SRCDIR/platforms/tools/linuxGcc platforms/tools/
|
|
|
|
mv $TERMUX_PKG_SRCDIR/platforms/tools/linux64Gcc platforms/tools/
|
2017-11-22 19:40:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_pre_configure() {
|
|
|
|
if [ "$TERMUX_ARCH" == "aarch64" ]; then
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH_FOLDER=linuxARM64Clang
|
2017-11-22 19:40:17 +01:00
|
|
|
TERMUX_COMPILER_PREFIX="aarch64-linux-android"
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH=aarch64
|
2017-11-22 19:40:17 +01:00
|
|
|
elif [ "$TERMUX_ARCH" == "arm" ]; then
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH_FOLDER=linuxARM7Clang
|
2017-11-22 19:40:17 +01:00
|
|
|
TERMUX_COMPILER_PREFIX="arm-linux-androideabi"
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH=armv7l
|
2017-11-22 19:40:17 +01:00
|
|
|
elif [ "$TERMUX_ARCH" == "i686" ]; then
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH_FOLDER=linuxClang
|
2017-11-22 19:40:17 +01:00
|
|
|
TERMUX_COMPILER_PREFIX="i686-linux-android"
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH=i686
|
2017-11-22 19:40:17 +01:00
|
|
|
elif [ "$TERMUX_ARCH" == "x86_64" ]; then
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH_FOLDER=linux64Clang
|
2017-11-22 19:40:17 +01:00
|
|
|
TERMUX_COMPILER_PREFIX="x86_64-linux-android"
|
2020-07-12 09:15:11 +02:00
|
|
|
ARCH=x86_64
|
2017-11-22 19:40:17 +01:00
|
|
|
fi
|
|
|
|
sed -i "s%\@TERMUX_COMPILER_PREFIX\@%${TERMUX_COMPILER_PREFIX}%g" "$TERMUX_PKG_SRCDIR/wmake/rules/General/Clang/c"
|
|
|
|
sed -i "s%\@TERMUX_COMPILER_PREFIX\@%${TERMUX_COMPILER_PREFIX}%g" "$TERMUX_PKG_SRCDIR/wmake/rules/General/Clang/c++"
|
|
|
|
sed -i "s%\@TERMUX_COMPILER_PREFIX\@%${TERMUX_COMPILER_PREFIX}%g" "$TERMUX_PKG_SRCDIR/wmake/rules/General/general"
|
2020-07-12 09:15:11 +02:00
|
|
|
|
|
|
|
mkdir -p platforms/tools
|
|
|
|
cp -r $TERMUX_PKG_HOSTBUILD_DIR/platforms/tools/linux64Gcc platforms/tools/${ARCH_FOLDER}
|
2017-11-22 19:40:17 +01:00
|
|
|
if [ $TERMUX_ARCH_BITS = 32 ]; then
|
2020-07-12 09:15:11 +02:00
|
|
|
cp -r $TERMUX_PKG_HOSTBUILD_DIR/platforms/tools/linuxGcc platforms/tools/${ARCH_FOLDER}
|
2017-11-22 19:40:17 +01:00
|
|
|
else
|
2020-07-12 09:15:11 +02:00
|
|
|
cp -r $TERMUX_PKG_HOSTBUILD_DIR/platforms/tools/linux64Gcc platforms/tools/${ARCH_FOLDER}
|
2017-11-22 19:40:17 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make() {
|
2020-07-12 09:15:11 +02:00
|
|
|
# Set ARCH here again so that continued builds work
|
|
|
|
if [ "$TERMUX_ARCH" == "aarch64" ]; then
|
|
|
|
ARCH=aarch64
|
|
|
|
elif [ "$TERMUX_ARCH" == "arm" ]; then
|
|
|
|
ARCH=armv7l
|
|
|
|
elif [ "$TERMUX_ARCH" == "i686" ]; then
|
|
|
|
ARCH=i686
|
|
|
|
elif [ "$TERMUX_ARCH" == "x86_64" ]; then
|
|
|
|
ARCH=x86_64
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Lots and lots of unset env. variables that "set -u"
|
|
|
|
# complains about, so disable exit on error temporarily
|
|
|
|
set +u
|
|
|
|
source "$TERMUX_PKG_SRCDIR"/etc/bashrc || true
|
|
|
|
set -u
|
2017-11-22 19:40:17 +01:00
|
|
|
unset LD_LIBRARY_PATH
|
|
|
|
./Allwmake
|
|
|
|
cd wmake/src
|
|
|
|
make clean
|
|
|
|
make
|
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_make_install() {
|
2021-12-04 11:26:40 +01:00
|
|
|
mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/opt
|
|
|
|
cp -a $TERMUX_PKG_SRCDIR $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/opt/OpenFOAM-v${TERMUX_PKG_VERSION}
|
2017-11-22 19:40:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
termux_step_post_make_install() {
|
2021-12-04 11:26:40 +01:00
|
|
|
sed -i 's%$ARCH%$(uname -m)%g' $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/opt/OpenFOAM-v${TERMUX_PKG_VERSION}/etc/config.sh/settings
|
2017-11-22 19:40:17 +01:00
|
|
|
}
|