Fil-C on Nix

Filnix wiki

mbrock/filnix

ports/pipewire-consumers.nix

PipeWire consumers ported against the full PipeWire package.

λpkgs, prev, final
let
8inherit import./default.nix inherit pkgs; inherit pkgs lib;
for arg use configure patch
in
21sdl3=
21sdl3
patch../patches/sdl3-fork.patch
patch../patches/sdl3-cpu-probe.patch
patch../patches/sdl3-aligned-allocation.patch
patch../patches/sdl3-process-fork.patch
patch../patches/sdl3-testfile-buffer.patch
arg

First pass: PipeWire/ALSA audio and X11 software rendering. The GPU and alternate audio stacks have independent campaign blockers.

30drmSupport=
false
31openglSupport=
false
32waylandSupport=
false
33libdecorSupport=
false
34ibusSupport=
false
35jackSupport=
false
36pulseaudioSupport=
false
37vulkanSupport=
false
38traySupport=
false
use
λold
41cmakeFlags=
old.cmakeFlags ++ "-DSDL_MMX=OFF"

Nixpkgs links SDL's backends directly (SDL_DEPS_SHARED=OFF), so this is normally a no-op; it guards against any backend left on dlopen.

46postConfigure=
old.postConfigure or ""
+
# Fil-C forwards dlopen through libc, losing SDL's caller RUNPATH.
# Pin every configured backend to the dependency selected by Nix.
${pkgs.python3}/bin/python ${./pin-sdl-libraries.py} \
include-config-release/build_config/SDL_build_config.h \
${pkgs.lib.escapeShellArgsmapp: "${pkgs.lib.getLibp}/lib" old.buildInputs}

testrwlock's writer can starve behind six readers that each hold the lock for a second; nixpkgs already calls it intermittent, and it timed out on a loaded builder.

58postPatch=
old.postPatch or ""
+
substituteInPlace test/CMakeLists.txt --replace-fail \
'add_sdl_test_executable(testrwlock SOURCES testrwlock.c NONINTERACTIVE NONINTERACTIVE_TIMEOUT 300)' \
'add_sdl_test_executable(testrwlock SOURCES testrwlock.c)'
63preCheck=
old.preCheck or ""
+
export FUGC_THREADS="$NIX_BUILD_CORES"
66doCheck=
true
70sdl2-compat=
70sdl2-compat
patch../patches/sdl2-symbol-loader.patch
patch../patches/sdl2-capabilities.patch
patch../patches/sdl2-testfile-buffer.patch
use
λold

This cohort's SDL3 has no OpenGL backend; keep the non-GL tests.

76checkInputs=
[ ]

Fil-C's function descriptors reference the implementation through an interposable global symbol. With sdl12-compat loaded, whose SDL_* functions share these names, dlsym(libSDL2, "SDL_strrchr") would return a descriptor pointing back into sdl12-compat, which then recursed forever. Bind libSDL2's own functions locally.

82cmakeFlags=
old.cmakeFlags or [ ] ++ "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-Bsymbolic-functions"
85postPatch=
old.postPatch or ""
+
# Keep SDL3 local to dlopen: direct linking would interpose SDL2 names.
substituteInPlace src/sdl2_compat.c \
--replace-fail '"libSDL3.so.0"' '"${pkgs.lib.getLibfinal.sdl3}/lib/libSDL3.so.0"'
90preCheck=
old.preCheck or ""
+
export FUGC_THREADS="$NIX_BUILD_CORES"
uses for patch use
96cava=
96cava
configure"--disable-input-pulse"
use
λold
99postPatch=
old.postPatch or ""
+
${pkgs.python3}/bin/python ${./cava-resources.py}
useold: buildInputs = builtins.filterdep: ¬builtins.elemdep.pname or "" "pulseaudio" "libpulseaudio" old.buildInputs;
114wireplumber=
114wireplumber
patch../patches/wireplumber-gtype.patch
patch../patches/wireplumber-pointer-properties.patch
arg
118systemd=
final.systemdLibs
119enableDocs=
false
use
λold
122doCheck=
true
123nativeCheckInputs=
old.nativeCheckInputs or [ ] ++ pkgs.dbus
124mesonFlags=
builtins.filterflag: ¬pkgs.lib.hasPrefix"-Dsysconfdir=" flag old.mesonFlags ++ "-Dsysconfdir=etc"
131preCheck=
old.preCheck or ""
+
export FUGC_THREADS="$NIX_BUILD_CORES"
mesonCheckFlagsArray+=(--num-processes "$NIX_BUILD_CORES")