From a1f57027551caac627c56f085233744533576f11 Mon Sep 17 00:00:00 2001 From: Jona Stubbe Date: Wed, 22 Aug 2018 19:27:23 +0200 Subject: mesa: restructure driver selection to be more architecture-neutral This allows Mesa to also build on ppc64le. --- pkgs/development/libraries/mesa/default.nix | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'pkgs') diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index e1a9477dcd6..2f8a4bda88a 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -24,24 +24,25 @@ with stdenv.lib; if ! lists.elem stdenv.system platforms.mesaPlatforms then - throw "unsupported platform for Mesa" + throw "${stdenv.system}: unsupported platform for Mesa" else let - defaultGalliumDrivers = - if stdenv.isAarch32 - then ["virgl" "nouveau" "freedreno" "vc4" "etnaviv" "imx"] - else if stdenv.isAarch64 - then ["virgl" "nouveau" "vc4" ] - else ["virgl" "svga" "i915" "r300" "r600" "radeonsi" "nouveau"]; - defaultDriDrivers = - if (stdenv.isAarch32 || stdenv.isAarch64) - then ["nouveau"] - else ["i915" "i965" "nouveau" "radeon" "r200"]; + inherit (stdenv) hostPlatform; + defaultGalliumDrivers = [ "virgl" "nouveau" ] + ++ (if hostPlatform.isAarch32 || hostPlatform.isAarch64 then + [ "vc4" ] + ++ lib.optionals hostPlatform.isAarch64 [ "freedreno" "etnaviv" "imx" ] + else + [ "r300" "r600" "radeonsi"] + ++ lib.optionals hostPlatform.isx86 [ "i915" "svga" ] + ); + defaultDriDrivers = [ "nouveau" ] + ++ lib.optionals (!hostPlatform.isAarch32 && !hostPlatform.isAarch64) [ "radeon" "r200" ] + ++ lib.optionals hostPlatform.isx86 [ "i915" "i965" ]; defaultVulkanDrivers = - if (stdenv.isAarch32 || stdenv.isAarch64) - then [] - else ["intel"] ++ lib.optional enableRadv "radeon"; + lib.optional hostPlatform.isx86 "intel" + ++ lib.optional enableRadv "radeon"; in let gallium_ = galliumDrivers; dri_ = driDrivers; vulkan_ = vulkanDrivers; in -- cgit 1.4.1