mesa: build KosmicKrisp on Darwin
This commit is contained in:
@@ -3,8 +3,12 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitLab,
|
||||
apple-sdk_26,
|
||||
bison,
|
||||
darwinMinVersionHook,
|
||||
flex,
|
||||
glslang,
|
||||
libpng,
|
||||
libxml2,
|
||||
llvmPackages,
|
||||
meson,
|
||||
@@ -15,8 +19,30 @@
|
||||
libxext,
|
||||
libx11,
|
||||
libxcb,
|
||||
libxshmfence,
|
||||
spirv-llvm-translator,
|
||||
spirv-tools,
|
||||
zlib,
|
||||
eglPlatforms ? [
|
||||
"macos"
|
||||
"x11"
|
||||
],
|
||||
galliumDrivers ? [
|
||||
"llvmpipe" # software renderer
|
||||
"softpipe" # older software renderer
|
||||
],
|
||||
vulkanDrivers ? [
|
||||
"kosmickrisp" # Vulkan on Metal
|
||||
],
|
||||
vulkanLayers ? [
|
||||
"anti-lag"
|
||||
"intel-nullhw"
|
||||
"overlay"
|
||||
"screenshot"
|
||||
"vram-report-limit"
|
||||
],
|
||||
}:
|
||||
|
||||
let
|
||||
common = import ./common.nix { inherit lib fetchFromGitLab; };
|
||||
in
|
||||
@@ -28,6 +54,11 @@ stdenv.mkDerivation {
|
||||
meta
|
||||
;
|
||||
|
||||
patches = [
|
||||
# Required to build KosmicKrisp
|
||||
./opencl.patch
|
||||
];
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
@@ -36,6 +67,9 @@ stdenv.mkDerivation {
|
||||
nativeBuildInputs = [
|
||||
bison
|
||||
flex
|
||||
# Use bin output from glslang to not propagate the dev output at
|
||||
# the build time with the host glslang.
|
||||
(lib.getBin glslang)
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
@@ -46,12 +80,21 @@ stdenv.mkDerivation {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
apple-sdk_26 # KosmicKrisp requires Metal 4 to build, but …
|
||||
(darwinMinVersionHook "15.0") # … it supports back to Metal 3.2, which requires macOS 15.
|
||||
libpng
|
||||
libxml2 # should be propagated from libllvm
|
||||
llvmPackages.libclang
|
||||
llvmPackages.libclc
|
||||
llvmPackages.libllvm
|
||||
python3Packages.python # for shebang
|
||||
spirv-llvm-translator
|
||||
spirv-tools
|
||||
libx11
|
||||
libxext
|
||||
libxfixes
|
||||
libxcb
|
||||
libxshmfence
|
||||
zlib
|
||||
];
|
||||
|
||||
@@ -60,10 +103,30 @@ stdenv.mkDerivation {
|
||||
mesonFlags = [
|
||||
"--sysconfdir=/etc"
|
||||
"--datadir=${placeholder "out"}/share"
|
||||
|
||||
# What to build
|
||||
(lib.mesonOption "platforms" (lib.concatStringsSep "," eglPlatforms))
|
||||
(lib.mesonOption "gallium-drivers" (lib.concatStringsSep "," galliumDrivers))
|
||||
(lib.mesonOption "vulkan-drivers" (lib.concatStringsSep "," vulkanDrivers))
|
||||
(lib.mesonOption "vulkan-layers" (lib.concatStringsSep "," vulkanLayers))
|
||||
|
||||
# Disable glvnd on Darwin
|
||||
(lib.mesonEnable "glvnd" false)
|
||||
(lib.mesonEnable "gbm" false)
|
||||
(lib.mesonBool "libgbm-external" false)
|
||||
|
||||
# Needed for KosmicKrisp
|
||||
(lib.mesonOption "clang-libdir" "${lib.getLib llvmPackages.libclang}/lib")
|
||||
(lib.mesonEnable "llvm" true)
|
||||
(lib.mesonEnable "shared-llvm" true)
|
||||
(lib.mesonEnable "spirv-tools" true)
|
||||
|
||||
# Needed for Apple GLX support
|
||||
(lib.mesonOption "glx" "dri")
|
||||
];
|
||||
|
||||
mesonBuildType = "release";
|
||||
|
||||
passthru = {
|
||||
# needed to pass evaluation of bad platforms
|
||||
driverLink = throw "driverLink not supported on darwin";
|
||||
|
||||
Reference in New Issue
Block a user