# Maintainer: Steffen Hansen <steffengrundsoe@gmail.com>
pkgname=quickemu
pkgver=4.9.6
pkgrel=1slint
slackdesc=("$pkgname (Quickly create and run optimised virtual machines.)")
url="https://github.com/quickemu-project/quickemu"
license=('MIT')
depends=('qemu' 'coreutils' 'grep' 'jq' 'procps' 'python3' 'cdrtools' 'usbutils' 'util-linux' 'sed' 'spice-gtk' 'swtpm' 'wget' 'xorg-xrandr' 'zsync' 'edk2-ovmf' 'xdg-user-dirs' 'socat')
optdepends=('quickgui: graphical user interface' 'aria2: faster downloads')
provides=("$pkgname")
conflicts=("$pkgname")
source=("https://github.com/quickemu-project/quickemu/archive/refs/tags/$pkgver.tar.gz"
"disable_smartcard_not_working_in_Slint.diff")
sha256sums=('fa5e2e5112deb836c0ab6035ab0aaabd1465b13e945d4a49dc975b94f1b01233')
options=("nosrcpack")
docs=("README.html" "SECURITY.html")
build() {
  cd "$pkgname-$pkgver"
  pandoc -f gfm -t html5 -o README.html README.md
  pandoc -f gfm -t html5 -o SECURITY.html SECURITY.md
  patch -p1 --verbose < $SRC/disable_smartcard_not_working_in_Slint.diff || exit
  install -Dm644 LICENSE "$PKG/usr/doc/${pkgname}-$pkgver/LICENSE"
  install -Dm755 quickemu "$PKG/usr/bin/quickemu"
  install -Dm755 macrecovery "$PKG/usr/bin/macrecovery"
  install -Dm755 quickget "$PKG/usr/bin/quickget"

  install -Dm644 docs/quickget.1 $PKG/usr/man/man1/quickget.1
  install -Dm644 docs/quickemu.1 $PKG/usr/man/man1/quickemu.1
  install -Dm644 docs/quickemu_conf.1 $PKG/usr/man/man1/quickemu_conf.1
}
