From 58d4aff0d1bb699fadc069836d33637452f30058 Mon Sep 17 00:00:00 2001 From: 4fury-c3440d8 Date: Sat, 16 Apr 2022 02:42:49 +0300 Subject: [PATCH] LXDE: lxsession-0.5.5 --- desktop/lxde/lxsession/actions.py | 22 ++++++ .../Avoid_costly_lsb_release_invocation.patch | 69 +++++++++++++++++++ desktop/lxde/lxsession/pspec.xml | 66 ++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 desktop/lxde/lxsession/actions.py create mode 100644 desktop/lxde/lxsession/files/Avoid_costly_lsb_release_invocation.patch create mode 100644 desktop/lxde/lxsession/pspec.xml diff --git a/desktop/lxde/lxsession/actions.py b/desktop/lxde/lxsession/actions.py new file mode 100644 index 0000000000..55d328ee0b --- /dev/null +++ b/desktop/lxde/lxsession/actions.py @@ -0,0 +1,22 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file https://www.gnu.org/licenses/gpl-3.0.txt + +from pisi.actionsapi import autotools, pisitools, get + +def setup(): + pisitools.cflags.add("-Wno-deprecated-declarations") + pisitools.unlink("*.stamp") + autotools.autoreconf("-fiv") + autotools.configure("--enable-gtk3 --enable-buildin-polkit --enable-buildin-clipboard") + +def build(): + autotools.make() + +def install(): + autotools.rawInstall("DESTDIR=%s" % get.installDIR()) + + pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING", "NEWS", "README") + diff --git a/desktop/lxde/lxsession/files/Avoid_costly_lsb_release_invocation.patch b/desktop/lxde/lxsession/files/Avoid_costly_lsb_release_invocation.patch new file mode 100644 index 0000000000..cc34728884 --- /dev/null +++ b/desktop/lxde/lxsession/files/Avoid_costly_lsb_release_invocation.patch @@ -0,0 +1,69 @@ +From c398fd6db61bc084679759096bde5747e5616eca Mon Sep 17 00:00:00 2001 +From: Jann Horn +Date: Sun, 18 Apr 2021 16:37:16 +0200 +Subject: [PATCH] lxsession-logout: Avoid costly lsb_release invocation + +Having the name of the distribution in the LXDE prompt looks kinda nice, +but `lsb_release -r -s` is fairly costly (or at least the version on +Debian is): It spins up a python interpreter, then runs `apt-cache policy` +(which in turn, among other things, runs +`/usr/bin/dpkg --print-foreign-architectures` twice). + +On a desktop machine with a proper Haswell CPU, `lsb_release -r -s` takes +"only" around 105ms (around 79ms of that are for `apt-cache policy`); +but on an old Intel NUC with a 5-years-old mobile Intel Pentium with a TDP +of 6W, it takes roughly between 500ms and 1000ms. + +As suggested by ZanderBrown, use glib's g_get_os_info() instead if +available. If that doesn't exist, it's probably better to omit the OS name +instead of potentially spending up to a second on figuring out what it is. +--- + lxsession-logout/lxsession-logout.c | 33 ++++++----------------------- + 1 file changed, 6 insertions(+), 27 deletions(-) + +diff --git a/lxsession-logout/lxsession-logout.c b/lxsession-logout/lxsession-logout.c +index 489e6e3..f06e61d 100644 +--- a/lxsession-logout/lxsession-logout.c ++++ b/lxsession-logout/lxsession-logout.c +@@ -716,35 +716,14 @@ int main(int argc, char * argv[]) + if (session_name == NULL) + session_name = "LXDE"; + +- gchar *output = NULL; +- +- if (g_find_program_in_path("lsb_release")) +- { +- const gchar *command_line = "lsb_release -r -s"; +- GError *error; +- if (!g_spawn_command_line_sync( command_line, +- &output, +- NULL, +- NULL, +- &error)) +- { +- +- fprintf (stderr, "Error: %s\n", error->message); +- g_error_free (error); +- +- } +- } ++ gchar *os_name = NULL; ++#if GLIB_CHECK_VERSION(2, 64, 0) ++ os_name = g_get_os_info(G_OS_INFO_KEY_PRETTY_NAME); ++#endif + +- if (output == NULL) +- { +- output = ""; +- } +- else +- { +- output[strlen ( output ) - 1] = '\0'; +- } ++ prompt = g_strdup_printf(_("Logout %s %s session ?"), session_name, os_name ? os_name : ""); + +- prompt = g_strdup_printf(_("Logout %s %s session ?"), session_name, output); ++ g_free(os_name); + } + gtk_label_set_markup(GTK_LABEL(label), prompt); + gtk_box_pack_start(GTK_BOX(controls), label, FALSE, FALSE, 4); diff --git a/desktop/lxde/lxsession/pspec.xml b/desktop/lxde/lxsession/pspec.xml new file mode 100644 index 0000000000..2fa31fc325 --- /dev/null +++ b/desktop/lxde/lxsession/pspec.xml @@ -0,0 +1,66 @@ + + + + + lxsession + https://www.lxde.org/ + + fury + uglyside@yandex.ru + + GPL-2 + app + desktop.lxde + LXDE session manager. + lxsession is the default X11 session manager of LXDE. + + mirrors://sourceforge/lxde/lxsession-0.5.5.tar.xz + + + intltool + vala-devel + gtk3-devel + glib2-devel + polkit-devel + elogind-devel + gettext-devel + libnotify-devel + gdk-pixbuf-devel + + + Avoid_costly_lsb_release_invocation.patch + + + + + lxsession + + gtk3 + glib2 + cairo + polkit + libX11 + gdk-pixbuf + + + /etc/xdg + /usr/bin + /usr/libexec + /usr/share + /usr/share/locale + /usr/share/man + /usr/share/doc + + + + + + 2022-04-14 + 0.5.5 + First build. + fury + uglyside@yandex.ru + + + +