Commit Graph

142 Commits

Author SHA1 Message Date
Martin Pulec
8a58843b7c AppRun: use bundled libwayland* only if needed
Besides the original check (-n $WAYLAND_DISPLAY), do not use the bundled
libraries also when there are the libwayland* in system (so not needed).

This allows `uv -d sdl:driver=KMSDRM` even from console when
WAYLAND_DISPLAY is not defined but Wayland is run in a different session.

If the WAYLAND_DISPLAY is defined but the not all libwayland* are found
in the system, now the bundled version is used (changed- was not
previously).
2024-09-17 13:59:21 +02:00
Martin Pulec
4b449c5917 create-appimage.sh: do not exclude libpipewire-0.3.so.0
ilibpipewire-0.3.so.0 was added to excludelist causing the distcheck fail,
see [1]

We do not need to exclude the lib, because we already handle the preload
in data/scripts/Linux-AppImage/AppRun:282 (the case is similar as for
libjack.so.0 as also mentioned in the related AppImage issue).

[1]:
04af461f47
2024-08-28 13:29:49 +02:00
Martin Pulec
81691c2199 AppRun: removed unused code
not run in MSW, C&P
2024-07-30 08:39:11 +02:00
Martin Pulec
f3d67249b7 AppImage custom excludelist x86: removed gnutls
Doesn't seem to be required and nwo (since the new PPA use) causes following error:
```
ultragrid_vidcap_rtsp.so: /lib/x86_64-linux-gnu/libgnutls.so.30: undefined symbol: nettle_siv_gcm_aes256_decrypt_message, version NETTLE_8
``
(obviously) when libgnutls30 is not installed, eg. in Ubuntu 24.04.
2024-07-18 10:49:28 +02:00
Martin Pulec
417497b406 AppRun: check system libva
Check if bundled libavcodec has all dependencies satisfied from system
libva, if not do not use the system ones.

Fixes the error message:
```
undefined symbol: vaMapBuffer2  (./squashfs-root/usr/lib/libavutil.so.59)
```

on (some) current Ubuntu 22.04 with current continuous AI.
2024-07-17 16:07:12 +02:00
Martin Pulec
89b173ba2b AppImage: option --ug-help for UG help
If run from within the AppImage, -h shows help of the AppImage wrapper
itself, not the one of UltraGrid. So add --ug-help as an alternative for
`-o uv -h`.

First considered was a shortopt -H, but this is currently mapped by UG
for --full-help (which can be used directly), so keep the long variant
in order not to make it confusing.
2024-07-09 09:27:19 +02:00
Martin Pulec
46b2c0ee64 AppRun: restore TIO with sighandler
Restore TIO always - the firejail doesn't always let UG exit gracefully
(seems like there is some timeout), so restore this with the wrapping
script.
2024-07-03 09:33:18 +02:00
Martin Pulec
e6473a01dd AppRun Firejail: allow Avahi over D-bus
needed for NDI discovery
2024-06-26 14:33:24 +02:00
Martin Pulec
51589f52da hd-rum-av: support for AppImage/Firejail 2024-05-28 08:51:01 +02:00
Martin Pulec
7373b28aaa AppRun: shorten conditions
||-syntax takes just one line instead of 3
2024-05-09 15:29:29 +02:00
Martin Pulec
3b30d2934b AppIamge: system libva usability improvement
In the current AppImages, the bundled libavcodec depends just on
libva.so.2 but libavutil depends on libva.so.2, libav-drm.so.2 and
libva-x11.so.2. Since the availability of any of libva-*.so was not
detected, even if those are not present (eg. in GRML 24.02 libva-x11.so.2
is missing), the system library was used.

As a solution, check the availability of all libav.* that is bundled
libavcodec and libavutil depending on.
2024-05-09 14:54:24 +02:00
Martin Pulec
65129a99e7 AppRun FJ (Linux): do not whitelist /tmp
if it happens that parent dir is /tmp, eg.:
`ug.AppImage -t testcard:file=/tmp/img.pam`

do not whitelist /tmp, otherwise following error occurs:
`Error: invalid whitelist path /tmp`
2024-04-12 10:56:52 +02:00
Martin Pulec
3efd4186a7 AppRun: exec UG binary with exec
This respawns the process instead of the script. The advantage is that
when the AppImage process is killed, UG is killed as well, eg. in this
case:
```
UltraGrid-continuous-x86_64.AppImage -t testcard & (sleep 3; kill $!)
```

Otherwise just the parent process (the shell) is killed, leaving the child
(UG) running on background, which is undesirable. See also:
<https://stackoverflow.com/questions/8533377/why-child-process-still-alive-after-parent-process-was-killed-in-linux>

For the above command, `kill -SIGTERM -$!` would be required to do
the job, but the parent shell process keeps "running" in the background
and `bg` needs to be run.
2024-02-19 15:10:38 +01:00
Martin Pulec
0c55a06c1e create-appimage.sh: disallow SoundFont override
Do not bundle SDL_SOUNDFONT instead of the SoundFont now included in
sources. This is a bit contra-intuitive, since the user may have set
the SDL_SOUNDFONT for its primary reason. Using the variable was just
a workaround to find _any_ usable soundfont, which is now unneeded.
Also, the user-selected soundfont may have hundreds of MB (as usually
the general-purpose soundfonts have).
2024-02-14 09:00:46 +01:00
Martin Pulec
bf09d1cdca CI: add sountfont, not download
The size is only some 90 kB when compressed so it is perhaps not worth
downloading from external source and depend on it.

It could be even bundled directly, not by CI. Now it is actually the case
in Linux (create-appimage.sh) but it is also possible for other platforms.
2024-02-13 16:44:31 +01:00
Martin Pulec
b73edbf575 scripts: remove SC2140 disable
It is not needed to split the string like this:
```
a="potentially long string on"\
"multiple lines"
```
but it is better rather to put the '\' inside the string:
```
a="potentially long string on\
multiple lines"
```
2024-02-09 12:14:21 +01:00
Martin Pulec
d093dbb0a9 AppRun: resolve tilde expansion (just "~/") 2023-11-30 11:26:22 +01:00
Martin Pulec
8670a1d25f AppRun: set LD_LIBRARY_PATH at the end
set LD_LIBRARY_PATH just before uv (or other tool) is run

This minimizes interference when running the script.
2023-11-03 16:16:06 +01:00
Martin Pulec
e09db568f9 AppRun FJ: allow /bin/bash
Bash is needed in /bin on U23.10 when running with Firejail (even though
/bin/sh is dash on that system).
2023-11-03 16:15:43 +01:00
Martin Pulec
af33553e1c AppRun FJ: do not whitelist /dev
eg. for `-d file:n=/dev/null` - whitelisting /dev is invalid:

    Error: invalid whitelist path /dev
2023-11-01 17:01:27 +01:00
Martin Pulec
f05a200add AppRun FJ: recognize also n[ame]=<n> paths 2023-11-01 15:55:41 +01:00
Martin Pulec
bb4ad12970 AppRun: preload also VDPAU 2023-10-09 16:25:43 +02:00
Martin Piatka
1cbb716198 vcap/pipewire: Buildable without screencast dbus portal stuff 2023-10-05 16:05:17 +02:00
Martin Pulec
b5cd530824 AppRun: do not disable dbus-user
Dbus is required for dbus audio and currently it even fails in Arch
without, see:

https://github.com/CESNET/UltraGrid/actions/runs/5642223630/job/15281663172
2023-07-26 09:50:44 +02:00
Martin Pulec
47be77ed94 create-appimage.sh: do not require fc-match
If not running in GitHub CI, do not fail on fc-match absence, only print
the error.
2023-07-24 14:48:12 +02:00
Martin Pulec
c381978ab3 create-appimage.sh: removed stdout->stderr redir
+ removed the subshell

The redirection is actually no longer neeeded - we do not need to bother
where the output goes but the reason for the redirection is no longer
valid - the created AppImage is no longer outputted.
2023-07-18 10:49:05 +02:00
Martin Pulec
74d1bf7963 CI Linux: prevent mkappimage auto upload
mkappimage now tries to automatically upload the asset if it detects
running in GitHub CI, which is not the behavior we perhaps want because
it deletes and recreates our _continuous_ release.

See following failed run:
https://github.com/CESNET/UltraGrid/actions/runs/5575039257/jobs/10185765784

+ fixed `wget` presence check in `create-appimage.sh`
2023-07-18 10:01:07 +02:00
Martin Pulec
bbe5c9e986 AppRun Firejail: disable mnt only if possible
If /mnt, /media, /run/mount, /run/media is included on command-line, do
not toggle Firejail option --disable-mnt.
2023-06-23 11:19:08 +02:00
Martin Pulec
16d11f013d AppRun Filejail: whitelist -t file:<name> 2023-06-15 16:43:46 +02:00
Martin Pulec
80df5db0fd AppImage Firejail: support for spaces in names 2023-06-08 15:42:51 +02:00
Martin Pulec
1d246688d8 AppRun: accept FIREJAIL_OPTS from caller
The caller can now provide its own FIREJAIL_OPTS (if something is
needed).

+ do not pass explicitly UG_FONT_DIR to firejail - the environment isn't
  entirely pruned, the env vars usually pass to the Firejail, except of
  some, including LD_PRELOAD, LD_LIBRARY_PATH and TMPDIR, which are
  already passed.
2023-05-18 08:43:51 +02:00
Martin Pulec
e15f57c38a AppRun: do not pass SoundFont in env var
Do not use env var SDL_SOUNDFONT to pass sounfont path but let the
sdl_mixer UG module load the fonts directly (as on other platforms).
2023-05-18 08:43:51 +02:00
Martin Pulec
78796781db bundled SoundFount is sf3 2023-05-18 08:43:39 +02:00
Martin Pulec
30e9484ff7 AppImage: bundle a SoundFont file
In order to sdl_mixer being able to synthetise MIDI.
2023-04-28 10:15:11 +02:00
Martin Pulec
34f5d2d036 AppRun Firejail updates
- TMPDIR was not writtable - `--read-only=/tmp` after
  `--read-write=/tmp/something` overrides read-write, order needs to be
  reversed
- for args file, filename, make parent directory writtable - it may not
  only be read, but also written (like `--protocol sdp:file=out.sdp`)
+ FIREJAIL_DEBUG to print assembled Firejail arguments
2023-04-27 15:21:18 +02:00
Martin Pulec
47fac9109c AppRun: use $ULTRAGRID_AUTOUPDATE val as interval
If $ULTRAGRID_AUTOUPDATE is set to >= 0, use it as update interval (in
days).

Since the value 0 was used to suppress the update warning, the value
to suppress the warning was required to change to -1.
2023-04-21 10:04:56 +02:00
Martin Pulec
0bd5c1d12c AppRun: autoupdater updates
- if updated, restart the command using the new AppImage
- if update fails (eg. no error connection), AppImage will continue
  running
2023-04-20 17:30:01 +02:00
Martin Pulec
b4b138b74f AppRun: do not use LD_LIB_PATH for handle_updates()
The command-line tools used here (eg. stat) may use our custom libraries
(like libselinux) which may not be entirely compatible (it just most
likely ends up with a warning).

+ do the same for get_tools() and set_libva_ld_preload()
+ use original (if any) LD_LIBRARY_PATH for set_ld_preload()
+ removed unneeded `exit $?` (it is implicit)
2023-04-05 16:32:58 +02:00
Martin Pulec
35bf20065e AppRun: use get_loader() from preload.sh 2023-04-05 16:12:55 +02:00
Martin Pulec
c0cde4bc82 Firejail: allow pipewire screen capture
additionally requires root (not to be disabled by default.profile) + not
disabling dbus
2023-04-05 15:24:11 +02:00
Martin Pulec
538fc2af3f AppRun: preload also libpipewire
libpipewire is incompatible with preloaded jack on current Arch and
causes a crash (unsatisfied jack pipewire function dependency).

Anyways, the pipewire screen capture didn't work with the bundled
library, anyways, so we certainly need one from system.
2023-04-05 15:24:11 +02:00
Martin Pulec
8ea11c3413 AppRun: run tput prior to setting LD_LIB_PATH
Setting LD_LIBRARY_PATH would override the library path also for tput
executable, leading to possible incompatible version of ncurses in
bundle, leading to following error:

    tput: /tmp/.mount_UG-20-oJoJEf/usr/lib/libncursesw.so.6: version `NCURSES6_TINFO_6.2.20211010' not found (required by tput)

