From 77feb16bb558f5e0a686afb326fa8235c6105ccd Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 26 Aug 2024 08:58:35 +0300 Subject: [PATCH] mesa: 24.1.6 -> 24.2.1 --- pkgs/development/libraries/mesa/common.nix | 16 +++++++------- .../libraries/mesa/darwin-build-fix.patch | 13 +++++++++++ pkgs/development/libraries/mesa/darwin.nix | 14 ++++++++++-- pkgs/development/libraries/mesa/default.nix | 22 +++++++++---------- 4 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/libraries/mesa/darwin-build-fix.patch diff --git a/pkgs/development/libraries/mesa/common.nix b/pkgs/development/libraries/mesa/common.nix index 5628ca1b49e0b..666da7fb99155 100644 --- a/pkgs/development/libraries/mesa/common.nix +++ b/pkgs/development/libraries/mesa/common.nix @@ -1,18 +1,18 @@ -{ lib, fetchurl }: +{ lib, fetchFromGitLab }: # When updating this package, please verify at least these build (assuming x86_64-linux): # nix build .#mesa .#pkgsi686Linux.mesa .#pkgsCross.aarch64-multiplatform.mesa .#pkgsMusl.mesa # Ideally also verify: # nix build .#legacyPackages.x86_64-darwin.mesa .#legacyPackages.aarch64-darwin.mesa rec { pname = "mesa"; - version = "24.1.6"; + version = "24.2.1"; - src = fetchurl { - urls = [ - "https://archive.mesa3d.org/mesa-${version}.tar.xz" - "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz" - ]; - hash = "sha256-2pTAkI1WYkZzabae2CNtoeFXcUGm59JRcam/Vjg7NOg="; + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "mesa"; + repo = "mesa"; + rev = "mesa-${version}"; + hash = "sha256-1aOK5M4Xe1FnmouOIoyafrvnxyoGpNK8wLVDC8yO4p0="; }; meta = { diff --git a/pkgs/development/libraries/mesa/darwin-build-fix.patch b/pkgs/development/libraries/mesa/darwin-build-fix.patch new file mode 100644 index 0000000000000..f253169b1594c --- /dev/null +++ b/pkgs/development/libraries/mesa/darwin-build-fix.patch @@ -0,0 +1,13 @@ +diff --git a/src/glx/glxext.c b/src/glx/glxext.c +index eee9f040151..289691db26b 100644 +--- a/src/glx/glxext.c ++++ b/src/glx/glxext.c +@@ -800,7 +800,7 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv, Bool zink, + + #if defined(GLX_USE_APPLE) + if (psc == NULL && priv->driswDisplay) { +- psc = priv->driswDisplay->createScreen(i, priv); ++ psc = priv->driswDisplay->createScreen(i, priv, driver_name_is_inferred); + } + #endif + diff --git a/pkgs/development/libraries/mesa/darwin.nix b/pkgs/development/libraries/mesa/darwin.nix index aeeb8ab7648b3..5be2a27f74e98 100644 --- a/pkgs/development/libraries/mesa/darwin.nix +++ b/pkgs/development/libraries/mesa/darwin.nix @@ -2,9 +2,11 @@ { lib, stdenv, - fetchurl, + fetchFromGitLab, bison, flex, + libxml2, + llvmPackages, meson, ninja, pkg-config, @@ -14,10 +16,14 @@ zlib, }: let - common = import ./common.nix { inherit lib fetchurl; }; + common = import ./common.nix { inherit lib fetchFromGitLab; }; in stdenv.mkDerivation { inherit (common) pname version src meta; + patches = [ + ./darwin-build-fix.patch + ]; + outputs = [ "out" "dev" ]; nativeBuildInputs = [ @@ -29,9 +35,12 @@ in stdenv.mkDerivation { python3Packages.packaging python3Packages.python python3Packages.mako + python3Packages.pyyaml ]; buildInputs = [ + libxml2 # should be propagated from libllvm + llvmPackages.libllvm Xplugin xorg.libX11 xorg.libXext @@ -46,6 +55,7 @@ in stdenv.mkDerivation { "--datadir=${placeholder "out"}/share" (lib.mesonEnable "glvnd" false) (lib.mesonEnable "shared-glapi" true) + (lib.mesonEnable "llvm" true) ]; # Don't need this on Darwin. diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index b1d5b0ad84f99..ca75bc6a8cf19 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -5,8 +5,7 @@ , elfutils , expat , fetchCrate -, fetchurl -, fetchpatch +, fetchFromGitLab , file , flex , glslang @@ -45,12 +44,12 @@ , galliumDrivers ? [ "d3d12" # WSL emulated GPU (aka Dozen) "iris" # new Intel (Broadwell+) - "kmsro" # special "render only" driver for GPUs without a display controller + "llvmpipe" # software renderer "nouveau" # Nvidia - "radeonsi" # new AMD (GCN+) "r300" # very old AMD "r600" # less old AMD - "swrast" # software renderer (aka LLVMPipe) + "radeonsi" # new AMD (GCN+) + "softpipe" # older software renderer "svga" # VMWare virtualized GPU "virgl" # QEMU virtualized GPU (aka VirGL) "zink" # generic OpenGL over Vulkan, experimental @@ -104,8 +103,8 @@ let } { pname = "proc-macro2"; - version = "1.0.70"; - hash = "sha256-e4ZgyZUTu5nAtaH5QVkLelqJQX/XPj/rWkzf/g2c+1g="; + version = "1.0.86"; + hash = "sha256-9fYAlWRGVIwPp8OKX7Id84Kjt8OoN2cANJ/D9ZOUUZE="; } { pname = "quote"; @@ -114,8 +113,8 @@ let } { pname = "syn"; - version = "2.0.39"; - hash = "sha256-Mjen2L/omhVbhU/+Ao65mogs3BP3fY+Bodab3uU63EI="; + version = "2.0.68"; + hash = "sha256-nGLBbxR0DFBpsXMngXdegTm/o13FBS6QsM7TwxHXbgQ="; } { pname = "unicode-ident"; @@ -133,7 +132,7 @@ let needNativeCLC = !stdenv.buildPlatform.canExecute stdenv.hostPlatform; - common = import ./common.nix { inherit lib fetchurl; }; + common = import ./common.nix { inherit lib fetchFromGitLab; }; in stdenv.mkDerivation { inherit (common) pname version src meta; @@ -275,6 +274,7 @@ in stdenv.mkDerivation { python3Packages.pycparser python3Packages.mako python3Packages.ply + python3Packages.pyyaml jdupes # Use bin output from glslang to not propagate the dev output at # the build time with the host glslang. @@ -368,7 +368,7 @@ in stdenv.mkDerivation { done # add RPATH here so Zink can find libvulkan.so - patchelf --add-rpath ${vulkan-loader}/lib $drivers/lib/dri/zink_dri.so + patchelf --add-rpath ${vulkan-loader}/lib $out/lib/libgallium*.so ''; env.NIX_CFLAGS_COMPILE = toString ([