Merge pull request #284256 from wegank/moltenvk-bump

darwin.moltenvk: 1.2.4 -> 1.2.7
This commit is contained in:
Weijia Wang 2024-01-30 13:20:20 +01:00 committed by GitHub
commit a940bf9292
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 62 additions and 26 deletions

View File

@ -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;
};
})

View File

@ -14,6 +14,7 @@
, libunwind
, libdovi
, xxHash
, fast-float
}:
stdenv.mkDerivation rec {
@ -46,6 +47,8 @@ stdenv.mkDerivation rec {
libunwind
libdovi
xxHash
] ++ lib.optionals (!stdenv.cc.isGNU) [
fast-float
];
mesonFlags = with lib; [

View File

@ -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

View File

@ -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";
};
@ -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 = (
);
@ -61,7 +68,7 @@ index c23afce4..12ac12f4 100644
);
name = "MoltenVK-macOS";
productName = MoltenVK;
@@ -1476,24 +1452,6 @@
@@ -1476,29 +1452,6 @@
};
/* End PBXSourcesBuildPhase section */
@ -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 */

View File

@ -6,7 +6,7 @@ index c7842b63..d55f73ed 100644
archiveVersion = 1;
classes = {
};
- objectVersion = 52;
- objectVersion = 54;
+ objectVersion = 48;
objects = {

View File

@ -1,7 +1,6 @@
{ lib
, overrideCC
, stdenv
, fetchurl
, fetchFromGitHub
, gitUpdater
, cctools
@ -24,7 +23,7 @@
stdenv.mkDerivation (finalAttrs: {
pname = "MoltenVK";
version = "1.2.4";
version = "1.2.7";
buildInputs = [
AppKit
@ -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 = [
@ -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;
@ -93,7 +93,6 @@ stdenv.mkDerivation (finalAttrs: {
NIX_LDFLAGS+=" \
-lMachineIndependent \
-lGenericCodeGen \
-lOGLCompiler \
-lglslang \
-lOSDependent \
-lSPIRV \
@ -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 = ''

View File

@ -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 wont 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;