unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 65371@debbugs.gnu.org, Raghav Gururajan <rg@raghavgururajan.name>
Subject: [bug#65371] [PATCH telephony-team 06/10] gnu: Add sdbus-cpp.
Date: Mon, 21 Aug 2023 10:57:04 -0400	[thread overview]
Message-ID: <87jztoe94v.fsf@gmail.com> (raw)
In-Reply-To: <7bb97573bd0fbbce161a1300527664d927faa44c.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 18 Aug 2023 20:53:43 +0200")

Hi Liliana,

Liliana Marie Prikler <liliana.prikler@gmail.com> writes:

> Am Freitag, dem 18.08.2023 um 14:12 -0400 schrieb Maxim Cournoyer:
>> * gnu/packages/glib.scm (sdbus-cpp): New variable.
>> * gnu/packages/patches/sdbus-c++-elogind.patch: New file.
>> * gnu/local.mk (dist_patch_DATA): Register it.
>> ---
>> 
>>  gnu/local.mk                                 |  1 +
>>  gnu/packages/glib.scm                        | 43 +++++++++++++
>>  gnu/packages/patches/sdbus-c++-elogind.patch | 63
>> ++++++++++++++++++++
>>  3 files changed, 107 insertions(+)
>>  create mode 100644 gnu/packages/patches/sdbus-c++-elogind.patch
>> 
>> diff --git a/gnu/local.mk b/gnu/local.mk
>> index abe8964f4d..de669c1177 100644
>> --- a/gnu/local.mk
>> +++ b/gnu/local.mk
>> @@ -1938,6 +1938,7 @@ dist_patch_DATA
>> =                                         \
>>    %D%/packages/patches/scons-test-environment.patch            \
>>    %D%/packages/patches/screen-hurd-path-max.patch              \
>>    %D%/packages/patches/scsh-nonstring-search-path.patch        \
>> +  %D%/packages/patches/sdbus-c++-elogind.patch                 \
>>    %D%/packages/patches/sdl-libx11-1.6.patch                    \
>>    %D%/packages/patches/seed-webkit.patch                       \
>>    %D%/packages/patches/sendgmail-accept-ignored-gsuite-
>> flag.patch      \
>> diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
>> index a0b85b15d1..588133e93f 100644
>> --- a/gnu/packages/glib.scm
>> +++ b/gnu/packages/glib.scm
>> @@ -1290,6 +1290,49 @@ (define-public dbus-cxx
>>      (home-page "https://dbus-cxx.github.io/")
>>      (license license:gpl3)))
>>  
>> +(define-public sdbus-c++
>> +  ;; Use the latest commit, which includes unreleased fixes to the
>> pkg-config
>> +  ;; file.
>> +  (let ((commit "3e84b254e9603935cb5fc180c4d2214d7024ccbb")
>> +        (revision "0"))
>> +    (package
>> +      (name "sdbus-c++")
>> +      (version (git-version "1.2.0" revision commit))
>> +      (source (origin
>> +                (method git-fetch)
>> +                (uri (git-reference
>> +                      (url
>> "https://github.com/Kistler-Group/sdbus-cpp")
>> +                      (commit commit)))
>> +                (file-name (git-file-name name version))
>> +                (sha256
>> +                 (base32
>> +                 
>> "0xrcp49almi3kwzmwcwv8sayqjxx8m55s5grxarw2hl9jmghwlc3"))
>> +                (patches (search-patches "sdbus-c++-
>> elogind.patch"))))
>> +      (build-system cmake-build-system)
>> +      (arguments
>> +       (list
>> +        ;; Avoid the integration test, which requires a system bus.
>> +        #:test-target "sdbus-c++-unit-tests"
>> +        #:configure-flags #~(list "-DBUILD_CODE_GEN=ON"
>> +                                  "-DBUILD_TESTS=ON"
>> +                                  ;; Do not install tests.
>> +                                  "-DTESTS_INSTALL_PATH=/tmp"
>> +                                  "-DCMAKE_VERBOSE_MAKEFILE=ON")
>> +        #:phases #~(modify-phases %standard-phases
>> +                     (add-after 'unpack 'do-not-install-tests
>> +                       (lambda _
>> +                         (substitute* "tests/CMakeLists.txt"
>> +                           (("/etc/dbus-1/system.d") "/tmp")))))))
> Should we perhaps add those to a separate output?  Are they useful on
> their own?

My informal policy on tests installation has been "only maybe install
tests if they cannot be made to run at build time", which is not the
case here.

>> +      (native-inputs (list googletest pkg-config))
>> +      (inputs (list expat))
>> +      (propagated-inputs (list elogind)) ;required by sdbus-c++.pc
>> +      (home-page "https://github.com/Kistler-Group/sdbus-cpp")
>> +      (synopsis "High-level C++ D-Bus library")
>> +      (description "@code{sdbus-c++} is a high-level C++ D-Bus
>> library designed
>> +to provide easy-to-use yet powerful API in modern C++.  It adds
>> another layer
>> +of abstraction on top of @code{sd-bus}, the C D-Bus implementation
>> by systemd.")
>> +      (license license:lgpl2.1+))))
>> +
>>  (define-public appstream-glib
>>    (package
>>      (name "appstream-glib")
>> 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
>> --- /dev/null
>> +++ b/gnu/packages/patches/sdbus-c++-elogind.patch
>> @@ -0,0 +1,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")
> Perhaps demote this to INFO?

I agree, but the patch is not entirely mine and more importantly has
already been merged :-).

>> ++        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
>> +
> Otherwise LGTM.

Thanks for the review!

-- 
Thanks,
Maxim

  reply	other threads:[~2023-08-21 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18 17:59 [bug#65371] [PATCH 00/10] [telephony-team] Update Jami and related packages Maxim Cournoyer
2023-08-18 18:12 ` [bug#65371] [PATCH telephony-team 01/10] gnu: opendht: Update to 2.5.5 Maxim Cournoyer
2023-08-18 18:12   ` [bug#65371] [PATCH telephony-team 02/10] gnu: mmtf-cpp: Update to 1.1.0 Maxim Cournoyer
2023-08-18 18:12   ` [bug#65371] [PATCH telephony-team 03/10] gnu: avogadrolibs: Remove msgpack from native-inputs Maxim Cournoyer
2023-08-18 18:12   ` [bug#65371] [PATCH telephony-team 04/10] gnu: python-pymol: " Maxim Cournoyer
2023-08-19  9:53     ` Andreas Enge
2023-08-21 15:03       ` Maxim Cournoyer
2023-08-18 18:12   ` [bug#65371] [PATCH telephony-team 05/10] gnu: msgpack: Deprecate with msgpack-c Maxim Cournoyer
2023-08-18 18:12   ` [bug#65371] [PATCH telephony-team 06/10] gnu: Add sdbus-cpp Maxim Cournoyer
2023-08-18 18:53     ` Liliana Marie Prikler
2023-08-21 14:57       ` Maxim Cournoyer [this message]
2024-01-10  3:37         ` bug#65371: " Maxim Cournoyer
2023-08-18 18:12   ` [bug#65371] [PATCH telephony-team 07/10] gnu: libnatpmp: Use gexps and simplify Maxim Cournoyer
2023-08-18 18:12   ` [bug#65371] [PATCH telephony-team 08/10] gnu: libnatpmp: Update home page Maxim Cournoyer
2023-08-18 18:13   ` [bug#65371] [PATCH telephony-team 09/10] gnu: libnatpmp: Install missing natpmp_declspec.h header Maxim Cournoyer
2023-08-18 18:13   ` [bug#65371] [PATCH telephony-team 10/10] gnu: jami: Update to 20230619.1 Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jztoe94v.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=65371@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=rg@raghavgururajan.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).