Commit f2280510 authored by Emily's avatar Emily
Browse files

mpv: remove legacy Darwin SDK pattern detritus

Oh, this is satisfying.

Swift already propagates its corresponding SDK, so we don’t need
the patch.
parent 472f5217
Loading
Loading
Loading
Loading
+2 −47
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
  buildPackages,
  callPackage,
  config,
  darwin,
  docutils,
  fetchFromGitHub,
  ffmpeg,
@@ -33,7 +32,6 @@
  libcdio-paranoia,
  libdrm,
  libdvdnav,
  libiconv,
  libjack2,
  libplacebo,
  libpng,
@@ -68,7 +66,6 @@
  wayland,
  wayland-protocols,
  wayland-scanner,
  xcbuild,
  zimg,

  # Boolean
@@ -107,33 +104,9 @@
}:

let
  inherit (darwin.apple_sdk_11_0.frameworks)
    AVFoundation
    Accelerate
    Cocoa
    CoreAudio
    CoreFoundation
    CoreMedia
    MediaPlayer
    VideoToolbox
    ;
  luaEnv = lua.withPackages (ps: with ps; [ luasocket ]);

  overrideSDK =
    platform: version:
    platform // lib.optionalAttrs (platform ? darwinMinVersion) { darwinMinVersion = version; };

  stdenv' =
    if swiftSupport && stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64 then
      stdenv.override (old: {
        buildPlatform = overrideSDK old.buildPlatform "11.0";
        hostPlatform = overrideSDK old.hostPlatform "11.0";
        targetPlatform = overrideSDK old.targetPlatform "11.0";
      })
    else
      stdenv;
in
stdenv'.mkDerivation (finalAttrs: {
stdenv.mkDerivation (finalAttrs: {
  pname = "mpv";
  version = "0.39.0";

@@ -151,11 +124,6 @@ stdenv'.mkDerivation (finalAttrs: {
    hash = "sha256-BOGh+QBTO7hrHohh+RqjSF8eHQH8jVBPjG/k4eyFaaM=";
  };

  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
@@ -211,7 +179,6 @@ stdenv'.mkDerivation (finalAttrs: {
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      buildPackages.darwin.sigtool
      xcbuild.xcrun
    ]
    ++ lib.optionals swiftSupport [ swift ]
    ++ lib.optionals waylandSupport [ wayland-scanner ];
@@ -284,19 +251,7 @@ stdenv'.mkDerivation (finalAttrs: {
    ++ lib.optionals xvSupport [ libXv ]
    ++ lib.optionals zimgSupport [ zimg ]
    ++ lib.optionals stdenv.hostPlatform.isLinux [ nv-codec-headers-11 ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      Accelerate
      CoreFoundation
      Cocoa
      CoreAudio
      MediaPlayer
      VideoToolbox
    ]
    ++ lib.optionals (stdenv.hostPlatform.isDarwin && swiftSupport) [
      AVFoundation
      CoreMedia
    ];
    ;

  postBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
    pushd .. # Must be run from the source dir because it uses relative paths
+1 −1
Original line number Diff line number Diff line
@@ -31181,7 +31181,7 @@ with pkgs;
    libdvdnav = libdvdnav_4_2_1;
  } // (config.mplayer or {}));
  mpv-unwrapped = darwin.apple_sdk_11_0.callPackage ../applications/video/mpv {
  mpv-unwrapped = callPackage ../applications/video/mpv {
    stdenv = if stdenv.hostPlatform.isDarwin then swiftPackages.stdenv else stdenv;
  };