this post was submitted on 29 Nov 2023
12 points (100.0% liked)

Linux

48446 readers
625 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I am pretty new to linux so please excuse any foolish mistakes.

I am trying to manually install gpu-screen-recorder(GSR) to get rid of an annoying password prompt that I can't seem to disable in the flatpak version. I know there must be some way to do it because this prompt didn't show up on Pop!_OS, but maybe it's just not possible on Nobara KDE/Fedora. I noticed in the install.sh of GSR, that setcap cap_sys_admin+ep is called on the executable. So if you know any way of replicating something like that for flatpaks that is simpler than installing GSR manually, feel free to let me know.

I tried checking the dependencies listed, but was unable to figure out how to really make sure they are installed and accessible for GSR.

For example: I tried checking for libglvnd by running dnf list libglvnd. Sure enough, it returns

Installed Packages
libglvnd.i686                                         1:1.6.0-2.fc38                                       @anaconda
libglvnd.x86_64                                       1:1.6.0-2.fc38                                       @anaconda

But then I tried checking for mesa, so I ran dnf list mesa. But it returned

Available Packages
mesa.src                                    23.2.1-1.fc38                                     nobara-baseos         
mesa.src                                    23.2.1-1.fc38                                     nobara-baseos-multilib

It says 'available packages', so not installed, right?

Well, glxinfo -B says I am using mesa 23.2.1, so it seems to be installed, I guess?

So, just assuming I had everything necessary, I cloned the repo and tried to just run install.sh. However, of course I get an error message: wayland-scanner: command not found.

I am a bit confused because I am running on wayland, and checked using loginctl show-session 1 -p Type.

How do I properly make sure the dependencies are available?

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 1 year ago (1 children)

First, it is generally a bad idea to manually install software in package based distro. It can break something in your system (providing install.sh script is quite uncommon, it means that developers can do something uncommon and unexpected). Even if everything will go fine, once after system update the program you installed will get broken dependencies and stop working. Better search for prebuilt RPM package.

Then, answering your question: to build against libraries you need to install corresponding -devel packages. In Fedora their names can differ from the library name (e. g. not libglvnd-devel, but glvnd-devel, you need to search them yourself). For wayland-scanner you need wayland-devel as you can find here or with command dnf provides '*/wayland-scanner'.

[–] meekah 1 points 1 year ago (1 children)

As far as I'm aware the only options to install GSR as a package are AUR/yay (not available on fedora as far as I understand) or flatpak (unable to resolve permission issue), so I do think a manual install is the best option. This is a gaming system so GSR breaking is no huge deal.

Thanks for the tips regarding manual installation! I did not know about -devel packages or about the dnf provides command. They will probably prove to be very useful!

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago) (1 children)

If you're going to install from source at least change the compile config options so the prefix defaults to /opt/program-name.

You can further integrate with the system by adding the /opt/program/bin/ and sbin/ dirs to the PATH variable, and add lib/ to /etc/ld.so.conf but it should not be needed normally — only if other programs need to compile against this one.

You can also simplify integration by making common dirs for example /opt/.bin and /opt/.lib, adding only those to PATH and ld, and symlinking binaries and libraries from all /opt programs to them.

[–] meekah 1 points 1 year ago

those are nice tips, thank you!

[–] [email protected] 1 points 1 year ago (1 children)

I noticed in the install.sh of GSR, that setcap cap_sys_admin+ep is called on the executable. So if you know any way of replicating something like that for flatpaks that is simpler than installing GSR manually, feel free to let me know.

You can just run the same command on the executable installed by flatpak. On my system it can be found in /var/lib/flatpak/app/{app name}/current/active/files/bin.

[–] meekah 1 points 1 year ago* (last edited 1 year ago)

I didn't consider that an option because whenever I searched for setcap and flatpak, most threads were pretty dismissive and told OP that flatpak is made with security in mind so doing that isn't supported.

Regardless, I tried it just now, but the password prompt (image below) still shows up when launching the autostart .desktop file I created. The .desktop file launches a script I wrote, which in turn actually starts GSR through flatpak, in case that changes anything.

password prompt

Do I assume correctly that this prompt might be gone if I set the capabilities of /usr/bin/flatpak? It's not something I want to do, so I'll probably keep trying to get the manually built version installed.