diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/mesa')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/mesa/default.nix | 31 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/mesa/link-radv-with-ld_args_build_id.patch | 25 |
2 files changed, 50 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/development/libraries/mesa/default.nix b/nixpkgs/pkgs/development/libraries/mesa/default.nix index 03977c74f11d..cf452fded14e 100644 --- a/nixpkgs/pkgs/development/libraries/mesa/default.nix +++ b/nixpkgs/pkgs/development/libraries/mesa/default.nix @@ -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.0.7"; # Update only to the final (last planned) release (i.e. X.Y.MAX)? + version = "20.1.7"; 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 = "0y517qpdg6v6dsdgzb365p03m30511sbyh8pq0mcvhvjwy7javpy"; + sha256 = "1252mgwiy05nz8mm4gjkzmnjfvdz5yv1shnsr837cdnan86dvsad"; }; prePatch = "patchShebangs ."; @@ -58,7 +58,22 @@ 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 - ] # do not prefix user provided dri-drivers-path + ./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"; @@ -81,6 +96,12 @@ stdenv.mkDerivation { substituteInPlace meson.build --replace \ "find_program('pkg-config')" \ "find_program('${buildPackages.pkg-config.targetPrefix}pkg-config')" + + # The drirc.d directory cannot be installed to $drivers as that would cause a cyclic dependency: + substituteInPlace src/util/xmlconfig.c --replace \ + 'DATADIR "/drirc.d"' '"${placeholder "out"}/drirc.d"' + substituteInPlace src/util/meson.build --replace \ + "get_option('datadir')" "'${placeholder "out"}'" ''; outputs = [ "out" "dev" "drivers" ] ++ lib.optional enableOSMesa "osmesa"; @@ -88,6 +109,7 @@ stdenv.mkDerivation { # TODO: Figure out how to enable opencl without having a runtime dependency on clang mesonFlags = [ "--sysconfdir=/etc" + "--datadir=${placeholder "drivers"}/share" # Vendor files # Don't build in debug mode # https://gitlab.freedesktop.org/mesa/mesa/blob/master/docs/meson.html#L327 @@ -158,9 +180,6 @@ stdenv.mkDerivation { mv $out/lib/lib*_mesa* $drivers/lib fi - # move vendor files - mv $out/share/ $drivers/ - # Update search path used by glvnd for js in $drivers/share/glvnd/egl_vendor.d/*.json; do substituteInPlace "$js" --replace '"libEGL_' '"'"$drivers/lib/libEGL_" 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 new file mode 100644 index 000000000000..0a660332392d --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/mesa/link-radv-with-ld_args_build_id.patch @@ -0,0 +1,25 @@ +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 |