archrelease: copy trunk to community-any
[ArchLinux/community.git] / distrho-ports / trunk / PKGBUILD
blobf41f3df4215146229511369550edf281aa95a464
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 pkgbase=distrho-ports
4 pkgname=(distrho-ports{,-{lv2,vst,vst3}})
5 pkgver=2021.03.15
6 pkgrel=3
7 pkgdesc="Linux audio plugins and LV2 ports"
8 arch=(x86_64)
9 url="https://github.com/distrho/distrho-ports"
10 license=(GPL2 LGPL3)
11 makedepends=(
12   alsa-lib
13   fftw
14   freetype2
15   git
16   libglvnd
17   libx11
18   libxcursor
19   libxext
20   lv2
21   meson
23 checkdepends=(
24   kxstudio-lv2-extensions
25   lv2lint
26   xorg-server-xvfb
28 source=(git+$url#tag=${pkgver//./-}?signed)
29 b2sums=('SKIP')
30 validpgpkeys=('62B11043D2F6EB6672D93103CDBAA37ABC74FBA0') # falkTX <falktx@falktx.com>
32 _pick() {
33   local p="$1" f d; shift
34   for f; do
35     d="$srcdir/$p/${f#$pkgdir/}"
36     mkdir -p "$(dirname "$d")"
37     mv "$f" "$d"
38     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
39   done
42 build() {
43   arch-meson build $pkgname
44   ninja -C build
47 check() {
48   local _legacy_plugin _legacy_plugins _legacy_urls _plugins _urls _plugin
49   _plugins=(
50     SwankyAmp
51     vitalium
52   )
53   declare -A _urls=(
54     ["SwankyAmp"]="urn:distrho:SwankyAmp"
55     ["vitalium"]="urn:distrho:vitalium"
56   )
57   _legacy_plugins=(
58     Dexed
59     EasySSP
60     HiReSam
61     JuceOPL
62     KlangFalter
63     LUFSMeter
64     LUFSMeterMulti
65     Luftikus
66     Obxd
67     PitchedDelay
68     ReFine
69     StereoSourceSeparation
70     TAL-Dub-3
71     TAL-Filter-2
72     TAL-Filter
73     TAL-NoiseMaker
74     TAL-Reverb-2
75     TAL-Reverb-3
76     TAL-Reverb
77     TAL-Vocoder-2
78     Temper
79     TheFunction
80     ThePilgrim
81     Wolpertinger
82     drowaudio-distortion
83     drowaudio-distortionshaper
84     drowaudio-flanger
85     drowaudio-reverb
86     drowaudio-tremolo
87     drumsynth
88     eqinox
89     vex
90   )
91   declare -A _legacy_urls=(
92     ["Dexed"]="https://github.com/asb2m10/dexed"
93     ["EasySSP"]="http://au.tomatl.org/essp"
94     ["HiReSam"]="https://github.com/klangfreund/SpectrumAnalyser"
95     ["JuceOPL"]="https://bsutherland.github.io/JuceOPLVSTi/"
96     ["KlangFalter"]="https://github.com/HiFi-LoFi/KlangFalter"
97     ["LUFSMeter"]="http://www.klangfreund.com/lufsmeter"
98     ["LUFSMeterMulti"]="http://www.klangfreund.com/lufsmetermultichannel"
99     ["Luftikus"]="https://code.google.com/p/lkjb-plugins/luftikus"
100     ["Obxd"]="https://obxd.wordpress.com"
101     ["PitchedDelay"]="http://code.google.com/p/lkjb-dc12/"
102     ["ReFine"]="https://github.com/lkjbdsp/lkjb-plugins#ReFine"
103     ["StereoSourceSeparation"]="https://github.com/laixinyuan/StereoSourceSepartion"
104     ["TAL-Dub-3"]="urn:juce:TalDub3"
105     ["TAL-Filter-2"]="urn:juce:TalFilter2"
106     ["TAL-Filter"]="urn:juce:TalFilter"
107     ["TAL-NoiseMaker"]="http://kunz.corrupt.ch/products/tal-noisemaker"
108     ["TAL-Reverb-2"]="urn:juce:TalReverb2"
109     ["TAL-Reverb-3"]="urn:juce:TalReverb3"
110     ["TAL-Reverb"]="urn:juce:TalReverb"
111     ["TAL-Vocoder"]="http://kunz.corrupt.ch/products/tal-vocoder"
112     ["Temper"]="https://github.com/creativeintent/temper"
113     ["TheFunction"]="http://arcticanaudio.com/plugins/thefunction"
114     ["ThePilgrim"]="http://arcticanaudio.com/plugins/thepilgrim"
115     ["Wolpertinger"]="http://tumbetoene.tuxfamily.org"
116     ["drowaudio-distortion"]="http://www.drowaudio.co.uk/audio/audio_plugins/distortion"
117     ["drowaudio-distortionshaper"]="http://www.drowaudio.co.uk/audio/audio_plugins/distortion_shaper"
118     ["drowaudio-flanger"]="http://www.drowaudio.co.uk/audio/audio_plugins/flanger"
119     ["drowaudio-reverb"]="http://www.drowaudio.co.uk/audio/audio_plugins/reverb"
120     ["drowaudio-tremolo"]="http://www.drowaudio.co.uk/audio/audio_plugins/tremolo"
121     ["drumsynth"]="urn:juced:DrumSynth"
122     ["eqinox"]="urn:juced:EQinox"
123     ["vex"]="urn:juce:Vex"
124   )
126   (
127     echo "Linting plugins: ${_legacy_plugins[*]}"
128     for _legacy_plugin in "${_legacy_plugins[@]}"; do
129       echo "Linting ${_plugin}: ${_legacy_urls[${_legacy_plugin}]}"
130       if [ -n "${_legacy_urls[${_legacy_plugin}]}" ]; then
131         # ignore lv2_generate_ttl symbol as it can not be removed easily:
132         # https://github.com/DISTRHO/DISTRHO-Ports/issues/58
133         lv2lint -Mpack -s lv2_generate_ttl -I "build/ports-legacy/${_legacy_plugin}.lv2/" "${_legacy_urls[${_legacy_plugin}]}"
134       fi
135     done
136     for _plugin in "${_plugins[@]}"; do
137       echo "Linting $_plugin: ${_urls[${_plugin}]}"
138       if [ -n "${_urls[${_plugin}]}" ]; then
139         # ignore lv2_generate_ttl symbol as it can not be removed easily:
140         # https://github.com/DISTRHO/DISTRHO-Ports/issues/58
141         xvfb-run lv2lint -Mpack -s lv2_generate_ttl -I "build/ports/$_plugin.lv2/" "${_urls[${_plugin}]}" || echo "xvfb-run is too dumb to kill itself"
142       fi
143     done
144   )
146   ninja test -C build
149 package_distrho-ports() {
150   depends=(
151     $pkgbase-{lv2,vst,vst3}
152   )
154   DESTDIR="$pkgdir" meson install -C build
156   (
157     cd "$pkgdir"
158     # have find-libdeps resolve dependencies properly:
159     # https://gitlab.archlinux.org/archlinux/devtools/-/issues/102
160     find usr/lib -type f -iname "*.so" -exec chmod +x {} \;
162     _pick $pkgbase-lv2 usr/lib/lv2
163     _pick $pkgbase-vst usr/lib/vst
164     _pick $pkgbase-vst3 usr/lib/vst3
165   )
168 package_distrho-ports-lv2() {
169   pkgdesc+=" - LV2 plugins"
170   depends=(
171     alsa-lib
172     freetype2
173     gcc-libs
174     glibc
175     libglvnd
176     libx11
177     libxext
178     lv2-host
179   )
181   groups=(
182     lv2-plugins
183     pro-audio
184   )
186   mv -v $pkgname/* "$pkgdir"
189 package_distrho-ports-vst() {
190   pkgdesc+=" - VST plugins"
191   depends=(
192     alsa-lib
193     freetype2
194     gcc-libs
195     glibc
196     libglvnd
197     libx11
198     libxext
199     vst-host
200   )
201   groups=(
202     pro-audio
203     vst-plugins
204   )
206   mv -v $pkgname/* "$pkgdir"
209 package_distrho-ports-vst3() {
210   pkgdesc+=" - VST3 plugins"
211   depends=(
212     freetype2
213     gcc-libs
214     glibc
215     libglvnd
216     vst3-host
217   )
218   groups=(
219     pro-audio
220     vst3-plugins
221   )
223   mv -v $pkgname/* "$pkgdir"