summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 70a800da8ce169b2a7784356e87acca49c0f3774 (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
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
# Maintainer: David Runge <dvzrv@archlinux.org>

_name=helm
_pkgname=$_name-synth
pkgbase=helm-synth-git
pkgname=(helm-synth{,-common,-lv2,-standalone,-vst}-git)
pkgver=v0.9.0.r21.gabdedd52
pkgrel=2
pkgdesc="A virtual analog poly synth LV2 and VST2 plugin and standalone application (git version)"
arch=(x86_64)
url="https://tytel.org/helm/"
license=(GPL3)
makedepends=(
  alsa-lib
  freetype2
  git
  hicolor-icon-theme
  jack
  libxcursor
  libglvnd
  libx11
  libxext
  libxinerama
  lv2
)
source=(
  "$_name::git+https://github.com/mtytel/helm.git"
  $_pkgname-gcc91.patch
  $_pkgname-0.9.0-rename_helm-synth.patch
)
sha256sums=('SKIP'
            '8a7e45210cef0af82cf8fa857c2219ab8c6e1eb3279ac0f7bc6e7c3546418f08'
            '4f41a6616720fd9665a511c016ac9b683c721fa77226721ddd2bec35fadc16a1')

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

pkgver() {
  cd $_name
  local ver="$(grep 'JUCERPROJECT.*version' helm.jucer | sed 's/.*version=\"\(.*\)\".*/\1/')"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.r%s.%s" "$ver" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}


prepare() {
  # gcc > 9.1 fixes:
  # https://github.com/mtytel/helm/pull/233
  patch -Np1 -d $_name -i ../$_pkgname-gcc91.patch
  # rename to helm-synth as (kubernetes) helm will be in the repos
  patch -Np1 -d $_name -i ../$_pkgname-0.9.0-rename_helm-synth.patch
  # prevent from linking against libcurl.so for no reason
  sed -e 's/libcurl //g' -i $_name/{builds/linux/{LV2,VST},standalone/builds/linux}/Makefile*
}

build() {
  make \
    -C $_name \
    CONFIG=Release \
    PREFIX=/usr \
    standalone \
    lv2 \
    vst
}

package_helm-synth-git() {
  local make_options=(
  )
  depends=(
    $_pkgname-lv2-git=$pkgver
    $_pkgname-standalone-git=$pkgver
    $_pkgname-vst-git=$pkgver
  )
  provides=(helm-synth)
  conflicts=(helm-synth)

  make \
    -C $_name \
    DESTDIR="$pkgdir/" \
    VSTDIR="$pkgdir/usr/lib/vst" \
    install_lv2 \
    install_standalone \
    install_vst

  (
    cd "$pkgdir"

    # make sure that find-libdeps is able to find dependencies:
    # https://gitlab.archlinux.org/archlinux/devtools/-/issues/102
    find usr/lib/lv2 -type f -iname "*.so" -exec chmod +x {} \;

    _pick $_pkgname-common-git usr/share/doc
    _pick $_pkgname-common-git usr/share/$_pkgname

    _pick $_pkgname-lv2-git usr/lib/lv2

    _pick $_pkgname-standalone-git usr/bin
    _pick $_pkgname-standalone-git usr/share/{applications,icons,man}

    _pick $_pkgname-vst-git usr/lib/vst
  )
}

package_helm-synth-common-git() {
  pkgdesc+=" - common files"
  provides=($_pkgname-common=$pkgver)
  conflicts=($_pkgname-common)

  mv -v $_pkgname-common-git/* "$pkgdir"
}

package_helm-synth-lv2-git() {
  pkgdesc+=" - LV2 plugin"
  groups=(
    pro-audio
    lv2-plugins
  )

  depends+=(
    alsa-lib libasound.so
    freetype2 libfreetype.so
    gcc-libs
    glibc
    helm-synth-common=$pkgver
    libglvnd
    libx11
    libxext
    libxinerama
    lv2-host
  )
  provides=($_pkgname-lv2)
  conflicts=($_pkgname-lv2)

  mv -v $_pkgname-lv2-git/* "$pkgdir"
}

package_helm-synth-standalone-git() {
  pkgdesc+=" - standalone"
  groups=(
    pro-audio
  )
  depends=(
    alsa-lib libasound.so
    freetype2 libfreetype.so
    gcc-libs
    glibc
    helm-synth-common=$pkgver
    hicolor-icon-theme
    libglvnd
    libx11
    libxext
    libxinerama
  )
  provides=($_pkgname-standalone)
  conflicts=($_pkgname-standalone)

  mv -v $_pkgname-standalone-git/* "$pkgdir"
}

package_helm-synth-vst-git() {
  pkgdesc+=" - VST plugin"
  groups=(
    pro-audio
    vst-plugins
  )
  depends=(
    alsa-lib libasound.so
    freetype2 libfreetype.so
    gcc-libs
    glibc
    helm-synth-common=$pkgver
    libglvnd
    libx11
    libxext
    libxinerama
    vst-host
  )
  provides=($_pkgname-vst)
  conflicts=($_pkgname-vst)

  mv -v $_pkgname-vst-git/* "$pkgdir"
}