diff --git a/srcpkgs/tuxguitar/patches/nogcj.patch b/srcpkgs/tuxguitar/patches/nogcj.patch
new file mode 100644
index 0000000000..f7bfb510c9
--- /dev/null
+++ b/srcpkgs/tuxguitar/patches/nogcj.patch
@@ -0,0 +1,168 @@
+diff -u -r build-scripts/native-modules/tuxguitar-alsa-linux-armv7hl/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-alsa-linux-armv7hl/pom.xml
+--- build-scripts/native-modules/tuxguitar-alsa-linux-armv7hl/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-alsa-linux-armv7hl/pom.xml 2017-02-08 22:06:28.220720753 +0100
+@@ -22,8 +22,8 @@
+
+ ${parent.relativePath}/TuxGuitar-alsa/jni/
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -fPIC
+- -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -fPIC
++ ${LDFLAGS} -fPIC
+ -lasound
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-alsa-jni
+diff -u -r build-scripts/native-modules/tuxguitar-alsa-linux-x86/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-alsa-linux-x86/pom.xml
+--- build-scripts/native-modules/tuxguitar-alsa-linux-x86/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-alsa-linux-x86/pom.xml 2017-02-08 22:06:28.220720753 +0100
+@@ -22,8 +22,8 @@
+
+ ${parent.relativePath}/TuxGuitar-alsa/jni/
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m32 -fPIC
+- -m32 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m32 -fPIC
++ ${LDFLAGS} -m32 -fPIC
+ -lasound
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-alsa-jni
+diff -u -r build-scripts/native-modules/tuxguitar-alsa-linux-x86_64/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-alsa-linux-x86_64/pom.xml
+--- build-scripts/native-modules/tuxguitar-alsa-linux-x86_64/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-alsa-linux-x86_64/pom.xml 2017-02-08 22:06:28.220720753 +0100
+@@ -22,8 +22,8 @@
+
+ ${parent.relativePath}/TuxGuitar-alsa/jni/
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m64 -fPIC
+- -m64 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m64 -fPIC
++ ${LDFLAGS} -m64 -fPIC
+ -lasound
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-alsa-jni
+diff -u -r build-scripts/native-modules/tuxguitar-fluidsynth-linux-armv7hl/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-fluidsynth-linux-armv7hl/pom.xml
+--- build-scripts/native-modules/tuxguitar-fluidsynth-linux-armv7hl/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-fluidsynth-linux-armv7hl/pom.xml 2017-02-08 22:06:28.220720753 +0100
+@@ -24,8 +24,8 @@
+ ${parent.relativePath}/TuxGuitar-fluidsynth/jni/
+ ${tuxguitar.jni.rm}
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -fPIC
+- -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -fPIC
++ ${LDFLAGS} -fPIC
+ -lfluidsynth
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-fluidsynth-jni
+diff -u -r build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86/pom.xml
+--- build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -24,8 +24,8 @@
+ ${parent.relativePath}/TuxGuitar-fluidsynth/jni/
+ ${tuxguitar.jni.rm}
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m32 -fPIC
+- -m32 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m32 -fPIC
++ ${LDFLAGS} -m32 -fPIC
+ -lfluidsynth
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-fluidsynth-jni
+diff -u -r build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86_64/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86_64/pom.xml
+--- build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86_64/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-fluidsynth-linux-x86_64/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -24,8 +24,8 @@
+ ${parent.relativePath}/TuxGuitar-fluidsynth/jni/
+ ${tuxguitar.jni.rm}
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m64 -fPIC
+- -m64 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m64 -fPIC
++ ${LDFLAGS} -m64 -fPIC
+ -lfluidsynth
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-fluidsynth-jni
+diff -u -r build-scripts/native-modules/tuxguitar-jack-linux-armv7hl/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-jack-linux-armv7hl/pom.xml
+--- build-scripts/native-modules/tuxguitar-jack-linux-armv7hl/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-jack-linux-armv7hl/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -24,8 +24,8 @@
+ ${parent.relativePath}/TuxGuitar-jack/jni/
+ ${tuxguitar.jni.rm}
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -fPIC
+- -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -fPIC
++ ${LDFLAGS} -fPIC
+ `pkg-config --libs jack`
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-jack-jni
+diff -u -r build-scripts/native-modules/tuxguitar-jack-linux-x86/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-jack-linux-x86/pom.xml
+--- build-scripts/native-modules/tuxguitar-jack-linux-x86/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-jack-linux-x86/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -24,8 +24,8 @@
+ ${parent.relativePath}/TuxGuitar-jack/jni/
+ ${tuxguitar.jni.rm}
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m32 -fPIC
+- -m32 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m32 -fPIC
++ ${LDFLAGS} -m32 -fPIC
+ `pkg-config --libs jack`
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-jack-jni
+diff -u -r build-scripts/native-modules/tuxguitar-jack-linux-x86_64/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-jack-linux-x86_64/pom.xml
+--- build-scripts/native-modules/tuxguitar-jack-linux-x86_64/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-jack-linux-x86_64/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -24,8 +24,8 @@
+ ${parent.relativePath}/TuxGuitar-jack/jni/
+ ${tuxguitar.jni.rm}
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m64 -fPIC
+- -m64 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m64 -fPIC
++ ${LDFLAGS} -m64 -fPIC
+ `pkg-config --libs jack`
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-jack-jni
+diff -u -r build-scripts/native-modules/tuxguitar-oss-linux-armv7hl/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-oss-linux-armv7hl/pom.xml
+--- build-scripts/native-modules/tuxguitar-oss-linux-armv7hl/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-oss-linux-armv7hl/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -22,8 +22,8 @@
+
+ ${parent.relativePath}/TuxGuitar-oss/jni/
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -fPIC
+- -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -fPIC
++ ${LDFLAGS} -fPIC
+
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-oss-jni
+diff -u -r build-scripts/native-modules/tuxguitar-oss-linux-x86/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-oss-linux-x86/pom.xml
+--- build-scripts/native-modules/tuxguitar-oss-linux-x86/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-oss-linux-x86/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -22,8 +22,8 @@
+
+ ${parent.relativePath}/TuxGuitar-oss/jni/
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m32 -fPIC
+- -m32 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m32 -fPIC
++ ${LDFLAGS} -m32 -fPIC
+
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-oss-jni
+diff -u -r build-scripts/native-modules/tuxguitar-oss-linux-x86_64/pom.xml tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-oss-linux-x86_64/pom.xml
+--- build-scripts/native-modules/tuxguitar-oss-linux-x86_64/pom.xml 2016-12-22 21:04:26.000000000 +0100
++++ tuxguitar-1.4-src-nogcj/build-scripts/native-modules/tuxguitar-oss-linux-x86_64/pom.xml 2017-02-08 22:06:28.224054080 +0100
+@@ -22,8 +22,8 @@
+
+ ${parent.relativePath}/TuxGuitar-oss/jni/
+ ${tuxguitar.jni.cc}
+- -I$(shell gcj -print-file-name=include/) -m64 -fPIC
+- -m64 -fPIC
++ ${CFLAGS} -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -m64 -fPIC
++ ${LDFLAGS} -m64 -fPIC
+
+ ${tuxguitar.jni.ldpath}
+ tuxguitar-oss-jni
diff --git a/srcpkgs/tuxguitar/template b/srcpkgs/tuxguitar/template
new file mode 100644
index 0000000000..a6f727498f
--- /dev/null
+++ b/srcpkgs/tuxguitar/template
@@ -0,0 +1,62 @@
+# Template file for 'tuxguitar'
+pkgname=tuxguitar
+version=1.5.1
+revision=1
+wrksrc="${pkgname}-${version}-src"
+hostmakedepends="apache-maven"
+makedepends="alsa-lib-devel fluidsynth-devel jack-devel"
+depends="virtual?java-runtime gtk+3 hicolor-icon-theme desktop-file-utils"
+short_desc="Multitrack guitar tablature editor and player"
+maintainer="John "
+license="LGPL-2.0-only"
+homepage="http://www.tuxguitar.com.ar/"
+distfiles="${SOURCEFORGE_SITE}/tuxguitar/tuxguitar-${version}-src.tar.gz"
+checksum=5735aadc7f6ae5c1c612a8e8c0e5f4469bc63ddbb566fbba544f0d71e412a9c7
+
+case $XBPS_TARGET_MACHINE in
+ i686) _arch="x86" ;;
+ x86_64) _arch="x86_64" ;;
+ armv7l) _arch="armv7hl" ;;
+ *) broken="package doesn't provide build function for other architectures" ;;
+esac
+
+do_build() {
+ export MAVEN_OPTS="$MAVEN_OPTS -Duser.home=$wrksrc"
+ export JAVA_HOME="/usr/lib/jvm/openjdk"
+ PATH=$PATH:/usr/share/apache-maven/bin
+ 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
+ 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
+
+ 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
+}