From f2280510e3e431e9c0907fe233a3534def4a7162 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 17 Oct 2024 16:08:29 +0100 Subject: [PATCH] mpv: remove legacy Darwin SDK pattern detritus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oh, this is satisfying. Swift already propagates its corresponding SDK, so we don’t need the patch. --- pkgs/applications/video/mpv/default.nix | 49 +------------------------ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 327009b88e23..cf14df58e656 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 40ee0d60265f..63ff10afe552 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; };