100.10. cdparanoia-10.2
Paranoia III audio CD ripper and its libcdda_interface and libcdda_paranoia libraries
| Version | 10.2, release 1 |
| Shelf | optical — CD, DVD and Blu-ray burning, mastering and CD reading or ripping |
| Phase | 41_system (System), 845 of 1047 in build order |
| Licence | GPL-2.0-or-later AND LGPL-2.1-or-later |
| Homepage | https://www.xiph.org/paranoia/ |
| Build time | 0.3 SBU |
| Installed size | 421.6 KiB in 15 files |
| Recipe | ports/core/optical/cdparanoia/kpkgbuild |
About
cdparanoia is the Paranoia III audio CD ripper: the cdparanoia program, and the libcdda_interface and libcdda_paranoia libraries it is built on, which read audio sectors and correct jitter, scratches and drive caching by overlapping reads. audiocd-kio requires the libraries and their headers for its audiocd:/ worker. The program is GPL and the libraries LGPL; both licence texts ship.
Sources
cdparanoia-10.2.tgz(178.9 KiB)
sha256005db45ef4ee017f5c32ec124f913a0546e77014266c6a1c50df902a55fe64df
upstream: https://downloads.xiph.org/releases/cdparanoia/cdparanoia-III-10.2.src.tgz
archive copy: sources-3/optical--cdparanoia-10.2.tgz
Dependencies
Depends on: nothing a recipe names.
Required by (1): audiocd-kio.
Patches
build.sh applies these; kpkg applies nothing by itself.
Each patch’s own Subject: line names what it changes, and all three come from Alpine’s main/cdparanoia. format-security.patch passes the progress line to fprintf() through a "%s" format, which -Werror=format-security requires and which keeps a % in it from being expanded. gcc.patch renames the private member of struct cdrom_drive to private_data throughout, because private is a C++ keyword and a C++ program could not include the installed cdda_interface.h otherwise. fix-includes.patch includes <sys/types.h> in utils.h for u_int32_t and u_int16_t, which glibc’s <stdlib.h> declares through that header and musl’s does not.
fix-includes.patch— include sys/types.h in utils.hutils.h casts to u_int32_t and u_int16_t, which glibc's stdlib.h declares through sys/types.h and musl's does not. From Alpine main/cdparanoia.
format-security.patch— pass the progress line to fprintf through a %s formatmain.c hands a buffer it built to fprintf as the format string, which -Werror=format-security refuses and a % in a track name would expand. From Alpine main/cdparanoia.
gcc.patch— rename cdrom_drive.private to private_data`private` is a C++ keyword, so a C++ program that includes cdda_interface.h (audiocd-kio does) cannot compile against the header. From Alpine main/cdparanoia.
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 cdparanoia'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/optical/cdparanoia.
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/optical/cdparanoia
echo '005db45ef4ee017f5c32ec124f913a0546e77014266c6a1c50df902a55fe64df cdparanoia-10.2.tgz' | 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/cdparanoia
SRC=$SRC_ROOT/cdparanoia-10.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf cdparanoia-10.2.tgz -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/format-security.patch"
patch -p1 -i "$PORT_SRC/gcc.patch"
patch -p1 -i "$PORT_SRC/fix-includes.patch"
env -u CC ./configure --prefix=/usr --sysconfdir=/etc
make -j1 CC="${CC:-cc} $LDFLAGS"
make -j1 prefix=$PKG/usr MANDIR=$PKG/usr/share/man install
The switches, and why each is set:
env -u CC— RunconfigurewithCCunset.configure.incallsAC_PROG_CConly whenCCis empty, and the tree exportsCC=gcc, so the macro is skipped and the object-file extension it would detect stays empty: every later compile test then looks forconftest.and fails, andconfigurestops withNo 16 bit type found on this platform!. Unset, the macro runs and findsgccitself, which it writes into the makefiles.make -j1— The tree exportsMAKEFLAGS=-j$KDOS_JOBS, and theinterface/andparanoia/makefiles build the static library and the shared one from the same object names, with the shared build’slessmessystep deleting every.ofirst. In parallel the two targets delete each other’s objects.CC="${CC:-cc} $LDFLAGS"— The two shared libraries are linked by a rule that reads onlyCC, the objects and-lm -lrt, neverLDFLAGS, so they would be linked without-z now,--as-neededor the build ID. Putting the flags inCChands them to every compile and link; the compiler ignores linker options on a-cline.prefix=$PKG/usr MANDIR=$PKG/usr/share/man— The makefiles have noDESTDIR; the install writes underprefix. This configure script predatesdatarootdirand puts manual pages in$prefix/man, soMANDIRis named.
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/cdparanoia, 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 cdparanoia-10.2-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/cdparanoia, and runs the triggers its paths call for.
Contents
Installed programs: cdparanoia.
Installed libraries: libcdda_interface.a, libcdda_interface.so, libcdda_paranoia.a, libcdda_paranoia.so.
Installed directories: /usr/share/licenses/cdparanoia.
Short descriptions
cdparanoia |
an audio CD reading utility which includes extra data verification features |
Notes
configure copies the 2006 configure.guess and configure.sub to config.guess and config.sub as it runs, after kpkg has looked for files of those names, so the old scripts decide the host triplet: x86_64-unknown-linux-gnu. The triplet only chooses upstream’s optimisation flags (-O2 -fsigned-char for anything that is not 32-bit x86), and the exported CFLAGS follow them, so the wrong C library in the name changes nothing in the build.
The install copies the static archives libcdda_interface.a and libcdda_paranoia.a beside the shared libraries; the package keeps them, as it keeps every archive a build installs.