139.11. libdvdread-7.1.1
Reads the file system and title structure of a DVD-Video disc
| Version | 7.1.1, release 2 |
| Shelf | video-libs — Video codecs, containers, subtitles, disc playback and effects libraries |
| Phase | 41_system (System), 990 of 1047 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://www.videolan.org/developers/libdvdnav.html |
| Build time | 0.3 SBU |
| Installed size | 321.0 KiB in 21 files |
| Recipe | ports/core/video-libs/libdvdread/kpkgbuild |
About
libdvdread reads the UDF file system and the title, chapter and cell structure of a DVD-Video disc. libdvdnav is built on it for menu navigation, and ffmpeg, VLC, mpv, GStreamer’s dvdreadsrc, k3b and MKVToolNix read discs through one or both. It decrypts a CSS-scrambled disc, which most commercial discs are, through libdvdcss; on its own it opens only unscrambled ones.
Why it is in KDOS
The comment above the 3 ports from libdvdcss to libdvdnav in script/phases/41_system/packages.d/video-libs.txt:
libdvdcss reads a CSS-scrambled DVD, which is most commercial discs; libdvdread opens only unscrambled ones without it.
Sources
libdvdread-7.1.1.tar.xz(100.1 KiB)
sha256a0d47876548bec806774bbf8dbf20bb19ba139464383156b32eb8e59915b90a9
upstream: https://download.videolan.org/pub/videolan/libdvdread/7.1.1/libdvdread-7.1.1.tar.xz
archive copy: sources-4/video-libs--libdvdread-7.1.1.tar.xz
Dependencies
Depends on: meson, ninja, pkgconf, libdvdcss.
Required by (8): ffmpeg, gnome-disk-utility, gst-plugins-bad, gst-plugins-ugly, k3b, libdvdnav, mkvtoolnix, vlc.
Patches
build.sh applies these; kpkg applies nothing by itself.
musl-off64_t.patch— The installeddvd_filesystem.h, reached throughdvd_reader.h, usesoff64_tand declares it itself only for MSVC, glibc, macOS and the BSDs. On musl,sys/types.hnamesoff64_tonly when it was first included with_LARGEFILE64_SOURCEdefined, so a consumer that includedsys/types.hfirst fails to compile (libdvdnav, mpv and gst-plugins-bad among them). The patch addstypedef off_t off64_t;for every other system that has not defined it, which is exact on musl, whoseoff_tis always 64 bits.
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/41_system/phase.env && kpkg install libdvdread'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/video-libs/libdvdread.
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-libs/libdvdread
echo 'a0d47876548bec806774bbf8dbf20bb19ba139464383156b32eb8e59915b90a9 libdvdread-7.1.1.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/libdvdread
SRC=$SRC_ROOT/libdvdread-7.1.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libdvdread-7.1.1.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-off64_t.patch"
meson setup build --prefix=/usr --libdir=lib --buildtype=release \
-Ddefault_library=shared \
-Dlibdvdcss=enabled \
-Denable_docs=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
The switches, and why each is set:
-Ddefault_library=shared— Build only the shared library.-Dlibdvdcss=enabled— Link libdvdcss directly, and fail the configure if it is missing. Atauto, upstream’s default, a build that does not find libdvdcss loadslibdvdcss.so.2withdlopenat run time instead; when that fails it logs only a warning,Encrypted DVD support unavailable., and reads a scrambled disc without decrypting it.-Denable_docs=false— No Doxygen API reference. It is upstream’s default.
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/libdvdread, 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 libdvdread-7.1.1-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/libdvdread, and runs the triggers its paths call for.
Contents
Installed libraries: libdvdread.so.
Installed directories: /usr/include/dvdread, /usr/share/doc/libdvdread, /usr/share/licenses/libdvdread.
Short descriptions
dvdread.pc |
Low level DVD access library |