{ lib, stdenv, fetchFromBitbucket, nix-update-script, boost, zlib, # File backends (for decoding and encoding) withMp3 ? true, lame, withOgg ? true, libvorbis, withFlac ? true, flac, # Audio backends (for playback) withOpenal ? false, openal, withSDL ? false, SDL, withOss ? false, withAlsa ? stdenv.hostPlatform.isLinux, alsa-lib, withPulse ? stdenv.hostPlatform.isLinux, libpulseaudio, # GUI audio player withQt ? true, qt5, zip, makeDesktopItem, copyDesktopItems, }: let dlopenBuildInputs = [ ] ++ lib.optional withMp3 lame ++ lib.optional withOgg libvorbis ++ lib.optional withFlac flac ++ lib.optional withOpenal openal ++ lib.optional withSDL SDL ++ lib.optional withAlsa alsa-lib ++ lib.optional withPulse libpulseaudio; supportWayland = (!stdenv.hostPlatform.isDarwin); platformName = "linux"; staticBuildInputs = [ boost zlib ] ++ lib.optional withQt (if (supportWayland) then qt5.qtwayland else qt5.qtbase); in stdenv.mkDerivation rec { pname = "zxtune"; version = "5100"; outputs = [ "out" ]; src = fetchFromBitbucket { owner = "zxtune"; repo = "zxtune"; rev = "r${version}"; hash = "sha256-SNHnpLAbiHCo11V090EY/vLH4seoZWpMHMMBLGkr88E="; }; passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex" "r([0-9]+)" ]; }; strictDeps = true; nativeBuildInputs = lib.optionals withQt [ zip qt5.wrapQtAppsHook copyDesktopItems ]; buildInputs = staticBuildInputs ++ dlopenBuildInputs; patches = [ ./disable_updates.patch ]; # Fix use of old OpenAL header path postPatch = '' substituteInPlace src/sound/backends/gates/openal_api.h \ --replace "#include