321.3. smplayer-26.8.29
Qt front end for mpv that remembers where every file stopped
| Version | 26.8.29, release 1 |
| Shelf | video-players — Video players and media centres, and their front-end add-ons |
| Phase | 44_apps (Applications), 402 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://www.smplayer.info/ |
| Build time | 1.6 SBU |
| Installed size | 5.4 MiB in 33 files |
| Recipe | ports/core/video-players/smplayer/kpkgbuild |
About
SMPlayer is a Qt front end for mpv that remembers the settings of each file it has played, so a file played again resumes at the point it stopped, with the same settings. It runs mpv as a child process and has it draw into SMPlayer’s own window by X11 window id, so on Linux main.cpp sets QT_QPA_PLATFORM=xcb for itself: SMPlayer runs under Xwayland, and the mpv it starts uses its X11 video output.
Sources
smplayer-26.8.29.tar.bz2(5.0 MiB)
sha25664a04328396069b4d8e1c1bca9aebf11f771707a4a1cb49125377d3ecca68450
upstream: https://github.com/smplayer-dev/smplayer/releases/download/v26.8.29/smplayer-26.8.29.tar.bz2
archive copy: sources-4/video-players--smplayer-26.8.29.tar.bz2
Dependencies
Depends on: qt5-qtbase, qt5-qtsvg, qt5-qttools, libX11, zlib, mpv.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
offline.patch— Comments out fourDEFINESinsrc/smplayer.pro, compiling out the features that exist only to reach the internet:UPDATE_CHECKER,FIND_SUBTITLES(the OpenSubtitles search),YOUTUBE_SUPPORT(the URL resolver, whose code downloader fetches ayt-dlpbinary) andCHROMECAST_SUPPORT. The project file sets them unconditionally, and qmake has no switch for any one of them.
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/44_apps/phase.env && kpkg install smplayer'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/video-players/smplayer.
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/smplayer
echo '64a04328396069b4d8e1c1bca9aebf11f771707a4a1cb49125377d3ecca68450 smplayer-26.8.29.tar.bz2' | 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/smplayer
SRC=$SRC_ROOT/smplayer-26.8.29
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf smplayer-26.8.29.tar.bz2 -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/offline.patch"
_qmake_opts="DEFINES+=NO_MPLAYER QMAKE_CFLAGS_RELEASE=\"$CFLAGS\" QMAKE_CXXFLAGS_RELEASE=\"$CXXFLAGS\" QMAKE_LFLAGS_RELEASE=\"$LDFLAGS\""
make PREFIX=/usr QMAKE=qmake-qt5 LRELEASE=/usr/lib/qt5/bin/lrelease \
QMAKE_OPTS="$_qmake_opts" CFLAGS_EXTRA=-Wno-error
make PREFIX=/usr QMAKE=qmake-qt5 LRELEASE=/usr/lib/qt5/bin/lrelease \
QMAKE_OPTS="$_qmake_opts" CFLAGS_EXTRA=-Wno-error \
DESTDIR=$PKG install
rm -f "$PKG/usr/bin/simple_web_server"
find "$PKG/usr/share/smplayer/translations" -name '*.qm' ! -name 'smplayer_en*.qm' -delete
find "$PKG/usr/share/doc/packages/smplayer" -mindepth 1 -maxdepth 1 -type d ! -name en -exec rm -rf {} +
gunzip "$PKG/usr/share/man/man1/smplayer.1.gz"
rm -f "$PKG/usr/share/applications/smplayer_enqueue.desktop"
cat > "$PKG/usr/share/applications/smplayer.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=SMPlayer
GenericName=Media Player
Comment=Play videos and music with mpv, remembering where each file stopped
TryExec=smplayer
Exec=smplayer %U
Icon=smplayer
Terminal=false
StartupWMClass=smplayer
Categories=Qt;AudioVideo;Player;Video;
Keywords=video;movie;player;mpv;subtitles;smplayer;
DESKTOP
chmod 644 "$PKG/usr/share/applications/smplayer.desktop"
The switches, and why each is set:
QMAKE=qmake-qt5— Build against Qt 5, with Qt 5’slreleasefor the translations (LRELEASE=/usr/lib/qt5/bin/lrelease). The project file accepts Qt 6, but the code uses Qt 5 interfaces with no Qt 6 replacement (QTextStream::setCodec,QRegExpwithout its header); see A Qt 5 program built against Qt 6.DEFINES+=NO_MPLAYER— Upstream’s switch that removes the MPlayer and MPlayer2 back ends, leaving mpv the one player SMPlayer drives. MPlayer is not a port.QMAKE_CFLAGS_RELEASE— WithQMAKE_CXXFLAGS_RELEASEandQMAKE_LFLAGS_RELEASE, hands the tree’s compiler and linker flags to qmake, which reads none from the environment. Without them the binary is built with qmake’s own release flags and none of the tree’s.CFLAGS_EXTRA=-Wno-error— The top-levelalltarget also buildssimple_web_server, the web server of the Chromecast sender, whose makefile compiles with-Werrorfollowed by$(CFLAGS_EXTRA), so-Wno-errorlands after it and a warning does not stop the build. The server itself is not shipped.
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/smplayer, 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 smplayer-26.8.29-1.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/smplayer, and runs the triggers its paths call for.
Contents
Installed programs: smplayer.
Installed directories: /usr/share/doc/packages, /usr/share/licenses/smplayer, /usr/share/smplayer.
Short descriptions
smplayer |
The best GUI frontend for MPlayer |
Notes
- What
build.shremoves.simple_web_serverfrom/usr/bin, since it serves only the Chromecast sender, which is not built; every translation catalogue but English; every manual directory under/usr/share/doc/packages/smplayerbuten; and thesmplayer_enqueue.desktopentry, a file-manager action rather than a program. The manual page is decompressed, because the install gzips it, and gzip records the page’s modification time, the moment of the install, in its header, which would make two builds of the same source differ. - The data paths stay upstream’s.
DOC_PATHand the other paths reach the compiler as quoted string defines through the top-level Makefile’s environment; set on themakeline, they would reach the sub-make unquoted. The manual SMPlayer’s About dialog shows is under/usr/share/doc/packages/smplayer, which the package-time prune of HTML manuals exempts (see Size and language policy). - The menu entry is replaced. Qt’s xcb backend sets
WM_CLASSfrom the program name,smplayer, which is theStartupWMClass. It claims no MIME type: mpv’s entry claims the video and audio types, andmimeapps.listis where the default player is chosen.