# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/mesa/mesa.conf # Copyright (C) 2008 - 2024 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- if atstage cross; then # translate native llvm-config libraries to sysroot var_append GCC_WRAPPER_FILTER '|' "sed 's,$root/TOOLCHAIN.*libLLVM\(.*\)\.[as].*,-lLLVM\1,'" # remove native llvm-config include var_append GCC_WRAPPER_REMOVE ' ' "-I$root/TOOLCHAIN/cross/include" var_append GCC_WRAPPER_REMOVE ' ' "-isystem$root/TOOLCHAIN/cross/include" var_append GCC_WRAPPER_REMOVE ' ' "-L$root/TOOLCHAIN/cross/lib" var_append GCC_WRAPPER_INSERT ' ' "-I$root`pkgprefix includedir libxcb`" fi # binutils complains about corrupted Thin archives, so disable for now: [ $arch = powerpc64 ] && hook_add inmake 5 "sed -i s/csrDT/csrD/ objdir/build.ninja" var_append GCC_WRAPPER_REMOVE ' ' '-Werror=int-conversion' # at least x32 :-/ galdrv= vuldrv= platforms= # drm pkginstalled libx11 && var_append platforms ',' 'x11' pkginstalled wayland && var_append platforms ',' 'wayland' pkginstalled libglvnd && var_append mesonopt ' ' '-Dglvnd=true' if pkginstalled libdrm; then var_append mesonopt ' ' '-Dosmesa=true -Dgbm=enabled' var_append mesonopt ' ' '-Degl=enabled -Dglx=auto' var_append mesonopt ' ' '-Dplatforms=$platforms -Dgles1=enabled -Dgles2=enabled' var_append mesonopt ' ' '-Dvideo-codecs=h264dec,h264enc,h265dec,h265enc,vc1dec' var_append galdrv ',' "swrast,r600,nouveau,virgl,zink" [ "$arch_sizeof_char_p" = 8 ] && var_append galdrv ',' "i915" case "$arch" in alpha) var_remove galdrv ',' "i915" ;; sparc) var_remove dridrv ',' "r100,r200,nouveau" var_remove galdrv ',' "r600,nouveau" ;; superh) var_remove galdrv ',' "r600,nouveau" ;; x86) var_remove galdrv ',' "i915" var_append galdrv ',' "svga" ;; x86-64) var_append galdrv ',' "svga,crocus" ;; esac else var_append mesonopt ' ' '-Ddri3=disabled -Dglx=disabled' fi pkginstalled libxshmfence || var_append mesonopt ' ' '-Ddri3=disabled' if pkginstalled llvm; then var_append mesonopt ' ' '-Dllvm=enabled -Dshared-llvm=enabled' var_append vuldrv ',' "swrast" if pkginstalled libdrm; then var_append mesonopt ' ' '-Dgallium-xa=enabled' var_append galdrv ',' "iris,r300,radeonsi" var_append vuldrv ',' "amd,imagination-experimental" pkginstalled rustc && var_append vuldrv ',' "nouveau-experimental" [ "$arch_sizeof_char_p" = 8 ] && var_append vuldrv ',' "intel" case $arch in sparc) var_remove galdrv ',' "r300,radeonsi" var_remove vuldrv ',' "amd" var_remove mesonopt ' ' '-Dgallium-xa=enabled' ;; superh) var_remove mesonopt ' ' '-Dgallium-xa=enabled' ;; arm*) # TODO: add asahi and all its new spirv libclc deps var_append galdrv ',' "etnaviv,freedreno,kmsro,lima,panfrost,tegra,v3d,vc4" var_append vuldrv ',' "broadcom,freedreno" ;; esac fi else var_append mesonopt ' ' '-Dllvm=false' fi pkginstalled vulkan-headers || var_remove galdrv ',' 'zink' [ "$SDECFG_DEFAULT_CC" = clang ] && var_remove galdrv ',' "radeonsi" && var_remove valdrv ',' "amd" var_append mesonopt ' ' "-Dvulkan-drivers=$vuldrv" var_append mesonopt ' ' "-Dgallium-drivers=$galdrv" var_append mesonopt ' ' '-Dshared-glapi=enabled'