264.1. vlc-3.0.24
VLC media player 3 with its Qt 5 interface — plays files, discs, devices and streams
| Version | 3.0.24, release 2 |
| Shelf | video-players — Video players and media centres, and their front-end add-ons |
| Phase | 43_toolkits (Toolkits), 283 of 344 in build order |
| Licence | GPL-2.0-or-later AND LGPL-2.1-or-later |
| Homepage | https://www.videolan.org/vlc/ |
| Build time | 8.8 SBU |
| Installed size | 20.9 MiB in 623 files |
| Recipe | ports/core/video-players/vlc/kpkgbuild |
About
VLC is VideoLAN’s media player: files, DVDs, Blu-ray discs, audio CDs, capture devices and network streams, with transcoding and streaming out (sout) as well. This port builds VLC 3 with its Qt 5 interface, libvlc and libvlccore for programs that embed it, the ncurses text interface, and the modules its configure line names.
The Qt interface is built with its X11 helpers (qt5-qtx11extras), and VLC 3 then starts Qt on its xcb platform whatever QT_QPA_PLATFORM says, and does not open the interface at all when no X display answers. So VLC runs under Xwayland, embeds the video in its window by X window id, and draws through the xcb, XVideo, GLX and EGL-on-X11 video outputs. --enable-wayland builds the Wayland outputs as well, with an xdg-shell video window that VLC opens when it runs without the Qt interface and with no X display, as cvlc does with DISPLAY unset.
Sources
vlc-3.0.24.tar.xz(26.3 MiB)
sha256e7cab503d1d7d5849b89d2cf0e1ee60d0ef6d012407791b644b9cfc0cc225fdf
upstream: https://download.videolan.org/pub/videolan/vlc/3.0.24/vlc-3.0.24.tar.xz
archive copy: sources-4/video-players--vlc-3.0.24.tar.xz
Dependencies
Depends on: pkgconf, lua54, dbus, zlib, minizip, libidn, freetype2, libogg, libxcb, libarchive, libdvdread, libdvdnav, libbluray, samba, libssh2, libnfs, v4l-utils, libdvbpsi, libgme, libebml, libmatroska, libmodplug, libmad, mpg123, ffmpeg, libva, faad2, dav1d, libvpx, flac, libvorbis, speex, speexdsp, opus, libtheora, libpng, libjpeg-turbo, x264, x265, a52dec, libmpeg2, twolame, fluidsynth, fribidi, harfbuzz, fontconfig, libass, librsvg, libpulse, alsa-lib, libsamplerate, soxr, libspatialaudio, chromaprint, qt5-qtbase, qt5-qtsvg, qt5-qtx11extras, qt5-qtwayland, ncurses, avahi, eudev, lirc, libmtp, libxml2, libgcrypt, gnutls, taglib, libsecret, xcb-util-keysyms, libX11, libSM, libICE, libsrt, librist, mesa, wayland, wayland-protocols.
Required by (5): elisa, kalarm, kasts, obs-studio, phonon-backend-vlc.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
--disable-opencv, line 108: opencv (explained with the switches below)--disable-freerdp, line 114: freerdp (explained with the switches below)--disable-mpc, line 119: mpc--disable-kwallet, line 159: kwallet (explained with the switches below)--disable-notify, line 160: libnotify--disable-libplacebo, line 161: libplacebo (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
fribidi_allow_deprecated.patch— removes#define FRIBIDI_NO_DEPRECATEDbefore#include <fribidi.h>in the FreeType text renderer. With the define,fribidi.hleaves out FriBidi’s compatibility declarations, which the renderer still calls.musl-ioctl.patch— in the V4L2 access module, declares thev4l2_ioctlfunction pointer asint (*)(int, int, ...), the type of musl’sioctl(), instead of glibc’sunsigned long intrequest. With glibc’s type, assigningioctlto it does not compile.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/43_toolkits/phase.env && kpkg install vlc'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/video-players/vlc.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/video-players/vlc
echo 'e7cab503d1d7d5849b89d2cf0e1ee60d0ef6d012407791b644b9cfc0cc225fdf vlc-3.0.24.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/vlc
SRC=$SRC_ROOT/vlc-3.0.24
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf vlc-3.0.24.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/musl-ioctl.patch"
patch -p1 -i "$PORT_SRC/fribidi_allow_deprecated.patch"
export LUA_CFLAGS="$(pkg-config --cflags lua5.4)"
export LUA_LIBS="$(pkg-config --libs lua5.4)"
export LUAC=luac5.4
export BUILDCC="gcc -std=gnu11"
./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib \
--disable-static \
--disable-rpath \
--disable-nls \
--disable-debug \
--disable-update-check \
--disable-addonmanagermodules \
--enable-vlc \
--enable-dbus \
--enable-sout \
--enable-lua \
--enable-vlm \
--enable-archive \
--enable-dvdread \
--enable-dvdnav \
--enable-bluray \
--enable-smbclient \
--enable-sftp \
--enable-nfs \
--enable-v4l2 \
--enable-vcd \
--enable-screen \
--enable-dvbpsi \
--enable-gme \
--enable-ogg \
--enable-matroska \
--enable-mod \
--enable-wma-fixed \
--enable-mad \
--enable-mpg123 \
--enable-merge-ffmpeg \
--enable-avcodec \
--enable-avformat \
--enable-swscale \
--enable-libva \
--enable-faad \
--enable-dav1d \
--enable-vpx \
--enable-a52 \
--enable-libmpeg2 \
--enable-twolame \
--enable-flac \
--enable-vorbis \
--enable-speex \
--enable-opus \
--enable-theora \
--enable-oggspots \
--enable-png \
--enable-jpeg \
--enable-x264 \
--enable-x265 \
--enable-fluidsynth \
--enable-telx \
--enable-css \
--enable-gles2 \
--with-x \
--enable-xcb \
--enable-xvideo \
--enable-wayland \
--enable-freetype \
--enable-fribidi \
--enable-harfbuzz \
--enable-fontconfig \
--enable-libass \
--enable-svg \
--enable-svgdec \
--enable-pulse \
--enable-alsa \
--enable-samplerate \
--enable-soxr \
--enable-spatialaudio \
--enable-chromaprint \
--enable-qt \
--enable-ncurses \
--enable-avahi \
--enable-udev \
--enable-lirc \
--enable-mtp \
--enable-libxml2 \
--enable-libgcrypt \
--enable-gnutls \
--enable-taglib \
--enable-secret \
--disable-live555 \
--disable-dc1394 \
--disable-dv1394 \
--disable-linsys \
--disable-opencv \
--disable-dsm \
--disable-smb2 \
--disable-decklink \
--disable-libcddb \
--disable-vnc \
--disable-freerdp \
--disable-realrtsp \
--disable-asdcp \
--disable-shout \
--disable-sid \
--disable-mpc \
--disable-shine \
--disable-omxil \
--disable-crystalhd \
--disable-gst-decode \
--disable-postproc \
--disable-aom \
--disable-fdkaac \
--disable-dca \
--disable-tremor \
--disable-daala \
--disable-openapv \
--disable-bpg \
--disable-x262 \
--disable-x26410b \
--disable-vpl \
--disable-fluidlite \
--disable-zvbi \
--disable-aribsub \
--disable-aribb25 \
--disable-kate \
--disable-tiger \
--disable-vdpau \
--disable-sdl-image \
--disable-aa \
--disable-caca \
--disable-mmal \
--disable-evas \
--disable-oss \
--disable-sndio \
--disable-jack \
--disable-chromecast \
--disable-skins2 \
--enable-srt \
--enable-librist \
--disable-goom \
--disable-projectm \
--disable-vsxu \
--disable-upnp \
--disable-microdns \
--disable-kwallet \
--disable-notify \
--disable-libplacebo
make
make -j1 DESTDIR=$PKG install
rm -f "$PKG/usr/lib/vlc/plugins/plugins.dat"
rm -rf "$PKG/usr/lib/mozilla" "$PKG/usr/share/kde4"
cat > "$PKG/usr/share/applications/vlc.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=VLC media player
GenericName=Media Player
Comment=Read, capture and stream multimedia, discs and devices
TryExec=vlc
Exec=vlc --started-from-file %U
Icon=vlc
Terminal=false
StartupNotify=true
StartupWMClass=vlc
X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb
Categories=Qt;AudioVideo;Player;Recorder;Video;
Keywords=player;capture;dvd;audio;video;playlist;stream;vlc;
Actions=play-dvd;play-cd;
[Desktop Action play-dvd]
Name=Play a DVD
Exec=vlc dvd://
[Desktop Action play-cd]
Name=Play an audio CD
Exec=vlc cdda://
DESKTOP
chmod 644 "$PKG/usr/share/applications/vlc.desktop"
The switches, and why each is set:
LUA_CFLAGS— withLUA_LIBSandLUAC: build the Lua modules against lua54, through its versioned nameslua5.4andluac5.4. configure askspkg-configforlua5.2, thenlua5.1, thenlua; the tree’sluais 5.5, whose API VLC’s Lua modules do not build against. The two variables answer configure’s check outright, andLUACcompiles the playlist, extension and interface scripts for the same virtual machine.BUILDCC— the compiler for the helper programs the build runs on the build machine. configure looks for one by the POSIX namesc11-gcc,c11,c99-gccandc99, which nothing in the tree installs, and stops when it finds none andBUILDCCis unset.--enable-avcodec— and every other--enable-of a module with an outside library, from--enable-archiveto--enable-secret,--enable-srtand--enable-librist: each module named, so that for most of them a missing port stops configure instead of producing a VLC that cannot open a format. Each library is a port independs.--enable-lirc— infrared remote controls through lirc. Its check never stops configure: a missing library leaves the module out without a word, whatever the switch says. The checks behind--enable-pngand--enable-jpegdo the same, and those behind--enable-libass,--enable-taglib,--enable-fontconfig,--enable-fribidiand--enable-harfbuzzprint only a warning. For these the port independsis what keeps the module or feature.--enable-merge-ffmpeg— build theavformatdemuxer and muxer, theavioaccess and theavparserpacketizer into theavcodecplugin instead of plugins of their own;swscalestays separate. Off by upstream’s default.--enable-wma-fixed— the fixed-point WMA decoder module, off by upstream’s default.--enable-telx— VLC’s own Teletext decoder, the one built when zvbi is absent; zvbi is not a port.--disable-live555— anddc1394,dv1394,linsys,dsm,smb2,shout,mpc,shine,dca,tremor,daala,openapv,bpg,x262,vpl,zvbi,aribsub,aribb25,kate,tiger,vdpau,caca,goom,projectm,vsxu,upnp,microdns,libcddb,aomandfluidlite: modules whose library is not a port.--disable-x26410b— no separate 10-bit H.264 encoder module. Its library is x264, which thex264module uses.--disable-libplacebo— VLC 3 accepts only libplacebo older than 6, and the libplacebo port is newer.--disable-postproc— thepostprocfilter needs FFmpeg’slibpostproc, which the ffmpeg port does not install.--disable-opencv— VLC 3 askspkg-configforopencv; OpenCV 4, the opencv port, installsopencv4.pc.--disable-sdl-image— VLC 3 takes SDL_image 1.2, not sdl2-image.--disable-sid— VLC 3 takes libsidplay2, not libsidplayfp.--disable-freerdp— VLC 3’s RDP access module askspkg-configforfreerdp, FreeRDP 1’s name; the freerdp port installs its file under a name carrying the major version, such asfreerdp3.pc.--disable-vnc— no VNC access module.--disable-fdkaac— the FDK AAC encoder’s licence cannot be combined with GPL code.--disable-gst-decode— with--disable-ossand--disable-sndio: modules that duplicate ones the build has. avcodec decodes what the GStreamer decoder would, and PulseAudio and ALSA are the audio outputs, both carried to PipeWire.--disable-aa— no ASCII-art video output through aalib.--disable-jack— no JACK audio output module.--disable-kwallet— no KWallet keystore; passwords go to the Secret Service through--enable-secretand libsecret.--disable-skins2— with--disable-notify: no skinnable interface and no libnotify popups; the Qt interface covers both.--disable-update-check— with--disable-addonmanagermodulesand--disable-chromecast: no check against videolan.org for new versions, no add-on manager for videolan.org’s catalogue, and no Chromecast output. Each needs the network to do anything.--disable-decklink— with--disable-asdcp,--disable-realrtsp,--disable-omxil,--disable-crystalhd,--disable-mmaland--disable-evas: no Blackmagic DeckLink SDI input, no Digital Cinema Package reader (asdcplib), no RealNetworks RTSP access, no OpenMAX IL or Broadcom Crystal HD decoders, no Raspberry Pi MMAL output and no EFL Evas output.--disable-rpath— hardcode no run-time library search path into the installed binaries.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/vlc, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf vlc-3.0.24-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/vlc, and runs the triggers its paths call for.
Contents
Installed programs: cvlc, nvlc, qvlc, rvlc, vlc, vlc-wrapper.
Installed libraries: libvlc.so, libvlccore.so.
Installed directories: /usr/include/vlc, /usr/lib/vlc, /usr/share/doc/vlc, /usr/share/licenses/vlc, /usr/share/vlc.
Short descriptions
vlc |
the VLC media player |
vlc-wrapper |
a wrapper to drop privileges with VLC |
libvlc.pc |
VLC media player external control library |
vlc-plugin.pc |
VLC media player plugin interface |
Notes
The install hook writes plugins.dat, a cache of each plugin’s size and modification time. Packaging resets every modification time, so the installed files would not match the cache, and the cache would differ between two builds; build.sh deletes it. kpkg writes it instead, once the files are in place, by running vlc-cache-gen whenever a package touches /usr/lib/vlc/plugins (see Shared indexes). Without the cache libvlc loads every plugin at start to learn what it does, the Qt 5 interface included, and Elisa, a Qt 6 program that links libvlc, crashes inside it.
The browser-plugin directory /usr/lib/mozilla and the KDE 4 service menus in /usr/share/kde4 name programs KDOS does not have, and are removed.
build.sh replaces upstream’s desktop entry. The Qt interface sets the window class vlc, which StartupWMClass names. The entry has no MimeType line: other players’ entries claim the audio and video types, and the default for each type is chosen in the desktop’s mimeapps table, /usr/share/kdos/xdg/kde-mimeapps.list. Every video row of that table, and the WebM-audio and AC-3 rows, names vlc.desktop behind Haruna’s entry, and those rows are the only place VLC is offered for a type. The installation medium carries both players, VLC because elisa plays through libvlc; a video opens in Haruna, and in VLC once Haruna is removed. The icons are upstream’s, from make install.
The Qt interface asks a privacy question on its first start, in a dialog in front of the first file played, unless qt-privacy-ask is 0. /etc/skel/.config/vlc/vlcrc sets it to 0 for every new account, with metadata-network-access=0, the answer the dialog leaves unticked: VLC fetches no album art or track details from the network. VLC reads the file from $XDG_CONFIG_HOME/vlc/vlcrc, skipping every line that starts with # or [, and rewrites it whole when its preferences are saved.