Skip to content

Add a build recipe for qbzd, the Qobuz Connect renderer - #29

Open
Gjuju wants to merge 2 commits into
moode-player:mainfrom
Gjuju:contrib/qbzd-build-recipe
Open

Add a build recipe for qbzd, the Qobuz Connect renderer#29
Gjuju wants to merge 2 commits into
moode-player:mainfrom
Gjuju:contrib/qbzd-build-recipe

Conversation

@Gjuju

@Gjuju Gjuju commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Builds qbzd from PhilipVinc's moOde-targeted tag (qbzd-v2.0.2.moode49), same
shape as the librespot recipe.

Upstream packages for Arch, snap and Flatpak but ships no Debian metadata, so
the [package.metadata.deb] section is added by a patch. Only the qbzd crate is
built -- the slint-free column of the workspace -- so none of the desktop GUI
stack is linked.

cargo jobs are budgeted from RAM rather than core count: 512 MB kept aside for
the system, then 512 MB per job, capped at nproc. This workspace is heavier
than librespot and its last crates are the hungry ones -- on a 1 GB board two
jobs thrash the card until the system stops answering and systemd's watchdog
resets it. Measured while building this package: 990 MB of swap at peak with a
single job.

Verified through the on-demand plugin chain, from boxes with no qbzd installed:

  • Orange Pi 3 LTS (2 GB, -j2): 439 crates, 82m15s
  • Raspberry Pi 3B (905 MB, -j1): 430 crates, 137m14s
    Both install cleanly and report qbzd 2.0.2.moode49.

One note on the librespot recipe it is modelled on: its two error paths end on
a bare exit, which returns 0, so a failed build looks successful to the
plugin script. This recipe uses exit 1.

Builds qbzd from PhilipVinc's moOde-targeted tag (qbzd-v2.0.2.moode49) the same
way the librespot recipe works: clone, install the toolchain, build on the host,
package with cargo-deb.

Upstream packages for Arch, snap and Flatpak but ships no Debian metadata, so
the [package.metadata.deb] section is added by a patch. Only the qbzd crate is
built -- it is the slint-free column of the workspace, so none of the desktop
GUI stack is linked and the build deps stay to ALSA, JACK, D-Bus and TLS.

QBZD_BUILD_ID is exported so the binary reports 2.0.2.moode49 rather than the
bare crate version: upstream provides that variable for packagers precisely
because a four-part id is not valid semver and cannot live in Cargo.toml.

cargo jobs are budgeted from RAM rather than core count, 512 MB kept aside for
the system and 512 MB per job. This workspace is heavier than librespot and its
last crates are the hungry ones: on a 1 GB board two jobs thrash the card until
the system stops answering and systemd's watchdog resets it. Measured, building
this package: 1 GB peaks at 990 MB of swap with a single job. The resulting
choices match what these boards have always needed -- 1 job at 1 GB, 2 at 2 GB,
capped at nproc -- and an explicit CARGO_BUILD_JOBS still wins.

Build times with that budget: 82m15s on an Orange Pi 3 LTS (2 GB, -j2),
137m14s on a Raspberry Pi 3B (905 MB, -j1), both installing cleanly through the
on-demand plugin chain.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Gjuju

Gjuju commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@moodeaudio

One naming question: the package comes out as qbzd_2.0.2-1moode1 while the binary reports 2.0.2.moode49, upstream's build id for the tag we clone.

Would you rather they matched -- qbzd_2.0.2.v49-1moode1, say?

It's one line here plus one in moode-sqlite3.db.sql, and I'm happy either way -- your call on naming.

@moodeaudio

Copy link
Copy Markdown
Contributor

I think @PhilipVinc said he wants to create a new repo name and release tag scheme at some point and so I would recommend simplifying things for this initial test package build and not entangling separate version or build vars.

Maybe something like this where the build number "49" is in the package name.

PKG="qbzd_2.0.2-49-1moode1"
PKG_SOURCE_GIT="https://github.com/PhilipVinc/qbz.git"
PKG_SOURCE_GIT_TAG="qbzd-v2.0.2.moode49"
export QBZD_BUILD_ID="2.0.2.moode49"

This will be good for local testing. I'm not planning to release this as an official plugin until the repo name and release tag format is settled.

@PhilipVinc

Copy link
Copy Markdown

I will be dropping the .moodeXX flags, and switching to a standard versioning scheme.
I will be renaming the package as well and cleaning up the repository to remove all cruft/gui stuff that was inserted from qbz .

I've done most changes locally, and testing a new build that is more reliable than the previous one.

I'll take care of the build recipe myself when I feel confident enough that things settled. I think mid week, probably.

@PhilipVinc

Copy link
Copy Markdown

I think you'll have something like

mu-qbzd 3.0.0
or
pi-qbzd 3.0.0

when I'm done

As suggested: qbzd_2.0.2-49-1moode1, with the version and build vars folded
into plain literals.

cargo-deb composes the package version from the crate version plus a revision,
and a Debian revision cannot carry the build number since it may not contain a
hyphen, so the whole version is passed with --deb-version instead. That also
removes the sed that used to patch the revision into Cargo.toml.

Verified with cargo-deb 2.12.1 on arm64: qbzd_2.0.2-49-1moode1_arm64.deb, which
dpkg-deb reads back as Version: 2.0.2-49-1moode1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Gjuju
Gjuju force-pushed the contrib/qbzd-build-recipe branch from 349d5c2 to f7b4b6c Compare September 13, 2026 07:39
@Gjuju

Gjuju commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Done, thanks.

As a temp solution :

Package now builds as qbzd_2.0.2-49-1moode1_arm64.deb.
dpkg-deb reads it back as Version: 2.0.2-49-1moode1.

One note: cargo-deb builds the version from the crate version plus a revision, and a revision can't hold the build number (no hyphens), so it goes through --deb-version instead.
That supersedes the revision, so the sed that used to patch it into Cargo.toml is no longer needed and is gone.

For local testing, cfg_plugin.version has to match the new name or the plugin looks for the old file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants