Loading pkgs/applications/video/mpv/0001-fix-darwin-build.patch 0 → 100644 +29 −0 Original line number Diff line number Diff line --- a/osdep/mac/input_helper.swift +++ b/osdep/mac/input_helper.swift @@ -18,6 +18,14 @@ import Cocoa import Carbon.HIToolbox +extension NSCondition { + fileprivate func withLock<T>(_ body: () throws -> T) rethrows -> T { + self.lock() + defer { self.unlock() } + return try body() + } +} + class InputHelper: NSObject { var option: OptionHelper? var lock = NSCondition() --- a/audio/out/ao_avfoundation.m +++ b/audio/out/ao_avfoundation.m @@ -312,7 +312,8 @@ + #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000 p->observer = [[AVObserver alloc] initWithAO:ao]; NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererOutputConfigurationDidChangeNotification object:p->renderer]; [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererWasFlushedAutomaticallyNotification object:p->renderer]; - + #endif return CONTROL_OK; pkgs/applications/video/mpv/default.nix +6 −2 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ pulseSupport ? config.pulseaudio or stdenv.isLinux, rubberbandSupport ? true, screenSaverSupport ? true, sdl2Support ? true, sdl2Support ? !stdenv.isDarwin, sixelSupport ? false, speexSupport ? true, swiftSupport ? stdenv.isDarwin, Loading Loading @@ -152,6 +152,11 @@ stdenv'.mkDerivation (finalAttrs: { hash = "sha256-dFajnCpGlNqUv33A8eFEn8kjtzIPkcBY5j0gNVlaiIY="; }; patches = [ # Fix build with Darwin SDK 11 ./0001-fix-darwin-build.patch ]; postPatch = lib.concatStringsSep "\n" [ # Don't reference compile time dependencies or create a build outputs cycle # between out and dev Loading Loading @@ -355,7 +360,6 @@ stdenv'.mkDerivation (finalAttrs: { mpv is a free and open-source general-purpose video player, based on the MPlayer and mplayer2 projects, with great improvements above both. ''; broken = stdenv.isDarwin; # Yet another SDK incompatibility... changelog = "https://github.com/mpv-player/mpv/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl2Plus; mainProgram = "mpv"; Loading Loading
pkgs/applications/video/mpv/0001-fix-darwin-build.patch 0 → 100644 +29 −0 Original line number Diff line number Diff line --- a/osdep/mac/input_helper.swift +++ b/osdep/mac/input_helper.swift @@ -18,6 +18,14 @@ import Cocoa import Carbon.HIToolbox +extension NSCondition { + fileprivate func withLock<T>(_ body: () throws -> T) rethrows -> T { + self.lock() + defer { self.unlock() } + return try body() + } +} + class InputHelper: NSObject { var option: OptionHelper? var lock = NSCondition() --- a/audio/out/ao_avfoundation.m +++ b/audio/out/ao_avfoundation.m @@ -312,7 +312,8 @@ + #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000 p->observer = [[AVObserver alloc] initWithAO:ao]; NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererOutputConfigurationDidChangeNotification object:p->renderer]; [center addObserver:p->observer selector:@selector(handleRestartNotification:) name:AVSampleBufferAudioRendererWasFlushedAutomaticallyNotification object:p->renderer]; - + #endif return CONTROL_OK;
pkgs/applications/video/mpv/default.nix +6 −2 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ pulseSupport ? config.pulseaudio or stdenv.isLinux, rubberbandSupport ? true, screenSaverSupport ? true, sdl2Support ? true, sdl2Support ? !stdenv.isDarwin, sixelSupport ? false, speexSupport ? true, swiftSupport ? stdenv.isDarwin, Loading Loading @@ -152,6 +152,11 @@ stdenv'.mkDerivation (finalAttrs: { hash = "sha256-dFajnCpGlNqUv33A8eFEn8kjtzIPkcBY5j0gNVlaiIY="; }; patches = [ # Fix build with Darwin SDK 11 ./0001-fix-darwin-build.patch ]; postPatch = lib.concatStringsSep "\n" [ # Don't reference compile time dependencies or create a build outputs cycle # between out and dev Loading Loading @@ -355,7 +360,6 @@ stdenv'.mkDerivation (finalAttrs: { mpv is a free and open-source general-purpose video player, based on the MPlayer and mplayer2 projects, with great improvements above both. ''; broken = stdenv.isDarwin; # Yet another SDK incompatibility... changelog = "https://github.com/mpv-player/mpv/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl2Plus; mainProgram = "mpv"; Loading