From 295d327b7170fa0750867183d73f0de6395a27d3 Mon Sep 17 00:00:00 2001 From: can1357 Date: Thu, 13 Aug 2026 05:38:57 +0200 Subject: [PATCH] feat(nix): added pulse and alsa libraries to native addon rpath - Added alsa-lib and libpulseaudio dependencies to the package derivation. - Configured patchelf to append client libraries to the native addon RUNPATH for dynamic loading. --- nix/package.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nix/package.nix b/nix/package.nix index 11ec5b3c0..2c0a1be0d 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -1,11 +1,13 @@ { autoPatchelfHook, + alsa-lib, bun, bun2nix, cmake, darwin, lib, libopus, + libpulseaudio, ninja, pipewire, pkg-config, @@ -135,6 +137,17 @@ stdenv.mkDerivation { # The loader extracts this archived addon at runtime, so fix its # interpreter-independent Nix RPATH before Bun embeds it. autoPatchelf -- "packages/natives/native/${platform.addon}" + # pi-voice dlopens libpulse-simple.so.0 / libpulse.so.0 / libasound.so.2 + # by bare name; glibc resolves those through the calling object's + # RUNPATH, so append the client libraries here. Nothing links them, so + # autoPatchelf cannot discover them on its own. + patchelf --add-rpath "${ + lib.makeLibraryPath [ + libpulseaudio + alsa-lib + ] + }" \ + "packages/natives/native/${platform.addon}" ''} ${lib.optionalString stdenv.hostPlatform.isDarwin '' # arm64 Darwin requires even locally-built Mach-O addons to carry an