2024-04-10 16:59:53 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, gtk3
|
|
|
|
, audacious, mpg123, ffmpeg, libvorbis, libao, jansson, speex
|
2023-10-29 01:23:25 +00:00
|
|
|
, nix-update-script
|
2024-04-10 16:59:53 +00:00
|
|
|
, buildAudaciousPlugin ? false # only build cli by default, pkgs.audacious-plugins sets this to enable plugin support
|
2021-06-10 19:13:30 +00:00
|
|
|
}:
|
2023-10-29 01:23:25 +00:00
|
|
|
|
2021-06-10 19:13:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-02-23 05:53:05 +00:00
|
|
|
pname = "vgmstream";
|
2024-04-12 01:51:44 +00:00
|
|
|
version = "1917";
|
2021-06-10 19:13:30 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-02-23 05:53:05 +00:00
|
|
|
owner = "vgmstream";
|
|
|
|
repo = "vgmstream";
|
2023-10-29 01:23:25 +00:00
|
|
|
rev = "refs/tags/r${version}";
|
2024-04-12 01:51:44 +00:00
|
|
|
sha256 = "sha256-9HIa5/whdLouUWNFml7tPfXStIkO76dxUl5S4yiat64=";
|
2021-06-10 19:13:30 +00:00
|
|
|
};
|
|
|
|
|
2023-10-29 01:23:25 +00:00
|
|
|
passthru.updateScript = nix-update-script {
|
|
|
|
attrPath = "vgmstream";
|
|
|
|
extraArgs = [ "--version-regex" "r(.*)" ];
|
|
|
|
};
|
2022-02-23 05:53:35 +00:00
|
|
|
|
2024-04-10 16:59:53 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
] ++ lib.optional buildAudaciousPlugin gtk3;
|
2021-06-10 19:13:30 +00:00
|
|
|
|
2024-04-10 16:59:53 +00:00
|
|
|
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\")"
|
|
|
|
'';
|
2021-06-10 19:13:30 +00:00
|
|
|
|
2022-02-23 05:53:05 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# It always tries to download it, no option to use the system one
|
|
|
|
"-DUSE_CELT=OFF"
|
2024-04-10 16:59:53 +00:00
|
|
|
] ++ lib.optional (! buildAudaciousPlugin) "-DBUILD_AUDACIOUS=OFF";
|
2021-06-10 19:13:30 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-07 07:46:46 +00:00
|
|
|
description = "Library for playback of various streamed audio formats used in video games";
|
2021-06-10 19:13:30 +00:00
|
|
|
homepage = "https://vgmstream.org";
|
|
|
|
maintainers = with maintainers; [ zane ];
|
|
|
|
license = with licenses; isc;
|
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|