Testing 3rd-party bundles (including ffmpeg)

Update 17-04-2020: to get the latest information keep track of my GitHub I will keep updating the readme and I will add more guides (like how to build your own 3rd-party repo) in the future. The GitHub organization that I created also contains all the package configs that I used.

The last few days I have been working on getting some 3rd-party repositories working on my local machine and now I have hosted them on my server for anyone to enjoy, please note some workarounds are still needed to get everything working properly as swupd 3rd-party is still in beta.

For now, I have packaged the following software, I do not plan on adding software upon request as this is mainly for my own personal use, however I might add more software when I start using it personally (GitKraken comes to mind right now).

  • FFmpeg

  • Flameshot

  • Google Chrome Stable

  • iio-sensor-proxy

  • Skype

  • Teams

  • VSCode

  • Zoom

In order to use the repository, we first have to enable it with:


sudo swupd 3rd-party add <repo-name> https://clear.greginator.xyz/

where <repo-name> can be anything, it is the name that will be used for the repository on your own machine and it will mean that all content of the repository will be placed under /opt/3rd-party/bundles/<repo-name>

In order to list all available bundles from 3rd-party repos:


sudo swupd 3rd-party bundle-list -a

To update the 3rd-party repos:


sudo swupd 3rd-party update

In order to install the actual packages (note this will install all the packages, you can choose to only select a few)


sudo swupd 3rd-party bundle-add ffmpeg flameshot google-chrome-stable iio-sensor-proxy skype teams vscode zoom

Some fixes:

Making the software available through a desktop environment:


cp -R /opt/3rd-party/bundles/<repo-name>/usr/share/applications $HOME/.local/share/applications

Make iio-sensor-proxy autostart


sudo cp -R /opt/3rd-party/bundles/<repo-name>/usr/lib/udev /etc

sudo cp -R /opt/3rd-party/bundles/<repo-name>/usr/lib/systemd /etc

Allow for large directory tracking in VS Code


sudo mkdir -p /etc/sysctl.d

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Adding the codecs to the path (note this doesn’t seem to be enough for firefox and vlc)


sudo sh -c 'echo /opt/3rd-party/bundles/<repo-name>/usr/lib >>/etc/ld.so.conf'

sudo ldconfig

To fix firefox and vlc (only for bash shell not for zsh, still working on a fix for that) add to /etc/environment


if [[ $UID -ge 1000 && -d /opt/3rd-party/bundles/<repo-name>/usr/lib && -z $(echo $LD_LIBRARY_PATH | grep -o /opt/3rd-party/bundles/<repo-name>/usr/lib) ]]

then

export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/3rd-party/bundles/<repo-name>/usr/lib"

fi

The current workaround for zsh is a bit cumbersome but the following is needed for firefox:


echo "export LD_LIBRARY_PATH=/opt/3rd-party/bundles/<repo-name>/usr/lib" >> ${HOME}/.config/firefox.conf

and for vlc just run


LD_LIBRARY_PATH=/opt/3rd-party/bundles/<repo-name>/usr/lib vlc

I hope this can be of use to some users out there and I want to thank the Clearlinux team for making great steps in improving the end-user experience by enabling 3rd-party repositories.

18 Likes

The great work gregor160300!
Thanks!

Just now add yours repo and install vscode (because I tried but cannot create my own local repo). All works fine!

Great work @gregor160300 !

Another option is to add /opt/3rd-party/bundles/<repo-name>/usr/share to XDG_DATA_DIRS env var.

Practically everything else I’ve seen on Clear Linux installs in

/usr/local

Why you decide on using /opt ?

On linux generally self (source) built software gets installed to /usr/local but most proprietary software gets installed to /opt, I didn’t decide where to put the 3rd-party bundles personally, but it was a choice by the Clearlinux team to do it so, I honestly don’t know why they made the choice but I would expect that is was done for the reason that most 3rd-party repos will contain proprietary software

3 Likes

That’s how Arch does it to. Anaconda, Chrome, intel-mkl install in the /opt folders

Can’t get it working in GNOME Wayland session, X session works fine.

1 Like

gregor, thanks for explanation :wink:

1 Like

Thanks very much for this. Just installed chrome and looks like it works fine.

Dear @gregor160300
It’s time to update, VSCode new version is out

Thanks!

I am working on an update of the repositories, however the update will not be available before tonight. I am also trying to get ffmpeg to compile with autospec and to add gitkraken abd TeamViewer, but both are giving me some issues

4 Likes

To get the latest information keep track of my GitHub I will keep updating the readme and I will add more guides (like how to build your own 3rd-party repo) in the future. The GitHub organization that I created also contains all the package configs that I used.

5 Likes

I have the following issue getting vscode from this repo working on Wayland:
Default browser (Firefox) not opening and chrome based browsers can't seem to find nautilus (Wayland only) · Issue #1884 · clearlinux/distribution · GitHub, which appears to only be an issue with AMD video controllers. Same Wayland issue you are seeing I wonder?

One issue is the lack of libsnappy.so.1 for ffmpeg install. A basic ClearLinux installation does not have the snappy; (or do not build ffmpeg with snappy);

I will try to include it in a future release (Clear Linux already has a package for it but it’s not in a bundle yet). Currently I am in the process of moving to a new server (with Clear Linux instead of Ubuntu Server) so there will be some downtime in the coming few hours. After moving I will begin updating the packages and I will try to automate some parts of the updates

2 Likes

On /opt vs. /usr/local. The reason that we chose /opt isn’t because of proprietary vs. open source. The simple reason is that locally compiled software automatically goes into /usr/local. We want to make sure that 3rd-party software doesn’t overwrite or interfere with locally compiled software, so we cannot use that location by default.

/opt is traditionally used by vendors to distribute software that is not originating from the default repositories. This can be both open source and proprietary. The most important thing to keep in mind is that /opt is generally “controlled” by a specific update mechanism, and /usr/local is not. The update mechanism is sometimes the same as the distro method (e.g. chrome in rpm format for rpm based distributions), but that isn’t a requirement.

Hence, the most suitable place for 3rd-party repos is /opt.

5 Likes

This note is really helpful and should probably go to one of the documentations.

1 Like

2 problem facing with google chrome install.

Font issue. Previously used to manage with 1.

sed -i 's\/usr/bin/google-chrome-stable\env FONTCONFIG_PATH=/usr/share/defaults/fonts /usr/bin/google-chrome-stable\g' /usr/share/applications/google-chrome.desktop

cannot add to favorite in dash to dock. “google-chrome.desktop” files is somewhere else.

youtube-dl problem

android@clr~ $ youtube-dl https://www.youtube.com/watch?v=2TtraezByG0
[youtube] 2TtraezByG0: Downloading webpage
WARNING: Requested formats are incompatible for merge and will be merged into mkv.
[download] Destination: Guess whos really going to Hell-2TtraezByG0.f134.mp4
[download] 100% of 18.54MiB in 00:04
[download] Destination: Guess whos really going to Hell-2TtraezByG0.f251.webm
[download] 100% of 22.17MiB in 00:05
[ffmpeg] Merging formats into "Guess whos really going to Hell-2TtraezByG0.mkv"
ERROR: /opt/3rd-party/bundles/3rdparty/usr/bin/ffmpeg: error while loading shared libraries: libsnappy.so.1: cannot open shared object file: No such file or directory

Thank you for making this bundle. I have a question. I am trying to use ffmpeg in a docker container. I passed the volume as /opt/3rd-party but when I try to use ffmpeg I get this error. I am not an expert in docker so I might be doing something wrong?

/opt/3rd-party/bundles/greginator/usr/bin/ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file: No such file or directory