upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / cardinal / repos / community-x86_64 / PKGBUILD
blobddee02d52e82233fdd94b0584d5de5a7515751ca
1 # Maintainer: David Runge <dvzrv@archlinux.org>
3 pkgbase=cardinal
4 pkgname=(cardinal cardinal-clap cardinal-data cardinal-jack cardinal-lv2 cardinal-vst cardinal-vst3)
5 pkgver=23.02
6 pkgrel=2
7 pkgdesc="Virtual modular synthesizer"
8 arch=(x86_64)
9 url="https://github.com/DISTRHO/Cardinal"
10 license=(GPL3)
11 makedepends=(
12   cmake
13   dbus
14   file
15   gcc-libs
16   gendesk
17   git
18   glibc
19   jansson
20   libarchive
21   libglvnd
22   liblo
23   libsndfile
24   libsamplerate
25   libx11
26   libxext
27   libxrandr
28   mold
29   python
30   speexdsp
32 checkdepends=(
33   kxstudio-lv2-extensions
34   lv2
35   lv2lint
36   mod-lv2-extensions
37   xorg-server-xvfb
39 source=(
40   https://github.com/DISTRHO/$pkgbase/releases/download/$pkgver/$pkgbase-$pkgver.tar.xz
41   $pkgbase-$pkgver.svg::https://raw.githubusercontent.com/DISTRHO/Cardinal/eb95b5990cf734c10f2caab1a246eac893f0266d/plugins/Cardinal/orig/distrho.svg
43 sha512sums=('60d6dcb2f3c90e41739c645f75408dc1603c5c999819577be26dbc7d05e2fbbce8dbf3d8d20d7d9e3075459f0fadb6f32c17d98c2186cf0ebed767f016410aec'
44             '31a7d1e548285af0ead1bc844fbb1d35b50f6284159047cb401a829d4068992fa328770e42c377c08d013f6787e55ac12b94eba4d5af4b90373b157971fc8835')
45 b2sums=('c28b1aff34c3e1b5fff01cf74c2df38e4ed58e7c56ccb5e106ef8582675e2914e4973bca874053371521150a838007d4eaa0e8ea58899337c22a2f5b22dfd5cd'
46         'd82fefe15234c1ed3a4d487c6082a2e3ac73b60f11041314e99c5a5de5b3ea141efbd5afd18851510bd4f801fd71f7cd89d54d86258d1ba750bbfd762aa37a8d')
48 _common_depends=(
49   cardinal-data
50   dbus libdbus-1.so
51   file libmagic.so
52   gcc-libs
53   glibc
54   jansson
55   libarchive libarchive.so
56   libglvnd libGL.so
57   liblo liblo.so
58   libsamplerate libsamplerate.so
59   libsndfile libsndfile.so
60   libx11
61   libxext
62   libxrandr
63   speexdsp libspeexdsp.so
65 _common_optdepends=(
66   'carla: for carla module and ildaeil plugin host'
67   'mpv: for experimental video support'
68   'xdg-desktop-portal-impl: for file browser'
71 _pick() {
72   local p="$1" f d; shift
73   for f; do
74     d="$srcdir/$p/${f#$pkgdir/}"
75     mkdir -p "$(dirname "$d")"
76     mv "$f" "$d"
77     rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
78   done
81 prepare() {
82   gendesk -n \
83           --exec Cardinal \
84           --name Cardinal \
85           --pkgname studio.kx.distrho.Cardinal \
86           --pkgdesc "$pkgdesc JACK standalone" \
87           --icon $pkgbase \
88           --genericname "Virtual modular synthesizer"
91 build() {
92   export CFLAGS+=" -B/usr/lib/mold -Wno-format-security"
93   export CXXFLAGS+=" -B/usr/lib/mold -Wno-format-security"
94   make PREFIX=/usr SYSDEPS=true WITH_LTO=true -C $pkgname-$pkgver
97 check() {
98   declare -A _links=(
99     ["Cardinal"]="https://distrho.kx.studio/plugins/cardinal"
100     ["CardinalFX"]="https://distrho.kx.studio/plugins/cardinal#fx"
101     ["CardinalSynth"]="https://distrho.kx.studio/plugins/cardinal#synth"
102   )
104   # NOTE: lvlint fails on Cardinal, as it makes use of non-standard Port Class, which it does not support yet
105   for _name in Cardinal{FX,Synth}; do
106     xvfb-run lv2lint -s "lv2_generate_ttl" -Mpack -I $pkgname-$pkgver/bin/$_name.lv2 "${_links[$_name]}"
107   done
110 package_cardinal() {
111   depends=(cardinal-jack cardinal-lv2 cardinal-vst cardinal-vst3)
113   make PREFIX=/usr SYSDEPS=true DESTDIR="$pkgdir" install -C $pkgbase-$pkgver
115   (
116     cd "$pkgdir"
117     # have find-libdeps resolve dependencies properly:
118     # https://gitlab.archlinux.org/archlinux/devtools/-/issues/102
119     find usr/lib -type f \( -iname "*.clap" -or -iname "*.so" \) -exec chmod +x {} \;
121     _pick $pkgbase-clap usr/lib/clap/
122     _pick $pkgbase-data usr/share/$pkgbase
123     _pick $pkgbase-data usr/share/doc
124     _pick $pkgbase-jack usr/bin/
125     _pick $pkgbase-lv2 usr/lib/lv2/
126     _pick $pkgbase-vst usr/lib/vst/
127     _pick $pkgbase-vst3 usr/lib/vst3/
128   )
131 package_cardinal-clap() {
132   pkgdesc+=" - CLAP plugin"
133   groups=(clap-plugins pro-audio)
134   depends=("${_common_depends[@]}" clap-host)
135   optdepends=("${_common_optdepends[@]}")
137   mv -v $pkgbase-clap/* "$pkgdir"
140 package_cardinal-data() {
141   pkgdesc+=" - data"
143   mv -v $pkgbase-data/* "$pkgdir"
146 package_cardinal-jack() {
147   pkgdesc+=" - JACK standalone"
148   groups=(pro-audio)
149   depends=("${_common_depends[@]}" hicolor-icon-theme jack)
150   optdepends=("${_common_optdepends[@]}")
152   mv -v $pkgbase-jack/* "$pkgdir"
153   install -vDm 644 *.desktop -t "$pkgdir/usr/share/applications"
154   install -vDm 644 $pkgbase-$pkgver.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/$pkgbase.svg"
157 package_cardinal-lv2() {
158   pkgdesc+=" - LV2 plugin"
159   groups=(lv2-plugins pro-audio)
160   depends=("${_common_depends[@]}" lv2-host)
161   optdepends=("${_common_optdepends[@]}")
163   mv -v $pkgbase-lv2/* "$pkgdir"
166 package_cardinal-vst() {
167   pkgdesc+=" - VST2 plugin"
168   groups=(pro-audio vst-plugins)
169   depends=("${_common_depends[@]}" vst-host)
170   optdepends=("${_common_optdepends[@]}")
172   mv -v $pkgbase-vst/* "$pkgdir"
175 package_cardinal-vst3() {
176   pkgdesc+=" - VST3 plugin"
177   groups=(pro-audio vst3-plugins)
178   depends=("${_common_depends[@]}" vst3-host)
179   optdepends=("${_common_optdepends[@]}")
181   mv -v $pkgbase-vst3/* "$pkgdir"