Merge pull request #217883 from Atemu/mesa-multi-version

mesa_23: init at 23.0.1
This commit is contained in:
K900 2023-03-26 11:53:44 +03:00 committed by GitHub
commit 22609a5d55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 62 additions and 15 deletions

View file

@ -69,21 +69,50 @@ in
package = mkOption {
type = types.package;
internal = true;
default = cfg.mesaPackage;
description = lib.mdDoc ''
The package that provides the OpenGL implementation.
The default is Mesa's drivers which should cover all OpenGL-capable
hardware. If you want to use another Mesa version, adjust
{option}`mesaPackage`.
'';
};
package32 = mkOption {
type = types.package;
internal = true;
default = cfg.mesaPackage32;
description = lib.mdDoc ''
The package that provides the 32-bit OpenGL implementation on
64-bit systems. Used when {option}`driSupport32Bit` is
set.
Same as {option}`package` but for the 32-bit OpenGL implementation on
64-bit systems. Used when {option}`driSupport32Bit` is set.
'';
};
mesaPackage = mkOption {
type = types.package;
default = pkgs.mesa_23;
defaultText = literalExpression "pkgs.mesa_23";
example = literalExpression "pkgs.mesa_22";
description = lib.mdDoc ''
The Mesa driver package used for rendering support on the system.
You should only need to adjust this if you require a newer Mesa
version for your hardware or because you need to patch a bug.
'';
apply = mesa: mesa.drivers or throw "`mesa` package must have a `drivers` output.";
};
mesaPackage32 = mkOption {
type = types.package;
default = pkgs.pkgsi686Linux.mesa_23;
defaultText = literalExpression "pkgs.pkgsi686Linux.mesa_23";
example = literalExpression "pkgs.pkgsi686Linux.mesa_22";
description = lib.mdDoc ''
Same as {option}`mesaPackage` but for the 32-bit Mesa on 64-bit
systems. Used when {option}`driSupport32Bit` is set.
'';
apply = mesa: mesa.drivers or throw "`mesa` package must have a `drivers` output.";
};
extraPackages = mkOption {
type = types.listOf types.package;
default = [];
@ -97,7 +126,6 @@ in
:::
'';
};
extraPackages32 = mkOption {
type = types.listOf types.package;
default = [];
@ -153,9 +181,6 @@ in
environment.sessionVariables.LD_LIBRARY_PATH = mkIf cfg.setLdLibraryPath
([ "/run/opengl-driver/lib" ] ++ optional cfg.driSupport32Bit "/run/opengl-driver-32/lib");
hardware.opengl.package = mkDefault pkgs.mesa.drivers;
hardware.opengl.package32 = mkDefault pkgs.pkgsi686Linux.mesa.drivers;
boot.extraModulePackages = optional (elem "virtualbox" videoDrivers) kernelPackages.virtualboxGuestAdditions;
};
}

View file

@ -0,0 +1,4 @@
import ./generic.nix {
version = "22.3.7";
hash = "sha256-iUzi9KHC52F3zdIoRiAZLQ2jBmskPuwvux18838TBCw=";
}

View file

@ -0,0 +1,4 @@
import ./generic.nix {
version = "23.0.1";
hash = "sha256-6OWGhWtViTq66b3NuYtBwIHZCbsfrzcubnJiMHvzSt8=";
}

View file

@ -1,8 +1,10 @@
{ version, hash }:
{ stdenv, lib, fetchurl
, meson, pkg-config, ninja
, intltool, bison, flex, file, python3Packages, wayland-scanner
, expat, libdrm, xorg, wayland, wayland-protocols, openssl
, llvmPackages, libffi, libomxil-bellagio, libva-minimal
, llvmPackages_15, libffi, libomxil-bellagio, libva-minimal
, libelf, libvdpau
, libglvnd, libunwind
, vulkan-loader, glslang
@ -88,11 +90,11 @@
let
# Release calendar: https://www.mesa3d.org/release-calendar.html
# Release frequency: https://www.mesa3d.org/releasing.html#schedule
version = "22.3.7";
branch = lib.versions.major version;
branch = lib.versions.major version;
withLibdrm = lib.meta.availableOn stdenv.hostPlatform libdrm;
llvmPackages = llvmPackages_15;
# Align all the Mesa versions used. Required to prevent explosions when
# two different LLVMs are loaded in the same process.
# FIXME: these should really go into some sort of versioned LLVM package set
@ -120,7 +122,7 @@ self = stdenv.mkDerivation {
"ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
"ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
];
hash = "sha256-iUzi9KHC52F3zdIoRiAZLQ2jBmskPuwvux18838TBCw=";
inherit hash;
};
# TODO:

View file

@ -22484,12 +22484,24 @@ with pkgs;
# Default libGLU
libGLU = mesa_glu;
mesa = callPackage ../development/libraries/mesa {
llvmPackages = llvmPackages_15;
stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
# When a new patch is out, add a new mesa attribute with the exact patch version
# Remove old mesa attributes when they're unused.
# Try to keep the previous version around for a bit in case there are new bugs.
mesa_22_3_7 = darwin.apple_sdk_11_0.callPackage ../development/libraries/mesa/22.3.7.nix {
inherit (darwin.apple_sdk_11_0.frameworks) OpenGL;
inherit (darwin.apple_sdk_11_0.libs) Xplugin;
};
mesa_23_0_1 = darwin.apple_sdk_11_0.callPackage ../development/libraries/mesa/23.0.1.nix {
inherit (darwin.apple_sdk_11_0.frameworks) OpenGL;
inherit (darwin.apple_sdk_11_0.libs) Xplugin;
};
# Bump this immediately on patches; wait a bit for minor versions
mesa_22 = mesa_22_3_7;
mesa_23 = mesa_23_0_1;
# Bump on staging only, tonnes of packages depend on it.
# See https://github.com/NixOS/nixpkgs/issues/218232
# Major versions should be bumped when they have proven to be reasonably stable
mesa = mesa_22_3_7;
mesa_glu = callPackage ../development/libraries/mesa-glu {
inherit (darwin.apple_sdk.frameworks) ApplicationServices;