# 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=tunal-bin
pkgver=0.1.0
pkgrel=1
pkgdesc='File manager with Material You styling, music tags, devices and SFTP'
arch=('x86_64')
url='https://archlinux.tail7c4f5e.ts.net/git/astar76/Tunal'
license=('GPL-3.0-or-later' 'Apache-2.0')
# Linked: libc, libm, libgcc_s, libasound, libfontconfig. dlopened (strings of the binary): libEGL/libGL (libglvnd), libwayland-client/-egl, libxkbcommon(-x11), libX11, libX11-xcb, libxcb, libXcursor, libXi, libXrender. Runs xdg-open.
depends=('glibc>=2.43' 'gcc-libs' 'alsa-lib' 'fontconfig' 'libglvnd' 'wayland' 'libxkbcommon' 'libxkbcommon-x11' 'libx11' 'libxcb' 'libxcursor' 'libxi' 'libxrender' 'xdg-utils' 'hicolor-icon-theme')
optdepends=(
    'polkit: administrator file operations'
    'xdg-desktop-portal: accent colour, dark mode and file pickers'
    'ffmpeg: video thumbnails'
    '7zip: 7z and most other archives'
    'libarchive: tar archives'
    'zip: zip archives'
    'udisks2: USB drives and other disks'
    'usbmuxd: iOS devices'
)
provides=('tunal')
conflicts=('tunal')
options=('!strip' '!debug')
source=("Tunal-$pkgver-Linux-x86_64.tar.gz::${TARBALL:-$url/releases/download/v$pkgver/Tunal-$pkgver-Linux-x86_64.tar.gz}")
sha256sums=('67f85852d52f5b1ddce1206ef03aa8a056d7f2b01837a2d1f944453e900c1e8f')

package() {
    cd "$srcdir/tunal-$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/tunal" ] && [ "$pkgname" != tunal ]; then
        mv "$pkgdir/usr/share/licenses/tunal" "$pkgdir/usr/share/licenses/$pkgname"
    fi
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
