From 9b8fc8a0112378d3331adc38f3a82afeb71fc743 Mon Sep 17 00:00:00 2001 From: Max Rees Date: Tue, 24 Jul 2018 12:20:54 -0400 Subject: user/mesa: support builds on hosts with intel GPUs --- user/mesa/APKBUILD | 8 +++-- user/mesa/intel.patch | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 user/mesa/intel.patch diff --git a/user/mesa/APKBUILD b/user/mesa/APKBUILD index bc968fd03..3943557c0 100644 --- a/user/mesa/APKBUILD +++ b/user/mesa/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: A. Wilcox pkgname=mesa pkgver=18.1.3 -pkgrel=1 +pkgrel=2 pkgdesc="Mesa DRI OpenGL library" url="https://www.mesa3d.org" arch="all" @@ -32,6 +32,7 @@ source="https://mesa.freedesktop.org/archive/mesa-$pkgver.tar.xz disk_cache-stack-overflow.patch drmdeps.patch python3-compat.patch + intel.patch " replaces="mesa-dricore" @@ -72,7 +73,7 @@ build() { cd "$builddir" export CFLAGS="$CFLAGS -D_XOPEN_SOURCE=700" - ./configure \ + PYTHON2=python3 ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ @@ -251,4 +252,5 @@ c7d91a660a033df91fac9c557039efc8669f0c26b2d35997d50753938b70d1af0bd110dcab3f8236 245d0d64d858dfadeeb544f31f7d0bb6ecb746a7fd5ec99755d679ae1a1eef4198d66473fb24d333eb6786bb8657012771e8285d67f165dc61a031df801947aa amdgpu-pthread-header.patch f40ff04ac73c090c74d1955de6013c5aa41fb77f28b2b82d89cfc1880306a9ca1dde4581592db19f0a0ec6d85032f1ed5d953103ab0d075f9f0b7e459a028c45 disk_cache-stack-overflow.patch 6800bc62aebfba22a2562c858c27391b47c5675020bd67f040da93ffe4d5d8ac828907a44c7cee6a4ebe63821b58c2515b4012f1f23473670b1de8670426a430 drmdeps.patch -61ddf4f33f11b4fbaa334bec04d184236f01bc8cad4340cb74b66c92fc8c0c985d36507cf43b504d186dc108fc2e5ae348ed28ea8a680ba4dfdb74994fc440f7 python3-compat.patch" +61ddf4f33f11b4fbaa334bec04d184236f01bc8cad4340cb74b66c92fc8c0c985d36507cf43b504d186dc108fc2e5ae348ed28ea8a680ba4dfdb74994fc440f7 python3-compat.patch +baa0039c65b760ac60d55a112cc3fe9c59759e6f6e31c9c0dc46cfc1dcca91726706d6fb3328e11c043ba1f84f01dd56d0208ee153b05174fde74252d3d7d95c intel.patch" diff --git a/user/mesa/intel.patch b/user/mesa/intel.patch new file mode 100644 index 000000000..10871fc7c --- /dev/null +++ b/user/mesa/intel.patch @@ -0,0 +1,85 @@ +--- mesa-18.1.3/src/mesa/drivers/dri/i965/brw_bufmgr.h 2018-06-29 13:47:29.000000000 -0400 ++++ mesa-18.1.3/src/mesa/drivers/dri/i965/brw_bufmgr.h 2018-07-24 03:18:37.479847335 -0400 +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include "util/u_atomic.h" + #include "util/list.h" + +--- mesa-18.1.3/src/intel/vulkan/anv_entrypoints_gen.py 2018-07-24 03:15:05.009848837 -0400 ++++ mesa-18.1.3/src/intel/vulkan/anv_entrypoints_gen.py 2018-07-24 03:12:21.739849990 -0400 +@@ -91,7 +91,7 @@ + % endfor + """, output_encoding='utf-8') + +-TEMPLATE_C = Template(u"""\ ++TEMPLATE_C = Template("""\ + /* + * Copyright © 2015 Intel Corporation + * +@@ -145,7 +145,7 @@ + /* Hash table stats: + * size ${len(strmap.sorted_strings)} entries + * collisions entries: +-% for i in xrange(10): ++% for i in range(10): + * ${i}${'+' if i == 9 else ' '} ${strmap.collisions[i]} + % endfor + */ +@@ -388,7 +388,7 @@ + + def bake(self): + self.sorted_strings = \ +- sorted(self.strings.values(), key=lambda x: x.string) ++ sorted(list(self.strings.values()), key=lambda x: x.string) + offset = 0 + for entry in self.sorted_strings: + entry.offset = offset +@@ -507,7 +507,7 @@ + assert e.core_version is None + e.extensions.append(ext) + +- return [e for e in entrypoints.itervalues() if e.enabled] ++ return [e for e in list(entrypoints.values()) if e.enabled] + + + def get_entrypoints_defines(doc): +--- mesa-18.1.3/src/intel/vulkan/anv_extensions.py 2018-06-29 13:47:29.000000000 -0400 ++++ mesa-18.1.3/src/intel/vulkan/anv_extensions.py 2018-07-24 03:07:13.599852168 -0400 +@@ -146,14 +146,32 @@ + patch = self.patch if self.patch is not None else 0 + return (self.major << 22) | (self.minor << 12) | patch + +- def __cmp__(self, other): ++ def __lt__(self, other): + # If only one of them has a patch version, "ignore" it by making + # other's patch version match self. + if (self.patch is None) != (other.patch is None): + other = copy.copy(other) + other.patch = self.patch + +- return self.__int_ver().__cmp__(other.__int_ver()) ++ return self.__int_ver() < other.__int_ver() ++ ++ def __gt__(self, other): ++ # If only one of them has a patch version, "ignore" it by making ++ # other's patch version match self. ++ if (self.patch is None) != (other.patch is None): ++ other = copy.copy(other) ++ other.patch = self.patch ++ ++ return self.__int_ver() > other.__int_ver() ++ ++ def __eq__(self, other): ++ # If only one of them has a patch version, "ignore" it by making ++ # other's patch version match self. ++ if (self.patch is None) != (other.patch is None): ++ other = copy.copy(other) ++ other.patch = self.patch ++ ++ return self.__int_ver() == other.__int_ver() + + + MAX_API_VERSION = VkVersion('0.0.0') -- cgit v1.2.3-70-g09d2