Trying to install decentralized internet browser fetchit-desktop - guix shell, npm & cargo issues

I’m trying to build the fetchit browser from source code, which is a tauri 2 desktop shell.

And I run into two issues:

  1. How do I add missing required system libraries when building the package?
  2. How can I tell which libraries I would need? Right now it’s a guessing game.
  3. How does npm run work? I can’t tell what npm run tauri devdoes which I was told by ant devs besides running cargo run for the tauri source code
  4. How do I get my development shell to support appsink plugin?

Problem #1

$ cargo build -r

...
pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags glib-2.0 'glib-2.0 >= 2.70'
...
    No package 'glib-2.0' found

  The system library `glib-2.0` required by crate `glib-sys` was not found.
...

I don’t know where to find system library glib-2.0.

Problem #2

glib-sys requires package glib. That’s straightforward, but

gio-sys requires package pkg-config and

gdk-sys requires package gtk+

javascriptcoregtk-4.1 requires package webkitgtk-for-gkt3

I’m figuring them out through web searching and guix package -s searching the package name and by trial and error of picking the most likely sounding required package.
Is there a better way of doing this?

Problem #3

I’m trying to figure what exactly is happening here..

$ CC=gcc npm run tauri dev

> fetchit-desktop@0.2.8 tauri
> tauri dev

     Running BeforeDevCommand (`npm run dev`)

> fetchit-desktop@0.2.8 dev
> vite
  
  VITE v6.4.2  ready in 252 ms

➜  Local:   http://localhost:1420/
Running DevCommand (`cargo  run --no-default-features --color always --`)
Info Watching /home/folaht/sur/fetchit-0.2.8/apps/fetchit-desktop/src-tauri for changes...
Compiling camino v1.2.2
...

Problem #4

So I got it running…

unfortunately, when I click on album and then press play on the first Bach song, it quickly fades to white with this error:

$ npm run tauri dev
...
Running `target/debug/fetchit-desktop`
...
GStreamer element appsink not found. Please install it.
GStreamer element autoaudiosink not found. Please install it

(WebKitWebProcess:25478): GLib-GObject-CRITICAL **: 16:46:57.056: invalid (NULL) pointer instance

(WebKitWebProcess:25478): GLib-GObject-CRITICAL **: 16:46:57.056: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

Will this work for you?

guix install glib

I run into this issue:

$ guix package -i glib
The following package will be installed:
   glib 2.86.0

guix package: error: profile contains conflicting entries for glib
guix package: error:   first entry: glib@2.86.0 /gnu/store/f3fvh9m9ia1wxgkys3sqfsq531dbfbjd-glib-2.86.0
guix package: error:   second entry: glib@2.86.0 /gnu/store/762g48vi94gkj9s9mhpbp84hm8ggfmky-glib-2.86.0
guix package: error:    ... propagated from libxfce4util@4.20.1
hint: Try upgrading both `glib' and `libxfce4util', or remove one of them from the profile.

Not sure what to do with this.

hmm, are you trying to install something directly with npm? I have never used it so i don’t know how that works and if they have their own environments like python, but this might be some fhs-related shenanigans going on. I think Guix has a way to emulate fhs environments (i think the Steam package in nonguix also uses this), but i never messed with that myself so i don’t think i can be of much help beyond that.

I should have said that I’m building something from source code. Fixed in my opening post.
I’m not sure how the code is being built. I just followed the instructions.

I’ll look into it myself later.

[update]

It get the feeling this npm run tauri dev command somehow runs a script of some sort that runs a cargo build command, because the npm command quickly turns into compiling crates.
I also found the folder where the cargo source code of the browser is located and ran cargo build -r with matching errors.

Answer #1

Okay, so this is about guix being guix and me not knowing exactly what the guix shell was for. I thought it was for running program language command line interfaces like python with all the necessary libraries installed, but instead it’s about gathering the necessary packages that might not be installed on your system just for developing purposes, because why carry all those library packages around on your system if you might not need them afterwards?

$ guix shell rust rust:cargo cargo-audit cargo-license pkg-config glib gtk+ webgitgtk-for-gtk3
$ CC=gcc guix build -r