# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: Eric Bélanger <eric at archlinux dot org>
# included in Slint by Didier Spaier didieratslintdotfr
pkgname=hardinfo
commit=0f5dea0
pkgver=git$commit
pkgrel=1slint
slackdesc="$pkgname (A system information and benchmark tool.)"
arch=('x86_64')
url="https://github.com/lpereira/hardinfo"
license=('GPL-2.0-or-later')
depends=('gtk3' 'libsoup')
makedepends=('cmake' 'git')
optdepends=('dmidecode: Memory Devices module'
            'fwupd: Firmware module'
            'lm_sensors: Sensors module'
            'pciutils: PCI Devices module'
            'sysbench: SysBench CPU benchmark'
            'usbutils: USB Devices module')
source=("benchmark.patch")
docs=("LICENSE" "README.html" "AUTHORS.html")
doinst() {
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
}

build() {
git clone https://github.com/lpereira/hardinfo.git
cd hardinfo
git checkout 0f5dea0
pandoc -f gfm -o html5 -o AUTHORS.html AUTHORS.md
pandoc -f gfm -o html5 -o README.html README.md

cd $SRC
  cmake -B build -S "$pkgname" \
    -DCMAKE_BUILD_TYPE='Debug' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DCMAKE_INSTALL_LIBDIR='lib' \
    -DHARDINFO_GTK3='ON' \
    -DHARDINFO_DEBUG='$(usex debug 1 0)' \
    -Wno-dev
  cmake --build build
  DESTDIR="$PKG" cmake --install build
}
