audacious: add vgmstream plugin

This commit is contained in:
Walter Huf 2024-04-10 09:59:53 -07:00
parent 06fc875337
commit 100a740c0f
2 changed files with 26 additions and 7 deletions

View File

@ -41,6 +41,7 @@
, qtmultimedia
, qtx11extras
, soxr
, vgmstream
, wavpack
}:
@ -109,6 +110,10 @@ stdenv.mkDerivation rec {
dontWrapQtApps = true;
postInstall = ''
ln -s ${vgmstream.override { buildAudaciousPlugin = true; }}/lib/audacious/Input/* $out/lib/audacious/Input
'';
meta = audacious.meta // {
description = "Plugins for Audacious music player";
};

View File

@ -1,6 +1,7 @@
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config
, mpg123, ffmpeg, libvorbis, libao, jansson, speex
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, gtk3
, audacious, mpg123, ffmpeg, libvorbis, libao, jansson, speex
, nix-update-script
, buildAudaciousPlugin ? false # only build cli by default, pkgs.audacious-plugins sets this to enable plugin support
}:
stdenv.mkDerivation rec {
@ -19,16 +20,29 @@ stdenv.mkDerivation rec {
extraArgs = [ "--version-regex" "r(.*)" ];
};
nativeBuildInputs = [ cmake pkg-config ];
nativeBuildInputs = [
cmake
pkg-config
] ++ lib.optional buildAudaciousPlugin gtk3;
buildInputs = [ mpg123 ffmpeg libvorbis libao jansson speex ];
buildInputs = [
mpg123
ffmpeg
libvorbis
libao
jansson
speex
] ++ lib.optional buildAudaciousPlugin (audacious.override { audacious-plugins = null; });
preConfigure = ''
substituteInPlace cmake/dependencies/audacious.cmake \
--replace "pkg_get_variable(AUDACIOUS_PLUGIN_DIR audacious plugin_dir)" "set(AUDACIOUS_PLUGIN_DIR \"$out/lib/audacious\")"
'';
cmakeFlags = [
# There's no nice way to build the audacious plugin without a circular dependency
"-DBUILD_AUDACIOUS=OFF"
# 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 = "A library for playback of various streamed audio formats used in video games";