# Maintainer: AshRa <ashra@genocide.fun>

pkgname=shr3d
pkgver=0.9.9
pkgrel=1
pkgdesc='Shr3D is a hackable, open-source, multi-platform application for playing and practicing guitar and bass'
arch=('x86_64')
url='https://shr3d.app'
license=('Unlicense')
depends=('sdl2' 'mesa' 'pipewire' 'libx11')
source=("file://$(pwd)/../../$pkgname-${pkgver}.tar.gz")
sha256sums=('SKIP')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  g++ -std=c++20 ${CXXFLAGS} ${CPPFLAGS} -fno-exceptions -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic -DNDEBUG -DSHR3D_XDG_PATH shr3d.cpp $(pkg-config --cflags --libs sdl2 gl x11 libpipewire-0.3) -o shr3d
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  install -Dm755 "$srcdir/$pkgname-$pkgver/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm644 "$srcdir/../../../res/shr3d.desktop" "$pkgdir/usr/share/applications/shr3d.desktop"
  install -Dm644 "$srcdir/../../../res/256x256.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/shr3d.png"
}
