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: clean‐ups and Darwin improvements #350674

Merged
merged 21 commits into from
Oct 24, 2024

Conversation

emilazy
Copy link
Member

@emilazy emilazy commented Oct 23, 2024

This ports mpv over to the new SDK format from #346043 (so much less cruft! yay!), enables the new upstream default of Vulkan on Darwin, and cleans up a bunch of flags and dependencies, including removing flags that had no effect, broke the build to toggle, or are just obsolete, and adjusting some defaults to be less Linux‐specific or more inline with upstream and other distros.

There are still things to investigate with the macOS build (e.g. VideoToolbox seems to support fewer pixel output formats compared to their official CI binaries), but I wanted to get this batch with the theoretically‐breaking changes posted before the freeze.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Oh, this is satisfying.

Swift already propagates its corresponding SDK, so we don’t need
the patch.
mpv currently doesn’t even build successfully on macOS without Swift,
and there’s no use of Swift outside of the platform.
Using `--vo=gpu` or `--vo=gpu-next` with MoltenVK is now supported
and has replaced the previous `cocoa-cb` as the default.
This is now detected correctly as part of the SDK, as it should be.
Does nothing, removed upstream in 2012(!):
<mpv-player/mpv@1fde09d>.
Does nothing, removed upstream in 2012(!):
<mpv-player/mpv@1fde09d>.
Does nothing, removed upstream in 2012(!):
<mpv-player/mpv@6a26b4a>.
This is required as part of X11 support since the Meson transition.
Upstream’s Meson defaults, upstream’s CI binaries, and Arch
don’t enable this.
This prints out a big warning about how you shouldn’t be using
it. Upstream CI builds and Arch don’t enable it. There are other
backends of questionable worth that we don’t expose options for,
so let’s ditch this one.
No reason for FreeBSD to miss out on the fun.
Since we’re doing auto‐detection anyway, this is unnecessary.
On macOS, many things won’t work properly unless mpv is executed from
the app bundle, such as spatial audio with `--ao=avfoundation`. This
ensures that those features work reliably and also avoids duplicating
the entire `mpv` binary.
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Oct 23, 2024
@emilazy
Copy link
Member Author

emilazy commented Oct 24, 2024

@AndersonTorres @fpletz would be great to get this reviewed before the freeze tonight if you have the time ^^

Copy link
Member

@AndersonTorres AndersonTorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides, lgtm

pkgs/applications/video/mpv/default.nix Show resolved Hide resolved
Copy link
Member

@fpletz fpletz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the cleanups. Much appreciated! ❤️

@fpletz fpletz merged commit f4f88f9 into NixOS:staging-next Oct 24, 2024
30 of 31 checks passed
@emilazy emilazy deleted the push-kmsntptmonot branch October 24, 2024 11:26
@@ -151,18 +111,13 @@ stdenv'.mkDerivation (finalAttrs: {
hash = "sha256-BOGh+QBTO7hrHohh+RqjSF8eHQH8jVBPjG/k4eyFaaM=";
};

patches = [
# Fix build with Darwin SDK 11
./0001-fix-darwin-build.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this file removed from Nixpkgs repo?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intended to, but it’s possible it got lost in rebasing. Will open a PR soon if nobody beats me to it (currently racing against time for the 24.11 freeze).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants