# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=upower
pkgver=1.90.6
pkgrel=1
pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics"
url="https://upower.freedesktop.org"
arch=(x86_64)
license=(GPL-2.0-or-later)
depends=(
  gcc-libs
  glib2
  glibc
  libgudev
  libimobiledevice
  libplist
  polkit
)
optdepends=(
  'usbmuxd: Read charge status of iOS devices'
)
makedepends=(
  docbook-xsl
  git
  glib2-devel
  gobject-introspection
  gtk-doc
  meson
  python
  systemd
  usbmuxd
)
checkdepends=(
  python-dbus
  python-dbusmock
  python-gobject
  python-packaging
  umockdev
)
backup=(etc/UPower/UPower.conf)
source=(
  "git+https://gitlab.freedesktop.org/upower/upower.git#tag=v$pkgver"
)
b2sums=('51f2bb2c7497c70ed094eee2167449bbdc2920cb71487c0d9707de5401653f6a03e80f6ec1b8109d05a6c4cd165a63467bef1d62a5f928653f96bf5be803e864')

prepare() {
  cd upower
}

build() {
  arch-meson upower build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libg{lib,object,io}-2.0.so)
  provides+=(libupower-glib.so)

  meson install -C build --destdir "$pkgdir"

  # Remove installed-tests
  rm -rv "$pkgdir"/usr/{lib/upower,share/installed-tests}
}

# vim:set sw=2 sts=-1 et:
