summaryrefslogtreecommitdiff
path: root/testing/source/vtown/deps/upower
diff options
context:
space:
mode:
Diffstat (limited to 'testing/source/vtown/deps/upower')
-rw-r--r--testing/source/vtown/deps/upower/doinst.sh15
-rw-r--r--testing/source/vtown/deps/upower/patches/0002-linux-Fix-memory-leak-in-Bluez-backend.patch51
-rw-r--r--testing/source/vtown/deps/upower/patches/0003-linux-Fix-warning-when-bluez-Appearance-property-isn.patch49
-rw-r--r--testing/source/vtown/deps/upower/patches/0006-lib-Add-Pen-device-type.patch89
-rw-r--r--testing/source/vtown/deps/upower/patches/0007-linux-Detect-Bluetooth-pens.patch28
-rw-r--r--testing/source/vtown/deps/upower/patches/0008-linux-Identify-keyboard-pointing-device-combos-as-ke.patch46
-rw-r--r--testing/source/vtown/deps/upower/patches/0011-linux-Add-support-for-iPhone-XR-XS-models.patch76
-rw-r--r--testing/source/vtown/deps/upower/patches/0012-build-Use-a-newer-libplist-if-available.patch28
-rw-r--r--testing/source/vtown/deps/upower/slack-desc19
-rwxr-xr-xtesting/source/vtown/deps/upower/upower.SlackBuild139
-rw-r--r--testing/source/vtown/deps/upower/upower.url1
11 files changed, 541 insertions, 0 deletions
diff --git a/testing/source/vtown/deps/upower/doinst.sh b/testing/source/vtown/deps/upower/doinst.sh
new file mode 100644
index 00000000..46abf401
--- /dev/null
+++ b/testing/source/vtown/deps/upower/doinst.sh
@@ -0,0 +1,15 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+config etc/UPower/UPower.conf.new
+
diff --git a/testing/source/vtown/deps/upower/patches/0002-linux-Fix-memory-leak-in-Bluez-backend.patch b/testing/source/vtown/deps/upower/patches/0002-linux-Fix-memory-leak-in-Bluez-backend.patch
new file mode 100644
index 00000000..0a45dcf1
--- /dev/null
+++ b/testing/source/vtown/deps/upower/patches/0002-linux-Fix-memory-leak-in-Bluez-backend.patch
@@ -0,0 +1,51 @@
+From 8e6cb06ff68a283b9857d4d0e831d93c42521534 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Thu, 17 Oct 2019 16:36:58 +0200
+Subject: [PATCH 2/7] linux: Fix memory leak in Bluez backend
+
+g_dbus_proxy_get_cached_property() returns transfer full GVariants.
+---
+ src/linux/up-device-bluez.c | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/src/linux/up-device-bluez.c b/src/linux/up-device-bluez.c
+index cd89529..5e595a9 100644
+--- a/src/linux/up-device-bluez.c
++++ b/src/linux/up-device-bluez.c
+@@ -71,9 +71,10 @@ up_device_bluez_coldplug (UpDevice *device)
+ GDBusProxy *proxy;
+ GError *error = NULL;
+ UpDeviceKind kind;
++ guint16 appearance;
+ const char *uuid;
+ const char *model;
+- guint16 appearance;
++ GVariant *v;
+ guchar percentage;
+
+ /* Static device properties */
+@@ -93,10 +94,18 @@ up_device_bluez_coldplug (UpDevice *device)
+ return FALSE;
+ }
+
+- appearance = g_variant_get_uint16 (g_dbus_proxy_get_cached_property (proxy, "Appearance"));
++ v = g_dbus_proxy_get_cached_property (proxy, "Appearance");
++ appearance = g_variant_get_uint16 (v);
+ kind = appearance_to_kind (appearance);
+- uuid = g_variant_get_string (g_dbus_proxy_get_cached_property (proxy, "Address"), NULL);
+- model = g_variant_get_string (g_dbus_proxy_get_cached_property (proxy, "Alias"), NULL);
++ g_variant_unref (v);
++
++ v = g_dbus_proxy_get_cached_property (proxy, "Address");
++ uuid = g_variant_get_string (v, NULL);
++ g_variant_unref (v);
++
++ v = g_dbus_proxy_get_cached_property (proxy, "Alias");
++ model = g_variant_get_string (v, NULL);
++ g_variant_unref (v);
+
+ /* hardcode some values */
+ g_object_set (device,
+--
+2.24.1
+
diff --git a/testing/source/vtown/deps/upower/patches/0003-linux-Fix-warning-when-bluez-Appearance-property-isn.patch b/testing/source/vtown/deps/upower/patches/0003-linux-Fix-warning-when-bluez-Appearance-property-isn.patch
new file mode 100644
index 00000000..156631a7
--- /dev/null
+++ b/testing/source/vtown/deps/upower/patches/0003-linux-Fix-warning-when-bluez-Appearance-property-isn.patch
@@ -0,0 +1,49 @@
+From ed0dfe4427770776a081877f77f1263491fbe1b6 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Thu, 17 Oct 2019 16:43:15 +0200
+Subject: [PATCH 3/7] linux: Fix warning when bluez Appearance property isn't
+ set
+
+The Appearance property might not be available, and would cause
+warnings like:
+upowerd[17733]: g_variant_get_type: assertion 'value != NULL' failed
+upowerd[17733]: g_variant_type_is_subtype_of: assertion 'g_variant_type_check (type)' failed
+upowerd[17733]: g_variant_get_uint16: assertion 'g_variant_is_of_type (value, G_VARIANT_TYPE_UINT16)' failed
+---
+ src/linux/up-device-bluez.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/src/linux/up-device-bluez.c b/src/linux/up-device-bluez.c
+index 5e595a9..2074746 100644
+--- a/src/linux/up-device-bluez.c
++++ b/src/linux/up-device-bluez.c
+@@ -71,7 +71,6 @@ up_device_bluez_coldplug (UpDevice *device)
+ GDBusProxy *proxy;
+ GError *error = NULL;
+ UpDeviceKind kind;
+- guint16 appearance;
+ const char *uuid;
+ const char *model;
+ GVariant *v;
+@@ -95,9 +94,15 @@ up_device_bluez_coldplug (UpDevice *device)
+ }
+
+ v = g_dbus_proxy_get_cached_property (proxy, "Appearance");
+- appearance = g_variant_get_uint16 (v);
+- kind = appearance_to_kind (appearance);
+- g_variant_unref (v);
++ if (v) {
++ guint16 appearance;
++
++ appearance = g_variant_get_uint16 (v);
++ kind = appearance_to_kind (appearance);
++ g_variant_unref (v);
++ } else {
++ kind = UP_DEVICE_KIND_UNKNOWN;
++ }
+
+ v = g_dbus_proxy_get_cached_property (proxy, "Address");
+ uuid = g_variant_get_string (v, NULL);
+--
+2.24.1
+
diff --git a/testing/source/vtown/deps/upower/patches/0006-lib-Add-Pen-device-type.patch b/testing/source/vtown/deps/upower/patches/0006-lib-Add-Pen-device-type.patch
new file mode 100644
index 00000000..f05b108d
--- /dev/null
+++ b/testing/source/vtown/deps/upower/patches/0006-lib-Add-Pen-device-type.patch
@@ -0,0 +1,89 @@
+From 72b85b8c1371f3396c293d9a2aa373b6a7551f63 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Thu, 24 Oct 2019 12:50:26 +0200
+Subject: [PATCH 6/7] lib: Add "Pen" device type
+
+So we can track the battery information for powered tablet pens, rather
+than labelling them as tablets.
+---
+ libupower-glib/up-device.c | 6 ++++--
+ libupower-glib/up-types.c | 4 ++++
+ libupower-glib/up-types.h | 1 +
+ src/linux/integration-test | 3 ++-
+ 4 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c
+index e21274d..01f752f 100644
+--- a/libupower-glib/up-device.c
++++ b/libupower-glib/up-device.c
+@@ -313,7 +313,8 @@ up_device_to_text (UpDevice *device)
+ kind == UP_DEVICE_KIND_BATTERY ||
+ kind == UP_DEVICE_KIND_MOUSE ||
+ kind == UP_DEVICE_KIND_KEYBOARD ||
+- kind == UP_DEVICE_KIND_GAMING_INPUT) &&
++ kind == UP_DEVICE_KIND_GAMING_INPUT ||
++ kind == UP_DEVICE_KIND_PEN) &&
+ !is_display)
+ g_string_append_printf (string, " rechargeable: %s\n", up_device_bool_to_string (up_exported_device_get_is_rechargeable (priv->proxy_device)));
+ if (kind == UP_DEVICE_KIND_BATTERY ||
+@@ -367,7 +368,8 @@ up_device_to_text (UpDevice *device)
+ kind == UP_DEVICE_KIND_COMPUTER ||
+ kind == UP_DEVICE_KIND_MEDIA_PLAYER ||
+ kind == UP_DEVICE_KIND_UPS ||
+- kind == UP_DEVICE_KIND_GAMING_INPUT) {
++ kind == UP_DEVICE_KIND_GAMING_INPUT ||
++ kind == UP_DEVICE_KIND_PEN) {
+ if (battery_level == UP_DEVICE_LEVEL_NONE)
+ g_string_append_printf (string, " percentage: %g%%\n", up_exported_device_get_percentage (priv->proxy_device));
+ else
+diff --git a/libupower-glib/up-types.c b/libupower-glib/up-types.c
+index 525cd02..7cf9573 100644
+--- a/libupower-glib/up-types.c
++++ b/libupower-glib/up-types.c
+@@ -71,6 +71,8 @@ up_device_kind_to_string (UpDeviceKind type_enum)
+ return "computer";
+ case UP_DEVICE_KIND_GAMING_INPUT:
+ return "gaming-input";
++ case UP_DEVICE_KIND_PEN:
++ return "pen";
+ default:
+ return "unknown";
+ }
+@@ -113,6 +115,8 @@ up_device_kind_from_string (const gchar *type)
+ return UP_DEVICE_KIND_TABLET;
+ if (g_str_equal (type, "gaming-input"))
+ return UP_DEVICE_KIND_GAMING_INPUT;
++ if (g_str_equal (type, "pen"))
++ return UP_DEVICE_KIND_PEN;
+ return UP_DEVICE_KIND_UNKNOWN;
+ }
+
+diff --git a/libupower-glib/up-types.h b/libupower-glib/up-types.h
+index 079bccd..379d46c 100644
+--- a/libupower-glib/up-types.h
++++ b/libupower-glib/up-types.h
+@@ -49,6 +49,7 @@ typedef enum {
+ UP_DEVICE_KIND_TABLET,
+ UP_DEVICE_KIND_COMPUTER,
+ UP_DEVICE_KIND_GAMING_INPUT,
++ UP_DEVICE_KIND_PEN,
+ UP_DEVICE_KIND_LAST
+ } UpDeviceKind;
+
+diff --git a/src/linux/integration-test b/src/linux/integration-test
+index 7098a67..e5c6c46 100755
+--- a/src/linux/integration-test
++++ b/src/linux/integration-test
+@@ -86,7 +86,8 @@ BATTERY_IFACE = 'org.bluez.Battery1'
+ UP_DEVICE_KIND_MEDIA_PLAYER,
+ UP_DEVICE_KIND_TABLET,
+ UP_DEVICE_KIND_COMPUTER,
+- UP_DEVICE_KIND_GAMING_INPUT) = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
++ UP_DEVICE_KIND_GAMING_INPUT,
++ UP_DEVICE_KIND_PEN) = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
+
+ class Tests(dbusmock.DBusTestCase):
+ @classmethod
+--
+2.24.1
+
diff --git a/testing/source/vtown/deps/upower/patches/0007-linux-Detect-Bluetooth-pens.patch b/testing/source/vtown/deps/upower/patches/0007-linux-Detect-Bluetooth-pens.patch
new file mode 100644
index 00000000..13624db0
--- /dev/null
+++ b/testing/source/vtown/deps/upower/patches/0007-linux-Detect-Bluetooth-pens.patch
@@ -0,0 +1,28 @@
+From 85cd95ae53499788a0df86af28876ec27074caa2 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Thu, 24 Oct 2019 12:52:33 +0200
+Subject: [PATCH 1/3] linux: Detect Bluetooth pens
+
+Numbers from:
+https://www.bluetooth.com/specifications/assigned-numbers/baseband/
+---
+ src/linux/up-device-bluez.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/linux/up-device-bluez.c b/src/linux/up-device-bluez.c
+index 2074746..8673d82 100644
+--- a/src/linux/up-device-bluez.c
++++ b/src/linux/up-device-bluez.c
+@@ -52,6 +52,9 @@ appearance_to_kind (guint16 appearance)
+ return UP_DEVICE_KIND_GAMING_INPUT;
+ case 0x05:
+ return UP_DEVICE_KIND_TABLET;
++ case 0x0e:
++ case 0x0f:
++ return UP_DEVICE_KIND_PEN;
+ }
+ break;
+ }
+--
+2.26.2
+
diff --git a/testing/source/vtown/deps/upower/patches/0008-linux-Identify-keyboard-pointing-device-combos-as-ke.patch b/testing/source/vtown/deps/upower/patches/0008-linux-Identify-keyboard-pointing-device-combos-as-ke.patch
new file mode 100644
index 00000000..f8fece70
--- /dev/null
+++ b/testing/source/vtown/deps/upower/patches/0008-linux-Identify-keyboard-pointing-device-combos-as-ke.patch
@@ -0,0 +1,46 @@
+From e0b8354e9cf53a271e66a7ba44fd567daeac2416 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Tue, 5 May 2020 16:07:31 +0200
+Subject: [PATCH 2/3] linux: Identify keyboard/pointing device combos as
+ keyboards
+
+Rather than using the type of the first sibling device we find, which is
+usually the pointing device portion, make sure that keyboard/pointing
+device combo devices are identified as keyboards.
+---
+ src/linux/up-device-supply.c | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
+index d7e4423..9302119 100644
+--- a/src/linux/up-device-supply.c
++++ b/src/linux/up-device-supply.c
+@@ -888,7 +888,7 @@ up_device_supply_get_sibling_with_subsystem (GUdevDevice *device,
+ class[0] = subsystem;
+ client = g_udev_client_new (class);
+ devices = g_udev_client_query_by_subsystem (client, subsystem);
+- for (l = devices; l != NULL && sibling == NULL; l = l->next) {
++ for (l = devices; l != NULL; l = l->next) {
+ GUdevDevice *d = l->data;
+ GUdevDevice *p;
+ const char *p_path;
+@@ -897,8 +897,14 @@ up_device_supply_get_sibling_with_subsystem (GUdevDevice *device,
+ if (!p)
+ continue;
+ p_path = g_udev_device_get_sysfs_path (p);
+- if (g_strcmp0 (p_path, parent_path) == 0)
+- sibling = g_object_ref (d);
++ if (g_strcmp0 (p_path, parent_path) == 0) {
++ if (sibling != NULL &&
++ g_udev_device_get_property_as_boolean (d, "ID_INPUT_KEYBOARD")) {
++ g_clear_object (&sibling);
++ }
++ if (sibling == NULL)
++ sibling = g_object_ref (d);
++ }
+
+ g_object_unref (p);
+ }
+--
+2.26.2
+
diff --git a/testing/source/vtown/deps/upower/patches/0011-linux-Add-support-for-iPhone-XR-XS-models.patch b/testing/source/vtown/deps/upower/patches/0011-linux-Add-support-for-iPhone-XR-XS-models.patch
new file mode 100644
index 00000000..2426e044
--- /dev/null
+++ b/testing/source/vtown/deps/upower/patches/0011-linux-Add-support-for-iPhone-XR-XS-models.patch
@@ -0,0 +1,76 @@
+From 97185bae75b16bea48d532aa5511417e485b1c06 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Wed, 17 Jun 2020 10:51:09 +0200
+Subject: [PATCH 1/4] linux: Add support for iPhone XR, XS models
+
+Modifying the udev serial to be acceptable as an hyphened UDID, as the
+usbmux stack expects.
+
+Closes: #114
+---
+ src/linux/up-device-idevice.c | 28 ++++++++++++++++++++++++++--
+ 1 file changed, 26 insertions(+), 2 deletions(-)
+
+diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c
+index a808269..d2fa0a1 100644
+--- a/src/linux/up-device-idevice.c
++++ b/src/linux/up-device-idevice.c
+@@ -203,6 +203,28 @@ out:
+ return G_SOURCE_CONTINUE;
+ }
+
++static char *
++get_device_uuid (GUdevDevice *native)
++{
++ const char *uuid;
++ char *retval;
++
++ uuid = g_udev_device_get_property (native, "ID_SERIAL_SHORT");
++ if (uuid == NULL)
++ return NULL;
++
++ if (strlen (uuid) != 24)
++ return g_strdup (uuid);
++
++ /* new style UDID: add hyphen between first 8 and following 16 digits */
++ retval = g_malloc0 (24 + 1 + 1);
++ memcpy (&retval[0], &uuid[0], 8);
++ retval[8] = '-';
++ memcpy (&retval[9], &uuid[8], 16);
++
++ return retval;
++}
++
+ /**
+ * up_device_idevice_coldplug:
+ *
+@@ -213,7 +235,7 @@ up_device_idevice_coldplug (UpDevice *device)
+ {
+ UpDeviceIdevice *idevice = UP_DEVICE_IDEVICE (device);
+ GUdevDevice *native;
+- const gchar *uuid;
++ char *uuid;
+ const gchar *model;
+ UpDeviceKind kind;
+
+@@ -223,7 +245,7 @@ up_device_idevice_coldplug (UpDevice *device)
+ return FALSE;
+
+ /* Get the UUID */
+- uuid = g_udev_device_get_property (native, "ID_SERIAL_SHORT");
++ uuid = get_device_uuid (native);
+ if (uuid == NULL)
+ return FALSE;
+
+@@ -253,6 +275,8 @@ up_device_idevice_coldplug (UpDevice *device)
+ g_source_set_name_by_id (idevice->priv->start_id,
+ "[upower] up_device_idevice_start_poll_cb (linux)");
+
++ g_free (uuid);
++
+ return TRUE;
+ }
+
+--
+2.27.0
+
diff --git a/testing/source/vtown/deps/upower/patches/0012-build-Use-a-newer-libplist-if-available.patch b/testing/source/vtown/deps/upower/patches/0012-build-Use-a-newer-libplist-if-available.patch
new file mode 100644
index 00000000..d7e24ecf
--- /dev/null
+++ b/testing/source/vtown/deps/upower/patches/0012-build-Use-a-newer-libplist-if-available.patch
@@ -0,0 +1,28 @@
+From 694207d3f08bdd2095f01eee09eb523363800825 Mon Sep 17 00:00:00 2001
+From: Bastien Nocera <hadess@hadess.net>
+Date: Tue, 16 Jun 2020 14:04:25 +0200
+Subject: [PATCH 2/4] build: Use a newer libplist if available
+
+---
+ configure.ac | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index a96b794..5f08d91 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -202,8 +202,10 @@ if test x$with_backend = xlinux; then
+ PKG_CHECK_MODULES(USB, [libusb-1.0 >= 1.0.0])
+ AC_ARG_WITH(idevice, AS_HELP_STRING([--without-idevice],[Build without libimobiledevice]),
+ with_idevice=$withval,with_idevice=yes)
++ LIBPLIST_DEP=libplist
++ PKG_CHECK_EXISTS(libplist-2.0, LIBPLIST_DEP=libplist-2.0)
+ AS_IF([test "x$with_idevice" != "xno"],
+- [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 libplist >= 0.12, have_idevice=yes, have_idevice=no)],
++ [PKG_CHECK_MODULES(IDEVICE, libimobiledevice-1.0 >= 0.9.7 $LIBPLIST_DEP, have_idevice=yes, have_idevice=no)],
+ [have_idevice=no])
+ AS_IF([test "x$have_idevice" = "xyes"],
+ [AC_DEFINE(HAVE_IDEVICE, 1, [Define to 1 if iDevice is going to be built])])
+--
+2.27.0
+
diff --git a/testing/source/vtown/deps/upower/slack-desc b/testing/source/vtown/deps/upower/slack-desc
new file mode 100644
index 00000000..b4401b93
--- /dev/null
+++ b/testing/source/vtown/deps/upower/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+upower: UPower (power management abstraction daemon)
+upower:
+upower: UPower is an abstraction for enumerating power devices, listening to
+upower: device events and querying history and statistics. Any application or
+upower: service on the system can access the org.freedesktop.UPower service
+upower: via the system message bus. Some operations (such as suspending the
+upower: system) are restricted using PolicyKit.
+upower:
+upower: Homepage: http://upower.freedesktop.org/
+upower:
+upower:
diff --git a/testing/source/vtown/deps/upower/upower.SlackBuild b/testing/source/vtown/deps/upower/upower.SlackBuild
new file mode 100755
index 00000000..ddd7e218
--- /dev/null
+++ b/testing/source/vtown/deps/upower/upower.SlackBuild
@@ -0,0 +1,139 @@
+#!/bin/bash
+
+# Slackware build script for upower
+
+# Copyright 2010, 2011, 2015 Robby Workman, Tuscaloosa, Alabama, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Modified 2012 by Eric Hameleers <alien at slackware.com> for ARM port.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PKGNAM=upower
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z* | rev | cut -f 3- -d . | cut -f 1 -d- | rev)}
+BUILD=${BUILD:-1_vtown_1}
+
+NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
+
+# Automatically determine the architecture we're building on:
+MARCH=$( uname -m )
+if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i586 ;;
+ armv7hl) export ARCH=$MARCH ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$MARCH ;;
+ esac
+fi
+
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
+ exit 0
+fi
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+elif [ "$ARCH" = "armv7hl" ]; then
+ SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16"
+ LIBDIRSUFFIX=""
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+case "$ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-$PKGNAM
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
+cd $PKGNAM-$VERSION || exit 1
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+zcat $CWD/patches/0002-linux-Fix-memory-leak-in-Bluez-backend.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0003-linux-Fix-warning-when-bluez-Appearance-property-isn.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0006-lib-Add-Pen-device-type.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0007-linux-Detect-Bluetooth-pens.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0008-linux-Identify-keyboard-pointing-device-combos-as-ke.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0011-linux-Add-support-for-iPhone-XR-XS-models.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/patches/0012-build-Use-a-newer-libplist-if-available.patch.gz | patch -p1 --verbose || exit 1
+
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --docdir=/usr/doc/$PKGNAM-$VERSION \
+ --disable-static \
+ --enable-man-pages \
+ --build=$TARGET || exit 1
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Don't ship .la files:
+rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+# Don't clobber the config file on upgrades
+mv $PKG/etc/UPower/UPower.conf $PKG/etc/UPower/UPower.conf.new
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
+cp -a \
+ AUTHORS COPYING ChangeLog HACKING INSTALL NEWS README \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
diff --git a/testing/source/vtown/deps/upower/upower.url b/testing/source/vtown/deps/upower/upower.url
new file mode 100644
index 00000000..9a4f5559
--- /dev/null
+++ b/testing/source/vtown/deps/upower/upower.url
@@ -0,0 +1 @@
+https://gitlab.freedesktop.org/upower/upower/-/releases