hedgewars: improve support for arch lacking freepascal

This commit is contained in:
Dylan Nash 2019-12-25 18:48:48 -07:00 committed by Daniel Kolesa
parent 295f08c549
commit 20fa8a6cf0
1 changed files with 18 additions and 10 deletions

View File

@ -6,7 +6,7 @@ wrksrc="${pkgname}-src-${version}"
build_style=cmake
configure_args="-DNOSERVER=1 -DDATA_INSTALL_DIR=/usr/share/${pkgname}
-DPHYSFS_SYSTEM=1 -DCMAKE_VERBOSE_MAKEFILE=1 -DMINIMAL_FLAGS=1"
hostmakedepends="lua51 pkg-config fpc"
hostmakedepends="lua51 pkg-config"
makedepends="ffmpeg-devel lua51-devel physfs-devel qt5-tools-devel SDL2_image-devel
SDL2_mixer-devel SDL2_net-devel SDL2_ttf-devel"
depends="hedgewars-data>=${version}_${revision} libfreeglut"
@ -24,22 +24,30 @@ if [ -n "$CROSS_BUILD" ]; then
fi
case $XBPS_TARGET_MACHINE in
# forces usage of C engine and ghc due to a 32 bit freepascal bug
# https://travis-ci.org/void-linux/void-packages/jobs/596458977#L4316
i686*)
hostmakedepends+=" glew-devel ghc libatomic-devel"
nopie_files+=" /usr/bin/hedgewars"
x86_64*)
hostmakedepends+=" fpc"
;;
*)
# use C engine for architectures lacking freepascal support
# https://www.hedgewars.org/kb/pas2CTutorial
# i686 has a 32 bit freepascal bug
# https://travis-ci.org/void-linux/void-packages/jobs/596458977#L4316
_use_c_engine=1
;;
esac
if [ -n "$_use_c_engine" ]; then
hostmakedepends+=" glew-devel libatomic-devel ghc"
configure_args+=" -DBUILD_ENGINE_C=1"
nopie_files+=" /usr/bin/hedgewars"
fi
pre_configure() {
# remove option not supported by clang
case $XBPS_TARGET_MACHINE in
i686*)
if [ -n "$_use_c_engine" ]; then
CFLAGS=${CFLAGS/-fstack-clash-protection/}
CXXFLAGS=${CXXFLAGS/-fstack-clash-protection/}
;;
esac
fi
}
post_install() {