This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 297
/
PKGBUILD
300 lines (264 loc) · 9.23 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# Maintainer: George Rawlinson <[email protected]>
# Contributor: OSAMC <https://github.com/osam-cologne/archlinux-proaudio>
# Contributor: Bleuzen <supgesu at gmail dot com>
# Contributor: David Runge <[email protected]>
# Contributor: Florian Hülsmann <[email protected]>
pkgbase=surge-xt
pkgname=(
'surge-xt'
'surge-xt-common'
'surge-xt-standalone'
'surge-xt-vst3'
'surge-xt-clap'
'surge-xt-lv2'
)
pkgver=1.2.3
pkgrel=1
pkgdesc='Subtractive hybrid synthesizer'
arch=('x86_64')
url='https://surge-synthesizer.github.io'
license=('GPL3')
groups=('pro-audio')
_common_depends=(
'glibc'
'gcc-libs'
'cairo'
'fontconfig'
'freetype2'
'libx11'
'libxcb'
'libxkbcommon-x11'
'xcb-util'
'xcb-util-cursor'
'xcb-util-image'
'xcb-util-keysyms'
'xcb-util-renderutil'
'xdg-utils'
'fmt'
'libsamplerate'
)
makedepends=(
"${_common_depends[@]}"
'git'
'cmake'
'libsndfile'
'python'
'libxrandr'
'libxinerama'
'libxcursor'
'alsa-lib'
'jack'
'webkit2gtk'
'ripgrep'
'lv2'
'juce'
)
options=('!lto') # LTO disabled due to crashes at application startup
_commit='bb8dd2b398cfa8d6d1a20daf7dee2cb4e8097dbf'
source=(
"$pkgbase::git+https://github.com/surge-synthesizer/surge#commit=$_commit"
'improve-reproducibility.patch'
'devendor-libs.patch'
'fix-lv2-ftbfs.patch'
'github.com-surge-synthesizer-tuning-library::git+https://github.com/surge-synthesizer/tuning-library'
'github.com-surge-synthesizer-eurorack::git+https://github.com/surge-synthesizer/eurorack'
'github.com-surge-synthesizer-JUCE::git+https://github.com/surge-synthesizer/JUCE'
'github.com-surge-synthesizer-sst-plugininfra::git+https://github.com/surge-synthesizer/sst-plugininfra'
'github.com-surge-synthesizer-sst-cpputils::git+https://github.com/surge-synthesizer/sst-cpputils'
'github.com-surge-synthesizer-sst-filters::git+https://github.com/surge-synthesizer/sst-filters'
'github.com-surge-synthesizer-sst-waveshapers::git+https://github.com/surge-synthesizer/sst-waveshapers'
'github.com-surge-synthesizer-pffft::git+https://github.com/surge-synthesizer/pffft'
'github.com-free-audio-clap::git+https://github.com/free-audio/clap'
'github.com-free-audio-clap-helpers::git+https://github.com/free-audio/clap-helpers'
'github.com-free-audio-clap-juce-extensions::git+https://github.com/free-audio/clap-juce-extensions'
'github.com-simd-everywhere-simde::git+https://github.com/simd-everywhere/simde'
'github.com-ODDSound-MTS-ESP::git+https://github.com/ODDSound/MTS-ESP'
'github.com-LuaJIT-LuaJIT::git+https://github.com/LuaJIT/LuaJIT'
'github.com-taocpp-PEGTL::git+https://github.com/taocpp/PEGTL'
'github.com-gulrak-filesystem::git+https://github.com/gulrak/filesystem'
'github.com-lv2-porting-project-JUCE::git+https://github.com/lv2-porting-project/JUCE#branch=lv2'
)
b2sums=('SKIP'
'6e71b56ffde699319def99e03637d9c3fb6197a6e0637b9f44b52a9207a8e06c8d482c05cdd711ec2c5901f403381dda70e786bca6b56cce14dc449325f24761'
'35ae92a5363334901810d801238ab9e655c2db5695d085bbc431291ef107c5726d2aa919de77fba154ab63b3875df772cc5fd1531c0adcb9215cac99500ba832'
'c43e5a1b9605243be07ab3903885836a2199787f0c7a8dc6ae2be9d8d4a91bcf07fde520c3440f1be425194476065cb287b99446b144c5cd76d012fb0f10f35e'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
pkgver() {
cd "$pkgbase"
git describe --tags | sed 's/^release_xt_//'
}
prepare() {
cd "$pkgbase"
# explicitly state which submodules to use,
# omitting devendored & unused submodules
git submodule init \
libs/tuning-library \
libs/simde \
libs/eurorack/eurorack \
libs/oddsound-mts/MTS-ESP \
libs/JUCE \
libs/LuaJitLib/LuaJIT \
libs/PEGTL \
libs/sst/sst-plugininfra \
libs/sst/sst-cpputils \
libs/clap-juce-extensions \
libs/sst/sst-filters \
libs/sst/sst-waveshapers \
libs/pffft
git config submodule.libs/tuning-library.url "$srcdir/github.com-surge-synthesizer-tuning-library"
git config submodule.libs/simde.url "$srcdir/github.com-simd-everywhere-simde"
git config submodule.libs/eurorack/eurorack.url "$srcdir/github.com-surge-synthesizer-eurorack"
git config submodule.libs/oddsound-mts/MTS-ESP.url "$srcdir/github.com-ODDSound-MTS-ESP"
git config submodule.libs/JUCE.url "$srcdir/github.com-surge-synthesizer-JUCE"
git config submodule.libs/LuaJitLib/LuaJIT.url "$srcdir/github.com-LuaJIT-LuaJIT"
git config submodule.libs/PEGTL.url "$srcdir/github.com-taocpp-PEGTL"
git config submodule.libs/sst/sst-plugininfra.url "$srcdir/github.com-surge-synthesizer-sst-plugininfra"
git config submodule.libs/sst/sst-cpputils.url "$srcdir/github.com-surge-synthesizer-sst-cpputils"
git config submodule.libs/clap-juce-extensions.url "$srcdir/github.com-free-audio-clap-juce-extensions"
git config submodule.libs/sst/sst-filters.url "$srcdir/github.com-surge-synthesizer-sst-filters"
git config submodule.libs/sst/sst-waveshapers.url "$srcdir/github.com-surge-synthesizer-sst-waveshapers"
git config submodule.libs/pffft.url "$srcdir/github.com-surge-synthesizer-pffft"
git -c protocol.file.allow=always submodule update
# setup git submodules for clap-juce-extensions
pushd libs/clap-juce-extensions
git submodule init
git config submodule.clap-libs/clap.url "$srcdir/github.com-free-audio-clap"
git config submodule.clap-libs/clap-helpers.url "$srcdir/github.com-free-audio-clap-helpers"
git -c protocol.file.allow=always submodule update
popd
# setup git submodules for sst-plugininfra
pushd libs/sst/sst-plugininfra
git submodule init
git config submodule.libs/filesystem/filesystem.url "$srcdir/github.com-gulrak-filesystem"
git -c protocol.file.allow=always submodule update
popd
# first shot at improving reproducibility:
# https://github.com/surge-synthesizer/surge/issues/2389
patch -p1 -i "$srcdir/improve-reproducibility.patch"
# devendor libs
patch -p1 -i "$srcdir/devendor-libs.patch"
rg --files-with-matches 'include "fmt/core.h"' | xargs -I@ sed 's|"fmt/core.h"|<fmt/core.h>|g' -i @
rg --files-with-matches 'include "samplerate.h"' | xargs -I@ sed 's|"samplerate.h"|<samplerate.h>|g' -i @
# add missing LV2 header
pushd "$srcdir/github.com-lv2-porting-project-JUCE"
patch -p1 -i "$srcdir/fix-lv2-ftbfs.patch"
popd
# FTBFS due to GCC13
git cherry-pick --no-commit d2fba1c6ff02cbdfa9db2ce06508745c247629b5
}
build() {
# binaries and shared libs have executable stack:
# https://github.com/surge-synthesizer/surge/issues/1701
export LDFLAGS="$LDFLAGS,-z,noexecstack"
cmake \
-B build \
-S "$pkgbase" \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_INSTALL_LIBDIR='/usr/lib' \
-DCMAKE_BUILD_TYPE=Release \
-W no-dev \
-DSURGE_BUILD_TESTRUNNER=OFF
cmake --build build
# build LV2 plugin
cmake \
-B build-lv2 \
-S "$pkgbase" \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_INSTALL_LIBDIR='/usr/lib' \
-DCMAKE_BUILD_TYPE=Release \
-W no-dev \
-DSURGE_BUILD_TESTRUNNER=OFF \
-DJUCE_SUPPORTS_LV2=True \
-DSURGE_JUCE_PATH="$srcdir/github.com-lv2-porting-project-JUCE"
cmake --build build-lv2 --target surge-xt_LV2 surge-fx_LV2 --parallel
}
package_surge-xt() {
depends=($pkgbase-{common,standalone,vst3,clap,lv2}=$pkgver)
# complete install, followed by…
DESTDIR="$pkgdir" cmake --install build
# …moving items out for split packages…
mv "$pkgdir/usr/share/surge-xt" usr-share
mv "$pkgdir/usr/bin" usr-bin
mv "$pkgdir/usr/lib" usr-lib
# …then remove leftovers
rm -rvf "$pkgdir/usr"
}
package_surge-xt-common() {
pkgdesc='Common files for Surge XT'
install -vd "$pkgdir/usr/share/surge-xt"
mv usr-share/* "$pkgdir/usr/share/surge-xt"
cd "$pkgbase"
# documentation
install -vDm644 -t "$pkgdir/usr/share/doc/$pkgbase" AUTHORS README.md doc/*
}
package_surge-xt-standalone() {
pkgdesc+=' - standalone'
depends=(
"surge-xt-common=$pkgver"
'hicolor-icon-theme'
"${_common_depends[@]}"
)
optdepends=(
'jack: audio backend'
'alsa-lib: audio backend'
)
# binaries
install -vd "$pkgdir/usr/bin"
mv usr-bin/* "$pkgdir/usr/bin"
cd "$pkgbase"
# application icons & desktop files
install -vd "$pkgdir/usr/share/"{applications,icons}
cd scripts/installer_linux
cp -r assets/icons/hicolor "$pkgdir/usr/share/icons"
cp -r assets/icons/scalable "$pkgdir/usr/share/icons/hicolor"
install -vDm644 -t "$pkgdir/usr/share/applications" assets/applications/*.desktop
}
package_surge-xt-vst3(){
pkgdesc+=' - VST3 plugin'
groups+=('vst3-plugins')
depends=(
"surge-xt-common=$pkgver"
"${_common_depends[@]}"
'vst3-host'
)
install -vd "$pkgdir/usr/lib"
mv usr-lib/vst3 "$pkgdir/usr/lib"
}
package_surge-xt-clap(){
pkgdesc+=' - CLAP plugin'
groups+=('clap-plugins')
depends=(
"surge-xt-common=$pkgver"
"${_common_depends[@]}"
'clap-host'
)
install -vd "$pkgdir/usr/lib"
mv usr-lib/clap "$pkgdir/usr/lib"
}
package_surge-xt-lv2(){
pkgdesc+=' - LV2 plugin'
groups+=('lv2-plugins')
depends=(
"surge-xt-common=$pkgver"
"${_common_depends[@]}"
'lv2-host'
)
install -vd "$pkgdir/usr/lib/lv2"
cp -vr build-lv2/surge_xt_products/*.lv2 "$pkgdir/usr/lib/lv2"
}