Notification time stamped 2023-06-30 14:54:44 UTC
From 30d82aef7f2ec070ae09941c6ec9fb93d529d726 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA mtasaka@fedoraproject.org Date: Jun 30 2023 14:54:34 +0000 Subject: Backport upstream patch to support procps-ng 4.0.x
---
diff --git a/lxqt-session-pr456-procps-ng-400.patch b/lxqt-session-pr456-procps-ng-400.patch new file mode 100644 index 0000000..298f3cd --- /dev/null +++ b/lxqt-session-pr456-procps-ng-400.patch @@ -0,0 +1,78 @@ +From 0d16e9e007794320b219eb4bf002fc38a45f107b Mon Sep 17 00:00:00 2001 +From: Palo Kisa palo.kisa@gmail.com +Date: Mon, 9 Jan 2023 10:36:47 +0100 +Subject: [PATCH] reaper: Build/Run on systems with procps-ng >= 4.0.0 + +On Linux, make it possible to use libproc2 or libprocps whichever is +available. +--- + CMakeLists.txt | 6 +++++- + lxqt-session/src/procreaper.cpp | 24 +++++++++++++++++++++++- + 2 files changed, 28 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3c5e0d0..f208600c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,7 +35,11 @@ find_package(X11 REQUIRED) + message(STATUS "Building with Qt${Qt5Core_VERSION}") + find_package(PkgConfig REQUIRED) + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") +- pkg_search_module(PROCPS REQUIRED libprocps) ++ pkg_search_module(PROCPS REQUIRED libproc2 libprocps) ++ message(STATUS "Using PROCPS -> ${PROCPS_MODULE_NAME} v${PROCPS_VERSION}") ++ if (PROCPS_VERSION VERSION_GREATER_EQUAL 4.0.0) ++ add_definitions("-DUSING_LIBPROC2") ++ endif() + endif() + + # Please don't move, must be after lxqt +diff --git a/lxqt-session/src/procreaper.cpp b/lxqt-session/src/procreaper.cpp +index 2acd0309..1ea4bdc7 100644 +--- a/lxqt-session/src/procreaper.cpp ++++ b/lxqt-session/src/procreaper.cpp +@@ -29,7 +29,11 @@ + #include "log.h" + #if defined(Q_OS_LINUX) + #include <sys/prctl.h> +-#include <proc/readproc.h> ++# if defined(USING_LIBPROC2) ++# include <libproc2/pids.h> ++# else ++# include <proc/readproc.h> ++# endif + #elif defined(Q_OS_FREEBSD) + #include <sys/procctl.h> + #include <libutil.h> +@@ -109,6 +113,23 @@ void ProcReaper::stop(const std::set<int64_t> & excludedPids) + const pid_t my_pid = ::getpid(); + std::vector<pid_t> children; + #if defined(Q_OS_LINUX) ++# if defined(USING_LIBPROC2) ++ constexpr pids_item items[] = { PIDS_ID_PPID, PIDS_ID_TGID }; ++ enum rel_items { rel_ppid, rel_tgid }; ++ pids_info * info = nullptr; ++ procps_pids_new(&info, const_cast<pids_item *>(items), sizeof(items) / sizeof(pids_item)); ++ pids_stack * stack = nullptr; ++ while ((stack = procps_pids_get(info, PIDS_FETCH_TASKS_ONLY))) ++ { ++ const int ppid = PIDS_VAL(rel_ppid, s_int, stack, info); ++ if (ppid == my_pid) ++ { ++ const int tgid = PIDS_VAL(rel_tgid, s_int, stack, info); ++ children.push_back(tgid); ++ } ++ } ++ procps_pids_unref(&info); ++# else + PROCTAB * proc_dir = ::openproc(PROC_FILLSTAT); + while (proc_t * proc = ::readproc(proc_dir, nullptr)) + { +@@ -119,6 +140,7 @@ void ProcReaper::stop(const std::set<int64_t> & excludedPids) + ::freeproc(proc); + } + ::closeproc(proc_dir); ++# endif + #elif defined(Q_OS_FREEBSD) + int cnt = 0; + if (kinfo_proc *proc_info = kinfo_getallproc(&cnt)) diff --git a/lxqt-session.spec b/lxqt-session.spec index d794c0d..743d613 100644 --- a/lxqt-session.spec +++ b/lxqt-session.spec @@ -3,10 +3,13 @@ Name: lxqt-session Summary: Main session for LXQt desktop suite Version: 1.2.0 -Release: 2%{?dist} +Release: 3%{?dist} License: LGPLv2+ URL: https://lxqt-project.org/ Source0: https://github.com/lxqt/%%7Bname%7D/archive/%%7Bversion%7D/%%7Bname%7D-%%7Bv... +# https://github.com/lxqt/lxqt-session/pull/456 +# Support procps-ng 4 +Patch0: lxqt-session-pr456-procps-ng-400.patch BuildRequires: make BuildRequires: %{?fedora:cmake}%{!?fedora:cmake3} >= 3.0 BuildRequires: pkgconfig(lxqt) >= 1.1.0 @@ -21,7 +24,11 @@ BuildRequires: pkgconfig(libudev) BuildRequires: kf5-kwindowsystem-devel >= 5.5 BuildRequires: desktop-file-utils BuildRequires: pkgconfig(glib-2.0) +%if 0%{?fedora} >= 39 +BuildRequires: pkgconfig(libproc2) +%else BuildRequires: pkgconfig(libprocps) +%endif BuildRequires: qtxdg-tools %if 0%{?el7} BuildRequires: devtoolset-7-gcc-c++ @@ -48,6 +55,7 @@ This package provides translations for the lxqt-session package.
%prep %setup -q +%patch -P0 -p1
%build %if 0%{?el7} @@ -116,6 +124,9 @@ sed -i 's/cursor_theme=whiteglass/cursor_theme=Adwaita/g;/General/a window_manag %{_datadir}/lxqt/translations/lxqt-session/lxqt-session_arn.qm
%changelog +* Fri Jun 30 2023 Mamoru TASAKA mtasaka@fedoraproject.org - 1.2.0-3 +- Backport upstream patch to support procps-ng 4.0.x + * Thu Jan 19 2023 Fedora Release Engineering releng@fedoraproject.org - 1.2.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
https://src.fedoraproject.org/rpms/lxqt-session/c/30d82aef7f2ec070ae09941c6e...
scm-commits@lists.fedoraproject.org