about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/mesa
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-15 10:30:44 +0000
commite0794be8a0d11e90461e5a9c85012a36b93ec976 (patch)
treeefd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/development/libraries/mesa
parent3538874082ded7647b1ccec0343c7c1e882cfef3 (diff)
parent1a57d96edd156958b12782e8c8b6a374142a7248 (diff)
downloadnixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst
nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/mesa')
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/link-radv-with-ld_args_build_id.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch12
4 files changed, 38 insertions, 88 deletions
diff --git a/nixpkgs/pkgs/development/libraries/mesa/default.nix b/nixpkgs/pkgs/development/libraries/mesa/default.nix
index cf452fded14e..c96d1edfadfe 100644
--- a/nixpkgs/pkgs/development/libraries/mesa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mesa/default.nix
@@ -8,7 +8,7 @@
 , galliumDrivers ? ["auto"]
 , driDrivers ? ["auto"]
 , vulkanDrivers ? ["auto"]
-, eglPlatforms ? [ "x11" "surfaceless" ] ++ lib.optionals stdenv.isLinux [ "wayland" "drm" ]
+, eglPlatforms ? [ "x11" ] ++ lib.optionals stdenv.isLinux [ "wayland" ]
 , OpenGL, Xplugin
 , withValgrind ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32, valgrind-light
 , enableGalliumNine ? stdenv.isLinux
@@ -31,7 +31,7 @@ with stdenv.lib;
 let
   # Release calendar: https://www.mesa3d.org/release-calendar.html
   # Release frequency: https://www.mesa3d.org/releasing.html#schedule
-  version = "20.1.7";
+  version = "20.3.1";
   branch  = versions.major version;
 in
 
@@ -46,7 +46,7 @@ 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"
     ];
-    sha256 = "1252mgwiy05nz8mm4gjkzmnjfvdz5yv1shnsr837cdnan86dvsad";
+    sha256 = "03vqm9kqrcpijg6bxldj0bg360z8d7c767n3b16jdc1apd4inxdg";
   };
 
   prePatch = "patchShebangs .";
@@ -58,39 +58,21 @@ stdenv.mkDerivation {
     ./missing-includes.patch # dev_t needs sys/stat.h, time_t needs time.h, etc.-- fixes build w/musl
     ./opencl-install-dir.patch
     ./disk_cache-include-dri-driver-path-in-cache-key.patch
-    ./link-radv-with-ld_args_build_id.patch
-  ]
-    ++ lib.optionals stdenv.hostPlatform.isMusl [
-      # Fix `-Werror=int-conversion` pthread warnings on musl.
-      # TODO: Remove when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6121 is merged and available
-      (fetchpatch {
-        name = "nine_debug-Make-tid-more-type-correct";
-        # Patch adjusted for version `20.1`, before the big mesa dirs change
-        # `gallium: rename 'state tracker' to 'frontend'`.
-        # Patch for versions after that change is at
-        #     https://gitlab.freedesktop.org/mesa/mesa/commit/aebbf819df6d1e3b4745ef16d0e833300ad67044.patch
-        url = "https://gitlab.freedesktop.org/nh2/mesa/commit/3385c49684375f1153a52ed7ccda3f5135268a41.patch";
-        sha256 = "1ci694sqjll44c9g2md4krhk6qlvq51r7ad5rnnfdnf3l8ys0i50";
-      })
-    ]
-    # do not prefix user provided dri-drivers-path
-    ++ lib.optional (lib.versionOlder version "19.0.0") (fetchpatch {
-      url = "https://gitlab.freedesktop.org/mesa/mesa/commit/f6556ec7d126b31da37c08d7cb657250505e01a0.patch";
-      sha256 = "0z6phi8hbrbb32kkp1js7ggzviq7faz1ria36wi4jbc4in2392d9";
+    # Fix `-Werror=int-conversion` pthread warnings on musl.
+    # TODO: Remove when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6121 is merged and available
+    (fetchpatch {
+      name = "nine_debug-Make-tid-more-type-correct";
+      url = "https://gitlab.freedesktop.org/mesa/mesa/commit/aebbf819df6d1e.patch";
+      sha256 = "17248hyzg43d73c86p077m4lv1pkncaycr3l27hwv9k4ija9zl8q";
     })
-    ++ lib.optionals (lib.versionOlder version "19.1.0") [
-      # do not prefix user provided d3d-drivers-path
-      (fetchpatch {
-        url = "https://gitlab.freedesktop.org/mesa/mesa/commit/dcc48664197c7e44684ccfb970a4ae083974d145.patch";
-        sha256 = "1nhs0xpx3hiy8zfb5gx1zd7j7xha6h0hr7yingm93130a5902lkb";
-      })
-
-      # don't build libGLES*.so with GLVND
-      (fetchpatch {
-        url = "https://gitlab.freedesktop.org/mesa/mesa/commit/b01524fff05eef66e8cd24f1c5aacefed4209f03.patch";
-        sha256 = "1pszr6acx2xw469zq89n156p3bf3xf84qpbjw5fr1sj642lbyh7c";
-      })
-    ];
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    # Fix for pre macOS SDK 10.13
+    # TODO(r-burns) can be applied unconditionally, at the cost of a mass linux rebuild
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/f4403f70fe5bf2ec41af5546122f0d78caffa984.patch";
+      sha256 = "03j2aj255m7ms848nkb41vj3s3yb72zb5rz3w3fzp5l9wzzargw5";
+    })
+  ];
 
   postPatch = ''
     substituteInPlace meson.build --replace \
