summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ff67faa6de4fb9d2f3692931a9f6a6bf944822f9 (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
# Maintainer: Robbert van der Helm <mail@robbertvanderhelm.nl>

# This is a split package since most people only need the VST3 plugin right now
pkgbase=spectral-compressor-git
pkgname=('spectral-compressor-clap-git' 'spectral-compressor-vst3-git')
_repo=nih-plug
# The name of the package in the Cargo worksapce
_package=spectral_compressor
# The name of the built plugin bundle or library
_bundle='Spectral Compressor'
pkgver=0.0.1.r1427.f557707
pkgrel=1
pkgdesc='Turn things into pink noise on demand - part of NIH-plug'
arch=('x86_64')
url="https://github.com/robbert-vdh/nih-plug/tree/master/plugins/spectral-compressor"
license=('GPL3')
groups=('nih-plug')
depends=('libglvnd' 'xcb-util-wm')
makedepends=('git' 'cargo-nightly')
source=('git+https://github.com/robbert-vdh/nih-plug.git')
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/$_repo"

    # Currently there's no tagged commit, so the only way to get this `git
    # describe` to output something would be using `--always`, and then you
    # would not get a very useful version number. So if that's the case, we'll
    # just use `0.0.1.rXXX-deadbee`.
    set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
      printf "0.0.1.r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "$srcdir/$_repo"
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
    export RUSTUP_TOOLCHAIN=nightly
    export CARGO_TARGET_DIR=target

    cd "$srcdir/$_repo"
    cargo xtask bundle "$_package" --frozen --release --all-features
}

package_spectral-compressor-clap-git() {
    provides=('spectral-compressor-clap')

    cd "$srcdir/$_repo"
    install -Dm0755 -t "$pkgdir/usr/lib/clap/" "target/bundled/$_bundle.clap"
}

package_spectral-compressor-vst3-git() {
    provides=('spectral-compressor-vst3')

    cd "$srcdir/$_repo"
    install -dm755 "$pkgdir/usr/lib/vst3"
    cp -r "target/bundled/$_bundle.vst3" "$pkgdir/usr/lib/vst3/"
}