-
Notifications
You must be signed in to change notification settings - Fork 2
/
PKGBUILD
142 lines (130 loc) · 5.82 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Maintainer: OSAMC <https://github.com/osam-cologne/archlinux-proaudio>
# Contributor: Stephan Springer <buzo+arch@Lini.de>
# Contributor: Thanos Apostolou <thanosapostolou@outlook.com>
# Contributor: Alexandre Moine <alexandre@moine.me>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: |AhIoRoS| < ahioros@gmail.com >
# Contributor: Florian Hülsmann <fh@cbix.de>
pkgbase=tuxguitar
pkgname=tuxguitar
pkgver=1.5.6
pkgrel=1
pkgdesc='Multitrack guitar tablature editor and player'
arch=(x86_64 i686)
url='https://sourceforge.net/projects/tuxguitar/'
license=(LGPL)
groups=(pro-audio)
depends=()
_java_ver=11
_swt_rel='4.22-202111241800'
_swt_rel_i686='4.9-201809060745'
makedepends=(alsa-lib fluidsynth jack "java-environment-openjdk=${_java_ver}" lilv maven qt5-base
suil)
optdepends=('alsa-lib: playback with ALSA'
'fluidsynth: alternative synthesizer for playback'
'jack: playback and MIDI support with JACK'
'lilv: for LV2 extension'
'pulseaudio: playback with PulseAudio'
'qt5-base: for LV2 extension'
'suil: for LV2 extension')
conflicts=(tuxguitar-common tuxguitar-gtk2)
source=("https://downloads.sourceforge.net/tuxguitar/tuxguitar-${pkgver}-src.tar.gz"
'dep-versions.patch'
'tuxguitar.sh')
source_i686=("https://archive.eclipse.org/eclipse/downloads/drops4/R-${_swt_rel_i686}/swt-${_swt_rel_i686%-*}-gtk-linux-x86.zip")
source_x86_64=("https://archive.eclipse.org/eclipse/downloads/drops4/R-${_swt_rel}/swt-${_swt_rel%-*}-gtk-linux-x86_64.zip")
sha256sums=('441e561ffbb9d91470f255c817f6c30300f579bf9013032615efe3f6701af274'
'058bce97ccbdc0de348bd919a3122434424bde29421153e030f4762efff5c432'
'8a5eccd2dca5a02580ccca3838db2220cabbb0a4b080030ea361efbafd7737aa')
sha256sums_x86_64=('55b46b575e8c93172be81e096fb72bce83b60df8087b4863a1a057aaead30b1f')
sha256sums_i686=('5317a8e30121a1c7b6da743bdd658b13491889d95158352de0de16831e5b5a5f')
_javapath="/usr/lib/jvm/java-${_java_ver}-openjdk/bin:$PATH"
# project internal build target names
case $CARCH in
i686) _arch=x86 ;;
armv7h) _arch=armv7hl ;;
*) _arch=$CARCH ;;
esac
prepare() {
cd tuxguitar-$pkgver-src
# locally install pinned SWT version to be included in the package
MAVEN_OPTS="$MAVEN_OPTS -Duser.home=$srcdir" \
PATH="$_javapath" \
mvn install:install-file \
-Dfile="${srcdir}/swt.jar" \
-DgroupId=org.eclipse.swt \
-DartifactId=org.eclipse.swt.gtk.linux.x86_64 \
-Dversion=${_swt_rel:0:-13} \
-Dpackaging=jar
MAVEN_OPTS="$MAVEN_OPTS -Duser.home=$srcdir" \
PATH="$_javapath" \
mvn install:install-file \
-Dfile="${srcdir}/swt.jar" \
-DgroupId=org.eclipse.swt \
-DartifactId=org.eclipse.swt.gtk.linux.x86 \
-Dversion=${_swt_rel_i686:0:-13} \
-Dpackaging=jar
# Reproducible build; pinned SWT versions; use https for swt-repo
patch -p1 -i ../dep-versions.patch
# https://sourceforge.net/p/tuxguitar/support-requests/13/
rm TuxGuitar-resources/resources/soundfont/*
}
build() {
cd tuxguitar-$pkgver-src
MAVEN_OPTS="$MAVEN_OPTS -Duser.home=$srcdir" \
PATH="$_javapath" \
mvn \
-P platform-linux-$_arch \
-Dproject.build.outputTimestamp=$SOURCE_DATE_EPOCH \
clean install
for _module in build-scripts/{tuxguitar,native-modules/tuxguitar-{alsa,fluidsynth,jack,synth-lv2}}-linux-$_arch; do (
cd $_module
MAVEN_OPTS="$MAVEN_OPTS -Duser.home=$srcdir" \
PATH="$_javapath" \
mvn \
-Dproject.build.outputTimestamp=$SOURCE_DATE_EPOCH \
clean install
); done
}
package() {
depends+=(libxtst glibc "java-runtime-openjdk=${_java_ver}" hicolor-icon-theme gtk3)
# base libraries
cd "$srcdir"/tuxguitar-${pkgver}-src/build-scripts/tuxguitar-linux-${_arch}/target/tuxguitar-${pkgver}-linux-${_arch}
install -Dm644 lib/*.jar -t "$pkgdir"/usr/share/java/$pkgname
install -Dm755 lib/*.so -t "$pkgdir"/usr/lib/$pkgname
# plugins
install -Dm644 share/plugins/*.jar -t "$pkgdir"/usr/share/java/$pkgname
cd "$srcdir"/tuxguitar-${pkgver}-src/build-scripts/native-modules
install -Dm644 tuxguitar-{alsa,fluidsynth,jack,synth-lv2}-linux-${_arch}/target/build/share/plugins/*.jar \
-t "$pkgdir"/usr/share/java/$pkgname
install -Dm755 tuxguitar-{alsa,fluidsynth,jack,synth-lv2}-linux-${_arch}/target/build/lib/*.so \
-t "$pkgdir"/usr/lib/$pkgname
install -Dm644 tuxguitar-synth-lv2-linux-${_arch}/target/build/lv2-client/*.png \
-t "$pkgdir"/usr/share/$pkgname/lv2-client
install -Dm755 tuxguitar-synth-lv2-linux-${_arch}/target/build/lv2-client/*.bin \
-t "$pkgdir"/usr/share/$pkgname/lv2-client
# Application data and docs
cd "$srcdir"/tuxguitar-${pkgver}-src/build-scripts/tuxguitar-linux-${_arch}/target/tuxguitar-${pkgver}-linux-${_arch}
install -d "$pkgdir"/usr/share/{,doc/}$pkgname
cp -a {dist,doc,share} "${pkgdir}"/usr/share/${pkgname}/
rm -r "${pkgdir}"/usr/share/${pkgname}/share/{help,plugins,soundfont,lang/toutf.pl}
cp -a share/help "${pkgdir}"/usr/share/doc/$pkgname
# ensure correct permissions for data
find "$pkgdir"/usr/share/{,doc/}$pkgname -type f -not -name *.bin -exec chmod 644 {} \;
# icons
cd "$srcdir"/tuxguitar-${pkgver}-src
for _size in 16x16 24x24 32x32 48x48 64x64 96x96; do
_dir="$pkgdir"/usr/share/icons/hicolor/$_size
install -d "$_dir"/{apps,mimetypes}
install -m644 TuxGuitar/share/skins/Lavender/icon-${_size}.png "$_dir"/apps/tuxguitar.png
for _mime in audio-x-{tuxguitar,gtp,ptb}; do
ln -sr "${_dir}"/apps/tuxguitar.png "$_dir"/mimetypes/${_mime}.png
done
done
# mimetype and launcher
cd "$srcdir"/tuxguitar-${pkgver}-src/misc
install -Dm644 tuxguitar.xml "$pkgdir"/usr/share/mime/packages/tuxguitar.xml
install -Dm644 tuxguitar.desktop "$pkgdir"/usr/share/applications/tuxguitar.desktop
# use custom instead of upstream starter script
install -Dm755 "$srcdir"/tuxguitar.sh "$pkgdir"/usr/bin/tuxguitar
}