timidity: broken on *-musl / fix cross compilation

This commit is contained in:
newbluemoon 2017-10-24 07:28:14 +02:00 committed by Enno Boland
parent 15ee21b700
commit 64e8a5910e
1 changed files with 24 additions and 2 deletions

View File

@ -1,7 +1,7 @@
# Template file for 'timidity' # Template file for 'timidity'
pkgname="timidity" pkgname="timidity"
version="2.14.0" version="2.14.0"
revision=1 revision=2
build_style=gnu-configure build_style=gnu-configure
wrksrc="TiMidity++-${version}" wrksrc="TiMidity++-${version}"
short_desc="A MIDI to WAVE converter and player" short_desc="A MIDI to WAVE converter and player"
@ -10,7 +10,6 @@ license="GPL-2"
homepage="http://timidity.sourceforge.net" homepage="http://timidity.sourceforge.net"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/TiMidity++-${version}.tar.xz" distfiles="${SOURCEFORGE_SITE}/${pkgname}/TiMidity++-${version}.tar.xz"
checksum="abf0c8367959e85c9e635b8fbd5183fc27bd380e0ef5e45de4158784538c86fc" checksum="abf0c8367959e85c9e635b8fbd5183fc27bd380e0ef5e45de4158784538c86fc"
nocross="configure: error: cannot run test program while cross compiling"
makedepends="alsa-lib-devel libvorbis-devel libao-devel libflac-devel makedepends="alsa-lib-devel libvorbis-devel libao-devel libflac-devel
libX11-devel gtk+-devel ncurses-devel" libX11-devel gtk+-devel ncurses-devel"
@ -19,3 +18,26 @@ configure_args="--with-default-path=/etc/timidity \
--enable-audio=alsa,oss,ao,vorbis,flac --enable-server \ --enable-audio=alsa,oss,ao,vorbis,flac --enable-server \
--enable-alsaseq=yes --enable-network \ --enable-alsaseq=yes --enable-network \
--enable-gtk --enable-ncurses" --enable-gtk --enable-ncurses"
case "$XBPS_TARGET_MACHINE" in
*-musl) broken="build finishes, but timidity segfaults right after execution";;
esac
if [ -n ${CROSS_BUILD} ]; then
# check for va_copy runs test program; assume no for target
configure_args+=" lib_cv_va_copy=no lib_cv___va_copy=no lib_cv_va_val_copy=no"
pre_configure() {
# configure assumes OggFLAC is available on target and uses default values
sed -i -e 's|no_libOggFLAC=""|no_libOggFLAC="yes"|' configure
}
pre_build() {
# build calcnewt with host gcc (calcnewt generates newton_table.c)
gcc -o timidity/calcnewt -lm timidity/calcnewt.c
# remove rule for calcnewt from Makefile and make
# newton_table.c not depend on removed rule
sed -i -e '/calcnewt$(EXEEXT): $(calcnewt_OBJECTS) $(calcnewt_DEPENDENCIES)/,+2d' \
-e 's|\(newton_table.c:\) calcnewt$(EXEEXT)|\1|' timidity/Makefile
}
fi