# Maintainer: astar76
# Built by tools/package.sh from the release tar.gz (TARBALL=file://… for an offline build); it keeps pkgver,
# sha256sums and the glibc floor current.
pkgname=nacre-bin
pkgver=0.4.1
pkgrel=1
pkgdesc='A web browser built on WebKitGTK'
arch=('x86_64')
url='https://astar76.com/git/astar76/Nacre'
license=('MPL-2.0')
depends=('glibc>=2.43' 'gcc-libs' 'webkitgtk-6.0' 'gtk4' 'libsoup3' 'libepoxy' 'gstreamer' 'gst-plugins-base' 'gst-plugins-good' 'gst-plugins-bad' 'gst-libav' 'dbus' 'pam' 'hicolor-icon-theme' 'xdg-utils')
optdepends=(
    'libnotify: desktop notifications'
    'xdg-desktop-portal: file pickers'
    'gnome-keyring: keeps the cookie key'
    'gst-plugin-pipewire: sound through PipeWire'
    'cava: music bars'
)
provides=('nacre')
conflicts=('nacre')
options=('!strip' '!debug')
source=("Nacre-$pkgver-Linux-x86_64.tar.gz::${TARBALL:-$url/releases/download/v$pkgver/Nacre-$pkgver-Linux-x86_64.tar.gz}")
sha256sums=('35902a2a539a53320814e9fd4ff670c118153fd8eaa6c788ef2dcf37bdcb2cff')

package() {
    cd "$srcdir/nacre-$pkgver"
    install -d "$pkgdir/usr"
    for d in bin lib share; do [ ! -d "$d" ] || cp -R "$d" "$pkgdir/usr/"; done
    if [ -d "$pkgdir/usr/share/licenses/nacre" ] && [ "$pkgname" != nacre ]; then
        mv "$pkgdir/usr/share/licenses/nacre" "$pkgdir/usr/share/licenses/$pkgname"
    fi
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