(and of course the color escape sequence is not returned)
2023-04-04 15:59:47 +02:00
Martin Pulec
1930b7b857 create-appimage.sh: fixed shellcheck warnings 2023-04-04 14:26:58 +02:00
Martin Pulec
062f771fde AppImage: don't use bundled Wayland libraries
Don't use bundled Wayland libraries when running on Wayland but use it
otherwise to satisfy possibly unsatisfied dependencies.

See also previous commit - Wayland libraries seem not to be portable and
prevent SDL2 native run on Wayland. After this change, SDL2 runs on
U22.04 in Weston (without Xwayland).
2023-04-04 14:19:55 +02:00
Martin Piatka
46c6486353 create-appimage: Bundle qt plugins with correct version
Starting from about 20th January, the wrong version (qt4) started
getting bundled on the Ubuntu runner.
2023-03-13 15:55:13 +01:00
Martin Pulec
2dbaec7255 AppRun: "printf" added to printed string by mistake 2023-03-09 14:14:26 +01:00
Martin Pulec
d6aaf6a6c3 create-appimage.sh: add --fail as curl opt 2023-01-25 16:25:53 +01:00
Martin Pulec
571b9a7064 AppRun firejail: removed deprecated --shell
firejail repors it's deprecated as for 0.9.72 and refuses to run
2023-01-18 11:38:16 +01:00
Martin Pulec
698b854e48 create-appimage.sh: pass GITHUB_TOKEN if available
to avoid GitHub rate-limiting

+ added '-Ss' options to curl
2023-01-02 16:22:50 +01:00
Martin Pulec
7d033195b3 AppRun,create-appimage.sh: added missing expr redirections 2023-01-02 10:44:31 +01:00