From 5bbfd670eda19f5c18946b380ef40d616bf7160c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francis=20Gagn=C3=A9?= Date: Thu, 17 Apr 2025 00:29:20 -0400 Subject: [PATCH] vgmstream: Install the Audacious plugin to a separate output Instead of building vgmstream separately with and without the Audacious plugin, build it only once and install the binaries and the Audacious plugin in separate outputs. Also, this way, audacious-plugins no longer has the vgmstream binaries in its closure. --- pkgs/by-name/au/audacious-plugins/package.nix | 4 +--- pkgs/by-name/vg/vgmstream/package.nix | 16 +++++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/au/audacious-plugins/package.nix b/pkgs/by-name/au/audacious-plugins/package.nix index 5614a0450e04..f8d739feb72e 100644 --- a/pkgs/by-name/au/audacious-plugins/package.nix +++ b/pkgs/by-name/au/audacious-plugins/package.nix @@ -110,9 +110,7 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; postInstall = '' - ln -s ${ - vgmstream.override { buildAudaciousPlugin = true; } - }/lib/audacious/Input/* $out/lib/audacious/Input + ln -s ${vgmstream.audacious}/lib/audacious/Input/* $out/lib/audacious/Input ''; meta = audacious-bare.meta // { diff --git a/pkgs/by-name/vg/vgmstream/package.nix b/pkgs/by-name/vg/vgmstream/package.nix index 0976107cab9f..e74ce1f5436f 100644 --- a/pkgs/by-name/vg/vgmstream/package.nix +++ b/pkgs/by-name/vg/vgmstream/package.nix @@ -12,7 +12,6 @@ libao, speex, nix-update-script, - buildAudaciousPlugin ? false, # only build cli by default, pkgs.audacious-plugins sets this to enable plugin support }: stdenv.mkDerivation rec { @@ -34,10 +33,16 @@ stdenv.mkDerivation rec { ]; }; + outputs = [ + "out" + "audacious" + ]; + nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optional buildAudaciousPlugin gtk3; + gtk3 + ]; buildInputs = [ mpg123 @@ -45,17 +50,18 @@ stdenv.mkDerivation rec { libvorbis libao speex - ] ++ lib.optional buildAudaciousPlugin audacious-bare; + audacious-bare + ]; preConfigure = '' substituteInPlace cmake/dependencies/audacious.cmake \ - --replace "pkg_get_variable(AUDACIOUS_PLUGIN_DIR audacious plugin_dir)" "set(AUDACIOUS_PLUGIN_DIR \"$out/lib/audacious\")" + --replace "pkg_get_variable(AUDACIOUS_PLUGIN_DIR audacious plugin_dir)" "set(AUDACIOUS_PLUGIN_DIR \"$audacious/lib/audacious\")" ''; cmakeFlags = [ # It always tries to download it, no option to use the system one "-DUSE_CELT=OFF" - ] ++ lib.optional (!buildAudaciousPlugin) "-DBUILD_AUDACIOUS=OFF"; + ]; meta = with lib; { description = "Library for playback of various streamed audio formats used in video games";