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.
This commit is contained in:
Francis Gagné 2025-04-17 00:29:20 -04:00
parent e708f71839
commit 5bbfd670ed
2 changed files with 12 additions and 8 deletions

View file

@ -110,9 +110,7 @@ stdenv.mkDerivation rec {
dontWrapQtApps = true; dontWrapQtApps = true;
postInstall = '' postInstall = ''
ln -s ${ ln -s ${vgmstream.audacious}/lib/audacious/Input/* $out/lib/audacious/Input
vgmstream.override { buildAudaciousPlugin = true; }
}/lib/audacious/Input/* $out/lib/audacious/Input
''; '';
meta = audacious-bare.meta // { meta = audacious-bare.meta // {

View file

@ -12,7 +12,6 @@
libao, libao,
speex, speex,
nix-update-script, nix-update-script,
buildAudaciousPlugin ? false, # only build cli by default, pkgs.audacious-plugins sets this to enable plugin support
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -34,10 +33,16 @@ stdenv.mkDerivation rec {
]; ];
}; };
outputs = [
"out"
"audacious"
];
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config
] ++ lib.optional buildAudaciousPlugin gtk3; gtk3
];
buildInputs = [ buildInputs = [
mpg123 mpg123
@ -45,17 +50,18 @@ stdenv.mkDerivation rec {
libvorbis libvorbis
libao libao
speex speex
] ++ lib.optional buildAudaciousPlugin audacious-bare; audacious-bare
];
preConfigure = '' preConfigure = ''
substituteInPlace cmake/dependencies/audacious.cmake \ 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 = [ cmakeFlags = [
# It always tries to download it, no option to use the system one # It always tries to download it, no option to use the system one
"-DUSE_CELT=OFF" "-DUSE_CELT=OFF"
] ++ lib.optional (!buildAudaciousPlugin) "-DBUILD_AUDACIOUS=OFF"; ];
meta = with lib; { meta = with lib; {
description = "Library for playback of various streamed audio formats used in video games"; description = "Library for playback of various streamed audio formats used in video games";