summaryrefslogtreecommitdiff
path: root/files/nixpkgs-patches
diff options
context:
space:
mode:
Diffstat (limited to 'files/nixpkgs-patches')
-rw-r--r--files/nixpkgs-patches/383432.diff217
1 files changed, 217 insertions, 0 deletions
diff --git a/files/nixpkgs-patches/383432.diff b/files/nixpkgs-patches/383432.diff
new file mode 100644
index 0000000..faa7e77
--- /dev/null
+++ b/files/nixpkgs-patches/383432.diff
@@ -0,0 +1,217 @@
+diff --git a/pkgs/development/libraries/mesa/common.nix b/pkgs/development/libraries/mesa/common.nix
+index 8439861cf36c8..db33ea5d30751 100644
+--- a/pkgs/development/libraries/mesa/common.nix
++++ b/pkgs/development/libraries/mesa/common.nix
+@@ -5,14 +5,14 @@
+ # nix build .#legacyPackages.x86_64-darwin.mesa .#legacyPackages.aarch64-darwin.mesa
+ rec {
+ pname = "mesa";
+- version = "24.3.4";
++ version = "25.0.0";
+
+ src = fetchFromGitLab {
+ domain = "gitlab.freedesktop.org";
+ owner = "mesa";
+ repo = "mesa";
+ rev = "mesa-${version}";
+- hash = "sha256-1RUHbTgcCxdDrWjqB0EG4Ny/nwdjQHHpyPauiW/yogU=";
++ hash = "sha256-ut6fB2m850Bx08V43TZ0WNoeDLZov76FtYPz6UFFjvQ=";
+ };
+
+ meta = {
+diff --git a/pkgs/development/libraries/mesa/cross_clc.patch b/pkgs/development/libraries/mesa/cross_clc.patch
+deleted file mode 100644
+index cb29e57ec3493..0000000000000
+--- a/pkgs/development/libraries/mesa/cross_clc.patch
++++ /dev/null
+@@ -1,90 +0,0 @@
+-commit f063e9f74b45f34e4ac570a90901253bf8e64efd
+-Author: Mary Guillemard <mary.guillemard@collabora.com>
+-Date: 2024-12-02 09:11:35 +0100
+-
+- meson: Add mesa-clc and install-mesa-clc options
+-
+- Due to the cross build issues in current meson, we adds new options to
+- allow mesa_clc and vtn_bindgen to be installed or searched on the
+- system.
+-
+- Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
+- Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
+- Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
+- Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719>
+-
+-diff --git a/meson.build b/meson.build
+-index de9c9af53a1..e37325ec176 100644
+---- a/meson.build
+-+++ b/meson.build
+-@@ -808,7 +808,7 @@ if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv')
+- endif
+-
+- with_clover_spirv = with_gallium_clover and get_option('opencl-spirv')
+--with_clc = with_microsoft_clc or with_intel_clc or with_gallium_asahi or with_asahi_vk or with_gallium_rusticl or with_clover_spirv
+-+with_clc = get_option('mesa-clc') != 'auto' or with_microsoft_clc or with_intel_clc or with_gallium_asahi or with_asahi_vk or with_gallium_rusticl
+-
+- dep_clc = null_dep
+- if with_gallium_clover or with_clc
+-diff --git a/meson_options.txt b/meson_options.txt
+-index 79ee65e6094..8f22b36e5fb 100644
+---- a/meson_options.txt
+-+++ b/meson_options.txt
+-@@ -744,3 +744,20 @@ option(
+- 'none', 'dri2'
+- ],
+- )
+-+
+-+option(
+-+ 'mesa-clc',
+-+ type : 'combo',
+-+ value : 'auto',
+-+ choices : [
+-+ 'enabled', 'system', 'auto'
+-+ ],
+-+ description : 'Build the mesa-clc compiler or use a system version.'
+-+)
+-+
+-+option(
+-+ 'install-mesa-clc',
+-+ type : 'boolean',
+-+ value : false,
+-+ description : 'Install the mesa-clc compiler (if needed for cross builds).'
+-+)
+-diff --git a/src/compiler/clc/meson.build b/src/compiler/clc/meson.build
+-index 74767d08de2..4875d71ca21 100644
+---- a/src/compiler/clc/meson.build
+-+++ b/src/compiler/clc/meson.build
+-@@ -117,15 +117,20 @@ idep_mesaclc = declare_dependency(
+- link_args : _idep_mesaclc_link_args,
+- )
+-
+--prog_mesa_clc = executable(
+-- 'mesa_clc',
+-- ['mesa_clc.c'],
+-- include_directories : [inc_include, inc_src],
+-- c_args : [pre_args, no_override_init_args],
+-- link_args : [ld_args_build_id],
+-- dependencies : [idep_mesaclc, dep_llvm, dep_spirv_tools, idep_getopt],
+-- # If we can run host binaries directly, just build mesa_clc for the host.
+-- # Most commonly this happens when doing a cross compile from an x86_64 build
+-- # machine to an x86 host
+-- native : not meson.can_run_host_binaries(),
+--)
+-+if get_option('mesa-clc') == 'system'
+-+ prog_mesa_clc = find_program('mesa_clc', native : true)
+-+else
+-+ prog_mesa_clc = executable(
+-+ 'mesa_clc',
+-+ ['mesa_clc.c'],
+-+ include_directories : [inc_include, inc_src],
+-+ c_args : [pre_args, no_override_init_args],
+-+ link_args : [ld_args_build_id],
+-+ dependencies : [idep_mesaclc, dep_llvm, dep_spirv_tools, idep_getopt],
+-+ # If we can run host binaries directly, just build mesa_clc for the host.
+-+ # Most commonly this happens when doing a cross compile from an x86_64 build
+-+ # machine to an x86 host
+-+ native : not meson.can_run_host_binaries(),
+-+ install : get_option('install-mesa-clc'),
+-+ )
+-+endif
+diff --git a/pkgs/development/libraries/mesa/darwin.nix b/pkgs/development/libraries/mesa/darwin.nix
+index 55392071010a9..1a458523632ec 100644
+--- a/pkgs/development/libraries/mesa/darwin.nix
++++ b/pkgs/development/libraries/mesa/darwin.nix
+@@ -27,18 +27,6 @@ stdenv.mkDerivation {
+ meta
+ ;
+
+- # Darwin build fixes. FIXME: remove in 25.1.
+- patches = [
+- (fetchpatch {
+- url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/e89eba0796b3469f1d2cdbb600309f6231a8169d.patch";
+- hash = "sha256-0EP0JsYy+UTQ+eGd3sMfoLf1R+2e8n1flmQAHq3rCR4=";
+- })
+- (fetchpatch {
+- url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/568a4ca899762fe96fc9b34d2288d07e6656af87.patch";
+- hash = "sha256-uLxa5vA3/cYAIJT9h7eBQ1EBu4MnMg9R5uGAHzTb5Fc=";
+- })
+- ];
+-
+ outputs = [
+ "out"
+ "dev"
+diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
+index 633770b6862c8..c1e950c2e5167 100644
+--- a/pkgs/development/libraries/mesa/default.nix
++++ b/pkgs/development/libraries/mesa/default.nix
+@@ -138,9 +138,6 @@ in stdenv.mkDerivation {
+
+ patches = [
+ ./opencl.patch
+- # cherry-picked from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32719
+- # safe to remove for versions > 24.3.2
+- ./cross_clc.patch
+ ];
+
+ postPatch = ''
+@@ -206,14 +203,13 @@ in stdenv.mkDerivation {
+ (lib.mesonOption "freedreno-kmds" "msm,kgsl,virtio,wsl")
+
+ # Enable Intel RT stuff when available
+- (lib.mesonBool "install-intel-clc" true)
+- (lib.mesonBool "install-mesa-clc" true)
+ (lib.mesonEnable "intel-rt" stdenv.hostPlatform.isx86_64)
++
++ # Required for OpenCL
+ (lib.mesonOption "clang-libdir" "${lib.getLib llvmPackages.clang-unwrapped}/lib")
+
+ # Clover, old OpenCL frontend
+ (lib.mesonOption "gallium-opencl" "icd")
+- (lib.mesonBool "opencl-spirv" true)
+
+ # Rusticl, new OpenCL frontend
+ (lib.mesonBool "gallium-rusticl" true)
+@@ -221,12 +217,18 @@ in stdenv.mkDerivation {
+ # meson auto_features enables this, but we do not want it
+ (lib.mesonEnable "android-libbacktrace" false)
+ (lib.mesonEnable "microsoft-clc" false) # Only relevant on Windows (OpenCL 1.2 API on top of D3D12)
++
++ # Build and install extra tools for cross
++ (lib.mesonBool "install-mesa-clc" true)
++ (lib.mesonBool "install-precomp-compiler" true)
++
++ # Disable valgrind on targets where it's not available
+ (lib.mesonEnable "valgrind" withValgrind)
+ ] ++ lib.optionals enablePatentEncumberedCodecs [
+ (lib.mesonOption "video-codecs" "all")
+ ] ++ lib.optionals needNativeCLC [
+- (lib.mesonOption "intel-clc" "system")
+ (lib.mesonOption "mesa-clc" "system")
++ (lib.mesonOption "precomp-compiler" "system")
+ ];
+
+ strictDeps = true;
+@@ -308,6 +310,7 @@ in stdenv.mkDerivation {
+
+ postInstall = ''
+ # Move driver-related bits to $drivers
++ moveToOutput "lib/gallium-pipe" $drivers
+ moveToOutput "lib/gbm" $drivers
+ moveToOutput "lib/lib*_mesa*" $drivers
+ moveToOutput "lib/libgallium*" $drivers
+@@ -339,7 +342,7 @@ in stdenv.mkDerivation {
+
+ moveToOutput bin/intel_clc $driversdev
+ moveToOutput bin/mesa_clc $driversdev
+- moveToOutput lib/gallium-pipe $opencl
++ moveToOutput bin/vtn_bindgen $driversdev
+ moveToOutput "lib/lib*OpenCL*" $opencl
+ moveToOutput "lib/libOSMesa*" $osmesa
+ moveToOutput bin/spirv2dxil $spirv2dxil
+@@ -392,7 +395,7 @@ in stdenv.mkDerivation {
+
+ env.NIX_CFLAGS_COMPILE = toString ([
+ "-UPIPE_SEARCH_DIR"
+- "-DPIPE_SEARCH_DIR=\"${placeholder "opencl"}/lib/gallium-pipe\""
++ "-DPIPE_SEARCH_DIR=\"${placeholder "drivers"}/lib/gallium-pipe\""
+ ]);
+
+ passthru = {