[PATCH gnome-team] gnu: sdbus-c++: Fix generated sdbus-c++.pc.

  • Done
  • quality assurance status badge
Details
3 participants
  • Liliana Marie Prikler
  • Maxim Cournoyer
  • Vivien Kraus
Owner
unassigned
Submitted by
Vivien Kraus
Severity
normal

Debbugs page

Vivien Kraus wrote 1 years ago
(address . guix-patches@gnu.org)
e0f0254bd46c74dc60c4ff95727401f8e8c9ba50.1705612625.git.vivien@planete-kraus.eu
* gnu/packages/glib.scm (sdbus-c++) [#:phases 'fix-libelogind-requirement]:
New phase.

Change-Id: Id29369178f164fc60e6882aa664556924cf4bfa7
---
gnu/packages/glib.scm | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 7b8cc3286d..d84b848b62 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -1289,11 +1289,20 @@ (define-public sdbus-c++
;; 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")))))))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'do-not-install-tests
+ (lambda _
+ (substitute* "tests/CMakeLists.txt"
+ (("/etc/dbus-1/system.d") "/tmp"))))
+ (add-before 'install 'fix-libelogind-requirement
+ (lambda _
+ ;; sdbus-c++.pc requires 'elogind', but it should
+ ;; require 'libelogind'. Fixed after 1.4.0 with
+ ;; fb9e4ae37152648a67814458d3ff673b1d3ca089
+ (substitute* "pkgconfig/sdbus-c++.pc"
+ (("Requires: elogind")
+ "Requires: libelogind")))))))
(native-inputs (list googletest pkg-config))
(inputs (list expat))
(propagated-inputs (list elogind)) ;required by sdbus-c++.pc

base-commit: 17c2e26068c5c36eb8ee1ec39a8695ef66f75c55
--
2.41.0
Liliana Marie Prikler wrote 1 years ago
47694e8e235223700dddb80b23a6d173e3097f3f.camel@gmail.com
Am Donnerstag, dem 18.01.2024 um 22:14 +0100 schrieb Vivien Kraus:
Toggle quote (3 lines)
> * gnu/packages/glib.scm (sdbus-c++) [#:phases 'fix-libelogind-
> requirement]:
> New phase.
Rather use [#:phases]: Add ‘fix-libelogind-requirement’ (or rename the
phase to ‘fix-elogind-requirement’ and use that).

Toggle quote (33 lines)
>
> Change-Id: Id29369178f164fc60e6882aa664556924cf4bfa7
> ---
>  gnu/packages/glib.scm | 19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
> index 7b8cc3286d..d84b848b62 100644
> --- a/gnu/packages/glib.scm
> +++ b/gnu/packages/glib.scm
> @@ -1289,11 +1289,20 @@ (define-public sdbus-c++
>                                  ;; 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")))))))
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (add-after 'unpack 'do-not-install-tests
> +            (lambda _
> +              (substitute* "tests/CMakeLists.txt"
> +                (("/etc/dbus-1/system.d") "/tmp"))))
> +          (add-before 'install 'fix-libelogind-requirement
> +            (lambda _
> +              ;; sdbus-c++.pc requires 'elogind', but it should
> +              ;; require 'libelogind'. Fixed after 1.4.0 with
> +              ;; fb9e4ae37152648a67814458d3ff673b1d3ca089
> +              (substitute* "pkgconfig/sdbus-c++.pc"
> +                (("Requires: elogind")
> +                 "Requires: libelogind")))))))
Instead of patching the generated file, you could try patching the .in
file from which it is generated or the CMakeLists.

Cheers
Vivien Kraus wrote 1 years ago
[PATCH gnome-team v2] gnu: sdbus-c++: Fix generated sdbus-c++.pc.
001bf4e4b4088613ad1469abcc6acecef3ceea6d.1705743574.git.vivien@planete-kraus.eu
* gnu/packages/glib.scm (sdbus-c++) [#:phases]: Add 'fix-elogind-requirement.

Change-Id: Id29369178f164fc60e6882aa664556924cf4bfa7
---
Hello!

Le samedi 20 janvier 2024 à 08:35 +0100, Liliana Marie Prikler a écrit :
Toggle quote (9 lines)
> + ;; sdbus-c++.pc requires 'elogind', but it should
> + ;; require 'libelogind'. Fixed after 1.4.0 with
> + ;; fb9e4ae37152648a67814458d3ff673b1d3ca089
> + (substitute* "pkgconfig/sdbus-c++.pc"
> + (("Requires: elogind")
> + "Requires: libelogind")))))))
> Instead of patching the generated file, you could try patching the .in file
> from which it is generated or the CMakeLists.

As far as I understand, the CMakeLists do not have a variable that contain
"libelogind", and we can’t change the LIBSYSTEMD variable content because it
is used in other places (notably to find headers, where “libelogind” would not
work).

So we have to ignore the CMakeLists entirely and bypass the .in substitution.

gnu/packages/glib.scm | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 7b8cc3286d..eee5251d03 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -1289,11 +1289,20 @@ (define-public sdbus-c++
;; 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")))))))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'do-not-install-tests
+ (lambda _
+ (substitute* "tests/CMakeLists.txt"
+ (("/etc/dbus-1/system.d") "/tmp"))))
+ (add-after 'unpack 'fix-elogind-requirement
+ (lambda _
+ ;; sdbus-c++.pc requires 'elogind', but it should
+ ;; require 'libelogind'. Fixed after 1.4.0 with
+ ;; fb9e4ae37152648a67814458d3ff673b1d3ca089
+ (substitute* "pkgconfig/sdbus-c++.pc.in"
+ (("@LIBSYSTEMD@")
+ "libelogind")))))))
(native-inputs (list googletest pkg-config))
(inputs (list expat))
(propagated-inputs (list elogind)) ;required by sdbus-c++.pc

base-commit: 49897f2dde7f469c83c496fad2699d3a05f72701
--
2.41.0
Maxim Cournoyer wrote 1 years ago
(name . Vivien Kraus)(address . vivien@planete-kraus.eu)
87a5ozhn6w.fsf@gmail.com
Hi,

Vivien Kraus <vivien@planete-kraus.eu> writes:

Toggle quote (4 lines)
> * gnu/packages/glib.scm (sdbus-c++) [#:phases]: Add 'fix-elogind-requirement.
>
> Change-Id: Id29369178f164fc60e6882aa664556924cf4bfa7

Thanks for the explanation, it makes sense.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>

--
Thanks,
Maxim
Liliana Marie Prikler wrote 1 years ago
1061cfe557e27279ba0d3f9d32ebef45177feafb.camel@gmail.com
Am Donnerstag, dem 18.01.2024 um 22:14 +0100 schrieb Vivien Kraus:
Toggle quote (4 lines)
> * gnu/packages/glib.scm (sdbus-c++) [#:phases]: Add 'fix-elogind-
> requirement.
>
> Change-Id: Id29369178f164fc60e6882aa664556924cf4bfa7
Pushed. Thanks
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 68573@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68573
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help