summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 943c51e8ca7910e035c8af32eccd20841fac75aa (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
# Maintainer: Christopher Arndt <aur -at- chrisarndt -dot- de>

_pkgname=dragonfly-reverb
pkgname=$_pkgname-git
pkgver=3.2.7.r397.3523f70
pkgrel=2
pkgdesc='An algorithmic hall, plate, room and ER reverb (git version)'
arch=(x86_64)
url='https://michaelwillis.github.io/dragonfly-reverb/'
license=(GPL3)
groups=(pro-audio clap-plugins lv2-plugins vst-plugins vst3-plugins)
depends=(gcc-libs glibc libglvnd libx11)
makedepends=(freeverb3 gendesk git jack libsamplerate lv2)
optdepends=(
  'jack: for standalone applications'
  'clap-host: for CLAP plugins'
  'lv2-host: for LV2 plugins'
  'vst-host: for VST2 plugins'
  'vst3-host: for VST3 plugins'
)
provides=($_pkgname)
conflicts=($_pkgname)
source=("$_pkgname::git+https://github.com/michaelwillis/dragonfly-reverb.git"
        'dpf::git+https://github.com/DISTRHO/DPF.git'
        'pugl::git+https://github.com/DISTRHO/pugl.git')
sha512sums=('SKIP'
            'SKIP'
            'SKIP')

_reverbs=(
    "DragonflyEarlyReflections - A stereo-to-stereo reverb effect based on Moorer's early reflection model from Freeverb3"
    "DragonflyHallReverb - An algorithmic stereo-to-stereo reverb effect based on Hibiki Reverb from Freeverb3"
    "DragonflyPlateReverb - An algorithmic mono-to-stereo reverb effect based on NVerb and STRev from Freeverb3"
    "DragonflyRoomReverb - An algorithmic stereo-to-stereo reverb effect based on ProG Reverb from Freeverb3"
)


pkgver() {
  cd $_pkgname

  cat > version.c <<__EOF__
#include <stdio.h>
#include "DragonflyVersion.h"
void main() {
  printf("%d.%d.%d\n", MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION);
}
__EOF__
  gcc -I./common -o version version.c
  echo "$(./version).r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

prepare() {
  cd $_pkgname

  git submodule init
  git config submodule.dpf.url "$srcdir/dpf"
  git -c protocol.file.allow=always submodule update

  cd dpf

  git submodule init
  git config submodule.dgl.src.pugl-upstream.url "$srcdir/pugl"
  git -c protocol.file.allow=always submodule update
}

build() {
  cd $_pkgname

  declare -A _generic=(
    ["DragonflyEarlyReflections"]="Early Reflections Reverb"
    ["DragonflyHallReverb"]="Concert Hall Reverb"
    ["DragonflyPlateReverb"]="Plate Reverb"
    ["DragonflyRoomReverb"]="Room Reverb"
  )

  for _reverb in "${_reverbs[@]}"; do
    local _name="${_reverb%% - *}"
    local _desc="${_reverb#* - }"
    gendesk -f -n \
      --pkgname "io.github.michaelwillis.${_name}" \
      --name $_name \
      --exec $_name \
      --pkgdesc "$_desc" \
      --genericname "${generic[$name]}" \
      --categories "AudioVideo;Audio"
  done


  # explicitly remove vendored freeverb as it causes issues:
  # https://github.com/michaelwillis/dragonfly-reverb/issues/129
  rm -frv common/freeverb/

  export SYSTEM_LIBSAMPLERATE="true"
  export SYSTEM_FREEVERB3="true"
  make
}

# not working yet
check() {
  cd $_pkgname

  declare -A _plugin_uris=(
    ["DragonflyEarlyReflections"]='urn:dragonfly:early'
    ["DragonflyHallReverb"]='https://github.com/michaelwillis/dragonfly-reverb'
    ["DragonflyPlateReverb"]='urn:dragonfly:plate'
    ["DragonflyRoomReverb"]='urn:dragonfly:room'
  )

  for _reverb in "${_reverbs[@]}"; do
    local _name="${_reverb%% - *}"
    lv2lint -M pack \
      -s lv2_generate_ttl \
      -t "Plugin License" \
      -I "bin/$_name.lv2/" "${_plugin_uris[$_name]}"
  done
}

package() {
  depends+=('libfreeverb3.so')
  cd $_pkgname

  for _reverb in "${_reverbs[@]}"; do
    _reverb="${_reverb%% - *}"
    # Stand-alone JACK clients
    install -Dm 755 "bin/$_reverb" -t "$pkgdir"/usr/bin
    # Desktop integration
    install -Dm 644 "io.github.michaelwillis.$_reverb.desktop" \
      -t "${pkgdir}"/usr/share/applications
    # CLAP plugins
    install -Dm 755 bin/$_reverb.clap \
      -t "${pkgdir}"/usr/lib/clap
    # LV2 bundles
    install -Dm 755 bin/$_reverb.lv2/*.so \
      -t "${pkgdir}"/usr/lib/lv2/$_reverb.lv2/
    install -Dm 644 bin/$_reverb.lv2/*.ttl \
      -t "${pkgdir}"/usr/lib/lv2/$_reverb.lv2/
    # VST2 plugins
    install -Dm 755 bin/$_reverb-vst.so \
      -t "${pkgdir}"/usr/lib/vst
    # VST3 plugins
    install -Dm 755 bin/$_reverb.vst3/Contents/$(uname -m)-linux/$_reverb.so \
      -t "${pkgdir}"/usr/lib/vst3/$_reverb.vst3/Contents/$(uname -m)-linux
  done

  # Documentation
  install -Dm 644 README.md -t "$pkgdir"/usr/share/doc/$pkgname
  cp -r docs/* -t "$pkgdir"/usr/share/doc/$pkgname
}