about summary refs log tree commit diff
path: root/pkgs/development/libraries/mesa/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/mesa/default.nix')
-rw-r--r--pkgs/development/libraries/mesa/default.nix17
1 files changed, 9 insertions, 8 deletions
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 94a72143a71f..fb5f6b1d817c 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -55,13 +55,13 @@
     "svga" # VMWare virtualized GPU
     "virgl" # QEMU virtualized GPU (aka VirGL)
     "zink" # generic OpenGL over Vulkan, experimental
-  ] ++ lib.optionals (stdenv.isAarch64 || stdenv.isAarch32) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) [
     "etnaviv" # Vivante GPU designs (mostly NXP/Marvell SoCs)
     "freedreno" # Qualcomm Adreno (all Qualcomm SoCs)
     "lima" # ARM Mali 4xx
     "panfrost" # ARM Mali Midgard and up (T/G series)
     "vc4" # Broadcom VC4 (Raspberry Pi 0-3)
-  ] ++ lib.optionals stdenv.isAarch64 [
+  ] ++ lib.optionals stdenv.hostPlatform.isAarch64 [
     "tegra" # Nvidia Tegra SoCs
     "v3d" # Broadcom VC5 (Raspberry Pi 4)
   ] ++ lib.optionals stdenv.hostPlatform.isx86 [
@@ -78,7 +78,7 @@
     # QEMU virtualized GPU (aka VirGL)
     # Requires ATOMIC_INT_LOCK_FREE == 2.
     "virtio"
-  ] ++ lib.optionals stdenv.isAarch64 [
+  ] ++ lib.optionals stdenv.hostPlatform.isAarch64 [
     "broadcom" # Broadcom VC5 (Raspberry Pi 4, aka V3D)
     "freedreno" # Qualcomm Adreno (all Qualcomm SoCs)
     "imagination-experimental" # PowerVR Rogue (currently N/A)
@@ -170,7 +170,7 @@ in stdenv.mkDerivation {
 
   # Needed to discover llvm-config for cross
   preConfigure = ''
-    PATH=${llvmPackages.libllvm.dev}/bin:$PATH
+    PATH=${lib.getDev llvmPackages.libllvm}/bin:$PATH
   '';
 
   mesonFlags = [
@@ -203,8 +203,8 @@ in stdenv.mkDerivation {
 
     # Enable Intel RT stuff when available
     (lib.mesonBool "install-intel-clc" true)
-    (lib.mesonEnable "intel-rt" stdenv.isx86_64)
-    (lib.mesonOption "clang-libdir" "${llvmPackages.clang-unwrapped.lib}/lib")
+    (lib.mesonEnable "intel-rt" stdenv.hostPlatform.isx86_64)
+    (lib.mesonOption "clang-libdir" "${lib.getLib llvmPackages.clang-unwrapped}/lib")
 
     # Clover, old OpenCL frontend
     (lib.mesonOption "gallium-opencl" "icd")
@@ -289,11 +289,12 @@ in stdenv.mkDerivation {
     rustPlatform.bindgenHook
     wayland-scanner
   ] ++ lib.optionals needNativeCLC [
-    buildPackages.mesa.driversdev
+    # `or null` to not break eval with `attribute missing` on darwin to linux cross
+    (buildPackages.mesa.driversdev or null)
   ];
 
   disallowedRequisites = lib.optionals needNativeCLC [
-    buildPackages.mesa.driversdev
+    (buildPackages.mesa.driversdev or null)
   ];
 
   propagatedBuildInputs = [ libdrm ];