[PATCH 0/3 gnome-team]: Require zlib in gdk-3.0.pc.

  • Open
  • quality assurance status badge
Details
3 participants
  • Jean-Pierre De Jesus DIAZ
  • Liliana Marie Prikler
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Jean-Pierre De Jesus DIAZ
Severity
normal
J
J
Jean-Pierre De Jesus DIAZ wrote on 4 Dec 2023 14:36
(address . guix-patches@gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
20231204133657.3448-1-jean@foundationdevices.com
This fixes the gtk+ package to correctly depend on zlib on the
pkg-config file as right now it specifies it as -lz but pkg-config is
not able to find the library directory of zlib because it is not listed.

This changes it so that zlib appears in the requires field.

This in turns fixes the coq-ide package build which wasn't able to find
zlib for that reason, and also simplifies the frama-c package which
worked around this by just adding zlib as an input.

I think it's best to use pkg-config way of doing things which simplifies
packages IMO instead of adding zlib to packages that require gtk+ and
don't have zlib listed in inputs.

Additionally moves gtksourceview-3 from native inputs to inputs as it is
a runtime dependency.

Jean-Pierre De Jesus DIAZ (3):
gnu: gtk+: Require zlib in gdk-3.0.pc.
gnu: ocaml-lablgtk3-sourceview3: Fix inputs.
gnu: frama-c: Remove zlib from inputs.

gnu/packages/gtk.scm | 13 ++++++++++++-
gnu/packages/maths.scm | 3 +--
gnu/packages/ocaml.scm | 2 +-
3 files changed, 14 insertions(+), 4 deletions(-)

--
2.41.0
J
J
Jean-Pierre De Jesus DIAZ wrote on 4 Dec 2023 14:39
[PATCH 1/3] gnu: gtk+: Require zlib in gdk-3.0.pc.
(address . 67623@debbugs.gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
20231204133934.3890-1-jean@foundationdevices.com
* gnu/packages/gtk.scm (gtk+) <inputs>: Add zlib.

* gnu/packages/gtk.scm (gtk+) <arguments>: Add 'add-zlib-to-gdk-3.0.pc
phase.

Change-Id: I5efadebded159e0bd495ec07020b431413bd6e10
---
gnu/packages/gtk.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

Toggle diff (33 lines)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 47d4c1808f..752c9f456d 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1032,7 +1032,9 @@ (define-public gtk+
mesa
pango
wayland
- wayland-protocols))
+ wayland-protocols
+ ;; When broadway backend is enabled gdk-3.0 requires zlib.
+ zlib))
(inputs
(list colord-minimal ;to prevent a cycle with inkscape
cups
@@ -1087,6 +1089,15 @@ (define-public gtk+
(add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
(assoc-ref glib-or-gtk:%standard-phases
'generate-gdk-pixbuf-loaders-cache-file))
+ (add-after 'unpack 'add-zlib-to-gdk-3.0.pc
+ (lambda _
+ ;; When -Dbroadway_backend=true zlib is added as a dependency to
+ ;; gdk-3.0 but isn't done correctly and can cause pkg-config to
+ ;; not add the correct -L...-zlib/lib flag.
+ (substitute* "meson.build"
+ (("pc_gdk_extra_libs += \\['-lz'\\]") "")
+ (("^gdk_packages \\+= cairo_packages" all)
+ (string-append all "\ngdk_packages += ' zlib'\n")))))
(add-before 'check 'pre-check
(lambda _
;; Tests require a running X server.
--
2.41.0
J
J
Jean-Pierre De Jesus DIAZ wrote on 4 Dec 2023 14:39
[PATCH 2/3] gnu: ocaml-lablgtk3-sourceview3: Fix inputs.
(address . 67623@debbugs.gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
20231204133934.3890-2-jean@foundationdevices.com
* gnu/packages/ocaml.scm (ocaml-lablgtk3-sourceview3): Move
gtksourceview-3 from native-inputs to inputs.

Change-Id: I9ea843ddf4cbb38cd69a93e3c125149417d8fa3d
---
gnu/packages/ocaml.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 7993dbaa73..47ea323b7d 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -9467,7 +9467,7 @@ (define-public ocaml-lablgtk3-sourceview3
(inherit lablgtk3)
(name "ocaml-lablgtk3-sourceview3")
(propagated-inputs (list lablgtk3))
- (native-inputs (list gtksourceview-3 pkg-config))
+ (inputs (list gtksourceview-3))
(arguments
`(#:package "lablgtk3-sourceview3"))
(synopsis "OCaml interface to GTK+ gtksourceview library")
--
2.41.0
J
J
Jean-Pierre De Jesus DIAZ wrote on 4 Dec 2023 14:39
[PATCH 3/3] gnu: frama-c: Remove zlib from inputs.
(address . 67623@debbugs.gnu.org)(name . Jean-Pierre De Jesus DIAZ)(address . jean@foundationdevices.com)
20231204133934.3890-3-jean@foundationdevices.com
* gnu/packages/maths.scm (frama-c) <inputs>: Remove zlib.

Change-Id: I338ba303ee59468ef7538cc2b87bc90fd597d6fb
---
gnu/packages/maths.scm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Toggle diff (16 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 246f189115..39f620c8af 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -9284,8 +9284,7 @@ (define-public frama-c
(lambda* (#:key inputs #:allow-other-keys)
(setenv "CONFIG_SHELL"
(search-input-file inputs "/bin/sh")))))))
- (inputs
- (list gmp zlib))
+ (inputs (list gmp))
(propagated-inputs
(list ocaml-biniou
ocaml-easy-format
--
2.41.0
L
L
Liliana Marie Prikler wrote on 4 Dec 2023 20:32
Re: [bug#67623] [PATCH 1/3] gnu: gtk+: Require zlib in gdk-3.0.pc.
671b1d16807a8c4b55973de440e14d5816a5f048.camel@gmail.com
Am Montag, dem 04.12.2023 um 14:39 +0100 schrieb Jean-Pierre De Jesus
DIAZ:
Toggle quote (44 lines)
> * gnu/packages/gtk.scm (gtk+) <inputs>: Add zlib.
>
> * gnu/packages/gtk.scm (gtk+) <arguments>: Add 'add-zlib-to-gdk-
> 3.0.pc
>   phase.
>
> Change-Id: I5efadebded159e0bd495ec07020b431413bd6e10
> ---
>  gnu/packages/gtk.scm | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
> index 47d4c1808f..752c9f456d 100644
> --- a/gnu/packages/gtk.scm
> +++ b/gnu/packages/gtk.scm
> @@ -1032,7 +1032,9 @@ (define-public gtk+
>             mesa
>             pango
>             wayland
> -           wayland-protocols))
> +           wayland-protocols
> +           ;; When broadway backend is enabled gdk-3.0 requires
> zlib.
> +           zlib))
>      (inputs
>       (list colord-minimal               ;to prevent a cycle with
> inkscape
>             cups
> @@ -1087,6 +1089,15 @@ (define-public gtk+
>            (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
>              (assoc-ref glib-or-gtk:%standard-phases
>                         'generate-gdk-pixbuf-loaders-cache-file))
> +          (add-after 'unpack 'add-zlib-to-gdk-3.0.pc
> +            (lambda _
> +              ;; When -Dbroadway_backend=true zlib is added as a
> dependency to
> +              ;; gdk-3.0 but isn't done correctly and can cause pkg-
> config to
> +              ;; not add the correct -L...-zlib/lib flag.
> +              (substitute* "meson.build"
> +                (("pc_gdk_extra_libs += \\['-lz'\\]") "")
> +                (("^gdk_packages \\+= cairo_packages" all)
> +                 (string-append all "\ngdk_packages += '
> zlib'\n")))))
Is there a good reason to do it this way? I would hope that
downstreams are already aware of this pkg-config variable.

Cheers
M
M
Maxim Cournoyer wrote on 3 Jan 20:50 +0100
Re: bug#67623: [PATCH 0/3 gnome-team]: Require zlib in gdk-3.0.pc.
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
87cyui5h8d.fsf_-_@gmail.com
Hello,
Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
Toggle quote (48 lines)
> Am Montag, dem 04.12.2023 um 14:39 +0100 schrieb Jean-Pierre De Jesus
> DIAZ:
>> * gnu/packages/gtk.scm (gtk+) <inputs>: Add zlib.
>>
>> * gnu/packages/gtk.scm (gtk+) <arguments>: Add 'add-zlib-to-gdk-
>> 3.0.pc
>>   phase.
>>
>> Change-Id: I5efadebded159e0bd495ec07020b431413bd6e10
>> ---
>>  gnu/packages/gtk.scm | 13 ++++++++++++-
>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
>> index 47d4c1808f..752c9f456d 100644
>> --- a/gnu/packages/gtk.scm
>> +++ b/gnu/packages/gtk.scm
>> @@ -1032,7 +1032,9 @@ (define-public gtk+
>>             mesa
>>             pango
>>             wayland
>> -           wayland-protocols))
>> +           wayland-protocols
>> +           ;; When broadway backend is enabled gdk-3.0 requires
>> zlib.
>> +           zlib))
>>      (inputs
>>       (list colord-minimal               ;to prevent a cycle with
>> inkscape
>>             cups
>> @@ -1087,6 +1089,15 @@ (define-public gtk+
>>            (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
>>              (assoc-ref glib-or-gtk:%standard-phases
>>                         'generate-gdk-pixbuf-loaders-cache-file))
>> +          (add-after 'unpack 'add-zlib-to-gdk-3.0.pc
>> +            (lambda _
>> +              ;; When -Dbroadway_backend=true zlib is added as a
>> dependency to
>> +              ;; gdk-3.0 but isn't done correctly and can cause pkg-
>> config to
>> +              ;; not add the correct -L...-zlib/lib flag.
>> +              (substitute* "meson.build"
>> +                (("pc_gdk_extra_libs += \\['-lz'\\]") "")
>> +                (("^gdk_packages \\+= cairo_packages" all)
>> +                 (string-append all "\ngdk_packages += '
>> zlib'\n")))))
> Is there a good reason to do it this way? I would hope that
> downstreams are already aware of this pkg-config variable.
It seems a problem that should be taken to upstream. Then while
waiting, we could carry that patch, with a reference to the upstream
issue.
Jean-Pierre, could you please check if this issue is known with the GTK
project, else file it on there tracker and reference it as a comment
with your patch?
--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 3 Jan 20:50 +0100
control message for bug #67623
(address . control@debbugs.gnu.org)
87bka25h7u.fsf@gmail.com
tags 67623 + moreinfo
quit
J
J
Jean-Pierre De Jesus Diaz wrote on 3 Jan 23:34 +0100
Re: bug#67623: [PATCH 0/3 gnome-team]: Require zlib in gdk-3.0.pc.
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
CAG1gdUoGgNh-Aspr7y4C2VUXVdm0V2RN8byvs=Cb=ATSd-0nqw@mail.gmail.com
Hello

On Wed, Jan 3, 2024 at 7:50?PM Maxim Cournoyer
<maxim.cournoyer@gmail.com> wrote:
Toggle quote (66 lines)
>
> Hello,
>
> Liliana Marie Prikler <liliana.prikler@gmail.com> writes:
>
> > Am Montag, dem 04.12.2023 um 14:39 +0100 schrieb Jean-Pierre De Jesus
> > DIAZ:
> >> * gnu/packages/gtk.scm (gtk+) <inputs>: Add zlib.
> >>
> >> * gnu/packages/gtk.scm (gtk+) <arguments>: Add 'add-zlib-to-gdk-
> >> 3.0.pc
> >> phase.
> >>
> >> Change-Id: I5efadebded159e0bd495ec07020b431413bd6e10
> >> ---
> >> gnu/packages/gtk.scm | 13 ++++++++++++-
> >> 1 file changed, 12 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
> >> index 47d4c1808f..752c9f456d 100644
> >> --- a/gnu/packages/gtk.scm
> >> +++ b/gnu/packages/gtk.scm
> >> @@ -1032,7 +1032,9 @@ (define-public gtk+
> >> mesa
> >> pango
> >> wayland
> >> - wayland-protocols))
> >> + wayland-protocols
> >> + ;; When broadway backend is enabled gdk-3.0 requires
> >> zlib.
> >> + zlib))
> >> (inputs
> >> (list colord-minimal ;to prevent a cycle with
> >> inkscape
> >> cups
> >> @@ -1087,6 +1089,15 @@ (define-public gtk+
> >> (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
> >> (assoc-ref glib-or-gtk:%standard-phases
> >> 'generate-gdk-pixbuf-loaders-cache-file))
> >> + (add-after 'unpack 'add-zlib-to-gdk-3.0.pc
> >> + (lambda _
> >> + ;; When -Dbroadway_backend=true zlib is added as a
> >> dependency to
> >> + ;; gdk-3.0 but isn't done correctly and can cause pkg-
> >> config to
> >> + ;; not add the correct -L...-zlib/lib flag.
> >> + (substitute* "meson.build"
> >> + (("pc_gdk_extra_libs += \\['-lz'\\]") "")
> >> + (("^gdk_packages \\+= cairo_packages" all)
> >> + (string-append all "\ngdk_packages += '
> >> zlib'\n")))))
> > Is there a good reason to do it this way? I would hope that
> > downstreams are already aware of this pkg-config variable.
>
> It seems a problem that should be taken to upstream. Then while
> waiting, we could carry that patch, with a reference to the upstream
> issue.
>
> Jean-Pierre, could you please check if this issue is known with the GTK
> project, else file it on there tracker and reference it as a comment
> with your patch?
>
> --
> Thanks,
> Maxim

I've searched on the GNOME's GitLab instance for related issues but
found none so
instead filed this one:


Thanks,

--
Jean-Pierre De Jesus DIAZ
Foundation Devices, Inc.
L
L
Liliana Marie Prikler wrote on 4 Jan 21:12 +0100
427697499991f7706401cb68dde1aeb22e16e425.camel@gmail.com
Am Mittwoch, dem 03.01.2024 um 22:34 +0000 schrieb Jean-Pierre De Jesus
Diaz:
Toggle quote (6 lines)
> I've searched on the GNOME's GitLab instance for related issues but
> found none so instead filed this one:
>
> https://gitlab.gnome.org/GNOME/gtk/-/issues/6306
>
> Thanks,
As reported upstream, this doesn't look like an abuse of the pkg-config
though, more like only zlib missing as propagated input. Do you have
an instance where the pkg-config variable is not resolved correctly?

Cheers
J
J
Jean-Pierre De Jesus Diaz wrote on 5 Jan 17:43 +0100
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)
CAG1gdUo7_nw0XRf5wcM2XEGqjoVfpx7YniCh=He9coBp-HLZCg@mail.gmail.com
Hello,

On Thu, Jan 4, 2024 at 8:12?PM Liliana Marie Prikler
<liliana.prikler@gmail.com> wrote:
Toggle quote (16 lines)
>
> Am Mittwoch, dem 03.01.2024 um 22:34 +0000 schrieb Jean-Pierre De Jesus
> Diaz:
> > I've searched on the GNOME's GitLab instance for related issues but
> > found none so instead filed this one:
> >
> > https://gitlab.gnome.org/GNOME/gtk/-/issues/6306
> >
> > Thanks,
> As reported upstream, this doesn't look like an abuse of the pkg-config
> though, more like only zlib missing as propagated input. Do you have
> an instance where the pkg-config variable is not resolved correctly?
>
> Cheers
>

The coq-ide package fails to build because ocaml-lablgtk3-sourceview3 isn't
able to find zlib correctly, I guess adding it to propagated-inputs would also
solve the problems though as libz.so should then be in the search paths.

--
Jean-Pierre De Jesus DIAZ
Foundation Devices, Inc.
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 67623
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