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

darwin.moltenvk: 1.2.4 -> 1.2.7 #284256

Merged
merged 4 commits into from
Jan 30, 2024
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
29 changes: 29 additions & 0 deletions pkgs/by-name/fa/fast-float/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
}:

stdenv.mkDerivation (finalAttrs: {
pname = "fast-float";
version = "6.0.0";

src = fetchFromGitHub {
owner = "fastfloat";
repo = "fast_float";
rev = "v${finalAttrs.version}";
hash = "sha256-yKHmturouLJkBAdIWoi8vhmipP6jxAwyA+YoSOl6xPU=";
};

nativeBuildInputs = [
cmake
];

meta = {
description = "Fast and exact implementation of the C++ from_chars functions for number types";
homepage = "https://github.com/fastfloat/fast_float";
license = with lib.licenses; [ asl20 boost mit ];
maintainers = with lib.maintainers; [ wegank ];
platforms = lib.platforms.all;
};
})
3 changes: 3 additions & 0 deletions pkgs/development/libraries/libplacebo/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
, libunwind
, libdovi
, xxHash
, fast-float
}:

stdenv.mkDerivation rec {
Expand Down Expand Up @@ -46,6 +47,8 @@ stdenv.mkDerivation rec {
libunwind
libdovi
xxHash
] ++ lib.optionals (!stdenv.cc.isGNU) [
fast-float
];

mesonFlags = with lib; [
Expand Down
4 changes: 4 additions & 0 deletions pkgs/games/quakespasm/vulkan.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ stdenv.mkDerivation rec {

makeFlags = [ "prefix=$(out) bindir=$(out)/bin" ];

env = lib.optionalAttrs stdenv.isDarwin {
NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable";
};

postFixup = ''
wrapProgram $out/bin/vkquake \
--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib
Expand Down
22 changes: 17 additions & 5 deletions pkgs/os-specific/darwin/moltenvk/MoltenVK.xcodeproj.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index c23afce4..12ac12f4 100644
2FEA0D1B249040CA00EEF3AD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */;
@@ -400,20 +393,6 @@
@@ -400,27 +393,6 @@
remoteGlobalIDString = A93903C71C57E9ED00FE90DC;
remoteInfo = "MVKSPIRVToMSLConverter-macOS";
};
Expand All @@ -34,9 +34,16 @@ index c23afce4..12ac12f4 100644
- remoteGlobalIDString = A9092A8C1A81717B00051823;
- remoteInfo = MoltenVKShaderConverter;
- };
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
- DCA2CEAE2A45DFD400FB75B6 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = DCFD7F6F2A45BDA0007BBBF7;
- remoteInfo = "MoltenVKShaderConverter-xrOS";
- };
DCBC41212A45DB1000F49BD1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = A9C86CB61C55B8350096CAF2 /* MoltenVKShaderConverter.xcodeproj */;
@@ -1019,7 +998,6 @@
buildRules = (
);
Expand All @@ -61,7 +68,7 @@ index c23afce4..12ac12f4 100644
);
name = "MoltenVK-macOS";
productName = MoltenVK;
@@ -1476,24 +1452,6 @@
@@ -1476,29 +1452,6 @@
};
/* End PBXSourcesBuildPhase section */

