diff --git a/pkgs/applications/emulators/wine/default.nix b/pkgs/applications/emulators/wine/default.nix index 8c8ebdea5878..8f579c35184f 100644 --- a/pkgs/applications/emulators/wine/default.nix +++ b/pkgs/applications/emulators/wine/default.nix @@ -39,7 +39,7 @@ waylandSupport ? false, x11Support ? false, embedInstallers ? false, # The Mono and Gecko MSI installers - moltenvk ? darwin.moltenvk # Allow users to override MoltenVK easily + moltenvk # Allow users to override MoltenVK easily }: let wine-build = build: release: diff --git a/pkgs/by-name/fa/fastfetch/package.nix b/pkgs/by-name/fa/fastfetch/package.nix index 5d1f54b8261e..bed0d66596a7 100644 --- a/pkgs/by-name/fa/fastfetch/package.nix +++ b/pkgs/by-name/fa/fastfetch/package.nix @@ -19,6 +19,7 @@ libsepol, libxcb, makeBinaryWrapper, + moltenvk, nix-update-script, ocl-icd, opencl-headers, @@ -119,7 +120,7 @@ stdenv'.mkDerivation (finalAttrs: { MediaRemote OpenCL SystemConfiguration - darwin.moltenvk + moltenvk ] ); diff --git a/pkgs/os-specific/darwin/moltenvk/default.nix b/pkgs/by-name/mo/moltenvk/package.nix similarity index 88% rename from pkgs/os-specific/darwin/moltenvk/default.nix rename to pkgs/by-name/mo/moltenvk/package.nix index 43ede5f950c5..af16cc07adf3 100644 --- a/pkgs/os-specific/darwin/moltenvk/default.nix +++ b/pkgs/by-name/mo/moltenvk/package.nix @@ -3,19 +3,16 @@ stdenv, fetchFromGitHub, gitUpdater, + apple-sdk_14, + darwinMinVersionHook, cereal, libcxx, glslang, - simd, spirv-cross, spirv-headers, spirv-tools, vulkan-headers, - xcbuild, - AppKit, - Foundation, - Metal, - QuartzCore, + xcbuildHook, enableStatic ? stdenv.hostPlatform.isStatic, # MoltenVK supports using private APIs to implement some Vulkan functionality. # Applications that use private APIs can’t be distributed on the App Store, @@ -26,23 +23,22 @@ stdenv.mkDerivation (finalAttrs: { pname = "MoltenVK"; - version = "1.2.9"; + version = "1.2.10"; + + strictDeps = true; buildInputs = [ - AppKit - Foundation - Metal - QuartzCore + apple-sdk_14 cereal + (darwinMinVersionHook "10.15") glslang - simd spirv-cross spirv-headers spirv-tools vulkan-headers ]; - nativeBuildInputs = [ xcbuild ]; + nativeBuildInputs = [ xcbuildHook ]; outputs = [ "out" @@ -54,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "KhronosGroup"; repo = "MoltenVK"; rev = "v${finalAttrs.version}"; - hash = "sha256-9k7NMw2M6IqCUQNBekzDaS6VYAOKwPmuCfJkENQ7oiI="; + hash = "sha256-5hc+bnsyc8Am9My2kzsU7fv+1CePCHgxL82Mxz/zJRo="; }; postPatch = '' @@ -95,6 +91,10 @@ stdenv.mkDerivation (finalAttrs: { # Link glslang source because MoltenVK needs non-public headers to build. mkdir -p build/include ln -s "${glslang.src}" "build/include/glslang" + + # MoltenVK should be using SPIRV_CROSS_NAMESPACE instead of hardcoding the namespace. + substituteInPlace MoltenVK/MoltenVK/GPUObjects/MVKDescriptorSet.mm \ + --replace-fail MVK_spirv_cross SPIRV_CROSS_NAMESPACE ''; env.NIX_CFLAGS_COMPILE = toString ( @@ -117,25 +117,25 @@ stdenv.mkDerivation (finalAttrs: { "-lspirv-cross-reflect" ]; - buildPhase = '' - runHook preBuild - + preBuild = '' NIX_CFLAGS_COMPILE+=" \ -I$NIX_BUILD_TOP/$sourceRoot/build/include \ -I$NIX_BUILD_TOP/$sourceRoot/Common" - - xcodebuild build \ - SYMROOT=$PWD/Products OBJROOT=$PWD/Intermedates \ - -jobs $NIX_BUILD_CORES \ - -configuration Release \ - -project MoltenVKPackaging.xcodeproj \ - -scheme 'MoltenVK Package (macOS only)' \ - -destination generic/platform=macOS \ - -arch ${stdenv.hostPlatform.darwinArch} - - runHook postBuild ''; + xcbuildFlags = [ + "-configuration" + "Release" + "-project" + "MoltenVKPackaging.xcodeproj" + "-scheme" + "MoltenVK Package (macOS only)" + "-destination" + "generic/platform=macOS" + "-arch" + stdenv.hostPlatform.darwinArch + ]; + postBuild = if enableStatic then '' @@ -187,6 +187,8 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + __structuredAttrs = true; + passthru.updateScript = gitUpdater { rev-prefix = "v"; ignoredVersions = ".*-(beta|rc).*"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6f583a4e5810..94c173989698 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2670,7 +2670,6 @@ with pkgs; dolphin-emu = qt6Packages.callPackage ../applications/emulators/dolphin-emu { stdenv = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv; inherit (darwin.apple_sdk_11_0.frameworks) CoreBluetooth ForceFeedback IOBluetooth IOKit OpenGL VideoToolbox; - inherit (darwin) moltenvk; }; dolphin-emu-primehack = qt5.callPackage ../applications/emulators/dolphin-emu/primehack.nix { @@ -23512,9 +23511,8 @@ with pkgs; vulkan-extension-layer = callPackage ../tools/graphics/vulkan-extension-layer { }; vulkan-headers = callPackage ../development/libraries/vulkan-headers { }; - vulkan-loader = callPackage ../development/libraries/vulkan-loader { inherit (darwin) moltenvk; }; + vulkan-loader = callPackage ../development/libraries/vulkan-loader { }; vulkan-tools = callPackage ../tools/graphics/vulkan-tools { - inherit (darwin) moltenvk; inherit (darwin.apple_sdk.frameworks) AppKit Cocoa; }; vulkan-tools-lunarg = callPackage ../tools/graphics/vulkan-tools-lunarg { }; @@ -35217,9 +35215,7 @@ with pkgs; quakespasm = callPackage ../games/quakespasm { inherit (darwin.apple_sdk.frameworks) Cocoa CoreAudio CoreFoundation IOKit OpenGL; }; - vkquake = callPackage ../games/quakespasm/vulkan.nix { - inherit (darwin) moltenvk; - }; + vkquake = callPackage ../games/quakespasm/vulkan.nix { }; ioquake3 = callPackage ../games/quake3/ioquake { }; quake3e = callPackage ../games/quake3/quake3e { }; diff --git a/pkgs/top-level/darwin-aliases.nix b/pkgs/top-level/darwin-aliases.nix index 46a96ce466eb..6fafa5f487c4 100644 --- a/pkgs/top-level/darwin-aliases.nix +++ b/pkgs/top-level/darwin-aliases.nix @@ -68,6 +68,10 @@ mapAliases ({ libauto = throw "'darwin.libauto' has been removed, as it was broken and unmaintained"; # added 2024-05-10 libtapi = pkgs.libtapi; # 2024-08-16 + ### M ### + + moltenvk = pkgs.moltenvk; # 2024-10-06 + ### O ### opencflite = pkgs.opencflite; # added 2024-05-02 diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index e473c313fdb9..dafb00befb40 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -206,15 +206,6 @@ impure-cmds // apple-source-packages // apple-source-headers // stubs // { lsusb = callPackage ../os-specific/darwin/lsusb { }; - moltenvk = callPackage ../os-specific/darwin/moltenvk { - stdenv = pkgs.overrideSDK stdenv { - darwinMinVersion = "10.15"; - darwinSdkVersion = "12.3"; - }; - inherit (apple_sdk.frameworks) AppKit Foundation Metal QuartzCore; - inherit (apple_sdk.libs) simd; - }; - openwith = callPackage ../os-specific/darwin/openwith { }; stubs = pkgs.callPackages ../os-specific/darwin/stubs { };