diff options
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rw-r--r-- | generic-power-commands.diff | 97 |
3 files changed, 113 insertions, 13 deletions
@@ -1,7 +1,7 @@ pkgbase = consolekit pkgdesc = A framework for defining and tracking users, login sessions, and seats pkgver = 1.2.4 - pkgrel = 1 + pkgrel = 2 url = https://github.com/ConsoleKit2/ConsoleKit2 install = consolekit.install arch = i686 @@ -16,13 +16,13 @@ pkgbase = consolekit depends = polkit-consolekit depends = udev depends = zlib - optdepends = consolekit-openrc: consolekit openrc initscript - optdepends = pm-utils: suspend/hibernate support provides = consolekit2 options = libtool - source = https://github.com/ConsoleKit2/ConsoleKit2/archive/refs/tags/1.2.4.tar.gz + source = https://github.com/ConsoleKit2/ConsoleKit2/archive/refs/tags/1.2.4/ConsoleKit2-1.2.4.tar.gz source = consolekit.tmpfiles.conf + source = generic-power-commands.diff sha256sums = 7c5ca07cc7ecb2743446c4ab5a66ae02667acab6214268d76f0fdf73eaf141e8 sha256sums = 778552dc12b3c235bde200e476d4262da0c135f3f6f8b3e975a87881d1f154d1 + sha256sums = SKIP pkgname = consolekit @@ -1,33 +1,36 @@ +# Maintainer: picokan <todaysoracle@protonmail.com> +# Contributor: artoo <artoo@manjaro.org> +# Contributor: micwoj92 <micwoj9292@gmail.com> + _pkgname=ConsoleKit2 pkgname=consolekit pkgver=1.2.4 -pkgrel=1 +pkgrel=2 pkgdesc="A framework for defining and tracking users, login sessions, and seats" arch=('i686' 'x86_64') url="https://github.com/ConsoleKit2/ConsoleKit2" license=('GPL') provides=('consolekit2') depends=('dbus' 'glib2' 'libx11' 'polkit-consolekit' 'udev' 'zlib') -optdepends=('consolekit-openrc: consolekit openrc initscript' - 'pm-utils: suspend/hibernate support') makedepends=('acl' 'xmlto' 'docbook-xsl') options=('libtool') install=consolekit.install -source=("$url/archive/refs/tags/$pkgver.tar.gz" - 'consolekit.tmpfiles.conf') +source=("$url/archive/refs/tags/$pkgver/$_pkgname-$pkgver.tar.gz" + 'consolekit.tmpfiles.conf' + 'generic-power-commands.diff') sha256sums=('7c5ca07cc7ecb2743446c4ab5a66ae02667acab6214268d76f0fdf73eaf141e8' - '778552dc12b3c235bde200e476d4262da0c135f3f6f8b3e975a87881d1f154d1') + '778552dc12b3c235bde200e476d4262da0c135f3f6f8b3e975a87881d1f154d1' + SKIP) prepare(){ - cd $srcdir/$_pkgname-$pkgver - autoreconf -fiv + patch -d "$srcdir/$_pkgname-$pkgver" -p1 < generic-power-commands.diff } build(){ cd $srcdir/$_pkgname-$pkgver - ./configure \ + ./autogen.sh \ --prefix=/usr \ --sysconfdir=/etc \ --sbindir=/usr/bin \ diff --git a/generic-power-commands.diff b/generic-power-commands.diff new file mode 100644 index 000000000000..fb05d3d93067 --- /dev/null +++ b/generic-power-commands.diff @@ -0,0 +1,97 @@ +diff -r -u a/src/ck-sysdeps-linux.c b/src/ck-sysdeps-linux.c +--- a/src/ck-sysdeps-linux.c 2021-07-04 11:36:33.000000000 +0100 ++++ b/src/ck-sysdeps-linux.c 2022-08-13 16:36:37.713469926 +0100 +@@ -884,8 +884,7 @@ + GError *error = NULL; + gint exit_status; + +- /* run script from pm-utils */ +- command = g_strdup_printf ("/usr/bin/pm-is-supported --%s", state); ++ command = g_strdup_printf ("/usr/bin/grep -q %s /sys/power/state", state); + g_debug ("excuting command: %s", command); + ret = g_spawn_command_line_sync (command, NULL, NULL, &exit_status, &error); + if (!ret) { +@@ -904,13 +903,13 @@ + gboolean + ck_system_can_suspend (void) + { +- return linux_supports_sleep_state ("suspend"); ++ return linux_supports_sleep_state ("mem"); + } + + gboolean + ck_system_can_hibernate (void) + { +- if (linux_supports_sleep_state ("hibernate")) ++ if (linux_supports_sleep_state ("disk")) + return linux_check_enough_swap() ; + return FALSE; + } +diff -r -u a/tools/linux/ck-system-hibernate b/tools/linux/ck-system-hibernate +--- a/tools/linux/ck-system-hibernate 2021-07-04 11:36:33.000000000 +0100 ++++ b/tools/linux/ck-system-hibernate 2022-08-13 16:31:31.156794292 +0100 +@@ -1,12 +1,3 @@ + #!/bin/sh + +-#Try for common tools +-if [ -x "/sbin/pm-hibernate" ] ; then +- /sbin/pm-hibernate +- exit $? +-elif [ -x "/usr/sbin/pm-hibernate" ] ; then +- /usr/sbin/pm-hibernate +- exit $? +-else +- exit 1 +-fi ++echo disk > /sys/power/state +diff -r -u a/tools/linux/ck-system-restart b/tools/linux/ck-system-restart +--- a/tools/linux/ck-system-restart 2021-07-04 11:36:33.000000000 +0100 ++++ b/tools/linux/ck-system-restart 2022-08-13 16:31:31.156794292 +0100 +@@ -1,12 +1,3 @@ + #!/bin/sh + +-#Try for common tools +-if [ -x "/sbin/shutdown" ] ; then +- /sbin/shutdown -r now +- exit $? +-elif [ -x "/usr/sbin/shutdown" ] ; then +- /usr/sbin/shutdown -r now +- exit $? +-else +- exit 1 +-fi ++/usr/bin/reboot +diff -r -u a/tools/linux/ck-system-stop b/tools/linux/ck-system-stop +--- a/tools/linux/ck-system-stop 2021-07-04 11:36:33.000000000 +0100 ++++ b/tools/linux/ck-system-stop 2022-08-13 16:31:31.156794292 +0100 +@@ -1,12 +1,3 @@ + #!/bin/sh + +-#Try for common tools +-if [ -x "/sbin/shutdown" ] ; then +- /sbin/shutdown -h now +- exit $? +-elif [ -x "/usr/sbin/shutdown" ] ; then +- /usr/sbin/shutdown -h now +- exit $? +-else +- exit 1 +-fi ++/usr/bin/poweroff +diff -r -u a/tools/linux/ck-system-suspend b/tools/linux/ck-system-suspend +--- a/tools/linux/ck-system-suspend 2021-07-04 11:36:33.000000000 +0100 ++++ b/tools/linux/ck-system-suspend 2022-08-13 16:31:31.156794292 +0100 +@@ -1,12 +1,3 @@ + #!/bin/sh + +-#Try for common tools +-if [ -x "/sbin/pm-suspend" ] ; then +- /sbin/pm-suspend +- exit $? +-elif [ -x "/usr/sbin/pm-suspend" ] ; then +- /usr/sbin/pm-suspend +- exit $? +-else +- exit 1 +-fi ++echo mem > /sys/power/state |