# Description: Abstraction for enumerating power devices, listening to device events and querying history and statistics.
# URL: https://upower.freedesktop.org/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: dbus-glib intltool libgudev libusb
# Optional: gobject-introspection gtk-doc libxslt

name=upower
version=1.90.4
release=1
source=(https://gitlab.freedesktop.org/upower/upower/-/archive/v$version/upower-v$version.tar.bz2)

build() {
  prt-get isinst libxslt || PKGMK_UPOWER+=' -D man=false'

  meson setup build $name-v$version $PKGMK_UPOWER \
    --prefix=/usr \
    --libexecdir=lib/upower \
    --buildtype=plain \
    --wrap-mode nodownload \
    -D b_lto=true \
    -D b_pie=true \
    -D udevrulesdir=/lib/udev/rules.d \
    -D udevhwdbdir=/lib/udev/hwdb.d/ \
    -D systemdsystemunitdir=no \
    -D gtk-doc=false
  meson compile -C build -j ${JOBS:-1}
  DESTDIR=$PKG meson install -C build

  rm -rf $PKG/usr/share/locale
}
