mesa: refactor for multi-version setup

This commit is contained in:
Atemu 2023-02-23 18:42:52 +01:00
parent 8f40f2f90b
commit c2ebb395ca
3 changed files with 12 additions and 7 deletions

View file

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

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

@ -22505,12 +22505,11 @@ 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;
mesa_22 = darwin.apple_sdk_11_0.callPackage ../development/libraries/mesa/22.nix {
inherit (darwin.apple_sdk_11_0.frameworks) OpenGL;
inherit (darwin.apple_sdk_11_0.libs) Xplugin;
};
mesa = mesa_22;
mesa_glu = callPackage ../development/libraries/mesa-glu {
inherit (darwin.apple_sdk.frameworks) ApplicationServices;