summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9e5bfec987fd79511e8ef69e735ee5390e9f62f4 (plain)
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
# Maintainer: xpufx <github@xpufx.com>
pkgname=tone3000-plugin-bin
pkgver=0.0.12
_tar_sha='c45ea5d64e6eef991b14f1883a4249ed1a883253db1a9d9f0605e0540aba5fc7'
_license_sha='88d4908d7343898f682e47e70f4288728006ed650dbf79e8940c709d55b76326'
pkgrel=3
pkgdesc="TONE3000 — NAM & IR loader plugin (VST3/CLAP/LV2/Standalone) (Github release binary)"
arch=('x86_64')
url="https://github.com/tone-3000/tone3000-plugin"
_github_url="https://github.com/tone-3000/tone3000-plugin"
license=('MIT')
depends=('gtk3' 'alsa-lib' 'freetype2' 'curl' 'hicolor-icon-theme' 'glibc' 'gcc-libs')
optdepends=('jack: JACK audio backend for standalone')
provides=('tone3000-plugin')
conflicts=('tone3000-plugin')
options=('!strip' '!debug')
source=("TONE3000-v${pkgver}-linux-x64.tar.gz::${_github_url}/releases/download/v${pkgver}/TONE3000-v${pkgver}-linux-x64.tar.gz"
        "LICENSE::https://raw.githubusercontent.com/tone-3000/tone3000-plugin/v${pkgver}/LICENSE")
sha256sums=("$_tar_sha"
            "$_license_sha")

package() {
	cd "$srcdir"

	_srcdir="TONE3000-v${pkgver}-linux-x64"
	# Fallback if prepare already ran in a different workdir (e.g. update-package.sh)
	if [ ! -d "$_srcdir" ] && [ -f "TONE3000-v${pkgver}-linux-x64.tar.gz" ]; then
		tar -xzf "TONE3000-v${pkgver}-linux-x64.tar.gz"
	fi

	# Binaries — system-wide locations (Arch audio plugin convention).
	# Do NOT use ${pkgname} in install paths (see paseo fix); use fixed names.
	install -Dm755 "${_srcdir}/TONE3000" "${pkgdir}/usr/bin/TONE3000"
	install -Dm755 "${_srcdir}/TONE3000.clap" "${pkgdir}/usr/lib/clap/TONE3000.clap"

	# VST3 is a bundle dir; LV2 is a bundle dir
	mkdir -p "${pkgdir}/usr/lib/vst3" "${pkgdir}/usr/lib/lv2"
	cp -a "${_srcdir}/TONE3000.vst3" "${pkgdir}/usr/lib/vst3/"
	cp -a "${_srcdir}/TONE3000.lv2" "${pkgdir}/usr/lib/lv2/"

	# Fix permissions: upstream tar ships dirs at 775, Arch wants 755; .so perms
	find "${pkgdir}/usr/lib" -type d -exec chmod 755 {} +
	find "${pkgdir}/usr/lib" -type f -name "*.so" -exec chmod 755 {} +

	# Factory presets — system-wide, replaces previous set (upstream install.sh does rm *.t3kpreset first)
	if compgen -G "${_srcdir}/factory-presets/*.t3kpreset" > /dev/null; then
		install -d "${pkgdir}/usr/share/tone3000/factory-presets"
		install -m644 "${_srcdir}/factory-presets"/*.t3kpreset "${pkgdir}/usr/share/tone3000/factory-presets/"
	fi

	# Icon + desktop entry (Exec must be absolute /usr/bin path)
	install -Dm644 "${_srcdir}/tone3000.png" "${pkgdir}/usr/share/icons/hicolor/512x512/apps/tone3000.png"
	install -d "${pkgdir}/usr/share/applications"
	cat > "${pkgdir}/usr/share/applications/tone3000.desktop" <<DESKTOP
[Desktop Entry]
Type=Application
Name=TONE3000
Comment=Play NAM captures and IRs straight from TONE3000
Exec=/usr/bin/TONE3000
Icon=tone3000
Terminal=false
Categories=AudioVideo;Audio;Music;
StartupWMClass=TONE3000
DESKTOP

	# License — ship original MIT from upstream (second source)
	install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}