# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Included in Slint by Didier Spaier didieratslintdotfr

export commit=6de8aaa
pkgver=git$commit
pkgrel=1slint
pkgname=hardinfo2
slackdesc=("hardinfo2 (System Information and Benchmark for Linux Systems)"
"Hardinfo can gather information about your system's hardware and"
"operating system, peform benchmarks, and generate printable reports"
"either in HTML or in plain text formats.")
arch=('x86_64')
url="https://www.hardinfo2.org"
license=('GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later')
depends=('gtk3' 'libsoup3' 'qt5-base')
makedepends=('cmake')
optdepends=(
  'dmidecode: Memory Devices / System DMI module'
  'fwupd: Firmware module'
  'iperf3: Internal Network Speed benchmark'
  'lm_sensors: Sensors module'
  'lsscsi: SCSI support for Storage module'
  'mesa-utils: GLX info for Display module'
  'pciutils: PCI Devices module'
  'sysbench: SysBench CPU benchmark'
  'udisks2: Storage module'
  'usbutils: USB Devices module'
  'xdg-utils: open your browser for bugs, homepage & links')
provides=('hardinfo')
conflicts=('hardinfo')
install="$pkgname.install"
#source=("https://github.com/hardinfo2/hardinfo2/archive/refs/tags/release-$pkgver.tar.gz")
sha256sums=('9bd3fdbc1149e1dc88694a72824d5f334b7b36e3b147da8004443928b139ae87')
doinst() {
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi
}
docs=("license*" "README.html")
build() {
  git clone https://github.com/hardinfo2/hardinfo2.git
  cd "$pkgname" || exit
  git checkout $commit
  pandoc -f gfm -o html5 -o README.html README.md
  cd ..
  cmake -B build -S "$pkgname" \
    -DCMAKE_BUILD_TYPE='Release' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -DCMAKE_INSTALL_LIBDIR='lib64' \
    -Wno-dev
  cmake --build build
  DESTDIR="$PKG" cmake --install build
}
