package/procps-ng: link the w command with systemd or elogin libs.

The build of procps-ng was broken when systemd was enabled.  Applying
commit ca004d46 of procps-ng upstream to explictly link the 'w'
command to libsystemd or elogind even though libproc2 is linked to it.

This was (likely) broken since the upgrade to procps-ng v4.0.4 with
commit d79f40dbbe.

Fixes: https://gitlab.com/buildroot.org/buildroot/-/issues/28
Fixes: http://autobuild.buildroot.org/results/e8b/e8bae7bfd7d6a7987f3afa199d8d944429144817/build-end.log

Signed-off-by: Hugo Cornelis <hugo.cornelis@essensium.com>
[yann.morin.1998@free.fr: don't number patch 1/1; add fixes tag]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Hugo Cornelis 2024-09-14 19:27:10 +02:00 committed by Yann E. MORIN
parent 7b888e08a2
commit 3b870057c6
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,48 @@
From 788248ee631b3b5f82073c36320fc3f4a3c8f9ba Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@dropbear.xyz>
Date: Thu, 31 Aug 2023 22:24:23 +1000
Subject: [PATCH] build-sys: Add systemd/elogind to w
Depending on the compiler flags, w needs to be explictly linked
to libsystemd or elogind even though libproc2 is linked to it.
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Upstream: https://gitlab.com/procps-ng/procps/-/commit/ca004d4657d5e8b468a4552ede429be53193a3a9
Signed-off-by: Hugo Cornelis <hugo.cornelis@essensium.com>
---
Makefile.am | 7 +++++++
NEWS | 3 +++
2 files changed, 10 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index f70c8fb1..ddfc0141 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -149,6 +149,13 @@ endif
dist_man_MANS += man/w.1
src_w_SOURCES = src/w.c local/fileutils.c
+src_w_LDADD = $(LDADD)
+if WITH_SYSTEMD
+src_w_LDADD += @SYSTEMD_LIBS@
+endif
+if WITH_ELOGIND
+src_w_LDADD += @ELOGIND_LIBS@
+endif
else
EXTRA_DIST += man/w.1
endif
diff --git a/NEWS b/NEWS
index 3f2158d4..4ad9f74e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+procps-ng-NEXT
+---------------
+
procps-ng-4.0.4
---------------
* library (API & ABI unchanged)
--
2.34.1

View File

@ -14,6 +14,9 @@ PROCPS_NG_INSTALL_STAGING = YES
PROCPS_NG_DEPENDENCIES = ncurses host-pkgconf $(TARGET_NLS_DEPENDENCIES)
PROCPS_NG_CONF_OPTS = LIBS=$(TARGET_NLS_LIBS)
# Applying 0001-build-sys-Add-systemd-elogind-to-w.patch touches Makefile.am
PROCPS_NG_AUTORECONF = YES
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
PROCPS_NG_DEPENDENCIES += systemd
PROCPS_NG_CONF_OPTS += --with-systemd