I wrote a terminal emulator (it uses libvte4 that does the real stuff) for me and it may be useful for someone else.
I needed to write an UI component for a project of mine to hold widgets in tiled stacks, and all this inside tabs, then I as a (now former) Tilix user realized that this UI approach would be very interesting for terminal emulators, so Batata was born.
It still having some glitches here and there and leaking a bit of memory until I fix some known issue in GTK4 bindings… but I use it every day and enjoy , if you spawn several terminals and want to easily switch between them you may like it too.
It’s Linux/Gtk and there’s a flatpak build script, however I didn’t submit it to flathub yet.
Also no success here (GNU Make 4.3):
Translated to English:
make: *** There is no rule to create target ‘.WAIT’ needed for all ‘all’. Stopt.
batata on main is 📦 v0.1.0 via 🔮 v1.13.3
❯ shards install
Resolving dependencies
Fetching https://github.com/hugopl/vte.cr.git
Fetching https://github.com/geopjr/libadwaita.cr.git
Fetching https://github.com/hugopl/gtk4.cr.git
Fetching https://github.com/hugopl/gi-crystal.git
Fetching https://github.com/hugopl/pango.cr.git
Fetching https://github.com/hugopl/harfbuzz.cr.git
Installing gi-crystal (0.24.0 at e230d25)
Postinstall of gi-crystal: shards build
Installing harfbuzz (0.2.0)
Installing pango (0.3.1)
Installing gtk4 (0.17.0)
Installing vte (0.1.0 at 3955f90)
Installing libadwaita (1.0.0 at cffabb5)
batata on main is 📦 v0.1.0 via 🔮 v1.13.3 took 26s
❯ make
make: *** Er is geen regel om doel '.WAIT' te maken, nodig voor 'all'. Gestopt.
batata on main is 📦 v0.1.0 via 🔮 v1.13.3
❯ make build
crystal build --release --debug -Dstrict_multi_assign -Duse_pcre2 -Dpreview_overload_order -s --link-flags='-Wl,--as-needed' src/main.cr -o bin/batata
Parse: 00:00:00.000303796 ( 1.07MB)
Showing last frame. Use --error-trace for full trace.
In lib/libadwaita/src/libadwaita.cr:2:11
2 | GICrystal.require("Adw", "1")
^------
Error: Bindings for Adw-1 not yet generated, run ./bin/gi-crystal first.
make: *** [Makefile:8: build] Fout 1
batata on main is 📦 v0.1.0 via 🔮 v1.13.3
❯ bin/gi-crystal
info - Starting at 2024-10-09 18:18:55 +02:00, project dir: /home/kees/Src/Crystal/batata
info - Gi-Crystal version 0.24.0, built with Crystal 1.13.3.
info - Generating bindings at /home/kees/Src/Crystal/batata/lib/gi-crystal/src/auto
info - Using binding config at /home/kees/Src/Crystal/batata/lib/gi-crystal/src/bindings/g_lib/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/gi-crystal/src/bindings/g_object/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/gi-crystal/src/bindings/gio/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/harfbuzz/src/bindings/harfbuzz/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/pango/src/bindings/pango/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/gtk4/src/bindings/gdk/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/gtk4/src/bindings/gsk/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/gtk4/src/bindings/gtk/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/vte/src/bindings/vte/binding.yml
info - Using binding config at /home/kees/Src/Crystal/batata/lib/libadwaita/src/bindings/binding.yml
warn - g_cancellable_connect - Callback without user_data!
warn - Gio::ActionEntry padding field - Unknown conversion to crystal for fixed size array.
warn - Gio::DBusInterfaceVTable padding field - Unknown conversion to crystal for fixed size array.
warn - Gio::DBusSubtreeVTable padding field - Unknown conversion to crystal for fixed size array.
warn - HarfBuzz - Interface constant not supported.
info - Pango - No binding config found for cairo-1.0.
info - Gdk - No binding config found for PangoCairo-1.0.
info - Gdk - No binding config found for GdkPixbuf-2.0.
warn - Gdk - SeatCapabilities::All (0xf) doesn't have all possible bits set (0x1f).
warn - Gdk::TimeCoord axes field - Unknown conversion to crystal for fixed size array.
info - GdkPixbuf - No binding config found for GModule-2.0.
warn - gdk_pixbuf_get_options - Unknown conversion to crystal for GHash
info - Gsk - No binding config found for Graphene-1.0.
warn - gsk_border_node_get_widths - Unknown conversion to crystal for fixed size array.
warn - Boxed not working for enums
warn - Gtk::BuildableParser padding field - Unknown conversion to crystal for fixed size array.
error - Failed to load Vte: Typelib file for namespace 'Vte', version '3.91' not found
you need to run sudo make post-install, so it does things that usually the distro packages do, like update gnome icon cache and compile the gschema. I’ll add this to the readme.
Thanks for your reply!
My vte version is too low.
Tried to build vte myself, but the meson version was also too low.
I give up, I hope you can provide executables.
Since I can’t upgrade my Linux Mint 21.3 to 22, I’m investigating rolling linux distro’s Arch and Rhino, I’'l have to reinstall anyway…
Indeed, I could install flatpack-builder from the distro’s repo.
The building took quite a while, managed to keep all my 4 processors at 100%, but finally gave an error:
error - Failed to load Vte: Typelib file for namespace 'Vte', version '3.91' not found
Running: make build
crystal build --release --debug -Dstrict_multi_assign -Duse_pcre2 -Dpreview_overload_order -s --link-flags='-Wl,--as-needed' src/main.cr -o bin/batata
Parse: 00:00:00.000931376 ( 1.05MB)
Showing last frame. Use --error-trace for full trace.
In lib/vte/src/vte.cr:3:11
3 | GICrystal.require("Vte", "3.91")
^------
Error: Bindings for Vte-3.91 not yet generated, run ./bin/gi-crystal first.
make: *** [Makefile:8: build] Error 1
Error: module batata: Child process ended with code 2
make: *** [Makefile:57: flatpak] Error 1
The error is from gi-crystal, it didn’t find the vte files with introspection data for binding generation.
I ran the make flatpak here yesterday and it worked, I really have no idea why it failed with you… I’ll submit the flatpak to flathub soon, hope guys there could point anything that I may be doing wrong in the flatpak file.
The flatpak file is here, there’s a script that just inject the Crystal dependencies.