Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpv: fix build with clang 16 and on x86_64-darwin #245452

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions pkgs/applications/video/mpv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
, sdl2Support ? true, SDL2
, sixelSupport ? false, libsixel
, speexSupport ? true, speex
, swiftSupport ? stdenv.isDarwin && stdenv.isAarch64, swift
, swiftSupport ? stdenv.isDarwin, swift
, theoraSupport ? true, libtheora
, vaapiSupport ? x11Support || waylandSupport, libva
, vapoursynthSupport ? false, vapoursynth
Expand All @@ -82,7 +82,20 @@ let
inherit (darwin.apple_sdk_11_0.frameworks)
AVFoundation CoreFoundation CoreMedia Cocoa CoreAudio MediaPlayer Accelerate;
luaEnv = lua.withPackages (ps: with ps; [ luasocket ]);
in stdenv.mkDerivation (finalAttrs: {

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

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

Expand Down
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33515,6 +33515,7 @@ with pkgs;
} // (config.mplayer or {}));

mpv-unwrapped = darwin.apple_sdk_11_0.callPackage ../applications/video/mpv {
stdenv = if stdenv.isDarwin then swiftPackages.stdenv else stdenv;
inherit lua;
};

Expand Down