Skip to content

Commit

Permalink
Removed buildtime dep on pipewire
Browse files Browse the repository at this point in the history
  • Loading branch information
Yves Pares committed Nov 10, 2024
1 parent 85cd24f commit 681efca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ nix build

which will create a `./result` symlink with two folders, `plugin` and `bin`.

Re. the standalone version, if you are using a Linux distribution with Pipewire (such as Ubuntu), prefer using the `nih_faust_jit_pipewire` output,
which wraps `nih_faust_jit_standalone` so it can use either the ALSA or Jack backend via Pipewire (JACK by default).

## Known shortcomings

- Scripts are reloaded only when clicking on the `Set or reload DSP script`
Expand Down
25 changes: 9 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@
DSP_LIBS_PATH = "${pkgs.faust}/share/faust";
};

alsa-overriden = with pkgs;
alsa-lib-with-plugins.override {
plugins = symlinkJoin {
name = "alsa-plugins";
paths = [ alsa-plugins pipewire ];
};
};

# Note: changes here will rebuild all dependency crates
commonArgs = with pkgs; {
src =
Expand All @@ -54,7 +46,7 @@

nativeBuildInputs = [ pkg-config ];

buildInputs = [ alsa-overriden libGL xorg.libX11 libjack2 faust ]
buildInputs = [ alsa-lib libGL xorg.libX11 libjack2 faust ]
++ lib.optionals stdenv.isDarwin [ libiconv ];

inherit env;
Expand Down Expand Up @@ -94,18 +86,19 @@
'';
});

# Standalone exe wrapped to use Jack via Pipewire (for Ubuntu notably)
nih_faust_jit_pw-jack = pkgs.writeShellApplication {
name = "nih_faust_jit_pw-jack";
# Standalone exe wrapped to use Pipewire for ALSA or Jack (for Ubuntu notably)
nih_faust_jit_pipewire = pkgs.writeShellApplication {
name = "nih_faust_jit_pipewire";
text = ''
${pkgs.pipewire.jack}/bin/pw-jack ${nih_faust_jit}/bin/nih_faust_jit_standalone -b jack "$@"
export ALSA_PLUGIN_DIR=${pkgs.pipewire}/lib/alsa-lib
${pkgs.pipewire.jack}/bin/pw-jack ${nih_faust_jit}/bin/nih_faust_jit_standalone "$@"
'';
};
in
{
packages.${system} = {
default = nih_faust_jit;
inherit faust_jit faust_jit_egui nih_faust_jit nih_faust_jit_pw-jack toolchain;
inherit faust_jit faust_jit_egui nih_faust_jit nih_faust_jit_pipewire toolchain;
};

checks.${system} = {
Expand All @@ -118,9 +111,9 @@
type = "app";
program = "${nih_faust_jit}/bin/nih_faust_jit_standalone";
};
nih_faust_jit_pw-jack = {
nih_faust_jit_pipewire = {
type = "app";
program = "${nih_faust_jit_pw-jack}/bin/nih_faust_jit_pw-jack";
program = "${nih_faust_jit_pipewire}/bin/nih_faust_jit_pipewire";
};
};

Expand Down

0 comments on commit 681efca

Please sign in to comment.