diff --git a/local/recipes/libs/pipewire/.gitignore b/local/recipes/libs/pipewire/.gitignore new file mode 100644 index 0000000000..e1a24d9b89 --- /dev/null +++ b/local/recipes/libs/pipewire/.gitignore @@ -0,0 +1,3 @@ +target/ +build/ +compile_commands.json diff --git a/local/recipes/libs/pipewire/recipe.toml b/local/recipes/libs/pipewire/recipe.toml new file mode 100644 index 0000000000..bdcd569f50 --- /dev/null +++ b/local/recipes/libs/pipewire/recipe.toml @@ -0,0 +1,126 @@ +# PipeWire — audio/video graph server (Red Bear OS fork). +# +# This recipe builds the upstream PipeWire 0.3.85 source fork maintained at +# local/sources/pipewire/. PipeWire is a low-level multimedia graph framework +# that handles audio/video stream routing, mixing, and processing. +# +# Red Bear OS uses PipeWire as the audio backend for KDE Plasma, providing +# PulseAudio-compatible semantics for applications (libpulse / libpipewire) +# and exposing audio routing to the compositor and session manager. +# +# On Redox, PipeWire's user-facing I/O targets the audiod scheme daemon +# (see local/sources/base/audiod/) rather than ALSA/PulseAudio. The build +# disables all Linux-specific backends (ALSA, V4L2, JACK, BlueZ) and only +# keeps the user-space graph core, the PulseAudio compat shim, and the +# audiod-suitable SPA support plugins. +# +# Known gaps (intentional TODOs in the upstream source, documented in +# local/sources/pipewire/README-redbear.md): +# * alsa / bluez5 / v4l2 / jack spa plugins — Linux-specific, not built +# * pipewire-alsa / pipewire-v4l2 / pipewire-jack — Linux-only compat shims +# * systemd activation — not available on Redox; we use init.d services +# * X11 / X11-xfixes window integration — not built +# * Vulkan compute / OpenCL — not built +# * spa plugins that need sndfile / ffmpeg / libusb — not built +# +# What IS built (this recipe's purpose): +# * libpipewire-0.3.so — the client library +# * libspa-0.2.so — the Simple Plugin API library +# * pipewire / pipewire-pulse — the daemon and PulseAudio compat shim +# * pw-cli / pw-cat / pw-dump — control utilities +# * SPA support plugins (aec, audioconvert, audiomixer, control, volume) +# +[source] +path = "../../../local/sources/pipewire" + +[build] +template = "custom" +dependencies = [ + "glib", + "dbus", + "expat", +] +script = """ +DYNAMIC_INIT + +# Use the cross-pkg-config wrapper for the Redox sysroot. +export PKG_CONFIG="${COOKBOOK_PKG_CONFIG:-x86_64-unknown-redox-pkg-config}" +export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}" +export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/usr/lib/pkgconfig:${COOKBOOK_SYSROOT}/usr/share/pkgconfig" + +# PipeWire's meson needs the cross toolchain to find headers from +# the relibc sysroot (eventfd, signalfd, timerfd, epoll, ioctl, etc). +export CC="x86_64-unknown-redox-gcc" +export CXX="x86_64-unknown-redox-g++" +export AR="x86_64-unknown-redox-ar" +export STRIP="x86_64-unknown-redox-strip" +export RANLIB="x86_64-unknown-redox-ranlib" +export CFLAGS="-I${COOKBOOK_SOURCE}/redox_compat -I${COOKBOOK_SYSROOT}/usr/include --sysroot=${COOKBOOK_SYSROOT} -Wno-error=format-overflow -Wno-error=stringop-truncation -Wno-error=array-bounds -Wno-error=use-after-free -Wno-error=array-parameter -Wno-error=cast-function-type -Wno-error=deprecated-declarations -Wno-error=stringop-overread -Wno-error=dangling-pointer -Wno-error=uninitialized -Wno-error=maybe-uninitialized -Wno-error=incompatible-pointer-types" +export LDFLAGS="--sysroot=${COOKBOOK_SYSROOT}" + +# Stage the redox_compat shim headers into the per-recipe sysroot so they are +# visible to every meson subproject (spa/plugins/*, etc.) without having to +# add a per-subproject c_args entry. Without this step, subprojects do not +# see the cross file's c_args and would fail to find byteswap.h / sys/mman.h. +mkdir -p "${COOKBOOK_SYSROOT}/usr/include" +cp -r "${COOKBOOK_SOURCE}/redox_compat/." "${COOKBOOK_SYSROOT}/usr/include/" + +# Disable everything Linux-specific. We only build the user-space graph core, +# the PulseAudio compat shim, the SPA core, and a minimal set of audio-only +# SPA support plugins that are pure C with no kernel dependencies beyond +# eventfd/timerfd/signalfd (all of which relibc provides on Redox). +cookbook_meson \ + -Ddocs=disabled \ + -Dtests=disabled \ + -Dinstalled_tests=disabled \ + -Dgstreamer=disabled \ + -Dgstreamer-device-provider=disabled \ + -Dsystemd=disabled \ + -Dsystemd-system-service=disabled \ + -Dsystemd-user-service=disabled \ + -Dpipewire-alsa=disabled \ + -Dpipewire-jack=disabled \ + -Dpipewire-v4l2=disabled \ + -Djack-devel=false \ + -Dalsa=disabled \ + -Dbluez5=disabled \ + -Dbluez5-backend-hsp-native=disabled \ + -Dbluez5-backend-hfp-native=disabled \ + -Dbluez5-backend-native-mm=disabled \ + -Dbluez5-backend-ofono=disabled \ + -Dbluez5-backend-hsphfpd=disabled \ + -Dbluez5-codec-aptx=disabled \ + -Dbluez5-codec-ldac=disabled \ + -Dbluez5-codec-lc3=disabled \ + -Dlibcamera=disabled \ + -Dvideoconvert=disabled \ + -Dvideotestsrc=disabled \ + -Dv4l2=disabled \ + -Djack=disabled \ + -Dffmpeg=disabled \ + -Dpw-cat-ffmpeg=disabled \ + -Dopus=disabled \ + -Droc=disabled \ + -Dlibmysofa=disabled \ + -Dsndfile=disabled \ + -Dlibusb=disabled \ + -Dlibpulse=disabled \ + '-Dsession-managers=[]' \ + -Dudevrulesdir='' \ + -Dudev=disabled \ + -Dselinux=disabled \ + -Dlibcanberra=disabled \ + -Dflatpak=disabled \ + -Dgsettings=disabled \ + -Dx11=disabled \ + -Dx11-xfixes=disabled \ + -Dreadline=disabled \ + -Dsdl2=disabled \ + -Dspa-plugins=enabled \ + -Dexamples=disabled \ + -Dman=disabled +""" + +[package] +version = "0.3.85" +description = "PipeWire 0.3.85 — graph-based multimedia server (v6.0 2026 Red Bear fork). Provides libpipewire-0.3.so, the pipewire daemon, and the PulseAudio compat shim, compiled against the Redox toolchain for use as the audio backend of KDE Plasma on Red Bear OS. Linux-only SPA plugins (ALSA, BlueZ, V4L2, JACK, libcamera) are disabled; audiod integration is provided by the user-space graph core and the SPA support plugins." diff --git a/local/recipes/libs/wireplumber/.gitignore b/local/recipes/libs/wireplumber/.gitignore new file mode 100644 index 0000000000..e1a24d9b89 --- /dev/null +++ b/local/recipes/libs/wireplumber/.gitignore @@ -0,0 +1,3 @@ +target/ +build/ +compile_commands.json diff --git a/local/recipes/libs/wireplumber/recipe.toml b/local/recipes/libs/wireplumber/recipe.toml new file mode 100644 index 0000000000..249cd1b493 --- /dev/null +++ b/local/recipes/libs/wireplumber/recipe.toml @@ -0,0 +1,92 @@ +# WirePlumber — PipeWire session/policy manager (Red Bear OS fork). +# +# This recipe builds the upstream WirePlumber 0.4.14 source fork +# maintained at local/sources/wireplumber/. WirePlumber is a +# Lua-based session and policy manager that runs on top of PipeWire; +# it owns the policy decisions about which audio stream connects to +# which sink/source, applies per-client volume and routing rules, and +# exposes a D-Bus API to the desktop session (org.freedesktop.PipeWire +# .Portal and the PulseAudio compatibility surface used by KDE +# Plasma / Phonon / KMix). +# +# Red Bear OS uses WirePlumber as the PipeWire session manager so +# that KDE Plasma and the Plasma audio applets can talk to a real, +# configurable PipeWire stack rather than the upstream "no-session" +# fallback. +# +# On Redox, WirePlumber talks to: +# * libpipewire-0.3 (this recipe's sibling, local/recipes/libs/pipewire) +# * libspa-0.2 (shipped with the pipewire recipe) +# * glib-2.0 (already a Red Bear dependency) +# * D-Bus (for activation and for KDE's org.pulseaudio.Server) +# The build disables the optional systemd / elogind integration paths +# since Redox uses init.d, and disables the optional PulseAudio +# helper that is only relevant on systems that still ship a +# PulseAudio daemon (Red Bear does not — pipewire-pulse replaces it). +# +# Known gaps (intentional TODOs in the source fork, documented in +# local/sources/wireplumber/README-redbear.md): +# * systemd / elogind integration — Redox uses init.d +# * wireplumber.options Lua config — needs to be staged by the +# recipe's [[files]] entry; not committed to the source fork +# * LuaJIT is preferred over the system Lua when both are available; +# Red Bear currently ships neither and depends on the bundled Lua +# subproject (downloaded via meson wrap on first build; we plan +# to vendor it once the wrap cache is committed) +# +# What IS built (this recipe's purpose): +# * libwireplumber-0.4.so — the C client library +# * wireplumber — the session manager daemon +# * wpctl — the command-line control utility +# * SPA modules — the Lua-loaded policy modules +[source] +path = "../../../local/sources/wireplumber" + +[build] +template = "custom" +dependencies = [ + "glib", + "dbus", + "expat", + "pipewire", +] +script = """ +DYNAMIC_INIT + +export PKG_CONFIG="\${COOKBOOK_PKG_CONFIG:-x86_64-unknown-redox-pkg-config}" +export PKG_CONFIG_SYSROOT_DIR="\${COOKBOOK_SYSROOT}" +export PKG_CONFIG_LIBDIR="\${COOKBOOK_SYSROOT}/usr/lib/pkgconfig:\${COOKBOOK_SYSROOT}/share/pkgconfig" + +export CC="x86_64-unknown-redox-gcc" +export CXX="x86_64-unknown-redox-g++" +export AR="x86_64-unknown-redox-ar" +export STRIP="x86_64-unknown-redox-strip" +export RANLIB="x86_64-unknown-redox-ranlib" +export CFLAGS="-I\${COOKBOOK_SOURCE}/redox_compat -I\${COOKBOOK_SYSROOT}/usr/include --sysroot=\${COOKBOOK_SYSROOT} -Wno-error=format-overflow -Wno-error=stringop-truncation -Wno-error=array-bounds -Wno-error=use-after-free -Wno-error=array-parameter -Wno-error=cast-function-type -Wno-error=deprecated-declarations -Wno-error=stringop-overread -Wno-error=dangling-pointer -Wno-error=uninitialized -Wno-error=maybe-uninitialized -Wno-error=incompatible-pointer-types" +export LDFLAGS="--sysroot=\${COOKBOOK_SYSROOT}" + +# Stage the redox_compat shim headers (same shims the pipewire +# recipe uses; the same relibc gaps affect wireplumber). +mkdir -p "\${COOKBOOK_SYSROOT}/usr/include" +cp -r "\${COOKBOOK_SOURCE}/redox_compat/." "\${COOKBOOK_SYSROOT}/usr/include/" + +# Disable the Linux-specific optional integrations. Keep the core +# session manager, the C library, and the command-line tools. +cookbook_meson \\ + -Ddocs=disabled \\ + -Dtests=disabled \\ + -Dsystemd=disabled \\ + -Delogind=disabled \\ + -Dsystemd-system-service=false \\ + -Dsystemd-user-service=false \\ + -Dintrospection=disabled \\ + -Dtools=enabled \\ + -Ddaemon=enabled \\ + -Dmodules=true \\ + -Ddbus-tests=false \\ + -Dsystem-lua=false +""" + +[package] +version = "0.4.14" +description = "WirePlumber 0.4.14 — PipeWire session and policy manager (v6.0 2026 Red Bear fork). Provides libwireplumber-0.4.so, the wireplumber session manager daemon, and the wpctl control utility. Compiled against the Redox toolchain to serve as the audio session manager for KDE Plasma on Red Bear OS; the systemd and elogind integration paths are disabled because Redox uses init.d, and the optional PulseAudio helper is disabled because pipewire-pulse (from the pipewire recipe) already provides the PulseAudio client surface."