summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevall4742021-02-25 23:46:05 -0500
committerkevall4742021-02-25 23:46:05 -0500
commited599ed64c94713ac9f9dc62ccefb495d52640a3 (patch)
treee7238f90a64616db2a839951b802e57bcd148bfa
downloadaur-ed599ed64c94713ac9f9dc62ccefb495d52640a3.tar.gz
first push
-rw-r--r--.SRCINFO113
-rw-r--r--0001-4114.patch28
-rw-r--r--0001-4200.patch28
-rw-r--r--0001-enable-llvm-by-default.patch66
-rw-r--r--LICENSE90
-rw-r--r--PKGBUILD185
6 files changed, 510 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e69a9290acc7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,113 @@
+pkgbase = lib32-mesa-stable
+ pkgdesc = An open-source implementation of the OpenGL specification. (32-bit) (stable release)
+ pkgver = 20.3.4
+ pkgrel = 1
+ url = https://mesa3d.org/
+ arch = x86_64
+ license = MIT
+ makedepends = meson
+ makedepends = ninja
+ makedepends = bison
+ makedepends = lib32-flex
+ makedepends = python
+ makedepends = python-mako
+ makedepends = python-appdirs
+ makedepends = python-evdev
+ makedepends = lua
+ makedepends = polly
+ makedepends = valgrind
+ makedepends = xorgproto
+ makedepends = wayland-protocols
+ makedepends = glslang
+ makedepends = libclc
+ makedepends = elfutils
+ makedepends = libarchive
+ makedepends = libconfig
+ makedepends = compiler-rt
+ makedepends = lib32-libxcb
+ makedepends = lib32-wayland
+ makedepends = lib32-libxml2
+ makedepends = lib32-libx11
+ makedepends = lib32-libvdpau
+ makedepends = lib32-libelf
+ makedepends = lib32-libglvnd
+ makedepends = lib32-ncurses
+ makedepends = lib32-libva
+ makedepends = lib32-libxrandr
+ makedepends = lib32-expat
+ makedepends = lib32-libdrm
+ makedepends = lib32-libxvmc
+ makedepends = lib32-libepoxy
+ makedepends = lib32-libxv
+ makedepends = lib32-libxshmfence
+ makedepends = lib32-libxxf86vm
+ makedepends = lib32-libxdamage
+ makedepends = lib32-zstd
+ makedepends = lib32-lm_sensors
+ makedepends = lib32-libunwind
+ makedepends = lib32-vulkan-icd-loader
+ makedepends = lib32-ocl-icd
+ makedepends = lib32-llvm
+ makedepends = lib32-llvm-libs
+ makedepends = lib32-glibc
+ makedepends = gcc
+ makedepends = lib32-gcc-libs
+ depends = lib32-libdrm
+ depends = lib32-libxcb
+ depends = lib32-wayland
+ depends = python
+ depends = libclc
+ depends = lib32-libx11
+ depends = lib32-libxshmfence
+ depends = lib32-zstd
+ depends = lib32-libelf
+ depends = lib32-llvm-libs
+ depends = lib32-expat
+ depends = lib32-libxxf86vm
+ depends = lib32-libxdamage
+ depends = lib32-libunwind
+ depends = lib32-lm_sensors
+ depends = lib32-libglvnd
+ depends = lib32-vulkan-icd-loader
+ depends = lib32-llvm
+ depends = lib32-clang
+ depends = lib32-gcc-libs
+ depends = gcc
+ depends = glslang
+ depends = vulkan-mesa-layers
+ depends = opencl-mesa
+ depends = mesa
+ provides = lib32-mesa
+ provides = lib32-opencl-mesa
+ provides = lib32-vulkan-intel
+ provides = lib32-vulkan-radeon
+ provides = lib32-vulkan-swrast
+ provides = lib32-vulkan-driver
+ provides = lib32-vulkan-mesa-layers
+ provides = lib32-libva-mesa-driver
+ provides = lib32-mesa-vdpau
+ provides = lib32-opengl-driver
+ provides = lib32-opencl-driver
+ provides = lib32-mesa-libgl
+ conflicts = lib32-mesa
+ conflicts = lib32-opencl-mesa
+ conflicts = lib32-vulkan-intel
+ conflicts = lib32-vulkan-radeon
+ conflicts = lib32-vulkan-mesa
+ conflicts = lib32-vulkan-swrast
+ conflicts = lib32-vulkan-mesa-layers
+ conflicts = lib32-libva-mesa-driver
+ conflicts = lib32-mesa-vdpau
+ conflicts = lib32-mesa-rc
+ conflicts = lib32-mesa-git
+ source = https://archive.mesa3d.org/mesa-20.3.4.tar.xz
+ source = LICENSE
+ source = 0001-4114.patch
+ source = 0001-4200.patch
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+ md5sums = SKIP
+
+pkgname = lib32-mesa-stable
+
diff --git a/0001-4114.patch b/0001-4114.patch
new file mode 100644
index 000000000000..c1bb09ca52f2
--- /dev/null
+++ b/0001-4114.patch
@@ -0,0 +1,28 @@
+From 9699a4f3b21d8cf5b48785d4d9ca4241fd4f2e03 Mon Sep 17 00:00:00 2001
+From: kevall474 <kevall474@tuta.io>
+Date: Wed, 24 Feb 2021 15:38:11 -0500
+Subject: [PATCH] 4114
+
+---
+ src/gallium/frontends/clover/llvm/invocation.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/gallium/frontends/clover/llvm/invocation.cpp b/src/gallium/frontends/clover/llvm/invocation.cpp
+index 779b28dc9b3..f3d68622ca9 100644
+--- a/src/gallium/frontends/clover/llvm/invocation.cpp
++++ b/src/gallium/frontends/clover/llvm/invocation.cpp
+@@ -230,7 +230,11 @@ namespace {
+
+ c->getInvocation().setLangDefaults(c->getLangOpts(),
+ compat::ik_opencl, ::llvm::Triple(target.triple),
++#if LLVM_VERSION_MAJOR >= 12
++ c->getPreprocessorOpts().Includes,
++#else
+ c->getPreprocessorOpts(),
++#endif
+ get_language_version(opts, device_clc_version));
+
+ c->createDiagnostics(new clang::TextDiagnosticPrinter(
+--
+2.30.1
+
diff --git a/0001-4200.patch b/0001-4200.patch
new file mode 100644
index 000000000000..24361aa92ad9
--- /dev/null
+++ b/0001-4200.patch
@@ -0,0 +1,28 @@
+From 03ac02c6436192b347f4e6f2c10f12021cb9c16c Mon Sep 17 00:00:00 2001
+From: kevall474 <kevall474@tuta.io>
+Date: Wed, 24 Feb 2021 15:19:47 -0500
+Subject: [PATCH] 4200
+
+---
+ src/gallium/frontends/clover/llvm/metadata.hpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/gallium/frontends/clover/llvm/metadata.hpp b/src/gallium/frontends/clover/llvm/metadata.hpp
+index be97a0036fe..cacee6871e3 100644
+--- a/src/gallium/frontends/clover/llvm/metadata.hpp
++++ b/src/gallium/frontends/clover/llvm/metadata.hpp
+@@ -129,7 +129,11 @@ namespace clover {
+ break;
+ }
+ if (type->isVectorTy())
+- data += std::to_string(((::llvm::VectorType*)type)->getNumElements());
++if LLVM_VERSION_MAJOR >= 13
++ data += std::to_string(((::llvm::FixedVectorType*)type)->getNumElements());
++#else
++ data += std::to_string(((::llvm::VectorType*)type)->getNumElements());
++#endif
+
+ } else {
+ ::llvm::raw_string_ostream os { data };
+--
+2.30.1
diff --git a/0001-enable-llvm-by-default.patch b/0001-enable-llvm-by-default.patch
new file mode 100644
index 000000000000..a2c029a50003
--- /dev/null
+++ b/0001-enable-llvm-by-default.patch
@@ -0,0 +1,66 @@
+From 557c5a6420d2ffe70f569a32ee7417f14e14c567 Mon Sep 17 00:00:00 2001
+From: kevall474 <kevall474@tuta.io>
+Date: Wed, 24 Feb 2021 15:09:34 -0500
+Subject: [PATCH] enable llvm by default
+
+---
+ src/amd/compiler/aco_ir.cpp | 5 +++++
+ src/amd/vulkan/radv_debug.h | 1 +
+ src/amd/vulkan/radv_device.c | 3 +++
+ 3 files changed, 9 insertions(+)
+
+diff --git a/src/amd/compiler/aco_ir.cpp b/src/amd/compiler/aco_ir.cpp
+index a258447b662..7c9619d7937 100644
+--- a/src/amd/compiler/aco_ir.cpp
++++ b/src/amd/compiler/aco_ir.cpp
+@@ -47,9 +47,14 @@ static void init_once()
+ {
+ debug_flags = parse_debug_string(getenv("ACO_DEBUG"), aco_debug_options);
+
++ debug_flags |= aco::DEBUG_NO_OPT;
++ debug_flags |= aco::DEBUG_NO_SCHED;
++
+ #ifndef NDEBUG
+ /* enable some flags by default on debug builds */
+ debug_flags |= aco::DEBUG_VALIDATE_IR;
++ debug_flags |= aco::DEBUG_NO_OPT;
++ debug_flags |= aco::DEBUG_NO_SCHED;
+ #endif
+ }
+
+diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
+index 2c559d8c125..9383dfe7787 100644
+--- a/src/amd/vulkan/radv_debug.h
++++ b/src/amd/vulkan/radv_debug.h
+@@ -70,6 +70,7 @@ enum {
+ RADV_PERFTEST_PS_WAVE_32 = 1 << 5,
+ RADV_PERFTEST_GE_WAVE_32 = 1 << 6,
+ RADV_PERFTEST_DFSM = 1 << 7,
++ RADV_PERFTEST_ACO = 1 << 8,
+ };
+
+ bool
+diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
+index 9a82094a1ff..6c96e9ce1df 100644
+--- a/src/amd/vulkan/radv_device.c
++++ b/src/amd/vulkan/radv_device.c
+@@ -574,6 +574,7 @@ static const struct debug_control radv_perftest_options[] = {
+ {"pswave32", RADV_PERFTEST_PS_WAVE_32},
+ {"gewave32", RADV_PERFTEST_GE_WAVE_32},
+ {"dfsm", RADV_PERFTEST_DFSM},
++ {"aco", RADV_PERFTEST_ACO},
+ {NULL, 0}
+ };
+
+@@ -716,6 +717,8 @@ VkResult radv_CreateInstance(
+ instance->debug_flags = parse_debug_string(getenv("RADV_DEBUG"),
+ radv_debug_options);
+
++ instance->debug_flags |= RADV_DEBUG_LLVM;
++
+ const char *radv_perftest_str = getenv("RADV_PERFTEST");
+ instance->perftest_flags = parse_debug_string(radv_perftest_str,
+ radv_perftest_options);
+--
+2.30.1
+
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..0ed1c8cd079f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,90 @@
+License and Copyright
+=====================
+
+Disclaimer
+----------
+
+Mesa is a 3-D graphics library with an API which is very similar to that
+of `OpenGL <https://www.opengl.org/>`_ [1]_.
+To the extent that Mesa utilizes the OpenGL command syntax or state
+machine, it is being used with authorization from `Silicon Graphics,
+Inc. <https://www.sgi.com/>`__\ (SGI). However, the author does not
+possess an OpenGL license from SGI, and makes no claim that Mesa is in
+any way a compatible replacement for OpenGL or associated with SGI.
+Those who want a licensed implementation of OpenGL should contact a
+licensed vendor.
+
+Please do not refer to the library as *MesaGL* (for legal reasons). It's
+just *Mesa* or *The Mesa 3-D graphics library*.
+
+.. [1] OpenGL is a trademark of `Silicon Graphics
+ Incorporated <https://www.sgi.com/>`__.
+
+License / Copyright Information
+-------------------------------
+
+The Mesa distribution consists of several components. Different
+copyrights and licenses apply to different components. For example, the
+GLX client code uses the SGI Free Software License B, and some of the
+Mesa device drivers are copyrighted by their authors. See below for a
+list of Mesa's main components and the license for each.
+
+The core Mesa library is licensed according to the terms of the MIT
+license. This allows integration with the XFree86, Xorg and DRI
+projects.
+
+The default Mesa license is as follows:
+
+::
+
+ Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+Attention, Contributors
+-----------------------
+
+When contributing to the Mesa project you must agree to the licensing
+terms of the component to which you're contributing. The following
+section lists the primary components of the Mesa distribution and their
+respective licenses.
+
+Mesa Component Licenses
+-----------------------
+
++-----------------+------------------------+-----------------------------+
+| Component | Location | License |
++=================+========================+=============================+
+| Main Mesa code | src/mesa/ | MIT |
++-----------------+------------------------+-----------------------------+
+| Device drivers | src/mesa/drivers/* | MIT, generally |
++-----------------+------------------------+-----------------------------+
+| Gallium code | src/gallium/ | MIT |
++-----------------+------------------------+-----------------------------+
+| Ext headers | include/GL/glext.h, | Khronos |
+| | include/GL/glxext.h | |
++-----------------+------------------------+-----------------------------+
+| GLX client code | src/glx/ | SGI Free Software License B |
++-----------------+------------------------+-----------------------------+
+| C11 thread | include/c11/threads*.h | Boost (permissive) |
+| emulation | | |
++-----------------+------------------------+-----------------------------+
+
+In general, consult the source files for license terms.
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..db850906fe51
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,185 @@
+#_ _ _ _ _ _____ _ _
+#| | _______ ____ _| | | || |___ | || |
+#| |/ / _ \ \ / / _` | | | || |_ / /| || |_
+#| < __/\ V / (_| | | |__ _/ / |__ _|
+#|_|\_\___| \_/ \__,_|_|_| |_|/_/ |_|
+
+#Maintainer: kevall474 <kevall474@tuta.io> <https://github.com/kevall474>
+#Credits: Lone_Wolf <lone_wolf@klaas-de-kat.nl> ---> For the base PKGBULD
+#Credits: Laurent Carlier <lordheavym@gmail.com> ---> For the base PKGBUILD
+
+#######################################
+
+#Enable llvm by default
+#Set 'y' to enable
+#Default is set to empty, so no llvm by default patch
+if [ -z ${_llvm+x} ]; then
+ _llvm=
+fi
+
+#######################################
+
+#Set compiler
+#Set '1' to use gcc
+#Set '2' to use clang
+#If not set is will build with gcc
+if [ -z ${_compiler+x} ]; then
+ _compiler=
+fi
+
+#######################################
+
+pkgname=lib32-mesa-stable
+pkgdesc='An open-source implementation of the OpenGL specification. (32-bit) (stable release)'
+pkgver=20.3.4
+pkgrel=1
+arch=('x86_64')
+url="https://mesa3d.org/"
+license=('MIT')
+makedepends=('meson' 'ninja' 'bison' 'lib32-flex' 'python' 'python-mako' 'python-appdirs' 'python-evdev' 'lua' 'polly' 'valgrind'
+ 'xorgproto' 'wayland-protocols' 'glslang' 'libclc' 'elfutils' 'libarchive' 'libconfig' 'compiler-rt' 'lib32-libxcb'
+ 'lib32-wayland' 'lib32-libxml2' 'lib32-libx11' 'lib32-libvdpau' 'lib32-libelf' 'lib32-libglvnd' 'lib32-ncurses'
+ 'lib32-libva' 'lib32-libxrandr' 'lib32-expat' 'lib32-libdrm' 'lib32-libxvmc' 'lib32-libepoxy' 'lib32-libxv'
+ 'lib32-libxshmfence' 'lib32-libxxf86vm' 'lib32-libxdamage' 'lib32-zstd' 'lib32-lm_sensors' 'lib32-libunwind'
+ 'lib32-vulkan-icd-loader' 'lib32-ocl-icd' 'lib32-llvm' 'lib32-llvm-libs' 'lib32-glibc' 'gcc' 'lib32-gcc-libs')
+depends=('lib32-libdrm' 'lib32-libxcb' 'lib32-wayland' 'python' 'libclc' 'lib32-libx11' 'lib32-libxshmfence' 'lib32-zstd' 'lib32-libelf'
+ 'lib32-llvm-libs' 'lib32-expat' 'lib32-libxxf86vm' 'lib32-libxdamage' 'lib32-libunwind' 'lib32-lm_sensors' 'lib32-libglvnd'
+ 'lib32-vulkan-icd-loader' 'lib32-llvm' 'lib32-clang' 'lib32-gcc-libs' 'gcc' 'glslang' 'vulkan-mesa-layers' 'opencl-mesa' 'mesa')
+conflicts=('lib32-mesa' 'lib32-opencl-mesa' 'lib32-vulkan-intel' 'lib32-vulkan-radeon' 'lib32-vulkan-mesa' 'lib32-vulkan-swrast'
+ 'lib32-vulkan-mesa-layers' 'lib32-libva-mesa-driver' 'lib32-mesa-vdpau' 'lib32-mesa-rc' 'lib32-mesa-git')
+provides=('lib32-mesa' 'lib32-opencl-mesa' 'lib32-vulkan-intel' 'lib32-vulkan-radeon' 'lib32-vulkan-swrast' 'lib32-vulkan-driver'
+ 'lib32-vulkan-mesa-layers' 'lib32-libva-mesa-driver' 'lib32-mesa-vdpau' 'lib32-opengl-driver' 'lib32-opencl-driver' 'lib32-mesa-libgl')
+source=("https://archive.mesa3d.org/mesa-$pkgver.tar.xz"
+ "LICENSE")
+md5sums=("SKIP"
+ "SKIP")
+if [[ $_llvm = "y" ]]; then
+ source+=("0001-enable-llvm-by-default.patch")
+ md5sums+=("SKIP") #0001-enable-llvm-by-default.patch
+fi
+# clover patch for llvm 12.0.0 and 13.0.0. Not commited in master branch for now
+source+=("0001-4114.patch"
+ "0001-4200.patch")
+md5sums+=("SKIP"
+ "SKIP")
+
+prepare(){
+ cd mesa-$pkgver
+
+ # Apply any patch
+ local src
+ for src in "${source[@]}"; do
+ src="${src%%::*}"
+ src="${src##*/}"
+ [[ $src = *.patch ]] || continue
+ msg2 "Applying patch $src..."
+ patch -Np1 < "../$src"
+ done
+}
+
+build(){
+if [[ $_compiler = "1" ]]; then
+ export CC='gcc -m32'
+ export CXX='g++ -m32'
+elif [[ $_compiler = "2" ]]; then
+ export CC='clang -m32'
+ export CXX='clang++ -m32'
+else
+ export CC='gcc -m32'
+ export CXX='g++ -m32'
+fi
+
+ cd mesa-$pkgver
+
+cat >crossfile.ini <<END
+[binaries]
+llvm-config = '/usr/bin/llvm-config32'
+END
+
+ # remove build dir if there is one
+ if dir build_32; then
+ rm -rf -v build_32
+ fi
+
+ # create build dir
+ mkdir -p -v build_32
+
+ # build with meson
+ meson setup build_32/ \
+ --native-file crossfile.ini \
+ -D b_ndebug=true \
+ -D buildtype=plain \
+ --wrap-mode=nofallback \
+ -Dprefix=/usr \
+ -D sysconfdir=/etc \
+ --libdir=/usr/lib32 \
+ -Dplatforms=x11,wayland \
+ -Ddri3=enabled \
+ -Ddri-drivers=i915,i965,r100,r200,nouveau \
+ -Dgallium-drivers=r300,r600,radeonsi,nouveau,virgl,svga,swrast,iris,zink \
+ -Dgallium-extra-hud=true \
+ -Dgallium-vdpau=enabled \
+ -Dgallium-xvmc=enabled \
+ -Dgallium-omx=disabled \
+ -Dgallium-va=enabled \
+ -Dgallium-xa=enabled \
+ -Dgallium-nine=true \
+ -Dgallium-opencl=icd \
+ -Dopencl-spirv=false \
+ -Dvulkan-drivers=amd,intel,swrast \
+ -Dshader-cache=enabled \
+ -Dvulkan-overlay-layer=true \
+ -Dvulkan-device-select-layer=true \
+ -Dshared-glapi=enabled \
+ -Dgles1=enabled \
+ -Dgles2=enabled \
+ -Dopengl=true \
+ -Dgbm=enabled \
+ -Dglx=dri \
+ -Degl=enabled \
+ -Dglvnd=true \
+ -Dllvm=enabled \
+ -Dshared-llvm=enabled \
+ -Dvalgrind=disabled \
+ -Dlibunwind=enabled \
+ -Dlmsensors=enabled \
+ -Dselinux=false \
+ -Dosmesa=gallium \
+ -Dswr-arches=avx,avx2,knl,skx \
+ -Dshared-swr=true \
+ -Dxlib-lease=enabled \
+ -Dglx-direct=true \
+ -Dzstd=enabled
+
+ meson configure build_32/
+
+ meson compile -C build_32/
+
+ ninja -C build_32/
+}
+
+package_lib32-mesa-stable(){
+ # compiling mesa and installing to "$pkgdir"
+ DESTDIR="${pkgdir}" ninja -C mesa-$pkgver/build_32/ install
+
+ #Remove files provided by standard mesa build
+ rm -rf -v "$pkgdir"/etc
+ rm -rf -v "$pkgdir"/usr/include
+ rm -rf -v "$pkgdir"/usr/share/glvnd
+ rm -rf -v "$pkgdir"/usr/share/drirc.d
+ rm -rf -v "$pkgdir"/usr/share/freedreno
+ rm -rf -v "$pkgdir"/usr/share/vulkan/explicit_layer.d
+ rm -rf -v "$pkgdir"/usr/share/vulkan/explicit_layer.d/VkLayer_MESA_overlay.json
+ rm -rf -v "$pkgdir"/usr/share/vulkan/implicit_layer.d
+ rm -rf -v "$pkgdir"/usr/share/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json
+
+ # remove script file from /usr/bin
+ rm -v "${pkgdir}/usr/bin/mesa-overlay-control.py"
+ rm -rf -v "${pkgdir}/usr/bin"
+
+ # indirect rendering
+ ln -s /usr/lib32/libGLX_mesa.so.0 "${pkgdir}/usr/lib32/libGLX_indirect.so.0"
+
+ # installing license
+ install -Dt "$pkgdir"/usr/share/licenses/"$pkgname" -m644 LICENSE
+}