Expand All @@ -81,6 +88,11 @@ index c23afce4..12ac12f4 100644
- name = MoltenVKShaderConverter;
- targetProxy = A9B1C7F4251AA5AF001D12CC /* PBXContainerItemProxy */;
- };
- DCA2CEAF2A45DFD400FB75B6 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = "MoltenVKShaderConverter-xrOS";
- targetProxy = DCA2CEAE2A45DFD400FB75B6 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
/* Begin XCBuildConfiguration section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ index c7842b63..d55f73ed 100644
archiveVersion = 1;
classes = {
};
- objectVersion = 52;
- objectVersion = 54;
+ objectVersion = 48;
objects = {

Expand Down
17 changes: 8 additions & 9 deletions pkgs/os-specific/darwin/moltenvk/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib
, overrideCC
, stdenv
, fetchurl
, fetchFromGitHub
, gitUpdater
, cctools
Expand All @@ -24,7 +23,7 @@

stdenv.mkDerivation (finalAttrs: {
pname = "MoltenVK";
version = "1.2.4";
version = "1.2.7";

buildInputs = [
AppKit
Expand All @@ -47,7 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
owner = "KhronosGroup";
repo = "MoltenVK";
rev = "v${finalAttrs.version}";
hash = "sha256-BL46BgZHUpk0dpzmeZ/2W0msHxFwieeGDjmVB8Nb1J4=";
hash = "sha256-0+S/kueV+AEVt+oFnh4cgcDRVtEbUH1QiHFPhGhimCA=";
};

patches = [
Expand All @@ -59,17 +58,18 @@ stdenv.mkDerivation (finalAttrs: {
postPatch = ''
# Move `mvkGitRevDerived.h` to a stable location
substituteInPlace Scripts/gen_moltenvk_rev_hdr.sh \
--replace '$'''{BUILT_PRODUCTS_DIR}' "$NIX_BUILD_TOP/$sourceRoot/build/include" \
--replace '$(git rev-parse HEAD)' ${finalAttrs.src.rev}
--replace-fail '$'''{BUILT_PRODUCTS_DIR}' "$NIX_BUILD_TOP/$sourceRoot/build/include" \
--replace-fail '$(git rev-parse HEAD)' ${finalAttrs.src.rev}
# Use the SPIRV-Cross packaged in nixpkgs instead of one built specifically for MoltenVK.
substituteInPlace MoltenVK/MoltenVK.xcodeproj/project.pbxproj \
--replace SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross SPIRV_CROSS_NAMESPACE_OVERRIDE=spirv_cross
--replace-fail SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross SPIRV_CROSS_NAMESPACE_OVERRIDE=spirv_cross
substituteInPlace MoltenVKShaderConverter/MoltenVKShaderConverter.xcodeproj/project.pbxproj \
--replace SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross SPIRV_CROSS_NAMESPACE_OVERRIDE=spirv_cross
--replace-fail SPIRV_CROSS_NAMESPACE_OVERRIDE=MVK_spirv_cross SPIRV_CROSS_NAMESPACE_OVERRIDE=spirv_cross
# Adding all of `usr/include` from the SDK results in header conflicts with `libcxx.dev`.
# Work around it by symlinking just the SIMD stuff needed by MoltenVK.
mkdir -p build/include
ln -s "${MacOSX-SDK}/usr/include/simd" "build/include"
ln -s "${glslang.src}" "build/include/glslang"
'';

dontConfigure = true;
Expand All @@ -93,7 +93,6 @@ stdenv.mkDerivation (finalAttrs: {
NIX_LDFLAGS+=" \
-lMachineIndependent \
-lGenericCodeGen \
-lOGLCompiler \
-lglslang \
-lOSDependent \
-lSPIRV \
Expand Down Expand Up @@ -139,7 +138,7 @@ stdenv.mkDerivation (finalAttrs: {
cp MoltenVK/MoltenVK/API/* "$dev/include/MoltenVK"
install -m644 MoltenVK/icd/MoltenVK_icd.json "$out/share/vulkan/icd.d/MoltenVK_icd.json"
substituteInPlace $out/share/vulkan/icd.d/MoltenVK_icd.json \
--replace ./libMoltenVK.dylib "$out/lib/libMoltenVK.dylib"
--replace-fail ./libMoltenVK.dylib "$out/lib/libMoltenVK.dylib"
'';

postFixup = ''
Expand Down
11 changes: 0 additions & 11 deletions pkgs/tools/graphics/vulkan-tools/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ stdenv.mkDerivation rec {
Cocoa
];

postPatch = lib.optionalString stdenv.isDarwin ''
# Modify mac_common.cmake to find the ICD where nixpkgs puts it.
substituteInPlace mac_common.cmake \
--replace MoltenVK/icd/MoltenVK_icd.json MoltenVK_icd.json
# Remove the unconditional check for `ibtool` since the cube demo that needs it won’t be built.
sed -e '/#.*Interface Builder/,/^endif()/d' -i mac_common.cmake
# Install `vulkaninfo` to $out/bin even on Darwin.
substituteInPlace vulkaninfo/CMakeLists.txt \
--replace 'install(TARGETS vulkaninfo RUNTIME DESTINATION "vulkaninfo")' 'install(TARGETS vulkaninfo)'
'';

libraryPath = lib.strings.makeLibraryPath [ vulkan-loader ];

dontPatchELF = true;
Expand Down
Loading