summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit user2023-10-14 13:37:19 +0200
committergit user2023-10-14 13:37:19 +0200
commit488435c40929e9cea49f907f58be19a3b32b98c5 (patch)
tree6f976ede29e1d467a35e9535b873627d08f46781
downloadaur-488435c40929e9cea49f907f58be19a3b32b98c5.tar.gz
Initial Commit.
-rw-r--r--.SRCINFO52
-rw-r--r--0001-Add-a-critical-action-Ignore.patch50
-rw-r--r--PKGBUILD137
3 files changed, 239 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d8c379f9401e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,52 @@
+pkgbase = upower-nocritical-nosystemd-git
+ pkgdesc = Abstraction for enumerating power devices, listening to device events and querying history and statistics (With a patch to disable low battery action). Built without systemd dependencies. Latest Git checkout.
+ pkgver = 1.90.2+6.r1677.20230706.029651a
+ pkgrel = 1
+ url = http://upower.freedesktop.org
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = docbook-xsl
+ makedepends = git
+ makedepends = gobject-introspection
+ makedepends = intltool
+ makedepends = meson
+ makedepends = python
+ depends = gcc-libs
+ depends = glibc
+ depends = libgudev
+ depends = libimobiledevice
+ depends = libusb
+ optdepends = gobject-introspection-runtime: For /usr/lib/upower/integration-test.py.
+ optdepends = python>=3: For /usr/lib/upower/{integration-test.py,output_checker.py}.
+ optdepends = python-dbus: For /usr/lib/upower/integration-test.py.
+ optdepends = python-dbusmock: For /usr/lib/upower/integration-test.py.
+ optdepends = python-gobject: For For /usr/lib/upower/integration-test.py.
+ optdepends = python-packaging: For /usr/lib/upower/integration-test.py.
+ optdepends = umockdev: For For /usr/lib/upower/integration-test.py.
+ provides = upower=1.90.2+6.r1677.20230706.029651a
+ provides = upower-nocritical=1.90.2+6.r1677.20230706.029651a
+ provides = upower-nosystemd=1.90.2+6.r1677.20230706.029651a
+ provides = upower-git=1.90.2+6.r1677.20230706.029651a
+ conflicts = upower
+ options = emptydirs
+ backup = etc/UPower/UPower.conf
+ source = upower::git+https://gitlab.freedesktop.org/upower/upower.git
+ source = 0001-Add-a-critical-action-Ignore.patch
+ sha256sums = SKIP
+ sha256sums = bf82acf436db8ab06aa90ff2f8841cb977439937b955a92644da785dc612dde3
+
+pkgname = upower-nocritical-nosystemd-git
+ depends = gcc-libs
+ depends = glibc
+ depends = libgudev
+ depends = libimobiledevice
+ depends = libusb
+ depends = libglib-2.0.so
+ depends = libgobject-2.0.so
+ depends = libgio-2.0.so
+ provides = upower=1.90.2+6.r1677.20230706.029651a
+ provides = upower-nocritical=1.90.2+6.r1677.20230706.029651a
+ provides = upower-nosystemd=1.90.2+6.r1677.20230706.029651a
+ provides = upower-git=1.90.2+6.r1677.20230706.029651a
+ provides = libupower-glib.so
diff --git a/0001-Add-a-critical-action-Ignore.patch b/0001-Add-a-critical-action-Ignore.patch
new file mode 100644
index 000000000000..6575a9b12e4f
--- /dev/null
+++ b/0001-Add-a-critical-action-Ignore.patch
@@ -0,0 +1,50 @@
+From 1ba6e724dabf3a91e59b871750e22d420a4b1238 Mon Sep 17 00:00:00 2001
+From: Star Brilliant <m13253@hotmail.com>
+Date: Wed, 5 Oct 2016 22:02:36 +0800
+Subject: [PATCH] Add a critical action: Ignore
+
+---
+ etc/UPower.conf | 3 ++-
+ src/linux/up-backend.c | 5 +++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/etc/UPower.conf b/etc/UPower.conf
+index e2c6a69..2bda528 100644
+--- a/etc/UPower.conf
++++ b/etc/UPower.conf
+@@ -88,7 +88,8 @@ TimeAction=120
+ # PowerOff
+ # Hibernate
+ # HybridSleep
++# Ignore
+ #
+ # If HybridSleep isn't available, Hibernate will be used
+ # If Hibernate isn't available, PowerOff will be used
+-CriticalPowerAction=HybridSleep
++CriticalPowerAction=Ignore
+diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c
+index 2ba201a..ade64e9 100644
+--- a/src/linux/up-backend.c
++++ b/src/linux/up-backend.c
+@@ -392,6 +392,7 @@ up_backend_get_critical_action (UpBackend *backend)
+ { "HybridSleep", "CanHybridSleep" },
+ { "Hibernate", "CanHibernate" },
+ { "PowerOff", NULL },
++ { "Ignore", NULL },
+ };
+ guint i = 0;
+ char *action;
+@@ -447,6 +448,10 @@ up_backend_take_action (UpBackend *backend)
+ method = up_backend_get_critical_action (backend);
+ g_assert (method != NULL);
+
++ if (g_strcmp0 (method, "Ignore") == 0) {
++ return;
++ }
++
+ /* Take action */
+ g_debug ("About to call logind method %s", method);
+ g_dbus_proxy_call (backend->priv->logind_proxy,
+--
+2.10.0
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..818367a9d7a2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,137 @@
+# Maintainer: dreieck (https://aur.archlinux.org/account/dreieck)
+# Contributor: slact (https://aur.archlinux.org/account/slact)
+# Contributor: Jan de Groot <jgc@archlinux.org>
+# Contributor: Star Brilliant (https://aur.archlinux.org/account/m13253)
+
+_pkgname=upower
+pkgname="${_pkgname}-nocritical-nosystemd-git"
+pkgver=1.90.2+6.r1677.20230706.029651a
+pkgrel=1
+pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics (With a patch to disable low battery action). Built without systemd dependencies. Latest Git checkout."
+arch=(
+ 'i686'
+ 'x86_64'
+)
+url="http://upower.freedesktop.org"
+license=(
+ 'GPL2'
+)
+depends=(
+ 'gcc-libs'
+ 'glibc'
+ 'libgudev'
+ 'libimobiledevice'
+ 'libusb'
+)
+makedepends=(
+ 'docbook-xsl'
+ 'git'
+ 'gobject-introspection'
+ 'intltool'
+ 'meson'
+ 'python'
+)
+optdepends=(
+ 'gobject-introspection-runtime: For /usr/lib/upower/integration-test.py.'
+ 'python>=3: For /usr/lib/upower/{integration-test.py,output_checker.py}.'
+ 'python-dbus: For /usr/lib/upower/integration-test.py.'
+ 'python-dbusmock: For /usr/lib/upower/integration-test.py.'
+ 'python-gobject: For For /usr/lib/upower/integration-test.py.'
+ 'python-packaging: For /usr/lib/upower/integration-test.py.'
+ 'umockdev: For For /usr/lib/upower/integration-test.py.'
+)
+# ## 2023-10-14: Checks disabled since it fails on my machine because battery temperature cannot be read out.
+# checkdepends=(
+# 'python-dbus'
+# 'python-dbusmock'
+# 'python-gobject'
+# 'python-packaging'
+# 'umockdev'
+# )
+provides=(
+ "${_pkgname}=${pkgver}"
+ "${_pkgname}-nocritical=${pkgver}"
+ "${_pkgname}-nosystemd=${pkgver}"
+ "${_pkgname}-git=${pkgver}"
+)
+conflicts=(
+ "${_pkgname}"
+)
+backup=(
+ 'etc/UPower/UPower.conf'
+)
+source=(
+ "${_pkgname}::git+https://gitlab.freedesktop.org/upower/upower.git"
+ "0001-Add-a-critical-action-Ignore.patch"
+)
+sha256sums=(
+ "SKIP"
+ "bf82acf436db8ab06aa90ff2f8841cb977439937b955a92644da785dc612dde3"
+)
+options+=('emptydirs')
+
+prepare() {
+ cd "${srcdir}/${_pkgname}"
+
+ for _patch in "${srcdir}/0001-Add-a-critical-action-Ignore.patch"; do
+ msg2 "Applying patch '$(basename "${_patch}")'"
+ patch -N -p1 --follow-symlinks -i "${_patch}"
+ done
+
+ git log > "${srcdir}/git.log"
+}
+
+pkgver() {
+ cd "${srcdir}/${_pkgname}"
+
+ _ver="$(git describe --tags | sed -E -e 's|^[vV]||' -e 's|\-g[0-9a-f]*$||' | tr '-' '+')"
+ _rev="$(git rev-list --count HEAD)"
+ _date="$(git log -1 --date=format:"%Y%m%d" --format="%ad")"
+ _hash="$(git rev-parse --short HEAD)"
+
+ if [ -z "${_ver}" ]; then
+ error "Could not determine version."
+ return 1
+ else
+ printf '%s' "${_ver}.r${_rev}.${_date}.${_hash}"
+ fi
+}
+
+build() {
+ cd "${srcdir}"
+
+ arch-meson \
+ -D man=true \
+ -D gtk-doc=false \
+ -D introspection=enabled \
+ -D systemdsystemunitdir=no \
+ -D idevice=enabled \
+ upower build
+
+ meson compile -C build
+}
+
+# ## 2023-10-14: Checks disabled since it fails on my machine because battery temperature cannot be read out.
+# check() {
+# cd "${srcdir}"
+#
+# meson test -C build --print-errorlogs
+# }
+
+package() {
+ depends+=(libg{lib,object,io}-2.0.so)
+ provides+=(libupower-glib.so)
+
+ cd "${srcdir}"
+
+ meson install -C build --destdir "${pkgdir}"
+
+ cd "${srcdir}/${_pkgname}"
+ for _docfile in "${srcdir}/git.log" AUTHORS code-of-conduct.md COMMITMENT HACKING NEWS README RELEASE; do
+ install -Dvm644 "${_docfile}" "${pkgdir}/usr/share/doc/${_pkgname}/$(basename "${_docfile}")"
+ done
+ for _licensefile in COPYING; do
+ install -Dvm644 "${_licensefile}" "${pkgdir}/usr/share/licenses/${pkgname}/$(basename "${_licensefile}")"
+ ln -svr "${pkgdir}/usr/share/licenses/${pkgname}/$(basename "${_licensefile}")" "${pkgdir}/usr/share/doc/${_pkgname}/$(basename "${_licensefile}")"
+ done
+}