all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob d01838edbc63b511f1582dcf54196afc72a067c9 2462 bytes (raw)
name: gnu/packages/patches/sdbus-c++-elogind.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
 
Submitted upstream: https://github.com/Kistler-Group/sdbus-cpp/pull/352

From 8423c44b6c24ebd59db06ad33704265aa81a1c7a Mon Sep 17 00:00:00 2001
From: Sven Eden <sven.eden@prydeworx.com>
Date: Thu, 17 Aug 2023 23:16:19 -0400
Subject: [PATCH] build: Add support for elogind.

* CMakeLists.txt: Fallback to elogind when libsystemd could not be
found.  Set LIBSYSTEMD variable.
* pkgconfig/sdbus-c++.pc.in (Description): Parameterize with above
LIBSYSTEMD variable.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
---
 CMakeLists.txt            | 11 +++++++++++
 pkgconfig/sdbus-c++.pc.in |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94f71c7..40c15f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,11 +12,22 @@ include(GNUInstallDirs) # Installation directories for `install` command and pkg
 # PERFORMING CHECKS & PREPARING THE DEPENDENCIES
 #-------------------------------
 
+set(LIBSYSTEMD "libsystemd")
+
 option(BUILD_LIBSYSTEMD "Build libsystemd static library and incorporate it into libsdbus-c++" OFF)
 
 if(NOT BUILD_LIBSYSTEMD)
     find_package(PkgConfig REQUIRED)
     pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL libsystemd>=236)
+    if(NOT TARGET PkgConfig::Systemd)
+        message(WARNING "libsystemd not found, checking for libelogind instead")
+        pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL libelogind>=236)
+        if(TARGET PkgConfig::Systemd)
+            set(LIBSYSTEMD "libelogind")
+            string(REPLACE "." ";" VERSION_LIST ${Systemd_VERSION})
+            list(GET VERSION_LIST 0 Systemd_VERSION)
+        endif()
+    endif()
     if(NOT TARGET PkgConfig::Systemd)
         message(FATAL_ERROR "libsystemd of version at least 236 is required, but was not found "
                             "(if you have systemd in your OS, you may want to install package containing pkgconfig "
diff --git a/pkgconfig/sdbus-c++.pc.in b/pkgconfig/sdbus-c++.pc.in
index 6ad010a..0703476 100644
--- a/pkgconfig/sdbus-c++.pc.in
+++ b/pkgconfig/sdbus-c++.pc.in
@@ -5,7 +5,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
 
 Name: @PROJECT_NAME@
 Description: C++ library on top of sd-bus, a systemd D-Bus library
-Requires@PKGCONFIG_REQS@: libsystemd
+Requires@PKGCONFIG_REQS@: @LIBSYSTEMD@
 Version: @SDBUSCPP_VERSION@
 Libs: -L${libdir} -l@PROJECT_NAME@
 Cflags: -I${includedir}

base-commit: 3e84b254e9603935cb5fc180c4d2214d7024ccbb
-- 
2.41.0


debug log:

solving d01838edbc ...
found d01838edbc in https://yhetil.org/guix/7cd1d20fbbb1cf9c620748e22bdfef7feb83ff72.1692382380.git.maxim.cournoyer@gmail.com/

applying [1/1] https://yhetil.org/guix/7cd1d20fbbb1cf9c620748e22bdfef7feb83ff72.1692382380.git.maxim.cournoyer@gmail.com/
diff --git a/gnu/packages/patches/sdbus-c++-elogind.patch b/gnu/packages/patches/sdbus-c++-elogind.patch
new file mode 100644
index 0000000000..d01838edbc

1:32: trailing whitespace.
 
1:36: trailing whitespace.
 
1:57: trailing whitespace.
 
1:67: trailing whitespace.
-- 
Checking patch gnu/packages/patches/sdbus-c++-elogind.patch...
1:69: new blank line at EOF.
+
Applied patch gnu/packages/patches/sdbus-c++-elogind.patch cleanly.
warning: 5 lines add whitespace errors.

index at:
100644 d01838edbc63b511f1582dcf54196afc72a067c9	gnu/packages/patches/sdbus-c++-elogind.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.