summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ed9cd57feaeda0d47ac06fbf3702d7053ecf0342 (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
# Maintainer: Vasiliy Bukharev <b dot v dot p at outlook dot com>

pkgname=go-dsp-guitar
pkgver=1.6.5
pkgrel=1
pkgdesc="A cross-platform multichannel multi-effects processor for electric guitars and other instruments"
arch=('x86_64')
url='https://github.com/andrepxx/go-dsp-guitar'
license=('Apache')
depends=('jack' 'glibc')
makedepends=('go' 'openssl')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/andrepxx/go-dsp-guitar/archive/v${pkgver}.tar.gz")
sha256sums=('6da8f42b81f22c820d6ffced2ca5dd385f0edcdbc0a301b662f27c486415cfbc')

prepare() {
  cd "${pkgname}-${pkgver}"
  mkdir -p build/
  mkdir -p keys
  openssl genrsa -out keys/private.pem 4096
  openssl req -new -x509 -days 365 -sha512 -key keys/private.pem -out keys/public.pem -subj "/C=DE/ST=Berlin/L=Berlin/O=None/OU=None/CN=localhost"
}

build() {
  cd "${pkgname}-${pkgver}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
  export GOPATH="${srcdir}"/go
  export PATH=$PATH:$GOPATH/bin
  export GO111MODULE="auto"
  go get -d -v
  go build -o build ./...
}

package() {
  cd "${pkgname}-${pkgver}"
  install -Dm755 build/${pkgname}-${pkgver} "${pkgdir}/opt/${pkgname}/go-dsp-guitar"
  cp -R config "${pkgdir}/opt/${pkgname}/"
  cp -R ir "${pkgdir}/opt/${pkgname}/"
  cp -R keys "${pkgdir}/opt/${pkgname}/"
  cp -R webroot "${pkgdir}/opt/${pkgname}/"
  install -d "${pkgdir}/usr/bin/"
  ln -s /opt/${pkgname}/${pkgname} "${pkgdir}/usr/bin/${pkgname}"
  chmod o+r "${pkgdir}/opt/go-dsp-guitar/keys/private.pem"
}