Thanks, that seems helpful. Before you answered, I already was searching how I could determine the line size of the display lines by temporarily enabling CHAR wrap. I got stuck at catching resize events and forcing a rerender. The invisible tag disappointing at doing what I hoped it would.
Anyway, I found that GtkSource.View
has a property of type GtkSource.SpaceDrawer
, which has properties matrix
and enable_matrix
that I can use. I’m not sure of the exact solution, but I will post it later.
(This is me having trouble installing a library, it’s fixed now. See below.)
First however, as I’m a complete newbie, I don’t know how to install this library. I searched the internet for general approaches with very little useful results. I found the repository, but it doesn’t have an ‘INSTALL’ (even though the README says so) and neither do the commands make sense to me.
I usually do something like
./configure --prefix=/home/your_user/
make
make install
But well, there is no ./configure
. I’m wondering if I downloaded the right tar at all. It’s just the repository in the tar. I downloaded the file from here.
Ignoring that I am not sure what to do. I tried the commands from the README mkdir build; meson build; ...
on a few locations, this was my best bet:
The Meson build system
Version: 0.63.2
Source dir: /home/vendillah/Projets/Clavier/builddir/gtksourceview-5.8.0
Build dir: /home/vendillah/Projets/Clavier/builddir/gtksourceview-5.8.0/build
Build type: native build
Project name: gtksourceview
Project version: 5.8.0
C compiler for the host machine: cc (gcc 12.2.0 "cc (Ubuntu 12.2.0-3ubuntu1) 12.2.0")
C linker for the host machine: cc ld.bfd 2.39
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program g-ir-scanner found: NO
Library m found: YES
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency glib-2.0 found: YES 2.74.3
Run-time dependency gobject-2.0 found: YES 2.74.3
Run-time dependency gio-2.0 found: YES 2.74.3
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency gtk4 found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency gtk4
meson.build:86:0: ERROR: Git program not found, cannot download gtk.wrap via git.
A full log can be found at /home/vendillah/Projets/Clavier/builddir/gtksourceview-5.8.0/build/meson-logs/meson-log.txt
Can you tell me how I install this package (or direct me to a useful source explaining it)? I created the application so far with Gnome Builder.
Edit 1:
Okay, because I’m stuborn, I couldn’t help but continue searching for it. It appears I had a wrong idea about what meson can do by reading meson’s documentation. As I was biased that it wouldn’t work, I didn’t check the error messages. It clearly said no cmake was found, and that’s an easy fix to try. I discovered it never was a problem, because in the application build, it was never required so far. (Hence I installed cmake through apt.)
I also had to install the libgtk-4-dev
(apt) package, because gtk-4 wasn’t found either and necessary to build. As I didn’t want to mess up my system, I installed it in a distrobox container and exported all matches of “gtk4” in /usr/bin
:
$ ls /usr/bin/ | grep gtk4
gtk4-broadwayd
gtk4-builder-tool
gtk4-encode-symbolic-svg
gtk4-launch
gtk4-query-settings
gtk4-update-icon-cache
$ distrobox-export --bin /usr/bin/gtk4-broadwayd --export-path ~/.local/bin
distrobox-export --bin /usr/bin/gtk4-builder-tool --export-path ~/.local/bin
distrobox-export --bin /usr/bin/gtk4-encode-symbolic-svg --export-path ~/.local/bin
distrobox-export --bin /usr/bin/gtk4-launch --export-path ~/.local/bin
distrobox-export --bin /usr/bin/gtk4-query-settings --export-path ~/.local/bin
distrobox-export --bin /usr/bin/gtk4-update-icon-cache --export-path ~/.local/bin
/usr/bin/gtk4-broadwayd from ubuntu-22-10 exported successfully in /home/vendillah/.local/bin.
OK!
/usr/bin/gtk4-builder-tool from ubuntu-22-10 exported successfully in /home/vendillah/.local/bin.
OK!
/usr/bin/gtk4-encode-symbolic-svg from ubuntu-22-10 exported successfully in /home/vendillah/.local/bin.
OK!
/usr/bin/gtk4-launch from ubuntu-22-10 exported successfully in /home/vendillah/.local/bin.
OK!
/usr/bin/gtk4-query-settings from ubuntu-22-10 exported successfully in /home/vendillah/.local/bin.
OK!
/usr/bin/gtk4-update-icon-cache from ubuntu-22-10 exported successfully in /home/vendillah/.local/bin.
OK!
Then, I managed to install the package in user space as follows:
# extract the sources anywhere on your filesystem
cd gtksourceview-5.8.0/
mkdir build
meson -Dprefix=$HOME/.local/bin build # --reconfigure
ninja install -C build
It seemed to have worked!
Next, I modified the dependencies in src/meson.build
as follows:
clavier_deps = [
dependency('gtk4'),
dependency('libadwaita-1', version: '>= 1.3'),
dependency('gtksourceview-5.0'),
]
Finally I built the project through Builder. It didn’t work 
The Meson build system
Version: 0.63.3
Source dir: /home/vendillah/Projets/Clavier
Build dir: /home/vendillah/.var/app/org.gnome.Builder/cache/gnome-builder/projects/Clavier/builds/org.codeberg.vendillah.Clavier.json-flatpak-org.gnome.Platform-44-x86_64-main
Build type: native build
Project name: clavier
Project version: 0.1.0
C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (GCC) 12.2.0")
C linker for the host machine: cc ld.bfd 2.38
Vala compiler for the host machine: valac (valac 0.56.8)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program msgfmt found: YES (/usr/bin/msgfmt)
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Program appstream-util found: YES (/usr/bin/appstream-util)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Dependency gtk4 found: YES 4.10.3 (cached)
Dependency libadwaita-1 found: YES 1.3.2 (cached)
Found pkg-config: /usr/bin/pkg-config (1.9.5)
Found CMake: /usr/bin/cmake (3.26.4)
WARNING: CMake Toolchain: Failed to determine CMake compilers state
Run-time dependency gtksourceview-5.0 found: NO (tried pkgconfig and cmake)
../../../../../../../../../Projets/Clavier/src/meson.build:10:0: ERROR: Dependency "gtksourceview-5.0" not found, tried pkgconfig and cmake
A full log can be found at /home/vendillah/.var/app/org.gnome.Builder/cache/gnome-builder/projects/Clavier/builds/org.codeberg.vendillah.Clavier.json-flatpak-org.gnome.Platform-44-x86_64-main/meson-logs/meson-log.txt
FAILED: build.ninja
/usr/bin/meson --internal regenerate /home/vendillah/Projets/Clavier /home/vendillah/.var/app/org.gnome.Builder/cache/gnome-builder/projects/Clavier/builds/org.codeberg.vendillah.Clavier.json-flatpak-org.gnome.Platform-44-x86_64-main --backend ninja
ninja: error: rebuilding 'build.ninja': subcommand failed
Can anyone help me further?
Edit 2
Okay, so I was impatient (again) and continued searching. I noticed I had share/
and include/
folders in my ~/.local/bin
and I couldn’t find gtksourceview-5
in that folder. I retried installing it, omitting bin
as follows:
cd gtksourceview-5.8.0/
mkdir build
meson -Dprefix=$HOME/.local build # --reconfigure
ninja install -C build
Next, I tried again a few estimated guesses on what the dependency should be ('gtksourceview-5.0'
, 'gtksource-5.0'
, 'gtksourceview-5.8'
, …), after all, they called it 'gtksourceview-3.0'
in the meson tutorial. Turns out 'gtksourceview-5'
works, which makes sense as it’s listed in ls ~/.local/include/
- I’m learning new things everyday. Thus, src/meson.build
looks like this:
clavier_deps = [
dependency('gtk4'),
dependency('libadwaita-1', version: '>= 1.3'),
dependency('gtksourceview-5.0'),
]
Building in Builder:
The Meson build system
Version: 0.63.3
Source dir: /home/vendillah/Projets/Clavier
Build dir: /home/vendillah/.var/app/org.gnome.Builder/cache/gnome-builder/projects/Clavier/builds/org.codeberg.vendillah.Clavier.json-flatpak-org.gnome.Platform-44-x86_64-main
Build type: native build
Project name: clavier
Project version: 0.1.0
C compiler for the host machine: ccache cc (gcc 12.2.0 "cc (GCC) 12.2.0")
C linker for the host machine: cc ld.bfd 2.38
Vala compiler for the host machine: valac (valac 0.56.8)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program msgfmt found: YES (/usr/bin/msgfmt)
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Program appstream-util found: YES (/usr/bin/appstream-util)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Dependency gtk4 found: YES 4.10.3 (cached)
Dependency libadwaita-1 found: YES 1.3.2 (cached)
Found pkg-config: /usr/bin/pkg-config (1.9.5)
Run-time dependency gtksourceview-5 found: YES 5.8.0
Found pkg-config: /usr/bin/pkg-config (1.9.5)
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Dependency gio-2.0 found: YES 2.76.3 (cached)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gtk4-update-icon-cache found: YES (/usr/bin/gtk4-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Build targets in project: 8
clavier 0.1.0
User defined options
backend: ninja
prefix : /app
Found ninja-1.11.1 at /usr/bin/ninja
Cleaning... 0 files.
[0/9] Compiling Vala source ../../../../../../../../../Projets/Clavier/src/main.vala ../../../../../../../../../Projets/Clavier/src/view/application.vala ../../../../../../../../../Projets/Clavier/src/view/window.vala ../../../../../../../../../Projets/Clavier/src/view/exercise-bin.vala ../../../../../../../../../Projets/Clavier/src/view/preferences-window.vala ../../../../[2/9] Compiling Vala source ../../../../../../../../../Projets/Clavier/src/main.vala ../../../../../../../../../Projets/Clavier/src/view/application.vala ../../../../../../../../../Projets/Clavier/src/view/window.vala ../../../../../../../../../Projets/Clavier/src/view/exercise-bin.vala ../../../../../../../../../Projets/Clavier/src/view/preferences-window.vala ../../../../../../../../../Projets/Clavier/src/model/exercise.vala
../../../../../../../../../Projets/Clavier/src/view/exercise-bin.vala:85.17-85.27: warning: unreachable code detected
85 | return true; // ???
| ^~~~~~~~~~~
Compilation succeeded - 1 warning(s)
[9/9] Linking target src/clavier
[0/1] Installing files.
Installing data/org.codeberg.vendillah.Clavier.desktop to /app/share/applications
Installing data/org.codeberg.vendillah.Clavier.appdata.xml to /app/share/appdata
Installing src/clavier to /app/bin
Installing /home/vendillah/Projets/Clavier/data/org.codeberg.vendillah.Clavier.gschema.xml to /app/share/glib-2.0/schemas
Installing /home/vendillah/Projets/Clavier/data/icons/hicolor/scalable/apps/org.codeberg.vendillah.Clavier.svg to /app/share/icons/hicolor/scalable/apps
Installing /home/vendillah/Projets/Clavier/data/icons/hicolor/symbolic/apps/org.codeberg.vendillah.Clavier-symbolic.svg to /app/share/icons/hicolor/symbolic/apps
Running custom install script '/usr/bin/glib-compile-schemas /app/share/glib-2.0/schemas'
Running custom install script '/usr/bin/gtk4-update-icon-cache -q -t -f /app/share/icons/hicolor'
Running custom install script '/usr/bin/update-desktop-database -q /app/share/applications'
It works
(or well, it builds)
Hopefully this setup guide helps out other people that are having trouble installing a library.
I will now try to use gtksourceview-5 to display custom whitespace characters so I can post the solution and close this thread - if all goes well.