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;
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 // {

View file

@ -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";