New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gtk3 as propagatedBuildInput to vte #44803
add gtk3 as propagatedBuildInput to vte #44803
Conversation
The `Vte.2.91.gir` imports `Gtk.3.0.gir`. So in order to use `Vte.2.91.gir`, you must also have `Gtk.3.0.gir` on the GI_TYPELIB_PATH. Adding gtk3 to the `propagatedBuildInputs` of vte accomplishes this.
@@ -19,7 +19,12 @@ stdenv.mkDerivation rec { | |||
nativeBuildInputs = [ gobjectIntrospection intltool pkgconfig vala gperf libxml2 ]; | |||
buildInputs = [ gnome3.glib gnome3.gtk3 ncurses ]; | |||
|
|||
propagatedBuildInputs = [ gnutls pcre2 ]; | |||
propagatedBuildInputs = [ | |||
# Needed because Vte-2.91.gir depends on Gtk-3.0.gir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is required by vte-2.91.pc
, not the gir (at least the gnutls).
On a side note, it is weird that pcre is used instead of the regexes from GLib but it does:
$ rg '#include <pcre'
src/vtepcre2.h
21:#include <pcre2.h>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jtojnar, thanks for reviewing this.
The comment "Needed because Vte-2.91.gir depends on Gtk-3.0.gir" might be a little misleading. I only meant it to apply to the gnome3.gtk
dependency.
Since the comment is a little misleading, I will take it out.
I think it is required by vte-2.91.pc, not the gir.
The Vte-2.91.gir
file is importing the GDK and GTK gir files, as explained here. If some package tries to make use of Vte-2.91.gir
, they will also necessarily need the GDK and GTK gir files.
Adding gnome3.gtk3
as a propagatedBuildInput
for VTE accomplishes this.
I'm not sure whether the vte-2.91.pc file requires the GTK .pc file as well. This didn't affect any of the stuff I was doing (and to be honest I'm not sure exactly how the .pc files work). Although I can totally buy that the vte .pc file depends on the GTK .pc file.
As for gnutls and pcre2, I'm not sure why they are in the propagatedBuildInputs
. They were already there, so I just left them there. I would be okay with taking them out if they are not actually needed, but I think this should happen in a future PR, since it is not really related to the reason I opened this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, they are required by the .pc
file:
$ nix-shell -p gnome3.vte gnome3.gtk pkgconfig --run 'pkg-config --print-requires vte-2.91'
glib-2.0 >= 2.40.0
gobject-2.0
pango >= 1.22.0
gtk+-3.0 >= 3.8.0
gobject-2.0
gio-2.0
gio-unix-2.0
zlib
libpcre2-8 >= 10.21
gnutls >= 3.2.7
Please change the comment to .pc
file like in gtksourceview
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would make the comment somewhat misleading, since GTK appears to be required by both the .gir
file and the .pc
file.
Although I'm much more interested in getting this merged in than having the best comment.
What do you recommend is the best way forward?
- Leave it like it is (no comment as implemented in commit 5241c5a)
- Add a comment explaining that the
.pc
file requires all three libraries (gtk, gnutls, and pcre2) - Add a comment explaining that the
.pc
file requires all three libraries, and the.gir
file requires just gtk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would choose the second variant. After all, the goal is to distinguish the dependencies required to use the package from those only used by the package and not required for the consumers to have – the second already tells that. The third would be also nice but I feel it does not add enough new information to justify the extra clutter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtojnar Okay, this sounds good. I'll update this PR.
@jtojnar Commit 5241c5a98db removes the somewhat confusing comment. Would you be able to take another look at this? |
5241c5a
to
05c0c3f
Compare
Motivation for this change
Vte.2.91.gir
importsGtk.3.0.gir
. So in order to useVte.2.91.gir
, you must also haveGtk.3.0.gir
on the GI_TYPELIB_PATH. Adding gtk3 to thepropagatedBuildInputs
of vte accomplishes this.This affects the the
gi-vte
Haskell package, which currently only depends onvte
but notgtk
.gi-vte
does not currently build on NixOS, and this PR fixes one of the reasons. Here is the current definition ofgi-vte
for reference:Merging in this PR will help
gi-vte
build.This fix is exactly the same as the fix for other Gnome packages, for instance
gtksourceview
:nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix
Lines 15 to 20 in 42eca7c
This was discussed on the following issue:
haskell-gi/haskell-gi#183
That issue was inspired by the following PR:
#44529
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)