Skip to content
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

Enviroment variable to disable system-deps #10

Closed
zoeyfyi opened this issue Jul 19, 2020 · 12 comments
Closed

Enviroment variable to disable system-deps #10

zoeyfyi opened this issue Jul 19, 2020 · 12 comments

Comments

@zoeyfyi
Copy link

zoeyfyi commented Jul 19, 2020

I am using gvsbuild to compile a gtk application on windows (I have other dependencys that won't compile under MSYS). Before the gtk-rs release a few weeks ago I could compile with:

${Env:RUSTFLAGS} = "-L C:\gtk-build\gtk\x64\release\lib"; cargo build

Now that gtk-rs uses system-deps I have to disable each dependency individually, which results in:

${Env:SYSTEM_DEPS_glib_2_0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_glib_2_0_LIB} = "glib-2.0"; 
${Env:SYSTEM_DEPS_cairo_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_cairo_LIB} = "cairo"; 
${Env:SYSTEM_DEPS_cairo_gobject_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_cairo_gobject_LIB} = "cairo-gobject"; 
${Env:SYSTEM_DEPS_gobject_2_0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_gobject_2_0_LIB} = "gobject-2.0"; 
${Env:SYSTEM_DEPS_atk_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_atk_LIB} = "atk-1.0"; 
${Env:SYSTEM_DEPS_pango_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_pango_LIB} = "pango-1.0"; 
${Env:SYSTEM_DEPS_gio_2_0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_gio_2_0_LIB} = "gio-2.0"; 
${Env:SYSTEM_DEPS_gdk_pixbuf_2_0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_gdk_pixbuf_2_0_LIB} = "gdk_pixbuf-2.0"; 
${Env:SYSTEM_DEPS_gdk_3_0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_gdk_3_0_LIB} = "gdk-3.0"; 
${Env:SYSTEM_DEPS_gtk+_3_0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_gtk+_3_0_LIB} = "gtk-3.0"; 
${Env:SYSTEM_DEPS_GTK+_3.0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_GTK+_3.0_LIB} = "gtk-3.0"; 
${Env:SYSTEM_DEPS_gtk_3_0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_gtk_3_0_LIB} = "gtk-3.0"; 
${Env:SYSTEM_DEPS_GTK_3.0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_GTK_3.0_LIB} = "gtk-3.0"; 
${Env:RUSTFLAGS} = "-L C:\gtk-build\gtk\x64\release\lib"; 
cargo build

Would it be possible to add somthing like SYSTEM_DEPS_DISABLE?

@gdesmott
Copy link
Owner

@sdroege : how do you think we should handle this?

@sdroege
Copy link

sdroege commented Jul 20, 2020

I don't know, from somewhere all the library names have to come from. That's the main problem here.

The official gtk way of doing that are the PKG-config files, and it seems like a bug to me that gvsbuild does not include them. If you used the meson build system included in gtk you could build with msvc and get those.

Maybe @nirbheek has a suggestion?

@nirbheek
Copy link

I thought gvsbuild shipped pkgconfig files? @nacho if it doesn't, shouldn't it ship pkgconfig files?

@nacho
Copy link

nacho commented Jul 20, 2020

We definitely ship pkgconfig files...

@gdesmott
Copy link
Owner

Then it should just work. Have you tried tweaking your PKG_CONFIG_PATH?

@nirbheek
Copy link

Does gvsbuild ship with pkg-config? Is it built with --define-prefix enabled by default? If so, it should not need any PKG_CONFIG_PATH tweaking. We do that in gstreamer and it works well.

@nacho
Copy link

nacho commented Jul 20, 2020

If I recall correct gvsbuild ships pkgconf, which should deal properly with --define-prefix. Maybe double check that all the pc files are in place and if some is missing let me know and I will add them

@zoeyfyi
Copy link
Author

zoeyfyi commented Jul 20, 2020

Ah, this is prehaps more complicated than I though 😅.

If I add C:\gtk-build\gtk\x64\release\bin to Path I get:

Package gtksourceview-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtksourceview-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtksourceview-3.0', required by 'virtual:world', not found
Package 'gtksourceview-3.0', required by 'virtual:world', not found

It doesn't look like gtksourceview-3.0.pc is anywhere in the gtk-build directory. Seems like this is the only one missing though, because I can build with:

${Env:GTKSOURCEVIEW_3.0_NO_PKG_CONFIG} = 1; 
${Env:SYSTEM_DEPS_GTKSOURCEVIEW_3.0_LIB} = "gtksourceview-3.0"; 
cargo build

@nacho
Copy link

nacho commented Jul 20, 2020

Do you need gtksourceview? If yes, note that we have not updated gsv for years. You might need to first update it in gvsbuild.

@nirbheek
Copy link

Latest gtksourceview is 4.6.1 which supports meson, so it shouldn't be too hard to update it.

@zoeyfyi
Copy link
Author

zoeyfyi commented Jul 20, 2020

The gtk-rs bindings are for sourceview 3, although I see there is a crate for sourview 4. I have to admit, this is a bit out of my league. My build command is a bit more sensible now, so feel free to close this.

@gdesmott
Copy link
Owner

Closing then, I don't think it makes much sense to disable system-deps completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants