From 997a904581d177809350eea0e12afd57d9cf6454 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Mon, 20 May 2019 13:56:54 -0300 Subject: [PATCH] recipes: xorg/mesa: upgraded to version 19.0.4, improving compatibility with Musl --- patches/mesa/adjust-cache-deflate-buffer.patch | 16 ++++++++++++++++ patches/mesa/musl-fix-includes.patch | 21 +++++++++++++++++++++ recipes/xorg/mesa/recipe | 18 ++++++++++++------ sources/SOURCELIST.txt | 2 +- sources/mesa-18.3.2.tar.gz.sha256 | 1 - sources/mesa-19.0.4.tar.gz.sha256 | 1 + 6 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 patches/mesa/adjust-cache-deflate-buffer.patch create mode 100644 patches/mesa/musl-fix-includes.patch delete mode 100644 sources/mesa-18.3.2.tar.gz.sha256 create mode 100644 sources/mesa-19.0.4.tar.gz.sha256 diff --git a/patches/mesa/adjust-cache-deflate-buffer.patch b/patches/mesa/adjust-cache-deflate-buffer.patch new file mode 100644 index 00000000..3c116cb6 --- /dev/null +++ b/patches/mesa/adjust-cache-deflate-buffer.patch @@ -0,0 +1,16 @@ +diff -ru mesa-18.1.7.orig/src/util/disk_cache.c mesa-18.1.7/src/util/disk_cache.c +--- mesa-18.1.7.orig/src/util/disk_cache.c 2018-08-24 19:25:19.000000000 +0300 ++++ mesa-18.1.7/src/util/disk_cache.c 2018-12-14 13:59:15.433631846 +0200 +@@ -721,8 +721,11 @@ + /* From the zlib docs: + * "If the memory is available, buffers sizes on the order of 128K or 256K + * bytes should be used." ++ * ++ * But that is performance optimization for large files. To keep stack usage ++ * in sensible amount (wrt. musl default stack) we use smaller stack on Alpine. + */ +-#define BUFSIZE 256 * 1024 ++#define BUFSIZE 4 * 1024 + + /** + * Compresses cache entry in memory and writes it to disk. Returns the size diff --git a/patches/mesa/musl-fix-includes.patch b/patches/mesa/musl-fix-includes.patch new file mode 100644 index 00000000..9ce9df4e --- /dev/null +++ b/patches/mesa/musl-fix-includes.patch @@ -0,0 +1,21 @@ +--- a/src/util/rand_xor.c ++++ b/src/util/rand_xor.c +@@ -24,6 +24,8 @@ + + #if defined(__linux__) + #include ++#include ++#include + #include + #include + #else +--- ./src/gallium/winsys/svga/drm/vmw_screen.h.orig ++++ ./src/gallium/winsys/svga/drm/vmw_screen.h +@@ -34,7 +34,7 @@ + #ifndef VMW_SCREEN_H_ + #define VMW_SCREEN_H_ + +- ++#include + #include "pipe/p_compiler.h" + #include "pipe/p_state.h" diff --git a/recipes/xorg/mesa/recipe b/recipes/xorg/mesa/recipe index 924c76a1..23b94e25 100644 --- a/recipes/xorg/mesa/recipe +++ b/recipes/xorg/mesa/recipe @@ -16,7 +16,7 @@ # limitations under the License. program=mesa -version=18.3.2 +version=19.0.4 release=1 # Set 'outdir' for a nice and well-organized output directory @@ -49,11 +49,16 @@ build() cd "$srcdir" + # To increment compatibility with Musl (Thanks to "Alpine Linux") + patch -p1 < "${worktree}/patches/mesa/adjust-cache-deflate-buffer.patch" + patch -p1 < "${worktree}/patches/mesa/musl-fix-includes.patch" + # Set sane permissions chmod -R u+w,go-w,a+rX-s . - ./configure CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \ - $configure_args \ + ./configure CPPFLAGS="-D_XOPEN_SOURCE=700" \ + CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \ + $configure_args --enable-autotools \ --libdir=/usr/lib${libSuffix} \ --infodir=$infodir \ --mandir=$mandir \ @@ -61,19 +66,20 @@ build() --disable-debug \ --disable-llvm \ --disable-gallium-llvm \ + --disable-xvmc \ + --disable-glx-tls \ + --enable-glx \ --enable-texture-float \ --enable-gles1 \ --enable-gles2 \ --enable-gbm \ --enable-shared-glapi \ - --enable-glx="dri" \ - --enable-glx-tls \ --enable-gallium-extra-hud \ --enable-dri \ --enable-dri3 \ - --enable-nine \ --enable-gallium-osmesa \ --enable-xa \ + --enable-nine \ --enable-xlib-lease \ --enable-lmsensors \ --with-gallium-drivers="i915,nouveau,r600,swrast" \ diff --git a/sources/SOURCELIST.txt b/sources/SOURCELIST.txt index 37eb01a3..e970adf0 100644 --- a/sources/SOURCELIST.txt +++ b/sources/SOURCELIST.txt @@ -246,7 +246,7 @@ http://www.gnupg.org/ftp/gcrypt/npth/npth-1.6.tar.bz2 http://www.greenwoodsoftware.com/less/less-530.tar.gz http://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-26.tar.gz http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.1.tar.gz -http://www.mesa3d.org/archive/mesa-18.3.2.tar.gz +http://www.mesa3d.org/archive/mesa-19.0.4.tar.gz http://www.mirbsd.org/MirOS/dist/mir/mksh/mksh-R56c.tgz http://www.mpfr.org/mpfr-current/mpfr-4.0.2.tar.bz2 http://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 diff --git a/sources/mesa-18.3.2.tar.gz.sha256 b/sources/mesa-18.3.2.tar.gz.sha256 deleted file mode 100644 index c038d8df..00000000 --- a/sources/mesa-18.3.2.tar.gz.sha256 +++ /dev/null @@ -1 +0,0 @@ -1cde4fafd40cd1ad4ee3a13b364b7a0175a08b7afdd127fb46f918c1e1dfd4b0 mesa-18.3.2.tar.gz diff --git a/sources/mesa-19.0.4.tar.gz.sha256 b/sources/mesa-19.0.4.tar.gz.sha256 new file mode 100644 index 00000000..b7f2c83e --- /dev/null +++ b/sources/mesa-19.0.4.tar.gz.sha256 @@ -0,0 +1 @@ +de361c76bf7aae09219f571b9ae77a34864a1cd9f6ba24c845b18b3cd5e4b9a2 mesa-19.0.4.tar.gz -- 2.11.4.GIT