menson/flatpak/Gnome Builder: subproject's source code location

70 Views Asked by At

I would like to create a specialized text editor based on the Gnome Text Editor (GTE) by replacing its GtkSourceView widget with my custom widget which I want to inherit from GtkSourceView. I downloaded the source code of GTE, opened it in Gnome Builder, the latter installed all required dependencies/SDKs automatically (presumably based on the flatpak and/or meson files) then I just clicked the Build button and the GTE was built and launched. Extremely smoothly without any single error or trouble. Amazing!

Since I'm new to gobject, gtk, flatpak and meson - I want to advance in small steps. My first step was to change the two URLs pointing to the GtkSourceView git repo inside subprojects/gtksourceview.wrap by the URLs of my new widget (which currently holds a copy of GtkSourceView). Once done - how can I verify that now GTE is built with the code from my git repo? When I rebuilt the project from within Gnome Builder it didn't seem to download any new code. So I wanted to find the location of the subprojected source code of GtkSourceView and check its .git/config file to understand whether the code is fetched from my new git repo or from the original GtkSourceView git repo. However I don't see the downloaded source code of GtkSourceView anywhere. I tried to check the subprojects/ directory of my copy of GTE; ~/.var/app/org.gnome.TextEditor.Devel/ and ~/.var/app/org.gnome.Builder - but none of these locations seems to hold the source code of GtkSourceView... Where can I find it to verify that it is fetched from my new git repo?

1

There are 1 best solutions below

0
Zachary Kleiman On

Meson will only subproject a dependency if it's specifically told to do so and there's a wrapper file for it. If you need to ensure that the gtksourceview dependency is being built from your repo I'd suggest adding

pacman -Rdd gtksourceview

(this removes regardless of dependency issues) just before the Meson setup command (Not sure if this step is necessary but it can't hurt to be on the safe side). When the Meson setup command is run you should add the argument

--force-fallback-for=gtksourceview

like:

meson setup builddir -Dlibadwaita:vapi=false -Dgtksourceview:vapi=false -Dgtk4:media-gstreamer=disabled --force-fallback-for=gtksourceview

This will force it to subproject gtksourceview from the file from the wrapper file you provided. By default it'll use the version installed on the system which is the Mingw-x64-{architecture}-gtksourceview or something like that version which is not the latest version or your git repo which is likely what's occurring on your end given that GTE uses the Mingw version by default.