├── .gitignore ├── LICENSE ├── PKGBUILD ├── README.md ├── customization.cfg ├── llvm32.native └── mesa-userpatches └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | !.gitignore 3 | *~ 4 | *.orig 5 | *.log 6 | *.run 7 | *.tgz 8 | *.xz 9 | *.pkg 10 | *.bak 11 | *.tar.gz 12 | *.tar.zst 13 | *.old 14 | *.db 15 | *.files 16 | *.mymesapatch 17 | src/ 18 | pkg/ 19 | mesa-aco/ 20 | mesa/ 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Disclaimer 2 | 3 | Mesa is a 3-D graphics library with an API which is very similar to 4 | that of OpenGL* 5 | To the extent that Mesa utilizes the OpenGL command syntax or state 6 | machine, it is being used with authorization from Silicon Graphics, 7 | Inc.(SGI). However, the author does not possess an OpenGL license 8 | from SGI, and makes no claim that Mesa is in any way a compatible 9 | replacement for OpenGL or associated with SGI. Those who want a 10 | licensed implementation of OpenGL should contact a licensed 11 | vendor. 12 | 13 | Please do not refer to the library as MesaGL (for legal 14 | reasons). It's just Mesa or The Mesa 3-D graphics 15 | library 16 | 17 | * OpenGL is a trademark of Silicon Graphics Incorporated. 18 | 19 | License / Copyright Information 20 | 21 | The Mesa distribution consists of several components. Different copyrights 22 | and licenses apply to different components. For example, GLUT is copyrighted 23 | by Mark Kilgard, some demo programs are copyrighted by SGI, some of the Mesa 24 | device drivers are copyrighted by their authors. See below for a list of 25 | Mesa's main components and the license for each. 26 | 27 | The core Mesa library is licensed according to the terms of the MIT license. 28 | This allows integration with the XFree86, Xorg and DRI projects. 29 | 30 | The default Mesa license is as follows: 31 | 32 | Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 33 | 34 | Permission is hereby granted, free of charge, to any person obtaining a 35 | copy of this software and associated documentation files (the "Software"), 36 | to deal in the Software without restriction, including without limitation 37 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 38 | and/or sell copies of the Software, and to permit persons to whom the 39 | Software is furnished to do so, subject to the following conditions: 40 | 41 | The above copyright notice and this permission notice shall be included 42 | in all copies or substantial portions of the Software. 43 | 44 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 45 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 46 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 47 | BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 48 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 49 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 50 | 51 | Attention, Contributors 52 | 53 | When contributing to the Mesa project you must agree to the licensing terms 54 | of the component to which you're contributing. 55 | The following section lists the primary components of the Mesa distribution 56 | and their respective licenses. 57 | 58 | 59 | Mesa Component Licenses 60 | 61 | Component Location Primary Author License 62 | ---------------------------------------------------------------------------- 63 | Main Mesa code src/mesa/ Brian Paul Mesa (MIT) 64 | 65 | Device drivers src/mesa/drivers/* See drivers See drivers 66 | 67 | Ext headers include/GL/glext.h SGI SGI Free B 68 | include/GL/glxext.h 69 | 70 | GLUT src/glut/ Mark Kilgard Mark's copyright 71 | 72 | Mesa GLU library src/glu/mesa/ Brian Paul GNU-LGPL 73 | 74 | SGI GLU library src/glu/sgi/ SGI SGI Free B 75 | 76 | demo programs progs/demos/ various see source files 77 | 78 | X demos progs/xdemos/ Brian Paul see source files 79 | 80 | SGI demos progs/samples/ SGI SGI copyright 81 | 82 | RedBook demos progs/redbook/ SGI SGI copyright 83 | -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Originally based on AUR pkgbuilds from Lone_Wolf - https://aur.archlinux.org/packages/mesa-git/ - https://aur.archlinux.org/packages/lib32-mesa-git/ 2 | # Glitched by: Tk-Glitch 3 | 4 | plain ' .---.` `.---.' 5 | plain ' `/syhhhyso- -osyhhhys/`' 6 | plain ' .syNMdhNNhss/``.---.``/sshNNhdMNys.' 7 | plain ' +sdMh.`+MNsssssssssssssssNM+`.hMds+' 8 | plain ' :syNNdhNNhssssssssssssssshNNhdNNys:' 9 | plain ' /ssyhhhysssssssssssssssssyhhhyss/' 10 | plain ' .ossssssssssssssssssssssssssssso.' 11 | plain ' :sssssssssssssssssssssssssssssssss:' 12 | plain ' /sssssssssssssssssssssssssssssssssss/' 13 | plain ' :sssssssssssssoosssssssoosssssssssssss:' 14 | plain ' osssssssssssssoosssssssoossssssssssssso' 15 | plain ' osssssssssssyyyyhhhhhhhyyyyssssssssssso' 16 | plain ' /yyyyyyhhdmmmmNNNNNNNNNNNmmmmdhhyyyyyy/' 17 | plain ' smmmNNNNNNNNNNNNNNNNNNNNNNNNNNNNNmmms' 18 | plain ' /dNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNd/' 19 | plain ' `:sdNNNNNNNNNNNNNNNNNNNNNNNNNds:`' 20 | plain ' `-+shdNNNNNNNNNNNNNNNdhs+-`' 21 | plain ' `.-:///////:-.`' 22 | 23 | if [ -z "$_where" ]; then 24 | export _where="$PWD" # track basedir as different Arch based distros are moving srcdir around 25 | fi 26 | 27 | source "$_where"/customization.cfg 28 | 29 | # Load external configuration file if present. Available variable values will overwrite customization.cfg ones. 30 | if [ -e "$_where/mesa-userpatches/user.cfg" ]; then 31 | source "$_where/mesa-userpatches/user.cfg" && msg2 "User.cfg config loaded" 32 | elif [ -e "$_EXT_CONFIG_PATH" ]; then 33 | source "$_EXT_CONFIG_PATH" && msg2 "External configuration file $_EXT_CONFIG_PATH will be used to override customization.cfg values.\n" 34 | fi 35 | 36 | pkgname=('mesa-tkg-git') 37 | if [ "$_lib32" == "true" ]; then 38 | pkgname+=('lib32-mesa-tkg-git') 39 | fi 40 | 41 | # custom mesa commit to pass to git 42 | if [ -n "$_mesa_commit" ]; then 43 | _mesa_version="#commit=${_mesa_commit}" 44 | else 45 | _mesa_version="#branch=${_mesa_branch}" 46 | fi 47 | 48 | pkgdesc="an open-source implementation of the OpenGL specification, git version" 49 | pkgver=0 50 | pkgrel=1 51 | arch=('x86_64') 52 | makedepends=('git' 'python-mako' 'python-ply' 'xorgproto' 'libxml2' 'libx11' 'libvdpau' 'libva' 53 | 'elfutils' 'libomxil-bellagio' 'libxrandr' 'ocl-icd' 'libgcrypt' 'wayland' 54 | 'wayland-protocols' 'meson' 'ninja' 'libdrm' 'xorgproto' 'libdrm' 'libxshmfence' 55 | 'libxxf86vm' 'libxdamage' 'libclc' 'libglvnd' 'libunwind' 'lm_sensors' 'libxrandr' 56 | 'valgrind' 'glslang' 'byacc' 'wget' 'flex' 'bison' 'rust' 'rust-bindgen' 'spirv-llvm-translator' 57 | 'cbindgen' 'python-packaging' 'python-yaml') 58 | 59 | if [ "$_lib32" == "true" ]; then 60 | makedepends+=('lib32-libxml2' 'lib32-libx11' 'lib32-libdrm' 'lib32-libxshmfence' 'lib32-libxxf86vm' 61 | 'lib32-gcc-libs' 'lib32-libvdpau' 'lib32-libelf' 'lib32-libgcrypt' 62 | 'lib32-lm_sensors' 'lib32-libxdamage' 'gcc-multilib' 'lib32-libunwind' 'lib32-libglvnd' 63 | 'lib32-libva' 'lib32-wayland' 'lib32-libvdpau' 'lib32-libxrandr' 'lib32-expat' 64 | 'lib32-spirv-llvm-translator' 'lib32-rust-libs') 65 | fi 66 | 67 | depends=('libdrm' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf' 'libomxil-bellagio' 'libunwind' 68 | 'libglvnd' 'wayland' 'lm_sensors' 'libclc' 'glslang' 'zstd' 'vulkan-icd-loader') 69 | if [ "$_lib32" == "true" ]; then 70 | depends+=('lib32-zstd' 'lib32-vulkan-icd-loader') 71 | fi 72 | optdepends=('opengl-man-pages: for the OpenGL API man pages') 73 | 74 | # Use ccache if available 75 | if pacman -Qq ccache &> /dev/null; then 76 | msg2 "ccache was found and will be used\n" 77 | _makepkg_options+=('ccache') 78 | else 79 | msg2 "ccache was not found and will not be used\n" 80 | fi 81 | 82 | if [ "$_lto" != "true" ]; then 83 | _makepkg_options+=('!lto') 84 | fi 85 | 86 | if [[ "$_additional_meson_flags" =~ "--buildtype debug" ]]; then 87 | _makepkg_options+=('debug !strip') 88 | fi 89 | 90 | options=(${_makepkg_options[@]}) 91 | 92 | url="https://www.mesa3d.org" 93 | license=('custom') 94 | 95 | _sourceurl="mesa::git+${_mesa_source}${_mesa_version}" 96 | _mesa_srcdir="mesa" 97 | 98 | source=("$_sourceurl" 99 | 'LICENSE' 100 | 'llvm32.native' 101 | ) 102 | md5sums=('SKIP' 103 | '5c65a0fe315dd347e09b1f2826a1df5a' 104 | '722c7b0a4f7ace13d9009996615da938') 105 | sha512sums=('SKIP' 106 | '25da77914dded10c1f432ebcbf29941124138824ceecaf1367b3deedafaecabc082d463abcfa3d15abff59f177491472b505bcb5ba0c4a51bb6b93b4721a23c2' 107 | '46874ef82f9794cfd4955ec1aa953b1a14848bfcf4019018e1932469cfc32ee7844d87dd5a798f6e0fca913ed95b1d6cc05b2d508d1c56d5122e37a872f237b3') 108 | 109 | function exit_cleanup { 110 | if [ "$pkgver" != "0" ]; then 111 | sed -i "s/pkgver=$pkgver.*/pkgver=0/g" "$_where"/PKGBUILD 112 | fi 113 | 114 | # Remove temporarily copied patches 115 | sleep 1 # Workarounds a race condition with ninja 116 | rm -rf "$_where"/*.mymesa* 117 | rm -f "$_where"/frogminer 118 | 119 | remove_deps 120 | 121 | msg2 "Cleanup done" 122 | } 123 | 124 | user_patcher() { 125 | # To patch the user because all your base are belong to us 126 | local _patches=("$_where"/*."${_userpatch_ext}revert") 127 | if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then 128 | if [ "$_user_patches_no_confirm" != "true" ]; then 129 | msg2 "Found ${#_patches[@]} 'to revert' userpatches for ${_userpatch_target}:" 130 | printf '%s\n' "${_patches[@]//*\//}" 131 | read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; 132 | fi 133 | if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then 134 | for _f in "${_patches[@]}"; do 135 | if [ -e "${_f}" ]; then 136 | msg2 "######################################################" 137 | msg2 "" 138 | msg2 "Reverting your own ${_userpatch_target} patch ${_f}" 139 | msg2 "" 140 | msg2 "######################################################" 141 | patch -Np1 -R < "${_f}" 142 | echo "Reverted your own patch ${_f}" >> "$_where"/last_build_config.log 143 | fi 144 | done 145 | fi 146 | fi 147 | 148 | _patches=("$_where"/*."${_userpatch_ext}patch") 149 | if [ ${#_patches[@]} -ge 2 ] || [ -e "${_patches}" ]; then 150 | if [ "$_user_patches_no_confirm" != "true" ]; then 151 | msg2 "Found ${#_patches[@]} userpatches for ${_userpatch_target}:" 152 | printf '%s\n' "${_patches[@]//*\//}" 153 | read -rp "Do you want to install it/them? - Be careful with that ;)"$'\n> N/y : ' _CONDITION; 154 | fi 155 | if [ "$_CONDITION" == "y" ] || [ "$_user_patches_no_confirm" == "true" ]; then 156 | for _f in "${_patches[@]}"; do 157 | if [ -e "${_f}" ]; then 158 | msg2 "######################################################" 159 | msg2 "" 160 | msg2 "Applying your own ${_userpatch_target} patch ${_f}" 161 | msg2 "" 162 | msg2 "######################################################" 163 | patch -Np1 < "${_f}" 164 | echo "Applied your own patch ${_f}" >> "$_where"/last_build_config.log 165 | fi 166 | done 167 | fi 168 | fi 169 | } 170 | 171 | # NINJAFLAGS is an env var used to pass commandline options to ninja 172 | # NOTE: It's your responbility to validate the value of $NINJAFLAGS. If unsure, don't set it. 173 | 174 | # MESA_WHICH_LLVM is an environment variable that determines which llvm package tree is used to built mesa-git against. 175 | # Adding a line to ~/.bashrc that sets this value is the simplest way to ensure a specific choice. 176 | # 177 | # 1: llvm-minimal-git (aur) preferred value 178 | # 2: AUR llvm-git 179 | # 3: llvm-git from LordHeavy unofficial repo 180 | # 4 llvm (stable from extra) Default value 181 | # 182 | 183 | if [[ ! $MESA_WHICH_LLVM ]] && [ ! -e "$_where"/frogminer ]; then 184 | plain "Which llvm package tree do you want to use to build mesa-tkg-git against ?" 185 | read -rp "`echo $' 1.llvm-minimal-git (AUR)\n 2.llvm-git (AUR)\n 3.llvm-git from LordHeavy unofficial repo\n > 4.llvm (default)\n choice[1-4?]: '`" MESA_WHICH_LLVM; 186 | touch "$_where"/frogminer 187 | fi 188 | # double dip 189 | if [ -z "$MESA_WHICH_LLVM" ] || [[ $MESA_WHICH_LLVM -le 0 ]] || [[ $MESA_WHICH_LLVM -ge 5 ]]; then 190 | MESA_WHICH_LLVM=4 191 | fi 192 | 193 | case $MESA_WHICH_LLVM in 194 | 1) 195 | # aur llvm-minimal-git 196 | makedepends+=('llvm-minimal-git') 197 | _llvm='llvm-libs-minimal-git' 198 | if [ "$_lib32" == "true" ]; then 199 | makedepends+=('lib32-llvm-minimal-git') 200 | _lib32_llvm='lib32-llvm-libs-minimal-git' 201 | fi 202 | msg2 "Using llvm-minimal-git (AUR)" 203 | echo "Using llvm-minimal-git (AUR)" >> "$_where"/last_build_config.log 204 | ;; 205 | 2) 206 | # aur llvm-git 207 | # depending on aur-llvm-* to avoid mixup with LH llvm-git 208 | makedepends+=('aur-llvm-git') 209 | _llvm='aur-llvm-libs-git' 210 | if [ "$_lib32" == "true" ]; then 211 | makedepends+=('aur-lib32-llvm-git') 212 | _lib32_llvm='aur-lib32-llvm-libs-git' 213 | fi 214 | msg2 "Using llvm-git (AUR)" 215 | echo "Using llvm-git (AUR)" >> "$_where"/last_build_config.log 216 | ;; 217 | 3) 218 | # mesa-git/llvm-git (lordheavy unofficial repo) 219 | makedepends+=('llvm-git' 'clang-git') 220 | _llvm='llvm-libs-git' 221 | if [ "$_lib32" == "true" ]; then 222 | makedepends+=('lib32-llvm-git') 223 | _lib32_llvm='lib32-llvm-libs-git' 224 | fi 225 | msg2 "Using llvm-git from LordHeavy unofficial repo" 226 | echo "Using llvm-git from LordHeavy unofficial repo" >> "$_where"/last_build_config.log 227 | ;; 228 | 4) 229 | # extra/llvm 230 | makedepends+=('llvm>=8.0.0' 'clang>=8.0.0') 231 | _llvm='llvm-libs>=8.0.0' 232 | if [ "$_lib32" == "true" ]; then 233 | makedepends+=('lib32-llvm>=8.0.0' 'lib32-clang>=8.0.0') 234 | _lib32_llvm='lib32-llvm-libs>=8.0.0' 235 | fi 236 | msg2 "Using llvm (default)" 237 | echo "Using llvm (default)" >> "$_where"/last_build_config.log 238 | ;; 239 | *) 240 | esac 241 | 242 | pkgver() { 243 | cd "$_mesa_srcdir" 244 | _ver=$( cat VERSION ) 245 | echo ${_ver/-/_}.$(git rev-list --count HEAD).$(git rev-parse --short HEAD) 246 | } 247 | 248 | prepare() { 249 | # cleanups 250 | cd "$srcdir/$_mesa_srcdir" 251 | git reset --hard HEAD 252 | git clean -xdf 253 | if [ -n "$_mesa_commit" ]; then 254 | git checkout "${_mesa_commit}" 255 | fi 256 | msg2 "Tree cleaned" 257 | 258 | # copy userpatches inside the PKGBUILD's dir 259 | for _file in "$_where"/mesa-userpatches/*.mymesa* 260 | do 261 | [ -e "$_file" ] && cp "$_file" "$_where" 262 | done 263 | 264 | if [ -n "$_mesa_prs" ]; then 265 | for _pr in ${_mesa_prs[@]}; do 266 | wget -O "$_where"/"$_pr".mymesapatch https://gitlab.freedesktop.org/mesa/mesa/merge_requests/"$_pr".diff 267 | done 268 | fi 269 | 270 | # Community patches 271 | if [ -n "$_community_patches" ]; then 272 | if [ ! -d "$_where/../community-patches" ]; then 273 | cd "$_where/.." && git clone https://github.com/Frogging-Family/community-patches.git && cd "$srcdir"/$_mesa_srcdir 274 | fi 275 | _community_patches=($_community_patches) 276 | for _p in ${_community_patches[@]}; do 277 | ln -s "$_where"/../community-patches/mesa-git/$_p "$_where"/ 278 | done 279 | fi 280 | 281 | # mesa user patches 282 | if [ "$_user_patches" == "true" ]; then 283 | _userpatch_target="mesa" 284 | _userpatch_ext="mymesa" 285 | echo -e "# Last ${pkgname} ${pkgver} configuration - $(date) :\n" > "$_where"/last_build_config.log 286 | echo -e "DRI drivers: ${_dri_drivers}" >> "$_where"/last_build_config.log 287 | echo -e "Gallium drivers: ${_gallium_drivers}" >> "$_where"/last_build_config.log 288 | echo -e "Vulkan drivers: ${_vulkan_drivers}\n" >> "$_where"/last_build_config.log 289 | user_patcher 290 | fi 291 | 292 | # Community/prs patches removal 293 | for _p in ${_community_patches[@]}; do 294 | rm -f "$_where"/$_p 295 | done 296 | for _pr in ${_mesa_prs[@]}; do 297 | rm -f "$_where"/$_pr.mymesapatch 298 | done 299 | 300 | cd "$srcdir" 301 | 302 | if [ "$_compiler" = "clang" ]; then 303 | echo "_compiler=clang" > "$_where"/frogminer 304 | else 305 | echo "_compiler=gcc" > "$_where"/frogminer 306 | fi 307 | 308 | # although removing _build folder in build() function feels more natural, 309 | # that interferes with the spirit of makepkg --noextract 310 | if [ -d _build64 ] && [ "$_NUKR" != "false" ]; then 311 | if [[ "$_additional_meson_flags" = *-Db_pgo=use* ]]; then 312 | find ./_build64 -type f ! -name '*.gcda' -delete 313 | else 314 | rm -rf _build64 315 | fi 316 | fi 317 | if [ -d _build32 ] && [ "$_NUKR" != "false" ]; then 318 | if [[ "$_additional_meson_flags" = *-Db_pgo=use* ]]; then 319 | find ./_build32 -type f ! -name '*.gcda' -delete 320 | else 321 | rm -rf _build32 322 | fi 323 | fi 324 | cd "$_where" 325 | } 326 | 327 | build () { 328 | if [ -n "$_custom_opt_flags" ]; then 329 | export CFLAGS="${_custom_opt_flags}" 330 | export CPPFLAGS="${_custom_opt_flags}" 331 | export CXXFLAGS="${_custom_opt_flags}" 332 | fi 333 | if [ "$_lto" != "true" ]; then 334 | export _lto="-D b_lto=false" 335 | else 336 | export _lto="-D b_lto=true" 337 | if [ "$_compiler" != "clang" ]; then 338 | warning "Enabling LTO on GCC is known to create issues with mesa. Consider using Clang instead of GCC." 339 | fi 340 | # With LTO, we'll hit `too many open files` if the limit is too low, so let's use some bif enough value for our current shell 341 | ulimit -Sn 4096 342 | fi 343 | 344 | # Selector fixes 345 | 346 | # dri drivers moved to the amber branch 347 | if [ "$_mesa_branch" = "amber" ] || ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor cdde031ac2c8124721655532ee6f4149e20e9c61 HEAD ); then 348 | _dri_inc="-D dri-drivers=${_dri_drivers} " 349 | fi 350 | 351 | # Syntax legacy compat 352 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor 138c003d22739b0d1e6860ed398dd511a44cde04 HEAD ); then 353 | _enabled_="enabled" 354 | _disabled_="disabled" 355 | else 356 | _enabled_="true" 357 | _disabled_="false" 358 | fi 359 | if [ "$_gallium_xa" = "false" ] || [ "$_gallium_xa" = "disabled" ]; then 360 | _gallium_xa="${_disabled_}" 361 | else 362 | _gallium_xa="${_enabled_}" 363 | fi 364 | 365 | # gallium_vdpau requires either r300, r600, radeonsi or nouveau 366 | if [[ $_gallium_drivers != *r300* ]] && [[ $_gallium_drivers != *r600* ]] && [[ $_gallium_drivers != *radeonsi* ]] && [[ $_gallium_drivers != *nouveau* ]]; then 367 | warning "Gallium VDPAU disabled (gallium driver r300, r600, radeonsi or nouveau required)" 368 | _gallium_vdpau="${_disabled_}" 369 | else 370 | _gallium_vdpau="${_enabled_}" 371 | fi 372 | 373 | # gallium_va requires either r600, radeonsi or nouveau 374 | if [[ $_gallium_drivers != *r600* ]] && [[ $_gallium_drivers != *radeonsi* ]] && [[ $_gallium_drivers != *nouveau* ]]; then 375 | warning "Gallium VA disabled (gallium driver r600, radeonsi or nouveau required)" 376 | _gallium_va="${_disabled_}" 377 | else 378 | _gallium_va="${_enabled_}" 379 | fi 380 | 381 | # gallium_omx requires either r600, radeonsi or nouveau 382 | if [[ $_gallium_drivers != *r600* ]] && [[ $_gallium_drivers != *radeonsi* ]] && [[ $_gallium_drivers != *nouveau* ]]; then 383 | warning "Gallium OMX disabled (gallium driver r600, radeonsi or nouveau required)" 384 | _gallium_omx="${_disabled_}" 385 | else 386 | _gallium_omx="bellagio" 387 | fi 388 | 389 | # legacy compat 390 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor e00adef34a5ce485e2c9216a268ca05e89a5fc98 HEAD ); then 391 | _platforms="x11,wayland" 392 | else 393 | _platforms="x11,wayland,drm,surfaceless" 394 | fi 395 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor e2de00876a7033b6923f912af8d2b0bbd100e113 HEAD ); then 396 | _legacy_switches="-D swr-arches=avx,avx2" 397 | fi 398 | 399 | # microsoft clc 400 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor a5227465c13ae74651a932a82aeae65683f4a063 HEAD ); then 401 | _microsoft_clc="-D microsoft-clc=${_disabled_}" 402 | fi 403 | 404 | # osmesa 405 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 027ccd963b1f8f288bef4224aedcddc1557e4f8a HEAD ); then 406 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor ee802372180a2b4460cc7abb53438e45c6b6f1e4 HEAD ); then 407 | if [ "$_osmesa" != "false" ]; then 408 | _osmesa="-D osmesa=true" 409 | else 410 | _osmesa="-D osmesa=false" 411 | fi 412 | else 413 | _osmesa="-D osmesa=gallium" 414 | fi 415 | fi 416 | 417 | # optional codecs after 7ab05e3 418 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor 7ab05e3c3fe34ea7f8d7345b9229c163e42c3600 HEAD ); then 419 | _optional_codecs="-D video-codecs=${_codecs}" 420 | fi 421 | 422 | # layer selector 423 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor 54fe5b0482df0f066384b274796d4081c2a1968c HEAD ); then 424 | _layers="-D vulkan-layers=device-select,overlay" 425 | else 426 | _layers="-D vulkan-overlay-layer=true -D vulkan-device-select-layer=true" 427 | fi 428 | 429 | # intel_hasvk removal for legacy trees 430 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 50013ca9a57c42114044f593c981bbad8c405cc9 HEAD ); then 431 | _vulkan_drivers=$(echo $_vulkan_drivers | sed "s/,intel_hasvk//g" | tr -s " ") 432 | fi 433 | 434 | # xvmc toggle for legacy trees 435 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 8cc766d8f7eac26b7c029a2fac1bdfdba4776c29 HEAD ); then 436 | _xvmc="-D gallium-xvmc=${_disabled_}" 437 | fi 438 | 439 | # android-libbacktrace was enabled with 6291d4d but only affects android. Let's disable. 440 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor 6291d4d33978f14e59e64a4b66ef92ee891babc3 HEAD ); then 441 | _android_libbacktrace="-D android-libbacktrace=disabled" 442 | fi 443 | 444 | # intel-rt 445 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor 876db9135048be34d84bd74b18411678e15c7c3f HEAD ); then 446 | if [[ ${_vulkan_drivers[*]} =~ "intel" ]]; then 447 | _intel_rt="-D intel-rt=enabled" 448 | else 449 | _intel_rt="-D intel-rt=disabled" 450 | fi 451 | _intel_rt_32="-D intel-rt=disabled" 452 | fi 453 | 454 | # intel-clc cross compile fix 455 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor 28c1053c07c177854520f6283fa665f17618adb5 HEAD ); then 456 | if [[ "$_lib32" == "true" ]]; then 457 | _intel_clc_32="-D intel-clc=system" 458 | # Workaround cross compilation error by using intel_clc binary from _build64 459 | export PATH=$srcdir/_build64/src/intel/compiler:${PATH} 460 | fi 461 | fi 462 | 463 | # omx removal 464 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 9b6c27a320ab4b0fcf1fb16220ae7c3d3f06f7df HEAD ); then 465 | _omx="-D gallium-omx=${_gallium_omx}" 466 | _omx_32="-D gallium-omx=${_disabled_}" 467 | fi 468 | 469 | # dri3 removal 470 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 8f6fca89aa1812b03da6d9f7fac3966955abc41e HEAD ); then 471 | _dri3="-D dri3=${_enabled_}" 472 | fi 473 | 474 | # gallium-nine deprecation 475 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 6b6cb825e92ad3bf33b1e032151e32c7b79d8323 HEAD ); then 476 | _galliumnine="-D gallium-nine=true" 477 | fi 478 | 479 | # gallium-xa deprecation 480 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor cf40099730c4af304227c30c891834cec220abff HEAD ); then 481 | _galliumxa="-D gallium-xa=${_gallium_xa}" 482 | fi 483 | 484 | # shared-glapi option removal 485 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor fefb1a6fb3cff1b227e835c2f67accd33fb96b2a HEAD ); then 486 | _sharedglapi="-D shared-glapi=${_enabled_}" 487 | fi 488 | 489 | # gallium-opencl deprecation 490 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 5844dea31620f36c41ac738e17fefd57084b2dbb HEAD ); then 491 | _galliumopencl="-D gallium-opencl=icd" 492 | fi 493 | 494 | # Windows-only feature gallium-mediafoundation needs explicit disabling on Linux because reasons 495 | if ( cd "$srcdir/$_mesa_srcdir" && git merge-base --is-ancestor d348fd5fb5b50edfbdf00f12fd900f77fd658a52 HEAD ); then 496 | _mediafoundation="-D gallium-mediafoundation=disabled" 497 | fi 498 | 499 | # /Selector fixes 500 | 501 | source "$_where"/frogminer 502 | 503 | if [ -n "${CUSTOM_GCC_PATH}" ] && [ "$_compiler" != "clang" ]; then 504 | export PATH=$( find "$CUSTOM_GCC_PATH/" -maxdepth 1 -printf "%p:" || ( warning "Custom compiler path seems wrong.." && exit 1 ) )${PATH} 505 | msg2 "CUSTOM_GCC_PATH = ${CUSTOM_GCC_PATH}" 506 | fi 507 | 508 | if [ "$_compiler" = "clang" ]; then 509 | export CC="clang" 510 | export CXX="clang++" 511 | else 512 | export CC="gcc" 513 | export CXX="g++" 514 | fi 515 | 516 | if [ "$_rusticl" = "true" ]; then 517 | _rusticladditions="-D rust_std=2021 -D llvm=enabled" 518 | fi 519 | 520 | arch-meson $_mesa_srcdir _build64 \ 521 | --wrap-mode=nofallback \ 522 | --force-fallback-for=syn,paste,rustc-hash \ 523 | -D b_ndebug=true \ 524 | -D platforms=${_platforms} \ 525 | -D gallium-drivers=${_gallium_drivers} \ 526 | -D vulkan-drivers=${_vulkan_drivers} \ 527 | -D egl=${_enabled_} \ 528 | -D gallium-extra-hud=true \ 529 | -D gallium-rusticl=${_rusticl} \ 530 | -D gallium-va=${_gallium_va} \ 531 | -D gallium-vdpau=${_gallium_vdpau} \ 532 | -D gbm=${_enabled_} \ 533 | -D gles1=${_disabled_} \ 534 | -D gles2=${_enabled_} \ 535 | -D glvnd=${_enabled_} \ 536 | -D glx=dri \ 537 | -D libunwind=${_enabled_} \ 538 | -D llvm=${_enabled_} \ 539 | -D lmsensors=${_enabled_} \ 540 | -D opengl=true \ 541 | -D zstd=auto \ 542 | -D valgrind=${_enabled_} $_legacy_switches $_dri3 $_omx $_dri_inc $_microsoft_clc $_osmesa $_xvmc $_layers $_optional_codecs $_android_libbacktrace $_intel_rt $_galliumnine $_galliumxa $_sharedglapi $_galliumopencl $_mediafoundation $_rusticladditions $_lto $_additional_meson_flags $_additional_meson_flags_64 543 | 544 | meson configure _build64 --no-pager 545 | 546 | # quoted from https://www.mesa3d.org/meson.html 547 | # Note: autotools automatically updated translation files (used by the DRI configuration tool) as part of the build process, Meson does not do this. 548 | # Instead, you will need do this: 549 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 2ef983dca61b549a9242afd9008200b231a26e90 HEAD ); then 550 | ninja $NINJAFLAGS -C _build64 xmlpool-pot xmlpool-update-po xmlpool-gmo 551 | fi 552 | # 553 | ninja $NINJAFLAGS -C _build64 554 | 555 | if [ "$_localglesv2pc" == "true" ]; then 556 | echo -e "prefix=/usr\nlibdir=\${prefix}/lib\nincludedir=\${prefix}/include\n\nName: glesv2\nDescription: Mesa OpenGL ES 2.0 library\nVersion: ${pkgver}\nLibs: -L\${libdir} -lGLESv2\nLibs.private: -lpthread -pthread -lm -ldl\nCflags: -I\${includedir}" > "$srcdir"/_build64/glesv2.pc 557 | fi 558 | if [ "$_localeglpc" == "true" ]; then 559 | echo -e "prefix=/usr\nlibdir=\${prefix}/lib\nincludedir=\${prefix}/include\n\nName: egl\nDescription: Mesa EGL Library\nVersion: ${pkgver}\nRequires.private: x11, xext, xdamage >= 1.1, xfixes, x11-xcb, xcb, xcb-glx >= 1.8.1, xcb-dri2 >= 1.8, xxf86vm, libdrm >= 2.4.75\nLibs: -L\${libdir} -lEGL\nLibs.private: -lpthread -pthread -lm -ldl\nCflags: -I\${includedir}" > "$srcdir"/_build64/egl.pc 560 | fi 561 | 562 | if [ "$_lib32" == "true" ]; then 563 | cd "$srcdir" 564 | if [ "$_compiler" = "clang" ]; then 565 | if [ "$_rusticl32_bypass" = "true" ]; then 566 | warning "LTO forcefully disabled on lib32 because _rusticl32_bypass=\"true\"" 567 | _lto="-D b_lto=false" 568 | fi 569 | export CC="clang -m32" 570 | export CXX="clang++ -m32" 571 | else 572 | export CC="gcc -m32" 573 | export CXX="g++ -m32" 574 | fi 575 | 576 | if [ "$_rusticl32_bypass" != "true" ]; then 577 | _rusticl_32="false" 578 | _crossfile_flag="--native-file llvm32.native" 579 | # lib32 nvk fails with native 580 | warning "lib32 nvk forcefully disabled when using _rusticl32_bypass=\"false\"" 581 | _vulkan_drivers=$(echo $_vulkan_drivers | sed "s/,nouveau//g" | tr -s " ") 582 | else 583 | _rusticl_32="$_rusticl" 584 | _crossfile_flag="--cross-file lib32" 585 | fi 586 | 587 | export PKG_CONFIG=/usr/bin/i686-pc-linux-gnu-pkg-config 588 | export BINDGEN_EXTRA_CLANG_ARGS="--target=i686-unknown-linux-gnu" 589 | 590 | arch-meson $_mesa_srcdir _build32 \ 591 | ${_crossfile_flag} \ 592 | --libdir=/usr/lib32 \ 593 | --wrap-mode=nofallback \ 594 | --force-fallback-for=syn,paste,rustc-hash \ 595 | -D b_ndebug=true \ 596 | -D platforms=${_platforms} \ 597 | -D gallium-drivers=${_gallium_drivers} \ 598 | -D vulkan-drivers=${_vulkan_drivers} \ 599 | -D egl=${_enabled_} \ 600 | -D gallium-extra-hud=true \ 601 | -D gallium-rusticl=${_rusticl_32} \ 602 | -D gallium-va=${_gallium_va} \ 603 | -D gallium-vdpau=${_gallium_vdpau} \ 604 | -D gbm=${_enabled_} \ 605 | -D gles1=${_disabled_} \ 606 | -D gles2=${_enabled_} \ 607 | -D glvnd=${_enabled_} \ 608 | -D glx=dri \ 609 | -D libunwind=${_disabled_} \ 610 | -D llvm=${_enabled_} \ 611 | -D lmsensors=${_enabled_} \ 612 | -D zstd=auto \ 613 | -D valgrind=${_disabled_} $_legacy_switches $_dri3 $_omx_32 $_dri_inc $_microsoft_clc $_osmesa $_xvmc $_layers $_optional_codecs $_android_libbacktrace $_intel_rt_32 $_intel_clc_32 $_galliumnine $_galliumxa $_sharedglapi $_galliumopencl $_mediafoundation $_rusticladditions $_lto $_additional_meson_flags $_additional_meson_flags_32 614 | 615 | meson configure _build32 --no-pager 616 | 617 | # quoted from https://www.mesa3d.org/meson.html 618 | # Note: autotools automatically updated translation files (used by the DRI configuration tool) as part of the build process, Meson does not do this. 619 | # Instead, you will need do this: 620 | if ( cd "$srcdir/$_mesa_srcdir" && ! git merge-base --is-ancestor 2ef983dca61b549a9242afd9008200b231a26e90 HEAD ); then 621 | ninja $NINJAFLAGS -C _build32 xmlpool-pot xmlpool-update-po xmlpool-gmo 622 | fi 623 | # 624 | ninja $NINJAFLAGS -C _build32 625 | 626 | if [ "$_localglesv2pc" == "true" ]; then 627 | echo -e "prefix=/usr\nlibdir=\${prefix}/lib32\nincludedir=\${prefix}/include\n\nName: glesv2\nDescription: Mesa OpenGL ES 2.0 library\nVersion: ${pkgver}\nLibs: -L\${libdir} -lGLESv2\nLibs.private: -lpthread -pthread -lm -ldl\nCflags: -I\${includedir}" > "$srcdir"/_build32/glesv2.pc 628 | fi 629 | if [ "$_localeglpc" == "true" ]; then 630 | echo -e "prefix=/usr\nlibdir=\${prefix}/lib32\nincludedir=\${prefix}/include\n\nName: egl\nDescription: Mesa EGL Library\nVersion: ${pkgver}\nRequires.private: x11, xext, xdamage >= 1.1, xfixes, x11-xcb, xcb, xcb-glx >= 1.8.1, xcb-dri2 >= 1.8, xxf86vm, libdrm >= 2.4.75\nLibs: -L\${libdir} -lEGL\nLibs.private: -lpthread -pthread -lm -ldl\nCflags: -I\${includedir}" > "$srcdir"/_build32/egl.pc 631 | fi 632 | fi 633 | } 634 | 635 | package_mesa-tkg-git() { 636 | depends=('libdrm' 'wayland' 'libxxf86vm' 'libxdamage' 'libxshmfence' 'libelf' 637 | 'libomxil-bellagio' 'libunwind' 'lm_sensors' 'libglvnd' 638 | 'expat' 'libclc' 'libx11' $_llvm 'spirv-tools') 639 | provides=(mesa=$pkgver-$pkgrel vulkan-intel=$pkgver-$pkgrel vulkan-radeon=$pkgver-$pkgrel vulkan-nouveau=$pkgver-$pkgrel vulkan-mesa-layers=$pkgver-$pkgrel mesa-vulkan-layers=$pkgver-$pkgrel libva-mesa-driver=$pkgver-$pkgrel mesa-vdpau=$pkgver-$pkgrel vulkan-driver opencl-mesa=$pkgver-$pkgrel opengl-driver opencl-driver ati-dri intel-dri nouveau-dri svga-dri mesa-dri mesa-libgl vulkan-swrast) 640 | conflicts=('mesa' 'opencl-mesa' 'vulkan-intel' 'vulkan-radeon' 'vulkan-nouveau' 'vulkan-mesa-layers' 'mesa-vulkan-layers' 'libva-mesa-driver' 'mesa-vdpau' 'vulkan-swrast') 641 | 642 | DESTDIR="$pkgdir" ninja $NINJAFLAGS -C _build64 install 643 | 644 | # remove script file from /usr/bin 645 | # https://gitlab.freedesktop.org/mesa/mesa/issues/2230 646 | rm -f "${pkgdir}/usr/bin/mesa-overlay-control.py" 647 | 648 | # indirect rendering 649 | ln -s /usr/lib/libGLX_mesa.so.0 "${pkgdir}/usr/lib/libGLX_indirect.so.0" 650 | 651 | if [ "$_localglesv2pc" == "true" ]; then 652 | # bring back glesv2.pc 653 | install -m644 -Dt "$pkgdir"/usr/lib/pkgconfig "$srcdir"/_build64/glesv2.pc 654 | fi 655 | if [ "$_localeglpc" == "true" ]; then 656 | # bring back egl.pc 657 | install -m644 -Dt "$pkgdir"/usr/lib/pkgconfig "$srcdir"/_build64/egl.pc 658 | fi 659 | 660 | install -Dt "$pkgdir"/usr/share/licenses/$pkgname "$srcdir"/LICENSE 661 | } 662 | 663 | package_lib32-mesa-tkg-git() { 664 | depends=('lib32-libdrm' 'lib32-libxxf86vm' 'lib32-libxdamage' 'lib32-libxshmfence' 665 | 'lib32-lm_sensors' 'lib32-libelf' 'lib32-wayland' 666 | 'lib32-libglvnd' 'lib32-libx11' 'mesa' $_lib32_llvm 'lib32-spirv-tools') 667 | provides=(lib32-mesa=$pkgver-$pkgrel lib32-vulkan-intel=$pkgver-$pkgrel lib32-vulkan-radeon=$pkgver-$pkgrel lib32-vulkan-nouveau=$pkgver-$pkgrel lib32-vulkan-mesa-layers=$pkgver-$pkgrel lib32-mesa-vulkan-layers=$pkgver-$pkgrel lib32-libva-mesa-driver=$pkgver-$pkgrel lib32-mesa-vdpau=$pkgver-$pkgrel lib32-opengl-driver lib32-vulkan-driver lib32-ati-dri lib32-intel-dri lib32-nouveau-dri lib32-mesa-dri lib32-mesa-libgl lib32-vulkan-swrast) 668 | conflicts=('lib32-mesa' 'lib32-vulkan-intel' 'lib32-vulkan-radeon' 'lib32-vulkan-nouveau' 'lib32-vulkan-mesa-layers' 'lib32-mesa-vulkan-layers' 'lib32-libva-mesa-driver' 'lib32-mesa-vdpau' 'lib32-vulkan-swrast') 669 | 670 | DESTDIR="$pkgdir" ninja $NINJAFLAGS -C _build32 install 671 | 672 | # remove files provided by mesa-git 673 | rm -rf "$pkgdir"/etc 674 | rm -rf "$pkgdir"/usr/include 675 | rm -rf "$pkgdir"/usr/share/glvnd/ 676 | rm -rf "$pkgdir"/usr/share/drirc.d/ 677 | rm -rf "$pkgdir"/usr/share/vulkan/explicit_layer.d/ 678 | rm -rf "$pkgdir"/usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json 679 | 680 | # indirect rendering 681 | ln -s /usr/lib32/libGLX_mesa.so.0 "${pkgdir}/usr/lib32/libGLX_indirect.so.0" 682 | 683 | if [ "$_localglesv2pc" == "true" ]; then 684 | # bring back glesv2.pc 685 | install -m644 -Dt "$pkgdir"/usr/lib32/pkgconfig "$srcdir"/_build32/glesv2.pc 686 | fi 687 | if [ "$_localeglpc" == "true" ]; then 688 | # bring back egl.pc 689 | install -m644 -Dt "$pkgdir"/usr/lib32/pkgconfig "$srcdir"/_build32/egl.pc 690 | fi 691 | 692 | install -Dt "$pkgdir"/usr/share/licenses/$pkgname "$srcdir"/LICENSE 693 | } 694 | 695 | trap exit_cleanup EXIT 696 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mesa - The 3D Graphics Library - git version, multilib with userpatches support 2 | 3 | https://gitlab.freedesktop.org/mesa/mesa 4 | 5 | You can customize key features in the `customization.cfg` file such as : 6 | - Selecting which LLVM backend version to use (respecting Lone_Wolf's MESA_WHICH_LLVM variable values) 7 | - Enabling/disabling compilation of the lib32 package 8 | - Change userpatches behaviour 9 | 10 | You can use your own mesa patches by putting them in the mesa-userpatches folder and giving them the .mymesapatch extension. 11 | You can also revert mesa patches by putting them in the mesa-userpatches folder and giving them the .mymesarevert extension. 12 | 13 | Note about Lone_Wolf's MESA_WHICH_LLVM for clean chroot users using an aur helper: Selecting AUR's llvm-git as the LLVM backend in a clean chroot will fail to find the package due to naming. Two workarounds can be used: installing llvm-git beforehand (that will provide the `aur-llvm-git` dependency required), or selecting LordHeavy's llvm-git option instead (that will actually install AUR's llvm-git package unless you have LordHeavy's package installed in your chroot, due to the package names being the same). 14 | 15 | 16 | ``` 17 | git clone https://github.com/Frogging-Family/mesa-git.git 18 | cd mesa-git 19 | makepkg -si 20 | ``` 21 | 22 | -------------------------------------------------------------------------------- /customization.cfg: -------------------------------------------------------------------------------- 1 | # mesa-git-tkg config file 2 | 3 | 4 | #### OPTIONS #### 5 | 6 | # External config file to use - If the given file exists in path, it will override default config (customization.cfg) - Default is ~/.config/frogminer/mesa-git.cfg 7 | _EXT_CONFIG_PATH=~/.config/frogminer/mesa-git.cfg 8 | 9 | # Uncomment the MESA_WHICH_LLVM variable below to select which LLVM package tree to use by default to build mesa-git against. 10 | # Note that if you're used to have that variable set in ~/.bashrc, you can leave it commented out here. It'll be respected by the PKGBUILD. 11 | # Else, you'll get prompted about it at build time. 12 | # 13 | # 1: llvm-minimal-git (AUR) 14 | # 2: llvm-git (AUR) 15 | # 3: llvm-git from LordHeavy unofficial repo 16 | # 4 llvm (stable from extra) Default value 17 | MESA_WHICH_LLVM=4 18 | 19 | # Set to "false" to skip cleanups. Default "true" will enable housecleaning and sanity tasks. 20 | _NUKR="true" 21 | 22 | # Compiler to use - gcc or clang - gcc is default 23 | _compiler="clang" 24 | 25 | # Custom GCC root dir - Leave empty to use system compilers. 26 | # Example: CUSTOM_GCC_PATH="/home/frog/PKGBUILDS/mostlyportable-gcc/gcc-mostlyportable-9.2.0" 27 | CUSTOM_GCC_PATH="" 28 | 29 | # Enable lib32. 30 | _lib32=true 31 | 32 | # Which Gallium drivers to include in the build - default is "r300,r600,radeonsi,nouveau,svga,llvmpipe,softpipe,virgl,iris,zink,crocus,i915". 33 | # As of mesa commit e2de00876a7033b6923f912af8d2b0bbd100e113, swr (which was part of that default list) was removed. You can add it back if building an older commit. 34 | # For users with a dedicated AMD GPU (RX 400 series and newer) the minimum required to get a working display driver is the "radeonsi,svga,llvmpipe" combo 35 | # If you experience build issues, try removing i915 to disable support for Gen 3 Intel hardware (GMA 950, GMA 3150, etc) 36 | _gallium_drivers="r300,r600,radeonsi,nouveau,svga,llvmpipe,softpipe,virgl,iris,zink,crocus,i915" 37 | 38 | # Which patent encumbered codecs to build support for - default is "vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec" (all of them) 39 | # This is used for all video APIs (vaapi, vdpau, vulkan). 40 | # Below 7b22dd8bfdc380be2e4037c1207fcb30a46ad296, you'll want to get rid of av1dec,av1enc,vp9dec as these options are not available 41 | _codecs="vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec" 42 | 43 | # Which Vulkan drivers to include in the build - default is "amd,intel,intel_hasvk,swrast,nouveau". 44 | _vulkan_drivers="amd,intel,intel_hasvk,swrast,nouveau" 45 | 46 | # Enables gallium-rusticl - Set to "false" to disable 47 | # Disabled on the lib32 package unless _rusticl32_bypass="true" is set (with quirks you can see below) 48 | _rusticl="true" 49 | 50 | # Set to "false" to disable gallium-rusticl on the lib32 package, allowing for native i686 builds and building with Clang - !! This will also disable lib32 NVK !! 51 | # When set to "true" (default) this will cross compile the lib32 package using GCC (Clang gets ignored along with extra compiler flags) 52 | # This also allows building lib32 nvk which breaks otherwise 53 | # Depends on _rusticl="true" 54 | _rusticl32_bypass="true" 55 | 56 | # Custom optimization flags - optional. 57 | #_custom_opt_flags="-march=native -O3 -fno-tree-vectorize" 58 | 59 | # Set to "true" to pass `-D b_lto=true` to meson, enabling LTO. 60 | # Be aware that lto'ing mesa can lead to stability issues on GCC. 61 | _lto="true" 62 | 63 | # Set optional additional flags for meson - Defaults are "--strip --buildtype release" 64 | # Can be used for PGO'ing (you need to make a first build with "-Db_pgo=generate" added, then launch your apps/games to generate the gcda profiles in your src dir. Once you feel like you have covered all your desired usecases, replace "-Db_pgo=generate" with "-Db_pgo=use" then rebuild the same commit to get your optimized build). 65 | # (coupling with _no_lto="false" is recommended for PGO builds) 66 | # On legacy toolchains you might encounter coverage mismatch errors with "-Db_pgo=use", that you can workaround by adding "-Wno-coverage-mismatch" 67 | _additional_meson_flags="--strip --buildtype release" 68 | # Same as above but only affecting the 64-bit side 69 | _additional_meson_flags_64="" 70 | # Same as above but only affecting the 32-bit side 71 | _additional_meson_flags_32="" 72 | 73 | # Custom Mesa commit to pass to Git. 74 | _mesa_commit="" 75 | 76 | # Mesa branch to pass to Git (when not using a custom commit). Default is "main". 77 | # Older mesa versions were using the master branch (up to May 5th 2021) 78 | _mesa_branch="main" 79 | 80 | # Use pending Mesa merge requests directly as userpatches with their PR ID, separated by space (example: "2421 3151 3273"). 81 | # https://gitlab.freedesktop.org/mesa/mesa/merge_requests 82 | _mesa_prs="" 83 | 84 | # Mesa source to use. Default is "https://gitlab.freedesktop.org/mesa/mesa.git". 85 | # You might want to use the github mirror "https://github.com/mesa3d/mesa.git" if gitlab is slow or unreliable for you, however it might not be in sync with the current HEAD 86 | _mesa_source="https://gitlab.freedesktop.org/mesa/mesa.git" 87 | 88 | #### LEGACY #### 89 | 90 | # Which DRI drivers to include in the build - default is "i915,i965,r100,r200,nouveau" - this doesn't affect the "main" (default) branch 91 | # This option was removed altogether with https://gitlab.freedesktop.org/mesa/mesa/-/commit/59625a68ffc592cc5c6c62baf3a03853f234dbf2 92 | _dri_drivers="i915,i965,r100,r200,nouveau" 93 | 94 | # Use local glesv2.pc - This is provided by libglvnd as of ab9b5fcc3bf90064418f6915cf4259fa11ffe64b. 95 | _localglesv2pc=false 96 | 97 | # Use local egl.pc - This is provided by libglvnd as of ab9b5fcc3bf90064418f6915cf4259fa11ffe64b. 98 | _localeglpc=false 99 | 100 | # Whether to build Gallium XA tracker - set to "false" to disable. 101 | _gallium_xa="false" 102 | 103 | # If you wanted to disable osmesa, uncomment the line below 104 | #_osmesa="false" 105 | 106 | #### USER PATCHES #### 107 | 108 | # Community patches - add patches (separated by a space) of your choice by name from the community-patches dir. 109 | # Example: _community_patches="intel_haswell_vk_workaround.mymesarevert VK_JOSH_depth_bias_info_header.mymesapatch VK_JOSH_depth_bias_info_radv.mymesapatch". 110 | _community_patches="" 111 | 112 | # You can use your own patches by putting them in the same folder as the PKGBUILD and giving them the .mymesapatch extension. 113 | # You can also revert patches by putting them in the same folder as the PKGBUILD and giving them the .mymesarevert extension. 114 | 115 | # Also, userpatches variable below must be set to true for the above to work. 116 | _user_patches="true" 117 | 118 | # Apply all user patches without confirmation - !!! NOT RECOMMENDED !!! 119 | _user_patches_no_confirm="false" 120 | -------------------------------------------------------------------------------- /llvm32.native: -------------------------------------------------------------------------------- 1 | [binaries] 2 | llvm-config = '/usr/bin/llvm-config32' 3 | rust = ['rustc', '--target=i686-unknown-linux-gnu'] 4 | -------------------------------------------------------------------------------- /mesa-userpatches/README.md: -------------------------------------------------------------------------------- 1 | # mesa-git userpatches 2 | 3 | You can make use of your own patches that aren't available in mesa-git/community-patches by putting them in this folder before running makepkg. 4 | 5 | They need to be diffs against the targeted tree. 6 | 7 | **!! Patches with unrecognized extension will get ignored !!** 8 | 9 | You can use your own mesa patches by giving them the .mymesapatch extension. 10 | 11 | You can also revert mesa patches by giving them the .mymesarevert extension. 12 | --------------------------------------------------------------------------------