Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mesa: 24.1.6 -> 24.2.1, now with 100% less Libgbm Thing(tm) #332413

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkgs/development/libraries/mesa/common.nix
Original file line number Diff line number Diff line change
@@ -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
Comment on lines 2 to 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these go in passthru.tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't really do that without instantiating a whole bunch of extra nixpkgses.

Copy link
Member

@emilazy emilazy Aug 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you took pkgsi686Linux etc. as arguments they’d still only be instantiated if you evaluated passthru.tests, wouldn’t they?

Edit: Oh, or I guess you’re worried about Hydra?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ofborg/hydra mostly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x86_64-linux probably builds at least pkgsi686Linux.mesa anyway, right? I guess I don’t really know how those package sets work in terms of Hydra eval though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're doing that in intel-media-driver and so far no one complained

inherit (pkgsi686Linux) intel-media-driver;

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 = {
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/libraries/mesa/darwin-build-fix.patch
Original file line number Diff line number Diff line change
@@ -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

14 changes: 12 additions & 2 deletions pkgs/development/libraries/mesa/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitLab,
bison,
flex,
libxml2,
llvmPackages,
meson,
ninja,
pkg-config,
Expand All @@ -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 = [
Expand All @@ -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
Expand All @@ -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.
Expand Down
22 changes: 11 additions & 11 deletions pkgs/development/libraries/mesa/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
, elfutils
, expat
, fetchCrate
, fetchurl
, fetchpatch
, fetchFromGitLab
, file
, flex
, glslang
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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;

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 ([
Expand Down