Skip to content
Snippets Groups Projects
PKGBUILD 1.97 KiB
Newer Older
jean-michel's avatar
jean-michel committed
# Copyright     : Obarun
#------------------------
Eric Vidal's avatar
Eric Vidal committed
# Maintainer    : Eric Vidal <eric@obarun.org>
# Maintainer    : Jean-Michel T.Dydak <jean-michel@obarun.org>
jean-michel's avatar
jean-michel committed
#----------------
# Pkgbuild Src  : https://git.obarun.org/pkg/obextra/upower
#--------------------------------------------------------------
# DESCRIPTION ]
Eric Vidal's avatar
Eric Vidal committed

pkgname=upower
Eric Vidal's avatar
Eric Vidal committed
pkgver=0.99.18
Gus Fun's avatar
Gus Fun committed
pkgrel=2
jean-michel's avatar
jean-michel committed
pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics"
url='http://upower.freedesktop.org'
Eric Vidal's avatar
Eric Vidal committed

track="commit"
Eric Vidal's avatar
Eric Vidal committed
target="017ac33d586bc57ace19af120f3ec48eebffddfe" # tags/v0.99.18^0
jean-michel's avatar
jean-michel committed
source=(
    "git+https://gitlab.freedesktop.org/upower/upower.git#${track}=${target}"
    0001-build-Fix-default-udevrulesdir.patch
    0002-build-Fix-version-macros.patch
)
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
#----------------------
# BUILD CONFIGURATION ]
Eric Vidal's avatar
Eric Vidal committed

makedepends=(
jean-michel's avatar
jean-michel committed
    'docbook-xsl'
    'gobject-introspection'
    'python'
    'git'
    'gtk-doc'
    'meson'
)

checkdepends=(
    'python-dbus'
    'python-dbusmock'
    'python-gobject'
jean-michel's avatar
jean-michel committed
)   #'umockdev'
jean-michel's avatar
jean-michel committed

#------------------------
# INSTALL CONFIGURATION ]

depends=(
    'libimobiledevice'
    'libgudev'
)
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
backup=(
    'etc/UPower/UPower.conf'
)

#--------------------
# BUILD PREPARATION ]
Eric Vidal's avatar
Eric Vidal committed

pkgver() {
jean-michel's avatar
jean-michel committed
    cd $pkgname
    git describe --tags | sed -e 's/^v\|^UPOWER_//;s/_/\./g;s/[^-]*-g/r&/;s/-/+/g'
Eric Vidal's avatar
Eric Vidal committed
}

Eric Vidal's avatar
Eric Vidal committed
prepare() {
jean-michel's avatar
jean-michel committed
    cd $pkgname

    ## meson fixes
    git apply -3 ../0001-build-Fix-default-udevrulesdir.patch
    git apply -3 ../0002-build-Fix-version-macros.patch
Eric Vidal's avatar
Eric Vidal committed
}

jean-michel's avatar
jean-michel committed
#--------
# BUILD ]
Eric Vidal's avatar
Eric Vidal committed

Eric Vidal's avatar
Eric Vidal committed
build() {
jean-michel's avatar
jean-michel committed
    arch-meson upower build -D systemdsystemunitdir=no
jean-michel's avatar
jean-michel committed
    meson compile -C build
Eric Vidal's avatar
Eric Vidal committed
}

jean-michel's avatar
jean-michel committed
#--------
# CHECK ]
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
#check() {
#    meson test -C build --print-errorlogs
#}
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
#----------
# PACKAGE ]
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
package() {
    depends+=(
        'libglib-2.0.so'
        'libgobject-2.0.so'
        'libgio-2.0.so'
    )
    provides+=(
        'libupower-glib.so'
    )

    meson install -C build --destdir "$pkgdir"
}
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
#--------------------
# ARCH LICENSE AUTH ]
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
arch=(x86_64)
license=(GPL)
Eric Vidal's avatar
Eric Vidal committed

jean-michel's avatar
jean-michel committed
sha512sums=('')