@@ -102,6 +84,10 @@ stdenv.mkDerivation {
       'DATADIR "/drirc.d"' '"${placeholder "out"}/drirc.d"'
     substituteInPlace src/util/meson.build --replace \
       "get_option('datadir')" "'${placeholder "out"}'"
+  '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    substituteInPlace meson.build --replace \
+      "find_program('nm')" \
+      "find_program('${stdenv.cc.targetPrefix}nm')"
   '';
 
   outputs = [ "out" "dev" "drivers" ] ++ lib.optional enableOSMesa "osmesa";
@@ -129,7 +115,7 @@ stdenv.mkDerivation {
     "-Domx-libs-path=${placeholder "drivers"}/lib/bellagio"
     "-Dva-libs-path=${placeholder "drivers"}/lib/dri"
     "-Dd3d-drivers-path=${placeholder "drivers"}/lib/d3d"
-    "-Dgallium-nine=${if enableGalliumNine then "true" else "false"}" # Direct3D in Wine
+    "-Dgallium-nine=${boolToString enableGalliumNine}" # Direct3D in Wine
     "-Dosmesa=${if enableOSMesa then "gallium" else "none"}" # used by wine
   ] ++ optionals stdenv.isLinux [
     "-Dglvnd=true"
@@ -229,7 +215,7 @@ stdenv.mkDerivation {
     inherit (libglvnd) driverLink;
   };
 
-  meta = with stdenv.lib; {
+  meta = {
     description = "An open source 3D graphics library";
     longDescription = ''
       The Mesa project began as an open-source implementation of the OpenGL
diff --git a/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch b/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
index acf3d827c562..fa78f4ae730a 100644
--- a/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
+++ b/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
@@ -1,4 +1,4 @@
-From 46b10f2bc28fd79d561c8c49bbae3aee6a4cf0e6 Mon Sep 17 00:00:00 2001
+From 980164fd92f5c2302624cd046d30ff21e6e4ba8a Mon Sep 17 00:00:00 2001
 From: David McFarland <corngood@gmail.com>
 Date: Mon, 6 Aug 2018 15:52:11 -0300
 Subject: [PATCH] disk_cache: include dri driver path in cache key
@@ -12,10 +12,10 @@ timestamps in /nix/store are zero.
  3 files changed, 15 insertions(+), 1 deletion(-)
 
 diff --git a/meson_options.txt b/meson_options.txt
-index 1a2dd8ebd12..2ac741af5a6 100644
+index 2d39d13b6ad..daf06480a60 100644
 --- a/meson_options.txt
 +++ b/meson_options.txt
-@@ -348,6 +348,12 @@ option(
+@@ -368,6 +368,12 @@ option(
    value : true,
    description : 'Enable direct rendering in GLX and EGL for DRI',
  )
@@ -26,13 +26,13 @@ index 1a2dd8ebd12..2ac741af5a6 100644
 +  description : 'Mesa cache key.'
 +)
  option(
-   'I-love-half-baked-turnips',
+   'prefer-iris',
    type : 'boolean',
 diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
-index d1f14736725..2ed328f292e 100644
+index a92d621927a..3bd65c6890c 100644
 --- a/src/util/disk_cache.c
 +++ b/src/util/disk_cache.c
-@@ -402,8 +402,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
+@@ -401,8 +401,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
  
     /* Create driver id keys */
     size_t id_size = strlen(driver_id) + 1;
@@ -43,7 +43,7 @@ index d1f14736725..2ed328f292e 100644
     cache->driver_keys_blob_size += gpu_name_size;
  
     /* We sometimes store entire structs that contains a pointers in the cache,
-@@ -424,6 +426,7 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
+@@ -423,6 +425,7 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
     uint8_t *drv_key_blob = cache->driver_keys_blob;
     DRV_KEY_CPY(drv_key_blob, &cache_version, cv_size)
     DRV_KEY_CPY(drv_key_blob, driver_id, id_size)
@@ -52,22 +52,23 @@ index d1f14736725..2ed328f292e 100644
     DRV_KEY_CPY(drv_key_blob, &ptr_size, ptr_size_size)
     DRV_KEY_CPY(drv_key_blob, &driver_flags, driver_flags_size)
 diff --git a/src/util/meson.build b/src/util/meson.build
-index 9da29cc7390..5f549bb1d99 100644
+index 0893f64793b..d46ce85a85f 100644
 --- a/src/util/meson.build
 +++ b/src/util/meson.build
-@@ -170,7 +170,12 @@ _libmesa_util = static_library(
-   include_directories : inc_common,
+@@ -179,7 +179,12 @@ _libmesa_util = static_library(
+   include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
    dependencies : deps_for_libmesa_util,
    link_with: libmesa_format,
--  c_args : [c_msvc_compat_args, c_vis_args],
+-  c_args : [c_msvc_compat_args],
 +  c_args : [
-+    c_msvc_compat_args, c_vis_args,
++    c_msvc_compat_args,
 +    '-DDISK_CACHE_KEY="@0@"'.format(
 +      get_option('disk-cache-key')
 +    ),
 +  ],
+   gnu_symbol_visibility : 'hidden',
    build_by_default : false
  )
- 
 -- 
-2.25.1
+2.28.0
+
diff --git a/nixpkgs/pkgs/development/libraries/mesa/link-radv-with-ld_args_build_id.patch b/nixpkgs/pkgs/development/libraries/mesa/link-radv-with-ld_args_build_id.patch
deleted file mode 100644
index 0a660332392d..000000000000
--- a/nixpkgs/pkgs/development/libraries/mesa/link-radv-with-ld_args_build_id.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From b49bcb6eece322b70fc2e8b0c8498f5a38ea7b82 Mon Sep 17 00:00:00 2001
-From: David McFarland <corngood@gmail.com>
-Date: Sun, 26 Jul 2020 17:29:49 -0300
-Subject: [PATCH] link radv with ld_args_build_id
-
-This is needed for radv_device_get_cache_uuid to work correctly.
----
- src/amd/vulkan/meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build
-index eec026e8f60..a07a0821938 100644
---- a/src/amd/vulkan/meson.build
-+++ b/src/amd/vulkan/meson.build
-@@ -183,7 +183,7 @@ libvulkan_radeon = shared_library(
-   ],
-   c_args : [c_vis_args, no_override_init_args, radv_flags],
-   cpp_args : [cpp_vis_args, radv_flags],
--  link_args : [ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args],
-+  link_args : [ld_args_build_id, ld_args_bsymbolic, ld_args_gc_sections, libvulkan_radeon_ld_args],
-   link_depends : [libvulkan_radeon_link_depends,],
-   install : true,
- )
---
-2.28.0
diff --git a/nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch b/nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch
index 9685a1619a58..72488893c6b6 100644
--- a/nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch
+++ b/nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch
@@ -9,18 +9,6 @@
  #include "pipe/p_compiler.h"
  #include "pipe/p_state.h"
  
---- ./src/util/rand_xor.c.orig	2017-06-20 00:38:57.199474067 +0200
-+++ ./src/util/rand_xor.c	2017-06-20 00:40:31.351279557 +0200
-@@ -23,7 +23,9 @@
-  */
- 
- #if defined(__linux__)
-+#include <sys/types.h>
- #include <sys/file.h>
-+#include <sys/stat.h>
- #include <unistd.h>
- #include <fcntl.h>
- #else
 --- ./src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
 +++ ./src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
 @@ -28,6 +28,8 @@