void-packages/srcpkgs/tuxguitar/template
2021-04-14 19:33:08 +00:00

71 lines
2.4 KiB
Bash

# Template file for 'tuxguitar'
pkgname=tuxguitar
version=1.5.4
revision=2
wrksrc="${pkgname}-${version}-src"
hostmakedepends="apache-maven openjdk8"
makedepends="alsa-lib-devel fluidsynth-devel jack-devel"
depends="virtual?java-environment icedtea-sound gtk+3 hicolor-icon-theme desktop-file-utils"
short_desc="Multitrack guitar tablature editor and player"
maintainer="John <me@johnnynator.dev>"
license="LGPL-2.0-only"
homepage="http://www.tuxguitar.com.ar/"
distfiles="${SOURCEFORGE_SITE}/tuxguitar/tuxguitar-${version}-src.tar.gz"
checksum=8f73c8c9a90d5df7828f9854a93068c623eec9ed27240436411552484d71503a
case $XBPS_TARGET_MACHINE in
i686*) _arch="x86" ;;
x86_64*) _arch="x86_64" ;;
armv7l*) _arch="armv7hl"
broken="[ERROR] Unable to find artifact. Could not find artifact org.eclipse.swt:org.eclipse.swt.gtk.linux.armv7hl:jar:4.6.1 in swt-repo"
;;
*) broken="package doesn't provide build function for other architectures" ;;
esac
post_extract() {
rm build-scripts/common-resources/common-linux-x86/lib/libicedtea-sound.so
rm build-scripts/common-resources/common-linux-x86_64/lib/libicedtea-sound.so
}
do_build() {
export MAVEN_OPTS="$MAVEN_OPTS -Duser.home=$wrksrc"
export JAVA_HOME="/usr/lib/jvm/java-1.8-openjdk"
for _i in . TuxGuitar-{lib,gm-utils} \
build-scripts/{tuxguitar,native-modules/tuxguitar-{alsa,oss,jack,fluidsynth}}-linux-$_arch; do
(
cd $_i
mvn install
)
done
}
post_build() {
cat > tuxguitar <<_EOF
#!/bin/sh -e
cd /usr/share/tuxguitar
exec ./tuxguitar.sh -Dorg.eclipse.swt.internal.gtk.cairoGraphics=false "\$@"
_EOF
}
do_install() {
vmkdir usr/share
vmkdir usr/lib/tuxguitar
vcopy build-scripts/tuxguitar-linux-${_arch}/target/tuxguitar-${version}-linux-${_arch} usr/share/tuxguitar
for _i in alsa oss jack fluidsynth; do
vcopy build-scripts/native-modules/tuxguitar-${_i}-linux-${_arch}/target/build/* usr/share/tuxguitar
done
mv ${DESTDIR}/usr/share/tuxguitar/lib/*.so ${DESTDIR}/usr/lib/tuxguitar
for _i in 16 24 32 48 64 96; do
vmkdir usr/share/icons/hicolor/${_i}x${_i}/mimetypes
vinstall TuxGuitar/share/skins/Lavender/icon-${_i}x${_i}.png 644 usr/share/icons/hicolor/${_i}x${_i}/apps tuxguitar.png
for _j in audio-x-{tuxguitar,gtp,ptb}; do
ln -s ../apps/tuxguitar.png ${DESTDIR}/usr/share/icons/hicolor/${_i}x${_i}/mimetypes/$_j.png
done
done
vinstall misc/tuxguitar.xml 644 usr/share/mime/packages
vinstall misc/tuxguitar.desktop 644 usr/share/applications
vbin tuxguitar
}