[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/12: gnu: mesa: Fix cross-compiling.
From: |
guix-commits |
Subject: |
02/12: gnu: mesa: Fix cross-compiling. |
Date: |
Sun, 15 Oct 2023 06:15:55 -0400 (EDT) |
efraim pushed a commit to branch master
in repository guix.
commit 2aab62fe24307cd0b9a5f168bae0a004b1f54f67
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Oct 15 13:00:24 2023 +0300
gnu: mesa: Fix cross-compiling.
* gnu/packages/gl.scm (mesa)[native-inputs]: When cross-compiling add
pkg-config-for-build, wayland, wayland-protocols.
[arguments]: Adjust configure-flags to use cond to also match the
architecture when cross-compiling. Add phase when cross-compilng to set
the location of llvm-config.
---
gnu/packages/gl.scm | 52 ++++++++++++++++++++++++++++++++--------------------
1 file changed, 32 insertions(+), 20 deletions(-)
diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm
index fd59ad9605..6472158abc 100644
--- a/gnu/packages/gl.scm
+++ b/gnu/packages/gl.scm
@@ -301,32 +301,37 @@ also known as DXTn or DXTC) for Mesa.")
wayland-protocols
`(,zstd "lib")))
(native-inputs
- (list bison
- flex
- gettext-minimal
- glslang
- pkg-config
- python-libxml2 ;for OpenGL ES 1.1 and 2.0 support
- python-mako
- python-wrapper
- (@ (gnu packages base) which)))
+ (cons* bison
+ flex
+ gettext-minimal
+ glslang
+ pkg-config
+ python-libxml2 ;for OpenGL ES 1.1 and 2.0 support
+ python-mako
+ python-wrapper
+ (@ (gnu packages base) which)
+ (if (%current-target-system)
+ (list pkg-config-for-build
+ wayland
+ wayland-protocols)
+ '())))
(outputs '("out" "bin"))
(arguments
(list
#:configure-flags
#~(list
- #$@(match (%current-system)
- ("aarch64-linux"
+ #$@(cond
+ ((target-aarch64?)
;; TODO: Fix svga driver for non-Intel architectures.
'("-Dgallium-drivers=etnaviv,freedreno,kmsro,lima,nouveau,\
panfrost,r300,r600,swrast,tegra,v3d,vc4,virgl"))
- ("armhf-linux"
+ ((target-arm32?)
;; Freedreno FTBFS when built on a 64-bit machine.
'("-Dgallium-drivers=etnaviv,kmsro,lima,nouveau,panfrost,\
r300,r600,swrast,tegra,v3d,vc4,virgl"))
- ((or "powerpc64le-linux" "powerpc-linux" "riscv64-linux")
+ ((or (target-ppc64le?) (target-ppc32?) (target-riscv64?))
'("-Dgallium-drivers=nouveau,r300,r600,radeonsi,swrast,virgl"))
- (_
+ (else
'("-Dgallium-drivers=crocus,iris,nouveau,r300,r600,radeonsi,\
svga,swrast,virgl")))
;; Enable various optional features. TODO: opencl requires libclc,
@@ -344,16 +349,16 @@ svga,swrast,virgl")))
"-Dshared-glapi=enabled"
;; Explicitly enable Vulkan on some architectures.
- #$@(match (%current-system)
- ((or "i686-linux" "x86_64-linux")
+ #$@(cond
+ ((or (target-x86-32?) (target-x86-64?))
'("-Dvulkan-drivers=intel,intel_hasvk,amd,swrast"))
- ((or "powerpc64le-linux" "powerpc-linux")
+ ((or (target-ppc64le?) (target-ppc32?))
'("-Dvulkan-drivers=amd,swrast"))
- ("aarch64-linux"
+ ((target-aarch64?)
'("-Dvulkan-drivers=freedreno,amd,broadcom,swrast"))
- ("riscv64-linux"
+ ((target-riscv64?)
'("-Dvulkan-drivers=amd,swrast"))
- (_
+ (else
'("-Dvulkan-drivers=auto")))
;; Enable the Vulkan overlay layer on all architectures.
@@ -381,6 +386,13 @@ svga,swrast,virgl")))
(guix build meson-build-system))
#:phases
#~(modify-phases %standard-phases
+ #$@(if (%current-target-system)
+ #~((add-after 'unpack 'fix-cross-compiling
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; It isn't a problem to use the host's llvm-config.
+ (setenv "LLVM_CONFIG"
+ (search-input-file inputs "/bin/llvm-config")))))
+ #~())
(add-after 'unpack 'disable-failing-test
(lambda _
;; Disable the intel vulkan (anv_state_pool) tests, as they may
- branch master updated (d2923babf3 -> e1600546b9), guix-commits, 2023/10/15
- 02/12: gnu: mesa: Fix cross-compiling.,
guix-commits <=
- 12/12: gnu: xcb-util-errors: Fix cross-compiling., guix-commits, 2023/10/15
- 09/12: gnu: libxkbcommon: Fix cross-compiling., guix-commits, 2023/10/15
- 07/12: gnu: sway: Fix cross-compiling., guix-commits, 2023/10/15
- 01/12: gnu: libinput-minimal: Fix cross-compiling., guix-commits, 2023/10/15
- 04/12: gnu: libtirpc: Keep reference to mit-krb5 when cross-compiling., guix-commits, 2023/10/15
- 05/12: gnu: poppler: Fix cross-compiling., guix-commits, 2023/10/15
- 11/12: gnu: xorg-server-xwayland: Fix cross-compiling., guix-commits, 2023/10/15
- 03/12: gnu: nss: Fix cross-compiling., guix-commits, 2023/10/15
- 08/12: gnu: swaybg: Fix cross-compiling., guix-commits, 2023/10/15
- 06/12: gnu: wlroots: Fix cross-compiling., guix-commits, 2023/10/15