# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=upower
pkgver=1.90.4
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
)
optdepends=(
  'usbmuxd: Read charge status of iOS devices'
)
makedepends=(
  docbook-xsl
  git
  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=('07acc8046eccaf891f3ae75673b945d00e3ae1071aac1cc9fa28e8c8d8fb31e8fd30f89d3dd0217090729ffa1c5921aa07f69994e42d4c9201fbe953fd6808ce')

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:
