# Maintainer: David Runge <dave@sleepmap.de>

pkgname=gxplugins.lv2
_name=GxPlugins
pkgver=0.7
pkgrel=2
pkgdesc="A set of extra lv2 plugins from the guitarix project"
arch=('x86_64')
url="https://github.com/brummer10/gxplugins.lv2"
license=('GPL3')
groups=('lv2-plugins')
depends=('cairo')
makedepends=('lv2')
provides=('gxplugins-lv2')
replaces=('gxplugins-lv2')
source=("$pkgname-$pkgver.tar.gz::https://github.com/brummer10/${pkgname}/releases/download/v${pkgver}/${_name}_${pkgver}.tar.gz")
sha512sums=('8f303accc38936c5c0578535c6f208baee9b6630df5310b4311958b6bd86a0290943c1f6fe63d404d8855c6089abc1e97a946aea815caf33ae067eb83431498e')

prepare() {
  mv -v "${_name}_$pkgver" "$pkgname-$pkgver"
  cd "$pkgname-$pkgver"
  # making stack non-executable:
  # https://github.com/brummer10/GxPlugins.lv2/issues/24
  sed -e "/LDFLAGS +=/ s/$/ ${LDFLAGS},-z,noexecstack/" \
      -i */Makefile
  # removing custom strip call, that makes plugins lack full RELRO:
  # https://github.com/brummer10/GxPlugins.lv2/issues/23
  sed -e '/STRIP/d' \
      -i */Makefile
}

build() {
  cd "$pkgname-$pkgver"
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
}
