libvgm: init at unstable-2022-05-27

This commit is contained in:
OPNA2608 2021-11-26 14:32:47 +01:00
parent 17e891b141
commit 0454ad0dcf
2 changed files with 126 additions and 0 deletions

View file

@ -0,0 +1,122 @@
{ stdenv
, lib
, fetchFromGitHub
, unstableGitUpdater
, cmake
, libiconv
, zlib
, enableShared ? true
, enableAudio ? true
, withWaveWrite ? true
, withWinMM ? stdenv.hostPlatform.isWindows
, withDirectSound ? stdenv.hostPlatform.isWindows
, withXAudio2 ? stdenv.hostPlatform.isWindows
, withWASAPI ? stdenv.hostPlatform.isWindows
, withOSS ? stdenv.hostPlatform.isFreeBSD
, withSADA ? stdenv.hostPlatform.isSunOS
, withALSA ? stdenv.hostPlatform.isLinux
, alsa-lib
, withPulseAudio ? stdenv.hostPlatform.isLinux
, libpulseaudio
, withCoreAudio ? stdenv.hostPlatform.isDarwin
, CoreAudio
, AudioToolbox
, withLibao ? true
, libao
, enableEmulation ? true
, withAllEmulators ? true
, emulators ? [ ]
, enableLibplayer ? true
, enableTools ? false
}:
assert enableTools -> enableAudio && enableEmulation && enableLibplayer;
let
inherit (lib) optional optionals;
onOff = val: if val then "ON" else "OFF";
in
stdenv.mkDerivation rec {
pname = "libvgm";
version = "unstable-2022-05-27";
src = fetchFromGitHub {
owner = "ValleyBell";
repo = "libvgm";
rev = "ec6ddae3e3488b6dc9e993cb0f76d3015d2f6fff";
sha256 = "AwIx4LuVSuCf7xgtximcB6N+rzC7g1ajeBdaBz6RSyk=";
};
outputs = [
"out"
"dev"
] ++ optional enableTools "bin";
nativeBuildInputs = [
cmake
];
propagatedBuildInputs = [
libiconv
zlib
] ++ optionals withALSA [
alsa-lib
] ++ optionals withPulseAudio [
libpulseaudio
] ++ optionals withCoreAudio [
CoreAudio
AudioToolbox
] ++ optionals withLibao [
libao
];
cmakeFlags = [
"-DBUILD_LIBAUDIO=${onOff enableAudio}"
"-DBUILD_LIBEMU=${onOff enableEmulation}"
"-DBUILD_LIBPLAYER=${onOff enableLibplayer}"
"-DBUILD_TESTS=${onOff enableTools}"
"-DBUILD_PLAYER=${onOff enableTools}"
"-DBUILD_VGM2WAV=${onOff enableTools}"
"-DLIBRARY_TYPE=${if enableShared then "SHARED" else "STATIC"}"
"-DUSE_SANITIZERS=ON"
] ++ optionals enableAudio [
"-DAUDIODRV_WAVEWRITE=${onOff withWaveWrite}"
"-DAUDIODRV_WINMM=${onOff withWinMM}"
"-DAUDIODRV_DSOUND=${onOff withDirectSound}"
"-DAUDIODRV_XAUDIO2=${onOff withXAudio2}"
"-DAUDIODRV_WASAPI=${onOff withWASAPI}"
"-DAUDIODRV_OSS=${onOff withOSS}"
"-DAUDIODRV_SADA=${onOff withSADA}"
"-DAUDIODRV_ALSA=${onOff withALSA}"
"-DAUDIODRV_PULSE=${onOff withPulseAudio}"
"-DAUDIODRV_APPLE=${onOff withCoreAudio}"
"-DAUDIODRV_LIBAO=${onOff withLibao}"
] ++ optionals enableEmulation ([
"-DSNDEMU__ALL=${onOff withAllEmulators}"
] ++ optionals (!withAllEmulators)
(lib.lists.forEach emulators (x: "-DSNDEMU_${x}=ON"))
) ++ optionals enableTools [
"-DUTIL_CHARCNV_ICONV=ON"
"-DUTIL_CHARCNV_WINAPI=${onOff stdenv.hostPlatform.isWindows}"
];
passthru.updateScript = unstableGitUpdater {
url = "https://github.com/ValleyBell/libvgm.git";
};
meta = with lib; {
homepage = "https://github.com/ValleyBell/libvgm";
description = "More modular rewrite of most components from VGMPlay";
license =
if (enableEmulation && (withAllEmulators || (lib.lists.any (core: core == "WSWAN_ALL") emulators))) then
licenses.unfree # https://github.com/ValleyBell/libvgm/issues/43
else
licenses.gpl2Only;
maintainers = with maintainers; [ OPNA2608 ];
platforms = platforms.all;
};
}

View file

@ -19348,6 +19348,10 @@ with pkgs;
libversion = callPackage ../development/libraries/libversion { };
libvgm = callPackage ../development/libraries/libvgm {
inherit (darwin.apple_sdk.frameworks) CoreAudio AudioToolbox;
};
libvirt = callPackage ../development/libraries/libvirt {
inherit (darwin.apple_sdk.frameworks) Carbon AppKit;
};