319.4. picard-3.0.0rc4
Tag and rename music files from the MusicBrainz database
The build-state snapshot was taken from 3.0.0rc4-1; this recipe is 3.0.0rc4-2, so the size, time and contents below describe the earlier build.
| Version | 3.0.0rc4, release 2 |
| Shelf | music-players — Music players, library managers and taggers |
| Phase | 44_apps (Applications), 302 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://picard.musicbrainz.org/ |
| Build time | 1.1 SBU |
| Installed size | 14.7 MiB in 1055 files |
| Recipe | ports/core/music-players/picard/kpkgbuild |
About
MusicBrainz Picard tags and renames music files from the MusicBrainz database: it identifies a release from file metadata, an AcoustID fingerprint computed with chromaprint’s fpcalc, or an audio CD’s disc ID through libdiscid, then writes the tags and moves the files into a naming scheme. Everything except tag editing and renaming needs the MusicBrainz server. It is a PyQt6 program.
Sources
picard-3.0.0rc4.tar.gz(9.8 MiB)
sha25657e8b332706ce2f8fbe154f0661a60ca16421886f5ccbe8342290c6832fdbb1d
upstream: https://files.pythonhosted.org/packages/source/p/picard/picard-3.0.0rc4.tar.gz
archive copy: sources-3/music-players--picard-3.0.0rc4.tar.gzpicard-vendor-3.0.0rc4.tar.xz(2.9 MiB)
sha2564154442b93cf52c9b2244a7877a453e222ab5fe2c84c6fa79f6c828658d152e1
a vendor bundle: the dependencies upstream’s own tool would download, packed once
archive copy: sources-3/music-players--picard-vendor-3.0.0rc4.tar.xz
Dependencies
Depends on: python3, python3-pip, python3-setuptools, python3-wheel, gettext, python3-pyqt6, qt6-qtbase, qt6-qtsvg, qt6-qtimageformats, qt6-qtmultimedia, qt6-qtwayland, python3-yaml, python3-charset-normalizer, python3-tomlkit, python3-markdown, libdiscid, chromaprint.
Required by: no port names it.
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 picard'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/music-players/picard.
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/music-players/picard
echo '57e8b332706ce2f8fbe154f0661a60ca16421886f5ccbe8342290c6832fdbb1d picard-3.0.0rc4.tar.gz' | sha256sum -c -
echo '4154442b93cf52c9b2244a7877a453e222ab5fe2c84c6fa79f6c828658d152e1 picard-vendor-3.0.0rc4.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/picard
SRC=$SRC_ROOT/picard-3.0.0rc4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf picard-3.0.0rc4.tar.gz -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 recipe’s helpers pyrequirements, pyruntime and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
mkdir -p vendor
tar -xf $PORT_SRC/$name-vendor-$version.tar.xz --strip-components=1 -C vendor
PICARD_DISABLE_AUTOUPDATE=1 \
pip3 install --ignore-installed --no-deps --no-index --find-links=vendor --no-build-isolation \
--root=$PKG --prefix=/usr \
mutagen discid pyjwt .
_site=$(python3 -c 'import sys, sysconfig; print(sysconfig.get_path("purelib", vars={"base": sys.argv[1]}))' "$PKG/usr")
_plat=$(python3 -c 'import sys, sysconfig; print(sysconfig.get_path("platlib", vars={"base": sys.argv[1]}))' "$PKG/usr")
rm -rf "$_site/picard/locale" "$_plat/picard/locale"
cat > "$PKG/usr/share/applications/org.musicbrainz.Picard.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=MusicBrainz Picard
GenericName=Music Tagger
Comment=Tag and rename music files; lookups need the MusicBrainz server
TryExec=picard
Exec=picard %F
Icon=org.musicbrainz.Picard
Terminal=false
StartupNotify=true
StartupWMClass=org.musicbrainz.Picard
Categories=Qt;AudioVideo;Audio;AudioVideoEditing;
Keywords=tag;tagger;tags;metadata;musicbrainz;music;rename;picard;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.musicbrainz.Picard.desktop"
The switches, and why each is set:
PICARD_DISABLE_AUTOUPDATE=1— read by the build step of Picard’ssetup.py, which writesautoupdate=Falseinto thepicardlauncher it generates fromscripts/picard.in: Picard never checks for a new release, and its update-check setting is hidden. The program is updated as a package.--no-index— with--find-links=vendor: pip installs only from the unpacked vendor bundle and never reaches the network.--no-deps— pip installs exactly the names on the line,mutagen discid pyjwtand Picard itself, and resolves nothing more; every other runtime module is a port independs.--no-build-isolation— build each source distribution with the build backend already installed from python3-setuptools and python3-wheel, instead of downloading one into a fresh environment.--ignore-installed— write the named packages into$PKGwithout looking for them in the build root. Without it pip finds the copy a previous build of this port left installed and uninstalls it from the build root before writing the new one; see The three Python keys.
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/picard, 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 picard-3.0.0rc4-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/picard, and runs the triggers its paths call for.
Contents
Installed programs: mid3cp, mid3iconv, mid3v2, moggsplit, mutagen-inspect, mutagen-pony, picard, picard-cli.
Installed directories: /usr/lib/python3.14/site-packages/discid, /usr/lib/python3.14/site-packages/discid-1.4.2.dist-info, /usr/lib/python3.14/site-packages/jwt, /usr/lib/python3.14/site-packages/mutagen, /usr/lib/python3.14/site-packages/mutagen-1.48.1.dist-info, /usr/lib/python3.14/site-packages/picard, /usr/lib/python3.14/site-packages/picard-3.0.0rc4.dist-info, /usr/lib/python3.14/site-packages/pyjwt-2.15.0.dist-info, /usr/share/licenses/picard.
Short descriptions
mid3cp |
copy ID3 tags $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
mid3iconv |
convert ID3 tag encodings $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
mid3v2 |
audio tag editor similar to 'id3v2' $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
moggsplit |
split Ogg logical streams $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
mutagen-inspect |
view Mutagen-supported audio tags $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
mutagen-pony |
scan a collection of MP3 files $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
Notes
The bundle, picard-vendor-<version>.tar.xz, holds source distributions only: the recipe’s pypackages = mutagen discid pyjwt, which ports/fetch downloads without resolving their dependencies; setuptools, the build backend; and Markdown, which build.sh does not install. See The three Python keys. mutagen, discid and PyJWT are the part of Picard’s runtime that no other port imports: mutagen reads and writes the tags, discid is the ctypes binding to libdiscid behind “Lookup CD”, and PyJWT signs the tokens of the “add release” path, which hands a cluster of files to the MusicBrainz release editor in the browser. PyQt6, PyYAML, charset-normalizer, tomlkit and Markdown come from their python3-* ports. pyrequirements = no stops the fetch reading upstream’s pinned requirements.txt, which names those ports’ modules, pygit2 and the Windows and macOS packages as well; pyruntime = no has no effect beside pypackages.
pygit2 is not a port. Picard imports it only when it is installed, and without it the plugin manager cannot install plugins from git repositories; the rest of the program runs.
build.sh removes Picard’s compiled translation catalogues, picard/locale, from the package; its strings are English in the source.
The desktop entry is KDOS’s own, written over upstream’s. Picard sets its desktop file name, and so its Wayland app id, to org.musicbrainz.Picard, which StartupWMClass repeats. It claims no MIME type: audio files open in elisa, the player the shipped MIME associations name, and Picard opens files and folders from its own window.
runtime = python3-tomlkit: exporting and importing an option profile reads and writes TOML through picard/profiles/exporter.py, a submodule the run-time needs record does not read. python3-tomlkit is a build-only port, so without the word a prebuilt install would leave it out and the profile export would fail.