commit:     a68639cd4a0a59e7bde0b0e33a6657d066e5fc5d
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 22 03:02:25 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 03:02:25 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=a68639cd

media-libs/mesa: fix mesa for stable systems

Package-Manager: Portage-2.3.72, Repoman-2.3.17
RepoMan-Options: --force
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 media-libs/mesa/Manifest                           |   6 +-
 media-libs/mesa/files/mesa-17-execinfo.patch       |  77 ---
 .../mesa/files/mesa-17-musl-invocation_name.patch  |  47 --
 media-libs/mesa/files/mesa-17-musl-pthread.patch   |  39 --
 media-libs/mesa/files/mesa-17-musl-string_h.patch  |  63 ---
 .../mesa/files/mesa-18-intel-missing-time_t.patch  |  11 -
 .../mesa-18-musl-amdgpu-include-pthread.patch      |  11 -
 .../mesa/files/mesa-18-musl-invocation_name.patch  |  12 -
 media-libs/mesa/files/mesa-18-musl-pthread.patch   |  40 --
 media-libs/mesa/files/mesa-19.0.8-execinfo.patch   |  97 ++++
 .../mesa/files/mesa-19.0.8-heap-allocation.patch   |  66 +++
 media-libs/mesa/mesa-18.1.9.ebuild                 | 519 --------------------
 media-libs/mesa/mesa-18.2.8.ebuild                 | 528 --------------------
 media-libs/mesa/mesa-18.3.4.ebuild                 | 532 ---------------------
 media-libs/mesa/mesa-18.3.5.ebuild                 | 532 ---------------------
 .../{mesa-18.3.6.ebuild => mesa-19.0.8.ebuild}     |  49 +-
 16 files changed, 191 insertions(+), 2438 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 31d2724..aec3d15 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,6 +1,2 @@
-DIST mesa-18.1.9.tar.xz 11146188 BLAKE2B 
753f0fa3780502d56927f9b0e6124b4728cb5aa3600de78585487fb8e178c6987a72b79fb56e6c310757d157f9f85f12b73a6889bd361b51b62fb1dc1c20eecd
 SHA512 
22db2950d25a3d9393e7c622c783bd177c21695569c8a95683bf77e92318e1db85672a134d4bea30c1f49a24e52bc3a2c1a0ac15deafb3a8fcbfb6de6a18adc2
-DIST mesa-18.2.8.tar.xz 11385224 BLAKE2B 
c6fbf71e2ab6837f91dfa996cf7e89e9cae22e219cac56bd4201f7a62c787ddd2f65e7d162a329971018f0b1a796ee1a5b252ee6b43bb3b27a233d67b6cdf615
 SHA512 
04d5ada9ba3acea853def3ebcbb53ee76936a4cd4229ae753d2ce1b5cf543bea1e5764f2ef2b19735d47d041ba6b0582841bc89e2c9331fdfbd89386f599a1f7
-DIST mesa-18.3.4.tar.xz 11875224 BLAKE2B 
81d34349c644cc93b3ca525046cdd63a5aa2a16d8f6b841830a138c8e9e375fb0f75a17bd80b4c48ed573f4976dd6612b0773305a3bec982540914365c9925ff
 SHA512 
e4ead944ba053aa05425e9e199d633f576dfa424976253fc32438e8db6da5e8d381122e4c4b7fb18f94177421f208bab5567cfec8d2692d104e266483ca02a99
-DIST mesa-18.3.5.tar.xz 11882012 BLAKE2B 
88279fe2f24c2a47c8857ad34382b7c8b64119632f1ec7ce8d0fe2afe669e01d2e071726f01e28b001be353d8d9ec1f0ef46d3ba1e64239d63221b100745e8ee
 SHA512 
f229ac122eafee98d1a40c54adeb019eb4458cb67063db9ba760b265da0634fe77247c3c8cb5c5de5fd40f8545e35d45000a74af9257ebf4e2028156add8644c
-DIST mesa-18.3.6.tar.xz 11882744 BLAKE2B 
f0f0de6d4c40cf01c6b9cb97d772c6386deb3d08f66f2731fe60eff21edfa822b6d7a293fbf9e426acddbb58445b9b0e3c0b1bc8ae05e8b19e802872571449c2
 SHA512 
3a6dcaba99185e28d162b130bbd760fe87e6072065958189b28f41ea287ef041397897e098d93218a64802cf11c73806f7400a866bd8e5ed69694fa15c147487
+DIST mesa-19.0.8.tar.xz 11967592 BLAKE2B 
91a46b67bdb8cb3ab4c7337be7c2b0dc6ab5ec8cc126afc2d8af8d056bff0392a5b443c26304bf4c68472eb6ba16d29ca248c1fc0c0f2dd6af03d3e10d3ec1b3
 SHA512 
fbddc3a74f223564343027380af776b3fa5d63fe1af4e34121273235d1c6eced96439f601eb19bf658eb927aff3965b520f0329fcbd4650f3112167303e1746d
 DIST mesa-19.1.4.tar.xz 10938008 BLAKE2B 
4745fc7e844397378fe1adf61bcd5b54aad11ec0b375ced85fd80ced01227432b491ad8b7ba7d9013190cfbb451bc11cdb7c8af0e1f298dd5d793d3ce43aa92b
 SHA512 
234032d917c9b378c3f6ceb921677b64e549344c3957331810b50fd73e0dccd2f4f62e2bd39e619590f389bc58fdab10fab4b88f7c117557cbeb1dda049b9fc5

diff --git a/media-libs/mesa/files/mesa-17-execinfo.patch 
b/media-libs/mesa/files/mesa-17-execinfo.patch
deleted file mode 100644
index 87b2ce6..0000000
--- a/media-libs/mesa/files/mesa-17-execinfo.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-diff -Naur mesa-17.3.0.orig/configure.ac mesa-17.3.0/configure.ac
---- mesa-17.3.0.orig/configure.ac      2017-12-08 05:49:11.000000000 -0800
-+++ mesa-17.3.0/configure.ac   2017-12-11 14:11:53.587811247 -0800
-@@ -794,6 +794,7 @@
- AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
- AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
- AC_CHECK_FUNC([memfd_create], [DEFINES="$DEFINES -DHAVE_MEMFD_CREATE"])
-+AC_CHECK_HEADER([execinfo.h], [DEFINES="$DEFINES -DHAVE_EXECINFO_H"])
- 
- AC_MSG_CHECKING([whether strtod has locale support])
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
-diff -Naur mesa-17.3.0.orig/src/gallium/auxiliary/util/u_debug_symbol.c 
mesa-17.3.0/src/gallium/auxiliary/util/u_debug_symbol.c
---- mesa-17.3.0.orig/src/gallium/auxiliary/util/u_debug_symbol.c       
2017-12-08 05:49:11.000000000 -0800
-+++ mesa-17.3.0/src/gallium/auxiliary/util/u_debug_symbol.c    2017-12-11 
14:13:52.780809112 -0800
-@@ -219,7 +219,7 @@
- #endif /* PIPE_OS_WINDOWS */
- 
- 
--#if defined(__GLIBC__) && !defined(__UCLIBC__)
-+#if defined(HAVE_EXECINFO_H)
- 
- #include <execinfo.h>
- 
-@@ -240,7 +240,7 @@
-    return TRUE;
- }
- 
--#endif /* defined(__GLIBC__) && !defined(__UCLIBC__) */
-+#endif /* defined(HAVE_EXECINFO_H) */
- 
- 
- void
-@@ -252,7 +252,7 @@
-    }
- #endif
- 
--#if defined(__GLIBC__) && !defined(__UCLIBC__)
-+#if defined(HAVE_EXECINFO_H)
-    if (debug_symbol_name_glibc(addr, buf, size)) {
-        return;
-    }
-diff -Naur mesa-17.3.0.orig/src/mapi/glapi/gen/gl_gentable.py 
mesa-17.3.0/src/mapi/glapi/gen/gl_gentable.py
---- mesa-17.3.0.orig/src/mapi/glapi/gen/gl_gentable.py 2017-12-08 
05:49:11.000000000 -0800
-+++ mesa-17.3.0/src/mapi/glapi/gen/gl_gentable.py      2017-12-11 
14:11:53.587811247 -0800
-@@ -43,7 +43,7 @@
- #endif
- 
- #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
--      || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && 
!defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && 
!defined(__DragonFly__))
-+      || (!defined(GLXEXT) && defined(DEBUG) && defined(HAVE_EXECINFO_H))
- #define USE_BACKTRACE
- #endif
- 
-diff -Naur mesa-17.3.0.orig/src/mapi/glapi/glapi_gentable.c 
mesa-17.3.0/src/mapi/glapi/glapi_gentable.c
---- mesa-17.3.0.orig/src/mapi/glapi/glapi_gentable.c   2017-12-08 
05:49:45.000000000 -0800
-+++ mesa-17.3.0/src/mapi/glapi/glapi_gentable.c        2017-12-11 
14:11:53.588811247 -0800
-@@ -36,7 +36,7 @@
- #endif
- 
- #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \
--      || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && 
!defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && 
!defined(__DragonFly__))
-+      || (!defined(GLXEXT) && defined(DEBUG) && defined(HAVE_EXECINFO_H))
- #define USE_BACKTRACE
- #endif
- 
-diff -Naur mesa-17.3.0.orig/src/mesa/drivers/dri/i915/intel_regions.c 
mesa-17.3.0/src/mesa/drivers/dri/i915/intel_regions.c
---- mesa-17.3.0.orig/src/mesa/drivers/dri/i915/intel_regions.c 2017-12-08 
05:49:11.000000000 -0800
-+++ mesa-17.3.0/src/mesa/drivers/dri/i915/intel_regions.c      2017-12-11 
14:11:53.588811247 -0800
-@@ -57,7 +57,7 @@
-  */
- #define DEBUG_BACKTRACE_SIZE 0
- 
--#if DEBUG_BACKTRACE_SIZE == 0
-+#if DEBUG_BACKTRACE_SIZE == 0 || !defined(HAVE_EXECINFO_H)
- /* Use the standard debug output */
- #define _DBG(...) DBG(__VA_ARGS__)
- #else

diff --git a/media-libs/mesa/files/mesa-17-musl-invocation_name.patch 
b/media-libs/mesa/files/mesa-17-musl-invocation_name.patch
deleted file mode 100644
index 80b02f5..0000000
--- a/media-libs/mesa/files/mesa-17-musl-invocation_name.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff -Naur mesa-17.3.0.orig/src/gallium/auxiliary/os/os_process.c 
mesa-17.3.0/src/gallium/auxiliary/os/os_process.c
---- mesa-17.3.0.orig/src/gallium/auxiliary/os/os_process.c     2017-12-08 
05:49:11.000000000 -0800
-+++ mesa-17.3.0/src/gallium/auxiliary/os/os_process.c  2017-12-11 
14:24:35.200797607 -0800
-@@ -32,7 +32,7 @@
- 
- #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
- #  include <windows.h>
--#elif defined(__GLIBC__) || defined(__CYGWIN__)
-+#elif defined(__linux__) || defined(__CYGWIN__)
- #  include <errno.h>
- #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || 
defined(PIPE_OS_ANDROID)
- #  include <stdlib.h>
-@@ -84,7 +84,7 @@
- 
-       name = lpProcessName;
- 
--#elif defined(__GLIBC__) || defined(__CYGWIN__)
-+#elif defined(__linux__) || defined(__CYGWIN__)
-       name = program_invocation_short_name;
- #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE) || 
defined(PIPE_OS_ANDROID)
-       /* *BSD and OS X */
-diff -Naur 
mesa-17.3.0.orig/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c 
mesa-17.3.0/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
---- mesa-17.3.0.orig/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c       
2017-12-08 05:49:11.000000000 -0800
-+++ mesa-17.3.0/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c    
2017-12-11 14:23:35.312798680 -0800
-@@ -84,7 +84,7 @@
-    ret = os_get_process_name(cmdline, 63);
-    if (ret == FALSE)
-       strcpy(cmdline, nstr);
--#if defined(__GLIBC__) || defined(__CYGWIN__)
-+#if defined(__linux__) || defined(__CYGWIN__)
-    if (!strcmp(cmdline, "shader_runner")) {
-       const char *name;
-       /* hack to get better testname */
-diff -Naur mesa-17.3.0.orig/src/util/xmlconfig.c 
mesa-17.3.0/src/util/xmlconfig.c
---- mesa-17.3.0.orig/src/util/xmlconfig.c      2017-12-08 05:49:11.000000000 
-0800
-+++ mesa-17.3.0/src/util/xmlconfig.c   2017-12-11 14:22:54.052799419 -0800
-@@ -40,8 +40,8 @@
- 
- #undef GET_PROGRAM_NAME
- 
--#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
--#    if !defined(__GLIBC__) || (__GLIBC__ < 2)
-+#if defined(__linux__)
-+#    if defined(__GLIBC__) && (__GLIBC__ < 2)
- /* These aren't declared in any libc5 header */
- extern char *program_invocation_name, *program_invocation_short_name;
- #    endif

diff --git a/media-libs/mesa/files/mesa-17-musl-pthread.patch 
b/media-libs/mesa/files/mesa-17-musl-pthread.patch
deleted file mode 100644
index aac95af..0000000
--- a/media-libs/mesa/files/mesa-17-musl-pthread.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -Naur mesa-17.3.0.orig/src/gallium/state_trackers/nine/nine_debug.c 
mesa-17.3.0/src/gallium/state_trackers/nine/nine_debug.c
---- mesa-17.3.0.orig/src/gallium/state_trackers/nine/nine_debug.c      
2017-12-12 16:55:53.885552821 -0800
-+++ mesa-17.3.0/src/gallium/state_trackers/nine/nine_debug.c   2017-12-12 
17:09:36.048538098 -0800
-@@ -73,8 +73,8 @@
-     }
- 
- #if defined(HAVE_PTHREAD)
--#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
--      (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-+#  if defined(__linux__) && !(defined(__GLIBC__) || \
-+      (__GLIBC__ < 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)))
-     if (dbg_flags & DBG_TID)
-         tid = pthread_self();
- #  endif
-diff -Naur mesa-17.3.0.orig/src/util/u_thread.h mesa-17.3.0/src/util/u_thread.h
---- mesa-17.3.0.orig/src/util/u_thread.h       2017-12-12 16:55:53.915552820 
-0800
-+++ mesa-17.3.0/src/util/u_thread.h    2017-12-12 17:09:34.079538133 -0800
-@@ -61,8 +61,8 @@
- static inline void u_thread_setname( const char *name )
- {
- #if defined(HAVE_PTHREAD)
--#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
--      (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-+#  if defined(__linux__) && !(defined(__GLIBC__) || \
-+      (__GLIBC__ < 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)))
-    pthread_setname_np(pthread_self(), name);
- #  endif
- #endif
-@@ -92,8 +92,8 @@
- static inline bool u_thread_is_self(thrd_t thread)
- {
- #if defined(HAVE_PTHREAD)
--#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
--      (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-+#  if defined(__linux__) && !(defined(__GLIBC__) || \
-+      (__GLIBC__ < 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 12)))
-    return pthread_equal(pthread_self(), thread);
- #  endif
- #endif

diff --git a/media-libs/mesa/files/mesa-17-musl-string_h.patch 
b/media-libs/mesa/files/mesa-17-musl-string_h.patch
deleted file mode 100644
index f3ec9e9..0000000
--- a/media-libs/mesa/files/mesa-17-musl-string_h.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -Naur mesa-17.3.0.orig/src/compiler/glsl/glcpp/glcpp-parse.c 
mesa-17.3.0/src/compiler/glsl/glcpp/glcpp-parse.c
---- mesa-17.3.0.orig/src/compiler/glsl/glcpp/glcpp-parse.c     2017-12-08 
05:49:48.000000000 -0800
-+++ mesa-17.3.0/src/compiler/glsl/glcpp/glcpp-parse.c  2017-12-11 
14:07:34.299815890 -0800
-@@ -1220,7 +1220,7 @@
- #if YYERROR_VERBOSE
- 
- # ifndef yystrlen
--#  if defined __GLIBC__ && defined _STRING_H
-+#  if defined __linux__ && defined _STRING_H
- #   define yystrlen strlen
- #  else
- /* Return the length of YYSTR.  */
-@@ -1236,7 +1236,7 @@
- # endif
- 
- # ifndef yystpcpy
--#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-+#  if defined __linux__ && defined _STRING_H && defined _GNU_SOURCE
- #   define yystpcpy stpcpy
- #  else
- /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-diff -Naur mesa-17.3.0.orig/src/compiler/glsl/glsl_parser.cpp 
mesa-17.3.0/src/compiler/glsl/glsl_parser.cpp
---- mesa-17.3.0.orig/src/compiler/glsl/glsl_parser.cpp 2017-12-08 
05:49:49.000000000 -0800
-+++ mesa-17.3.0/src/compiler/glsl/glsl_parser.cpp      2017-12-11 
14:07:04.530816423 -0800
-@@ -2815,7 +2815,7 @@
- #if YYERROR_VERBOSE
- 
- # ifndef yystrlen
--#  if defined __GLIBC__ && defined _STRING_H
-+#  if defined __linux__ && defined _STRING_H
- #   define yystrlen strlen
- #  else
- /* Return the length of YYSTR.  */
-@@ -2831,7 +2831,7 @@
- # endif
- 
- # ifndef yystpcpy
--#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-+#  if defined __linux__ && defined _STRING_H && defined _GNU_SOURCE
- #   define yystpcpy stpcpy
- #  else
- /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-diff -Naur mesa-17.3.0.orig/src/mesa/program/program_parse.tab.c 
mesa-17.3.0/src/mesa/program/program_parse.tab.c
---- mesa-17.3.0.orig/src/mesa/program/program_parse.tab.c      2017-12-08 
05:49:53.000000000 -0800
-+++ mesa-17.3.0/src/mesa/program/program_parse.tab.c   2017-12-11 
14:10:08.621813126 -0800
-@@ -1440,7 +1440,7 @@
- #if YYERROR_VERBOSE
- 
- # ifndef yystrlen
--#  if defined __GLIBC__ && defined _STRING_H
-+#  if defined __linux__ && defined _STRING_H
- #   define yystrlen strlen
- #  else
- /* Return the length of YYSTR.  */
-@@ -1456,7 +1456,7 @@
- # endif
- 
- # ifndef yystpcpy
--#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-+#  if defined __linux__ && defined _STRING_H && defined _GNU_SOURCE
- #   define yystpcpy stpcpy
- #  else
- /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in

diff --git a/media-libs/mesa/files/mesa-18-intel-missing-time_t.patch 
b/media-libs/mesa/files/mesa-18-intel-missing-time_t.patch
deleted file mode 100644
index 353f8f2..0000000
--- a/media-libs/mesa/files/mesa-18-intel-missing-time_t.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur mesa-18.1.0-rc1.orig/src/mesa/drivers/dri/i965/brw_bufmgr.h 
mesa-18.1.0-rc1/src/mesa/drivers/dri/i965/brw_bufmgr.h
---- mesa-18.1.0-rc1.orig/src/mesa/drivers/dri/i965/brw_bufmgr.h        
2018-04-22 12:42:46.505947484 -0700
-+++ mesa-18.1.0-rc1/src/mesa/drivers/dri/i965/brw_bufmgr.h     2018-04-22 
12:44:09.720945994 -0700
-@@ -37,6 +37,7 @@
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdio.h>
-+#include <time.h>
- #include "util/u_atomic.h"
- #include "util/list.h"
- 

diff --git a/media-libs/mesa/files/mesa-18-musl-amdgpu-include-pthread.patch 
b/media-libs/mesa/files/mesa-18-musl-amdgpu-include-pthread.patch
deleted file mode 100644
index 7a0bde0..0000000
--- a/media-libs/mesa/files/mesa-18-musl-amdgpu-include-pthread.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur mesa-18.1.3-orig/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h 
mesa-18.1.3/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
---- mesa-18.1.3-orig/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h 
2018-07-08 22:01:10.758633781 +0300
-+++ mesa-18.1.3/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h      
2018-07-08 22:01:30.097631709 +0300
-@@ -32,6 +32,7 @@
- #include "ac_gpu_info.h"
- #include "addrlib/addrinterface.h"
- #include <amdgpu.h>
-+#include <pthread.h>
- #include "util/list.h"
- 
- struct radv_amdgpu_winsys {

diff --git a/media-libs/mesa/files/mesa-18-musl-invocation_name.patch 
b/media-libs/mesa/files/mesa-18-musl-invocation_name.patch
deleted file mode 100644
index f591d47..0000000
--- a/media-libs/mesa/files/mesa-18-musl-invocation_name.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur 
mesa-18.2.1.orig/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c 
mesa-18.2.1/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
---- mesa-18.2.1.orig/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c       
2018-09-21 06:57:00.000000000 -0400
-+++ mesa-18.2.1/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c    
2018-10-04 20:06:47.074806047 -0400
-@@ -84,7 +84,7 @@
-    ret = os_get_process_name(cmdline, 63);
-    if (ret == FALSE)
-       strcpy(cmdline, nstr);
--#if defined(__GLIBC__) || defined(__CYGWIN__)
-+#if defined(__linux__) || defined(__CYGWIN__)
-    if (!strcmp(cmdline, "shader_runner")) {
-       const char *name;
-       /* hack to get better testname */

diff --git a/media-libs/mesa/files/mesa-18-musl-pthread.patch 
b/media-libs/mesa/files/mesa-18-musl-pthread.patch
deleted file mode 100644
index a6af63e..0000000
--- a/media-libs/mesa/files/mesa-18-musl-pthread.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -Naur mesa-18.0.0-rc2.orig/src/gallium/state_trackers/nine/nine_debug.c 
mesa-18.0.0-rc2/src/gallium/state_trackers/nine/nine_debug.c
---- mesa-18.0.0-rc2.orig/src/gallium/state_trackers/nine/nine_debug.c  
2018-01-24 13:20:13.287944874 -0800
-+++ mesa-18.0.0-rc2/src/gallium/state_trackers/nine/nine_debug.c       
2018-01-24 13:23:34.722941267 -0800
-@@ -73,8 +73,8 @@
-     }
- 
- #if defined(HAVE_PTHREAD)
--#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
--      (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-+#  if defined(__linux__) && (!defined(__GLIBC__) || \
-+      __GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-     if (dbg_flags & DBG_TID)
-         tid = pthread_self();
- #  endif
-diff -Naur mesa-18.0.0-rc2.orig/src/util/u_thread.h 
mesa-18.0.0-rc2/src/util/u_thread.h
---- mesa-18.0.0-rc2.orig/src/util/u_thread.h   2018-01-24 13:20:13.166944876 
-0800
-+++ mesa-18.0.0-rc2/src/util/u_thread.h        2018-01-24 13:24:11.028940616 
-0800
-@@ -61,9 +61,8 @@
- static inline void u_thread_setname( const char *name )
- {
- #if defined(HAVE_PTHREAD)
--#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
--      (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12)) && \
--      defined(__linux__)
-+#  if defined(__linux__) && (!defined(__GLIBC__) || \
-+      __GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-    pthread_setname_np(pthread_self(), name);
- #  endif
- #endif
-@@ -93,8 +92,8 @@
- static inline bool u_thread_is_self(thrd_t thread)
- {
- #if defined(HAVE_PTHREAD)
--#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && 
defined(__GLIBC_MINOR__) && \
--      (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-+#  if defined(__linux__) && !(defined(__GLIBC__) || \
-+      __GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-    return pthread_equal(pthread_self(), thread);
- #  endif
- #endif

diff --git a/media-libs/mesa/files/mesa-19.0.8-execinfo.patch 
b/media-libs/mesa/files/mesa-19.0.8-execinfo.patch
new file mode 100644
index 0000000..217739d
--- /dev/null
+++ b/media-libs/mesa/files/mesa-19.0.8-execinfo.patch
@@ -0,0 +1,97 @@
+From 10e8d466011076a0453368cb976d9f6b06af0e94 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anar...@gentoo.org>
+Date: Tue, 7 May 2019 21:47:40 -0500
+Subject: [PATCH] meson: Search for execinfo.h
+
+Rather than checking __GLIBC__/__UCLIBC__ macros as a proxy for
+execinfo.h presence, just check directly. This allows the build to work
+on musl.
+
+Reviewed-by: Matt Turner <matts...@gmail.com>
+Reviewed-by: Eric Anholt <e...@anholt.net>
+Reviewed-by: Eric Engestrom <eric.engest...@intel.com>
+---
+ meson.build                                 | 2 +-
+ src/gallium/auxiliary/util/u_debug_symbol.c | 8 ++++----
+ src/mapi/glapi/gen/gl_gentable.py           | 2 +-
+ src/mesa/drivers/dri/i915/intel_regions.c   | 2 +-
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index a2978117409..a0c965efc32 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1036,7 +1036,7 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
+   pre_args += '-DMAJOR_IN_MKDEV'
+ endif
+ 
+-foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 
'dlfcn.h']
++foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 
'dlfcn.h', 'execinfo.h']
+   if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h))
+     pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
+   endif
+diff --git a/src/gallium/auxiliary/util/u_debug_symbol.c 
b/src/gallium/auxiliary/util/u_debug_symbol.c
+index 22e6c8ce771..d8380b76bf6 100644
+--- a/src/gallium/auxiliary/util/u_debug_symbol.c
++++ b/src/gallium/auxiliary/util/u_debug_symbol.c
+@@ -219,7 +219,7 @@ debug_symbol_name_dbghelp(const void *addr, char* buf, 
unsigned size)
+ #endif /* PIPE_OS_WINDOWS */
+ 
+ 
+-#if defined(__GLIBC__) && !defined(__UCLIBC__)
++#if defined(HAVE_EXECINFO_H)
+ 
+ #include <execinfo.h>
+ 
+@@ -240,7 +240,7 @@ debug_symbol_name_glibc(const void *addr, char* buf, 
unsigned size)
+    return TRUE;
+ }
+ 
+-#endif /* defined(__GLIBC__) && !defined(__UCLIBC__) */
++#endif /* defined(HAVE_EXECINFO_H) */
+ 
+ 
+ void
+@@ -252,11 +252,11 @@ debug_symbol_name(const void *addr, char* buf, unsigned 
size)
+    }
+ #endif
+ 
+-#if defined(__GLIBC__) && !defined(__UCLIBC__)
++#if defined(HAVE_EXECINFO_H)
+    if (debug_symbol_name_glibc(addr, buf, size)) {
+        return;
+    }
+-#endif
++#endif /* defined(HAVE_EXECINFO_H) */
+ 
+    util_snprintf(buf, size, "%p", addr);
+    buf[size - 1] = 0;
+diff --git a/src/mapi/glapi/gen/gl_gentable.py 
b/src/mapi/glapi/gen/gl_gentable.py
+index 9d8923cf8db..92e1a546cff 100644
+--- a/src/mapi/glapi/gen/gl_gentable.py
++++ b/src/mapi/glapi/gen/gl_gentable.py
+@@ -45,7 +45,7 @@ header = """/* GLXEXT is the define used in the xserver when 
the GLX extension i
+ #endif
+ 
+ #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\
+-      || (!defined(GLXEXT) && defined(DEBUG) && !defined(__CYGWIN__) && 
!defined(__MINGW32__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && 
!defined(__DragonFly__))
++      || (!defined(GLXEXT) && defined(DEBUG) && defined(HAVE_EXECINFO_H))
+ #define USE_BACKTRACE
+ #endif
+ 
+diff --git a/src/mesa/drivers/dri/i915/intel_regions.c 
b/src/mesa/drivers/dri/i915/intel_regions.c
+index fee734801cd..803ea9326e8 100644
+--- a/src/mesa/drivers/dri/i915/intel_regions.c
++++ b/src/mesa/drivers/dri/i915/intel_regions.c
+@@ -57,7 +57,7 @@
+  */
+ #define DEBUG_BACKTRACE_SIZE 0
+ 
+-#if DEBUG_BACKTRACE_SIZE == 0
++#if DEBUG_BACKTRACE_SIZE == 0 || !defined(HAVE_EXECINFO_H)
+ /* Use the standard debug output */
+ #define _DBG(...) DBG(__VA_ARGS__)
+ #else
+-- 
+2.21.0
+

diff --git a/media-libs/mesa/files/mesa-19.0.8-heap-allocation.patch 
b/media-libs/mesa/files/mesa-19.0.8-heap-allocation.patch
new file mode 100644
index 0000000..90e30e0
--- /dev/null
+++ b/media-libs/mesa/files/mesa-19.0.8-heap-allocation.patch
@@ -0,0 +1,66 @@
+From fd7b7f14d857f96cf3b2e9d8405dbbfa30dc261a Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anar...@gentoo.org>
+Date: Mon, 10 Jun 2019 11:48:02 -0700
+Subject: [PATCH] util: Heap-allocate 256K zlib buffer
+
+The disk cache code tries to allocate a 256 Kbyte buffer on the stack.
+Since musl only gives 80 Kbyte of stack space per thread, this causes a
+trap.
+
+See 
https://wiki.musl-libc.org/functional-differences-from-glibc.html#Thread-stack-size
+
+(In musl-1.1.21 the default stack size has increased to 128K)
+
+[mattst88]: Original author unknown, but I think this is small enough
+            that it is not copyrightable.
+Reviewed-by: Matt Turner <matts...@gmail.com>
+Reviewed-by: Eric Anholt <e...@anholt.net>
+Reviewed-by: Eric Engestrom <eric.engest...@intel.com>
+---
+ src/util/disk_cache.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
+index 9977c385de1..bc3becfe535 100644
+--- a/src/util/disk_cache.c
++++ b/src/util/disk_cache.c
+@@ -732,7 +732,7 @@ static size_t
+ deflate_and_write_to_disk(const void *in_data, size_t in_data_size, int dest,
+                           const char *filename)
+ {
+-   unsigned char out[BUFSIZE];
++   unsigned char *out;
+ 
+    /* allocate deflate state */
+    z_stream strm;
+@@ -749,6 +749,11 @@ deflate_and_write_to_disk(const void *in_data, size_t 
in_data_size, int dest,
+    /* compress until end of in_data */
+    size_t compressed_size = 0;
+    int flush;
++
++   out = malloc(BUFSIZE * sizeof(unsigned char));
++   if (out == NULL)
++      return 0;
++
+    do {
+       int remaining = in_data_size - BUFSIZE;
+       flush = remaining > 0 ? Z_NO_FLUSH : Z_FINISH;
+@@ -770,6 +775,7 @@ deflate_and_write_to_disk(const void *in_data, size_t 
in_data_size, int dest,
+          ssize_t written = write_all(dest, out, have);
+          if (written == -1) {
+             (void)deflateEnd(&strm);
++            free(out);
+             return 0;
+          }
+       } while (strm.avail_out == 0);
+@@ -784,6 +790,7 @@ deflate_and_write_to_disk(const void *in_data, size_t 
in_data_size, int dest,
+ 
+    /* clean up and return */
+    (void)deflateEnd(&strm);
++   free(out);
+    return compressed_size;
+ }
+ 
+-- 
+2.21.0
+

diff --git a/media-libs/mesa/mesa-18.1.9.ebuild 
b/media-libs/mesa/mesa-18.1.9.ebuild
deleted file mode 100644
index e61e3fd..0000000
--- a/media-libs/mesa/mesa-18.1.9.ebuild
+++ /dev/null
@@ -1,519 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git";
-
-if [[ ${PV} = 9999 ]]; then
-       GIT_ECLASS="git-r3"
-       EXPERIMENTAL="true"
-fi
-
-PYTHON_COMPAT=( python2_7 )
-
-inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
-
-OPENGL_DIR="xorg-x11"
-
-MY_P="${P/_/-}"
-
-DESCRIPTION="OpenGL-like graphic library for Linux"
-HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/";
-
-if [[ $PV == 9999 ]]; then
-       SRC_URI=""
-else
-       SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz";
-       KEYWORDS="amd64 ~arm ~arm64 ~mips ~ppc x86"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="!bindist? ( bindist )"
-
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl 
vivante vmware"
-for card in ${VIDEO_CARDS}; do
-       IUSE_VIDEO_CARDS+=" video_cards_${card}"
-done
-
-IUSE="${IUSE_VIDEO_CARDS}
-       bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 unwind
-       +llvm +nptl opencl osmesa pax_kernel pic selinux vaapi valgrind
-       vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-       d3d9?   ( dri3 gallium )
-       llvm?   ( gallium )
-       opencl? ( gallium llvm || ( video_cards_r600 video_cards_radeonsi ) )
-       gles1?  ( egl )
-       gles2?  ( egl )
-       vaapi? ( gallium )
-       vdpau? ( gallium )
-       vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
-                         video_cards_radeonsi? ( llvm ) )
-       wayland? ( egl gbm )
-       xa?  ( gallium )
-       video_cards_freedreno?  ( gallium )
-       video_cards_intel?  ( classic )
-       video_cards_i915?   ( || ( classic gallium ) )
-       video_cards_i965?   ( classic )
-       video_cards_imx?    ( gallium video_cards_vivante )
-       video_cards_nouveau? ( || ( classic gallium ) )
-       video_cards_radeon? ( || ( classic gallium )
-                                                 gallium? ( x86? ( llvm ) 
amd64? ( llvm ) ) )
-       video_cards_r100?   ( classic )
-       video_cards_r200?   ( classic )
-       video_cards_r300?   ( gallium x86? ( llvm ) amd64? ( llvm ) )
-       video_cards_r600?   ( gallium )
-       video_cards_radeonsi?   ( gallium llvm )
-       video_cards_vc4? ( gallium )
-       video_cards_virgl? ( gallium )
-       video_cards_vivante? ( gallium gbm )
-       video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.91"
-RDEPEND="
-       !app-eselect/eselect-mesa
-       >=app-eselect/eselect-opengl-1.3.0
-       >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
-       >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
-       >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
-       x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-       unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
-       llvm? (
-               video_cards_radeonsi? (
-                       virtual/libelf:0=[${MULTILIB_USEDEP}]
-               )
-               video_cards_r600? (
-                       virtual/libelf:0=[${MULTILIB_USEDEP}]
-               )
-               video_cards_radeon? (
-                       virtual/libelf:0=[${MULTILIB_USEDEP}]
-               )
-       )
-       opencl? (
-                               app-eselect/eselect-opencl
-                               dev-libs/libclc
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-       vaapi? (
-               >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
-               video_cards_nouveau? ( !<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
-       )
-       vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
-       wayland? (
-               >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
-               >=dev-libs/wayland-protocols-1.8
-       )
-       xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
-       
${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
-
-       video_cards_intel? (
-               !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-       )
-       video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-"
-for card in ${RADEON_CARDS}; do
-       RDEPEND="${RDEPEND}
-               video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
-       "
-done
-RDEPEND="${RDEPEND}
-       video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
-"
-
-# Please keep the LLVM dependency block separate. Since LLVM is slotted,
-# we need to *really* make sure we're not pulling one than more slot
-# simultaneously.
-#
-# How to use it:
-# 1. List all the working slots (with min versions) in ||, newest first.
-# 2. Update the := to specify *max* version, e.g. < 7.
-# 3. Specify LLVM_MAX_SLOT, e.g. 6.
-LLVM_MAX_SLOT="6"
-LLVM_DEPSTR="
-       || (
-               sys-devel/llvm:7[${MULTILIB_USEDEP}]
-               sys-devel/llvm:6[${MULTILIB_USEDEP}]
-               sys-devel/llvm:5[${MULTILIB_USEDEP}]
-               sys-devel/llvm:4[${MULTILIB_USEDEP}]
-               >=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
-       )
-       sys-devel/llvm:=[${MULTILIB_USEDEP}]
-"
-LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
-CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-RDEPEND="${RDEPEND}
-       llvm? (
-               opencl? (
-                       video_cards_r600? (
-                               ${CLANG_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${CLANG_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${CLANG_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${CLANG_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-               !opencl? (
-                       video_cards_r600? (
-                               ${LLVM_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${LLVM_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${LLVM_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${LLVM_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-       )
-"
-unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
-
-DEPEND="${RDEPEND}
-       ${PYTHON_DEPS}
-       opencl? (
-               >=sys-devel/gcc-4.6
-       )
-       sys-devel/gettext
-       virtual/pkgconfig
-       valgrind? ( dev-util/valgrind )
-       x11-base/xorg-proto
-       vulkan? (
-               $(python_gen_any_dep 
">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
-       )
-"
-[[ ${PV} == 9999 ]] && DEPEND+="
-       sys-devel/bison
-       sys-devel/flex
-       $(python_gen_any_dep ">=dev-python/mako-0.7.3[\${PYTHON_USEDEP}]")
-"
-
-S="${WORKDIR}/${MY_P}"
-EGIT_CHECKOUT_DIR=${S}
-
-QA_WX_LOAD="
-x86? (
-       !pic? (
-               usr/lib*/libglapi.so.0.0.0
-               usr/lib*/libGLESv1_CM.so.1.1.0
-               usr/lib*/libGLESv2.so.2.0.0
-               usr/lib*/libGL.so.1.2.0
-               usr/lib*/libOSMesa.so.8.0.0
-       )
-)"
-
-llvm_check_deps() {
-       local flags=${MULTILIB_USEDEP}
-       if use video_cards_r600 || use video_cards_radeon || use 
video_cards_radeonsi
-       then
-               flags+=",llvm_targets_AMDGPU(-)"
-       fi
-
-       if use opencl; then
-               has_version "sys-devel/clang[${flags}]" || return 1
-       fi
-       has_version "sys-devel/llvm[${flags}]"
-}
-
-pkg_setup() {
-       # warning message for bug 459306
-       if use llvm && has_version sys-devel/llvm[!debug=]; then
-               ewarn "Mismatch between debug USE flags in media-libs/mesa and 
sys-devel/llvm"
-               ewarn "detected! This can cause problems. For details, see bug 
459306."
-       fi
-
-       if use llvm; then
-               llvm_pkg_setup
-       fi
-       python-any-r1_pkg_setup
-}
-
-src_prepare() {
-       eapply "${FILESDIR}"/${PN}-17-execinfo.patch
-       eapply "${FILESDIR}"/${PN}-17-musl-string_h.patch
-       eapply "${FILESDIR}"/${PN}-17-musl-invocation_name.patch
-       eapply "${FILESDIR}"/${PN}-18-musl-pthread.patch
-       eapply "${FILESDIR}"/${PN}-18-intel-missing-time_t.patch
-       eapply "${FILESDIR}"/${PN}-18-musl-amdgpu-include-pthread.patch
-       eapply_user
-       eautoreconf
-}
-
-multilib_src_configure() {
-       local myconf
-
-       if use classic; then
-               # Configurable DRI drivers
-               driver_enable swrast
-
-               # Intel code
-               driver_enable video_cards_i915 i915
-               driver_enable video_cards_i965 i965
-               if ! use video_cards_i915 && \
-                       ! use video_cards_i965; then
-                       driver_enable video_cards_intel i915 i965
-               fi
-
-               # Nouveau code
-               driver_enable video_cards_nouveau nouveau
-
-               # ATI code
-               driver_enable video_cards_r100 radeon
-               driver_enable video_cards_r200 r200
-               if ! use video_cards_r100 && \
-                               ! use video_cards_r200; then
-                       driver_enable video_cards_radeon radeon r200
-               fi
-       fi
-
-       if use egl; then
-               myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo 
",wayland")$(use gbm && echo ",drm")"
-       fi
-
-       if use gallium; then
-               myconf+="
-                       $(use_enable d3d9 nine)
-                       $(use_enable llvm)
-                       $(use_enable vaapi va)
-                       $(use_enable vdpau)
-                       $(use_enable xa)
-                       $(use_enable xvmc)
-               "
-               use vaapi && myconf+=" 
--with-va-libdir=/usr/$(get_libdir)/va/drivers"
-
-               gallium_enable swrast
-               gallium_enable video_cards_vc4 vc4
-               gallium_enable video_cards_vivante etnaviv
-               gallium_enable video_cards_vmware svga
-               gallium_enable video_cards_nouveau nouveau
-               gallium_enable video_cards_i915 i915
-               gallium_enable video_cards_imx imx
-               if ! use video_cards_i915 && \
-                       ! use video_cards_i965; then
-                       gallium_enable video_cards_intel i915
-               fi
-
-               gallium_enable video_cards_r300 r300
-               gallium_enable video_cards_r600 r600
-               gallium_enable video_cards_radeonsi radeonsi
-               if ! use video_cards_r300 && \
-                               ! use video_cards_r600; then
-                       gallium_enable video_cards_radeon r300 r600
-               fi
-
-               gallium_enable video_cards_freedreno freedreno
-               # opencl stuff
-               if use opencl; then
-                       myconf+="
-                               $(use_enable opencl)
-                               --with-clang-libdir="${EPREFIX}/usr/lib"
-                               "
-               fi
-
-               gallium_enable video_cards_virgl virgl
-       fi
-
-       if use vulkan; then
-               vulkan_enable video_cards_i965 intel
-               vulkan_enable video_cards_radeonsi radeon
-       fi
-
-       # x86 hardened pax_kernel needs glx-rts, bug 240956
-       if [[ ${ABI} == x86 ]]; then
-               myconf+=" $(use_enable pax_kernel glx-read-only-text)"
-       fi
-
-       # on abi_x86_32 hardened we need to have asm disable
-       if [[ ${ABI} == x86* ]] && use pic; then
-               myconf+=" --disable-asm"
-       fi
-
-       if use gallium; then
-               myconf+=" $(use_enable osmesa gallium-osmesa)"
-       else
-               myconf+=" $(use_enable osmesa)"
-       fi
-
-       # build fails with BSD indent, bug #428112
-       use userland_GNU || export INDENT=cat
-
-       ECONF_SOURCE="${S}" \
-       econf \
-               --enable-dri \
-               --enable-glx \
-               --enable-shared-glapi \
-               $(use_enable !bindist texture-float) \
-               $(use_enable d3d9 nine) \
-               $(use_enable debug) \
-               $(use_enable dri3) \
-               $(use_enable egl) \
-               $(use_enable gbm) \
-               $(use_enable gles1) \
-               $(use_enable gles2) \
-               $(use_enable nptl glx-tls) \
-               $(use_enable unwind libunwind) \
-               --enable-valgrind=$(usex valgrind auto no) \
-               --enable-llvm-shared-libs \
-               --disable-opencl-icd \
-               --with-dri-drivers=${DRI_DRIVERS} \
-               --with-gallium-drivers=${GALLIUM_DRIVERS} \
-               --with-vulkan-drivers=${VULKAN_DRIVERS} \
-               PYTHON2="${PYTHON}" \
-               ${myconf}
-}
-
-multilib_src_install() {
-       emake install DESTDIR="${D}"
-
-       if use wayland; then
-               # These files are now provided by >=dev-libs/wayland-1.15.0
-               rm "${ED}/usr/$(get_libdir)/libwayland-egl.so" || die
-               rm "${ED}/usr/$(get_libdir)/libwayland-egl.so.1" || die
-               rm "${ED}/usr/$(get_libdir)/libwayland-egl.so.1.0.0" || die
-               rm "${ED}/usr/$(get_libdir)/pkgconfig/wayland-egl.pc" || die
-       fi
-
-       if use opencl; then
-               ebegin "Moving Gallium/Clover OpenCL implementation for dynamic 
switching"
-               local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
-               dodir ${cl_dir}/{lib,include}
-               if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
-                       mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
-                       "${ED}"${cl_dir}
-               fi
-               if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
-                       mv -f "${ED}"/usr/include/CL \
-                       "${ED}"${cl_dir}/include
-               fi
-               eend $?
-       fi
-}
-
-multilib_src_install_all() {
-       find "${ED}" -name '*.la' -delete
-       einstalldocs
-
-       if use !bindist; then
-               dodoc docs/patents.txt
-       fi
-}
-
-multilib_src_test() {
-       if use llvm; then
-               local llvm_tests='lp_test_arit lp_test_arit lp_test_blend 
lp_test_blend lp_test_conv lp_test_conv lp_test_format lp_test_format 
lp_test_printf lp_test_printf'
-               pushd src/gallium/drivers/llvmpipe >/dev/null || die
-               emake ${llvm_tests}
-               pax-mark m ${llvm_tests}
-               popd >/dev/null || die
-       fi
-       emake check
-}
-
-pkg_postinst() {
-       # Switch to the xorg implementation.
-       echo
-       eselect opengl set --use-old ${OPENGL_DIR}
-
-       # Switch to mesa opencl
-       if use opencl; then
-               eselect opencl set --use-old ${PN}
-       fi
-
-       # warn about patent encumbered texture-float
-       if use !bindist; then
-               elog "USE=\"bindist\" was not set. Potentially patent 
encumbered code was"
-               elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 
for an"
-               elog "explanation."
-       fi
-}
-
-# $1 - VIDEO_CARDS flag
-# other args - names of DRI drivers to enable
-# TODO: avoid code duplication for a more elegant implementation
-driver_enable() {
-       case $# in
-               # for enabling unconditionally
-               1)
-                       DRI_DRIVERS+=",$1"
-                       ;;
-               *)
-                       if use $1; then
-                               shift
-                               for i in $@; do
-                                       DRI_DRIVERS+=",${i}"
-                               done
-                       fi
-                       ;;
-       esac
-}
-
-gallium_enable() {
-       case $# in
-               # for enabling unconditionally
-               1)
-                       GALLIUM_DRIVERS+=",$1"
-                       ;;
-               *)
-                       if use $1; then
-                               shift
-                               for i in $@; do
-                                       GALLIUM_DRIVERS+=",${i}"
-                               done
-                       fi
-                       ;;
-       esac
-}
-
-vulkan_enable() {
-       case $# in
-               # for enabling unconditionally
-               1)
-                       VULKAN_DRIVERS+=",$1"
-                       ;;
-               *)
-                       if use $1; then
-                               shift
-                               for i in $@; do
-                                       VULKAN_DRIVERS+=",${i}"
-                               done
-                       fi
-                       ;;
-       esac
-}

diff --git a/media-libs/mesa/mesa-18.2.8.ebuild 
b/media-libs/mesa/mesa-18.2.8.ebuild
deleted file mode 100644
index 68f8024..0000000
--- a/media-libs/mesa/mesa-18.2.8.ebuild
+++ /dev/null
@@ -1,528 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 )
-
-inherit llvm meson multilib-minimal pax-utils python-any-r1
-
-OPENGL_DIR="xorg-x11"
-
-MY_P="${P/_/-}"
-
-DESCRIPTION="OpenGL-like graphic library for Linux"
-HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/";
-
-if [[ ${PV} == 9999 ]]; then
-       EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git";
-       EXPERIMENTAL="true"
-       inherit git-r3
-else
-       SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz";
-       KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="
-       !test? ( test )
-"
-
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl 
vivante vmware"
-for card in ${VIDEO_CARDS}; do
-       IUSE_VIDEO_CARDS+=" video_cards_${card}"
-done
-
-IUSE="${IUSE_VIDEO_CARDS}
-       +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm 
lm_sensors
-       opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind vdpau
-       vulkan wayland xa xvmc"
-
-REQUIRED_USE="
-       d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 
video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
-       gles1?  ( egl )
-       gles2?  ( egl )
-       vulkan? ( dri3
-                         || ( video_cards_i965 video_cards_radeonsi )
-                         video_cards_radeonsi? ( llvm ) )
-       wayland? ( egl gbm )
-       video_cards_freedreno?  ( gallium )
-       video_cards_intel?  ( classic )
-       video_cards_i915?   ( || ( classic gallium ) )
-       video_cards_i965?   ( classic )
-       video_cards_imx?    ( gallium video_cards_vivante )
-       video_cards_nouveau? ( || ( classic gallium ) )
-       video_cards_radeon? ( || ( classic gallium )
-                                                 gallium? ( x86? ( llvm ) 
amd64? ( llvm ) ) )
-       video_cards_r100?   ( classic )
-       video_cards_r200?   ( classic )
-       video_cards_r300?   ( gallium x86? ( llvm ) amd64? ( llvm ) )
-       video_cards_r600?   ( gallium )
-       video_cards_radeonsi?   ( gallium llvm )
-       video_cards_vc4? ( gallium )
-       video_cards_virgl? ( gallium )
-       video_cards_vivante? ( gallium gbm )
-       video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.93"
-RDEPEND="
-       !app-eselect/eselect-mesa
-       >=app-eselect/eselect-opengl-1.3.0
-       >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
-       >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
-       >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
-       x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-       gallium? (
-               unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
-               llvm? (
-                       video_cards_radeonsi? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-                       video_cards_r600? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-                       video_cards_radeon? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-               )
-               lm_sensors? ( sys-apps/lm_sensors:=[${MULTILIB_USEDEP}] )
-               opencl? (
-                                       
dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
-                                       dev-libs/libclc
-                                       virtual/libelf:0=[${MULTILIB_USEDEP}]
-                               )
-               vaapi? (
-                       >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
-                       video_cards_nouveau? ( 
!<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
-               )
-               vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
-               xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
-       )
-       wayland? (
-               >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
-               >=dev-libs/wayland-protocols-1.8
-       )
-       
${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
-
-       video_cards_intel? (
-               !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-       )
-       video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-"
-for card in ${RADEON_CARDS}; do
-       RDEPEND="${RDEPEND}
-               video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
-       "
-done
-RDEPEND="${RDEPEND}
-       video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
-"
-
-# Please keep the LLVM dependency block separate. Since LLVM is slotted,
-# we need to *really* make sure we're not pulling one than more slot
-# simultaneously.
-#
-# How to use it:
-# 1. List all the working slots (with min versions) in ||, newest first.
-# 2. Update the := to specify *max* version, e.g. < 8.
-# 3. Specify LLVM_MAX_SLOT, e.g. 7.
-LLVM_MAX_SLOT="7"
-LLVM_DEPSTR="
-       || (
-               sys-devel/llvm:7[${MULTILIB_USEDEP}]
-               sys-devel/llvm:6[${MULTILIB_USEDEP}]
-               sys-devel/llvm:5[${MULTILIB_USEDEP}]
-               sys-devel/llvm:4[${MULTILIB_USEDEP}]
-       )
-       <sys-devel/llvm-8:=[${MULTILIB_USEDEP}]
-"
-LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
-CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-RDEPEND="${RDEPEND}
-       llvm? (
-               opencl? (
-                       video_cards_r600? (
-                               ${CLANG_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${CLANG_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${CLANG_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${CLANG_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-               !opencl? (
-                       video_cards_r600? (
-                               ${LLVM_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${LLVM_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${LLVM_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${LLVM_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-       )
-"
-unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
-
-DEPEND="${RDEPEND}
-       ${PYTHON_DEPS}
-       opencl? (
-               >=sys-devel/gcc-4.6
-       )
-       sys-devel/bison
-       sys-devel/flex
-       sys-devel/gettext
-       virtual/pkgconfig
-       valgrind? ( dev-util/valgrind )
-       x11-base/xorg-proto
-       x11-libs/libXrandr[${MULTILIB_USEDEP}]
-       $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
-"
-
-S="${WORKDIR}/${MY_P}"
-EGIT_CHECKOUT_DIR=${S}
-
-QA_WX_LOAD="
-x86? (
-       !pic? (
-               usr/lib*/libglapi.so.0.0.0
-               usr/lib*/libGLESv1_CM.so.1.0.0
-               usr/lib*/libGLESv2.so.2.0.0
-               usr/lib*/libGL.so.1.2.0
-               usr/lib*/libOSMesa.so.8.0.0
-       )
-)"
-
-PATCHES=(
-       "${FILESDIR}"/${PN}-17-execinfo.patch
-       "${FILESDIR}"/${PN}-17-musl-string_h.patch
-       "${FILESDIR}"/${PN}-18-musl-invocation_name.patch
-       "${FILESDIR}"/${PN}-18-musl-pthread.patch
-       "${FILESDIR}"/${PN}-18-musl-amdgpu-include-pthread.patch
-       "${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
-)
-
-llvm_check_deps() {
-       local flags=${MULTILIB_USEDEP}
-       if use video_cards_r600 || use video_cards_radeon || use 
video_cards_radeonsi
-       then
-               flags+=",llvm_targets_AMDGPU(-)"
-       fi
-
-       if use opencl; then
-               has_version "sys-devel/clang[${flags}]" || return 1
-       fi
-       has_version "sys-devel/llvm[${flags}]"
-}
-
-pkg_pretend() {
-       if use opencl; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi; then
-                       ewarn "Ignoring USE=opencl     since VIDEO_CARDS does 
not contain r600 or radeonsi"
-               fi
-       fi
-
-       if use vaapi; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=vaapi      since VIDEO_CARDS does 
not contain r600, radeonsi, or nouveau"
-               fi
-       fi
-
-       if use vdpau; then
-               if ! use video_cards_r300 &&
-                  ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=vdpau      since VIDEO_CARDS does 
not contain r300, r600, radeonsi, or nouveau"
-               fi
-       fi
-
-       if use xa; then
-               if ! use video_cards_freedreno &&
-                  ! use video_cards_nouveau &&
-                  ! use video_cards_vmware; then
-                       ewarn "Ignoring USE=xa         since VIDEO_CARDS does 
not contain freedreno, nouveau, or vmware"
-               fi
-       fi
-
-       if use xvmc; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=xvmc       since VIDEO_CARDS does 
not contain r600 or nouveau"
-               fi
-       fi
-
-       if ! use gallium; then
-               use lm_sensors && ewarn "Ignoring USE=lm_sensors since USE does 
not contain gallium"
-               use llvm       && ewarn "Ignoring USE=llvm       since USE does 
not contain gallium"
-               use opencl     && ewarn "Ignoring USE=opencl     since USE does 
not contain gallium"
-               use vaapi      && ewarn "Ignoring USE=vaapi      since USE does 
not contain gallium"
-               use vdpau      && ewarn "Ignoring USE=vdpau      since USE does 
not contain gallium"
-               use unwind     && ewarn "Ignoring USE=unwind     since USE does 
not contain gallium"
-               use xa         && ewarn "Ignoring USE=xa         since USE does 
not contain gallium"
-               use xvmc       && ewarn "Ignoring USE=xvmc       since USE does 
not contain gallium"
-       fi
-
-       if ! use llvm; then
-               use opencl     && ewarn "Ignoring USE=opencl     since USE does 
not contain llvm"
-       fi
-}
-
-pkg_setup() {
-       # warning message for bug 459306
-       if use llvm && has_version sys-devel/llvm[!debug=]; then
-               ewarn "Mismatch between debug USE flags in media-libs/mesa and 
sys-devel/llvm"
-               ewarn "detected! This can cause problems. For details, see bug 
459306."
-       fi
-
-       if use llvm; then
-               llvm_pkg_setup
-       fi
-       python-any-r1_pkg_setup
-}
-
-multilib_src_configure() {
-       local emesonargs=()
-
-       if use classic; then
-               # Intel code
-               dri_driver_enable video_cards_i915 i915
-               dri_driver_enable video_cards_i965 i965
-               if ! use video_cards_i915 && \
-                       ! use video_cards_i965; then
-                       dri_driver_enable video_cards_intel i915 i965
-               fi
-
-               # Nouveau code
-               dri_driver_enable video_cards_nouveau nouveau
-
-               # ATI code
-               dri_driver_enable video_cards_r100 r100
-               dri_driver_enable video_cards_r200 r200
-               if ! use video_cards_r100 && \
-                       ! use video_cards_r200; then
-                       dri_driver_enable video_cards_radeon r100 r200
-               fi
-       fi
-
-       emesonargs+=( -Dplatforms=x11,surfaceless$(use wayland && echo 
",wayland")$(use gbm && echo ",drm") )
-
-       if use gallium; then
-               emesonargs+=(
-                       $(meson_use llvm)
-                       $(meson_use lm_sensors lmsensors)
-                       $(meson_use unwind libunwind)
-               )
-
-               if use video_cards_r300 ||
-                  use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau ||
-                  use video_cards_vmware; then
-                       emesonargs+=($(meson_use d3d9 gallium-nine))
-               else
-                       emesonargs+=(-Dgallium-nine=false)
-               fi
-
-               if use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use vaapi gallium-va))
-                       use vaapi && emesonargs+=( 
-Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
-               else
-                       emesonargs+=(-Dgallium-va=false)
-               fi
-
-               if use video_cards_r300 ||
-                  use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use vdpau gallium-vdpau))
-               else
-                       emesonargs+=(-Dgallium-vdpau=false)
-               fi
-
-               if use video_cards_freedreno ||
-                  use video_cards_nouveau ||
-                  use video_cards_vmware; then
-                       emesonargs+=($(meson_use xa gallium-xa))
-               else
-                       emesonargs+=(-Dgallium-xa=false)
-               fi
-
-               if use video_cards_r600 ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use xvmc gallium-xvmc))
-               else
-                       emesonargs+=(-Dgallium-xvmc=false)
-               fi
-
-               gallium_enable video_cards_vc4 vc4
-               gallium_enable video_cards_vivante etnaviv
-               gallium_enable video_cards_vmware svga
-               gallium_enable video_cards_nouveau nouveau
-               gallium_enable video_cards_imx imx
-
-               # Only one i915 driver (classic vs gallium). Default to classic.
-               if ! use classic; then
-                       gallium_enable video_cards_i915 i915
-                       if ! use video_cards_i915 && \
-                               ! use video_cards_i965; then
-                               gallium_enable video_cards_intel i915
-                       fi
-               fi
-
-               gallium_enable video_cards_r300 r300
-               gallium_enable video_cards_r600 r600
-               gallium_enable video_cards_radeonsi radeonsi
-               if ! use video_cards_r300 && \
-                       ! use video_cards_r600; then
-                       gallium_enable video_cards_radeon r300 r600
-               fi
-
-               gallium_enable video_cards_freedreno freedreno
-               gallium_enable video_cards_virgl virgl
-
-               # opencl stuff
-               emesonargs+=(
-                       -Dgallium-opencl="$(usex opencl icd disabled)"
-               )
-       fi
-
-       if use vulkan; then
-               vulkan_enable video_cards_i965 intel
-               vulkan_enable video_cards_radeonsi amd
-       fi
-
-       # x86 hardened pax_kernel needs glx-rts, bug 240956
-       if [[ ${ABI} == x86 ]]; then
-               emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
-       fi
-
-       # Disable glx tls support on musl
-       if use elibc_musl; then
-               emesonargs+=( -Dglx-tls=false )
-       fi
-
-       # on abi_x86_32 hardened we need to have asm disable
-       if [[ ${ABI} == x86* ]] && use pic; then
-               emesonargs+=( -Dasm=false )
-       fi
-
-       if use gallium; then
-               gallium_enable -- swrast
-               emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
-       else
-               dri_driver_enable -- swrast
-               emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
-       fi
-
-       driver_list() {
-               local drivers="$(sort -u <<< "${1// /$'\n'}")"
-               echo "${drivers//$'\n'/,}"
-       }
-
-       emesonargs+=(
-               $(meson_use test build-tests)
-               -Dglx=dri
-               -Dshared-glapi=true
-               $(meson_use dri3)
-               $(meson_use egl)
-               $(meson_use gbm)
-               $(meson_use gles1)
-               $(meson_use gles2)
-               $(meson_use selinux)
-               -Dvalgrind=$(usex valgrind auto false)
-               -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
-               -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
-               -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
-               --buildtype $(usex debug debug plain)
-               -Db_ndebug=$(usex debug false true)
-       )
-       meson_src_configure
-}
-
-multilib_src_compile() {
-       meson_src_compile
-}
-
-multilib_src_install() {
-       meson_src_install
-}
-
-multilib_src_install_all() {
-       einstalldocs
-}
-
-multilib_src_test() {
-       meson_src_test
-}
-
-pkg_postinst() {
-       # Switch to the xorg implementation.
-       echo
-       eselect opengl set --use-old ${OPENGL_DIR}
-}
-
-# $1 - VIDEO_CARDS flag (check skipped for "--")
-# other args - names of DRI drivers to enable
-dri_driver_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               DRI_DRIVERS+=("$@")
-       fi
-}
-
-gallium_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               GALLIUM_DRIVERS+=("$@")
-       fi
-}
-
-vulkan_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               VULKAN_DRIVERS+=("$@")
-       fi
-}

diff --git a/media-libs/mesa/mesa-18.3.4.ebuild 
b/media-libs/mesa/mesa-18.3.4.ebuild
deleted file mode 100644
index 0b02534..0000000
--- a/media-libs/mesa/mesa-18.3.4.ebuild
+++ /dev/null
@@ -1,532 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python3_4 python3_5 python3_6 python3_7 )
-
-inherit llvm meson multilib-minimal pax-utils python-any-r1
-
-OPENGL_DIR="xorg-x11"
-
-MY_P="${P/_/-}"
-
-DESCRIPTION="OpenGL-like graphic library for Linux"
-HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/";
-
-if [[ ${PV} == 9999 ]]; then
-       EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git";
-       EXPERIMENTAL="true"
-       inherit git-r3
-else
-       SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz";
-       KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="
-       !test? ( test )
-"
-
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl 
vivante vmware"
-for card in ${VIDEO_CARDS}; do
-       IUSE_VIDEO_CARDS+=" video_cards_${card}"
-done
-
-IUSE="${IUSE_VIDEO_CARDS}
-       +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm 
lm_sensors
-       opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind vdpau
-       vulkan wayland xa xvmc"
-
-REQUIRED_USE="
-       d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 
video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
-       gles1?  ( egl )
-       gles2?  ( egl )
-       vulkan? ( dri3
-                         || ( video_cards_i965 video_cards_radeonsi )
-                         video_cards_radeonsi? ( llvm ) )
-       wayland? ( egl gbm )
-       video_cards_freedreno?  ( gallium )
-       video_cards_intel?  ( classic )
-       video_cards_i915?   ( || ( classic gallium ) )
-       video_cards_i965?   ( classic )
-       video_cards_imx?    ( gallium video_cards_vivante )
-       video_cards_nouveau? ( || ( classic gallium ) )
-       video_cards_radeon? ( || ( classic gallium )
-                                                 gallium? ( x86? ( llvm ) 
amd64? ( llvm ) ) )
-       video_cards_r100?   ( classic )
-       video_cards_r200?   ( classic )
-       video_cards_r300?   ( gallium x86? ( llvm ) amd64? ( llvm ) )
-       video_cards_r600?   ( gallium )
-       video_cards_radeonsi?   ( gallium llvm )
-       video_cards_vc4? ( gallium )
-       video_cards_virgl? ( gallium )
-       video_cards_vivante? ( gallium gbm )
-       video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.96"
-RDEPEND="
-       !app-eselect/eselect-mesa
-       >=app-eselect/eselect-opengl-1.3.0
-       >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
-       >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
-       >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
-       x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-       gallium? (
-               unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
-               llvm? (
-                       video_cards_radeonsi? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-                       video_cards_r600? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-                       video_cards_radeon? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-               )
-               lm_sensors? ( sys-apps/lm_sensors:=[${MULTILIB_USEDEP}] )
-               opencl? (
-                                       
dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
-                                       dev-libs/libclc
-                                       virtual/libelf:0=[${MULTILIB_USEDEP}]
-                               )
-               vaapi? (
-                       >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
-                       video_cards_nouveau? ( 
!<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
-               )
-               vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
-               xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
-       )
-       wayland? (
-               >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
-               >=dev-libs/wayland-protocols-1.8
-       )
-       
${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
-
-       video_cards_intel? (
-               !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-       )
-       video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-"
-for card in ${RADEON_CARDS}; do
-       RDEPEND="${RDEPEND}
-               video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
-       "
-done
-RDEPEND="${RDEPEND}
-       video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
-"
-
-# Please keep the LLVM dependency block separate. Since LLVM is slotted,
-# we need to *really* make sure we're not pulling one than more slot
-# simultaneously.
-#
-# How to use it:
-# 1. List all the working slots (with min versions) in ||, newest first.
-# 2. Update the := to specify *max* version, e.g. < 8.
-# 3. Specify LLVM_MAX_SLOT, e.g. 7.
-LLVM_MAX_SLOT="7"
-LLVM_DEPSTR="
-       || (
-               sys-devel/llvm:7[${MULTILIB_USEDEP}]
-               sys-devel/llvm:6[${MULTILIB_USEDEP}]
-               sys-devel/llvm:5[${MULTILIB_USEDEP}]
-               sys-devel/llvm:4[${MULTILIB_USEDEP}]
-       )
-       <sys-devel/llvm-8:=[${MULTILIB_USEDEP}]
-"
-LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
-CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-RDEPEND="${RDEPEND}
-       llvm? (
-               opencl? (
-                       video_cards_r600? (
-                               ${CLANG_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${CLANG_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${CLANG_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${CLANG_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-               !opencl? (
-                       video_cards_r600? (
-                               ${LLVM_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${LLVM_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${LLVM_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${LLVM_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-       )
-"
-unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
-
-DEPEND="${RDEPEND}
-       ${PYTHON_DEPS}
-       opencl? (
-               >=sys-devel/gcc-4.6
-       )
-       sys-devel/bison
-       sys-devel/flex
-       sys-devel/gettext
-       virtual/pkgconfig
-       valgrind? ( dev-util/valgrind )
-       x11-base/xorg-proto
-       x11-libs/libXrandr[${MULTILIB_USEDEP}]
-       $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
-"
-
-S="${WORKDIR}/${MY_P}"
-EGIT_CHECKOUT_DIR=${S}
-
-QA_WX_LOAD="
-x86? (
-       !pic? (
-               usr/lib*/libglapi.so.0.0.0
-               usr/lib*/libGLESv1_CM.so.1.0.0
-               usr/lib*/libGLESv2.so.2.0.0
-               usr/lib*/libGL.so.1.2.0
-               usr/lib*/libOSMesa.so.8.0.0
-       )
-)"
-
-PATCHES=(
-       "${FILESDIR}"/${PN}-17-execinfo.patch
-       "${FILESDIR}"/${PN}-17-musl-string_h.patch
-       "${FILESDIR}"/${PN}-18-musl-invocation_name.patch
-       "${FILESDIR}"/${PN}-18-musl-pthread.patch
-       "${FILESDIR}"/${PN}-18-musl-amdgpu-include-pthread.patch
-       "${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
-)
-
-llvm_check_deps() {
-       local flags=${MULTILIB_USEDEP}
-       if use video_cards_r600 || use video_cards_radeon || use 
video_cards_radeonsi
-       then
-               flags+=",llvm_targets_AMDGPU(-)"
-       fi
-
-       if use opencl; then
-               has_version "sys-devel/clang[${flags}]" || return 1
-       fi
-       has_version "sys-devel/llvm[${flags}]"
-}
-
-pkg_pretend() {
-       if use opencl; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi; then
-                       ewarn "Ignoring USE=opencl     since VIDEO_CARDS does 
not contain r600 or radeonsi"
-               fi
-       fi
-
-       if use vaapi; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=vaapi      since VIDEO_CARDS does 
not contain r600, radeonsi, or nouveau"
-               fi
-       fi
-
-       if use vdpau; then
-               if ! use video_cards_r300 &&
-                  ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=vdpau      since VIDEO_CARDS does 
not contain r300, r600, radeonsi, or nouveau"
-               fi
-       fi
-
-       if use xa; then
-               if ! use video_cards_freedreno &&
-                  ! use video_cards_nouveau &&
-                  ! use video_cards_vmware; then
-                       ewarn "Ignoring USE=xa         since VIDEO_CARDS does 
not contain freedreno, nouveau, or vmware"
-               fi
-       fi
-
-       if use xvmc; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=xvmc       since VIDEO_CARDS does 
not contain r600 or nouveau"
-               fi
-       fi
-
-       if ! use gallium; then
-               use lm_sensors && ewarn "Ignoring USE=lm_sensors since USE does 
not contain gallium"
-               use llvm       && ewarn "Ignoring USE=llvm       since USE does 
not contain gallium"
-               use opencl     && ewarn "Ignoring USE=opencl     since USE does 
not contain gallium"
-               use vaapi      && ewarn "Ignoring USE=vaapi      since USE does 
not contain gallium"
-               use vdpau      && ewarn "Ignoring USE=vdpau      since USE does 
not contain gallium"
-               use unwind     && ewarn "Ignoring USE=unwind     since USE does 
not contain gallium"
-               use xa         && ewarn "Ignoring USE=xa         since USE does 
not contain gallium"
-               use xvmc       && ewarn "Ignoring USE=xvmc       since USE does 
not contain gallium"
-       fi
-
-       if ! use llvm; then
-               use opencl     && ewarn "Ignoring USE=opencl     since USE does 
not contain llvm"
-       fi
-}
-
-python_check_deps() {
-       has_version --host-root ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
-       # warning message for bug 459306
-       if use llvm && has_version sys-devel/llvm[!debug=]; then
-               ewarn "Mismatch between debug USE flags in media-libs/mesa and 
sys-devel/llvm"
-               ewarn "detected! This can cause problems. For details, see bug 
459306."
-       fi
-
-       if use llvm; then
-               llvm_pkg_setup
-       fi
-       python-any-r1_pkg_setup
-}
-
-multilib_src_configure() {
-       local emesonargs=()
-
-       if use classic; then
-               # Intel code
-               dri_driver_enable video_cards_i915 i915
-               dri_driver_enable video_cards_i965 i965
-               if ! use video_cards_i915 && \
-                       ! use video_cards_i965; then
-                       dri_driver_enable video_cards_intel i915 i965
-               fi
-
-               # Nouveau code
-               dri_driver_enable video_cards_nouveau nouveau
-
-               # ATI code
-               dri_driver_enable video_cards_r100 r100
-               dri_driver_enable video_cards_r200 r200
-               if ! use video_cards_r100 && \
-                       ! use video_cards_r200; then
-                       dri_driver_enable video_cards_radeon r100 r200
-               fi
-       fi
-
-       emesonargs+=( -Dplatforms=x11,surfaceless$(use wayland && echo 
",wayland")$(use gbm && echo ",drm") )
-
-       if use gallium; then
-               emesonargs+=(
-                       $(meson_use llvm)
-                       $(meson_use lm_sensors lmsensors)
-                       $(meson_use unwind libunwind)
-               )
-
-               if use video_cards_r300 ||
-                  use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau ||
-                  use video_cards_vmware; then
-                       emesonargs+=($(meson_use d3d9 gallium-nine))
-               else
-                       emesonargs+=(-Dgallium-nine=false)
-               fi
-
-               if use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use vaapi gallium-va))
-                       use vaapi && emesonargs+=( 
-Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
-               else
-                       emesonargs+=(-Dgallium-va=false)
-               fi
-
-               if use video_cards_r300 ||
-                  use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use vdpau gallium-vdpau))
-               else
-                       emesonargs+=(-Dgallium-vdpau=false)
-               fi
-
-               if use video_cards_freedreno ||
-                  use video_cards_nouveau ||
-                  use video_cards_vmware; then
-                       emesonargs+=($(meson_use xa gallium-xa))
-               else
-                       emesonargs+=(-Dgallium-xa=false)
-               fi
-
-               if use video_cards_r600 ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use xvmc gallium-xvmc))
-               else
-                       emesonargs+=(-Dgallium-xvmc=false)
-               fi
-
-               gallium_enable video_cards_vc4 vc4
-               gallium_enable video_cards_vivante etnaviv
-               gallium_enable video_cards_vmware svga
-               gallium_enable video_cards_nouveau nouveau
-               gallium_enable video_cards_imx imx
-
-               # Only one i915 driver (classic vs gallium). Default to classic.
-               if ! use classic; then
-                       gallium_enable video_cards_i915 i915
-                       if ! use video_cards_i915 && \
-                               ! use video_cards_i965; then
-                               gallium_enable video_cards_intel i915
-                       fi
-               fi
-
-               gallium_enable video_cards_r300 r300
-               gallium_enable video_cards_r600 r600
-               gallium_enable video_cards_radeonsi radeonsi
-               if ! use video_cards_r300 && \
-                       ! use video_cards_r600; then
-                       gallium_enable video_cards_radeon r300 r600
-               fi
-
-               gallium_enable video_cards_freedreno freedreno
-               gallium_enable video_cards_virgl virgl
-
-               # opencl stuff
-               emesonargs+=(
-                       -Dgallium-opencl="$(usex opencl icd disabled)"
-               )
-       fi
-
-       if use vulkan; then
-               vulkan_enable video_cards_i965 intel
-               vulkan_enable video_cards_radeonsi amd
-       fi
-
-       # x86 hardened pax_kernel needs glx-rts, bug 240956
-       if [[ ${ABI} == x86 ]]; then
-               emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
-       fi
-
-       # Disable glx tls support on musl
-       if use elibc_musl; then
-               emesonargs+=( -Dglx-tls=false )
-       fi
-
-       # on abi_x86_32 hardened we need to have asm disable
-       if [[ ${ABI} == x86* ]] && use pic; then
-               emesonargs+=( -Dasm=false )
-       fi
-
-       if use gallium; then
-               gallium_enable -- swrast
-               emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
-       else
-               dri_driver_enable -- swrast
-               emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
-       fi
-
-       driver_list() {
-               local drivers="$(sort -u <<< "${1// /$'\n'}")"
-               echo "${drivers//$'\n'/,}"
-       }
-
-       emesonargs+=(
-               $(meson_use test build-tests)
-               -Dglx=dri
-               -Dshared-glapi=true
-               $(meson_use dri3)
-               $(meson_use egl)
-               $(meson_use gbm)
-               $(meson_use gles1)
-               $(meson_use gles2)
-               $(meson_use selinux)
-               -Dvalgrind=$(usex valgrind auto false)
-               -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
-               -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
-               -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
-               --buildtype $(usex debug debug plain)
-               -Db_ndebug=$(usex debug false true)
-       )
-       meson_src_configure
-}
-
-multilib_src_compile() {
-       meson_src_compile
-}
-
-multilib_src_install() {
-       meson_src_install
-}
-
-multilib_src_install_all() {
-       einstalldocs
-}
-
-multilib_src_test() {
-       meson_src_test
-}
-
-pkg_postinst() {
-       # Switch to the xorg implementation.
-       echo
-       eselect opengl set --use-old ${OPENGL_DIR}
-}
-
-# $1 - VIDEO_CARDS flag (check skipped for "--")
-# other args - names of DRI drivers to enable
-dri_driver_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               DRI_DRIVERS+=("$@")
-       fi
-}
-
-gallium_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               GALLIUM_DRIVERS+=("$@")
-       fi
-}
-
-vulkan_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               VULKAN_DRIVERS+=("$@")
-       fi
-}

diff --git a/media-libs/mesa/mesa-18.3.5.ebuild 
b/media-libs/mesa/mesa-18.3.5.ebuild
deleted file mode 100644
index f49d518..0000000
--- a/media-libs/mesa/mesa-18.3.5.ebuild
+++ /dev/null
@@ -1,532 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python3_4 python3_5 python3_6 python3_7 )
-
-inherit llvm meson multilib-minimal pax-utils python-any-r1
-
-OPENGL_DIR="xorg-x11"
-
-MY_P="${P/_/-}"
-
-DESCRIPTION="OpenGL-like graphic library for Linux"
-HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/";
-
-if [[ ${PV} == 9999 ]]; then
-       EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git";
-       EXPERIMENTAL="true"
-       inherit git-r3
-else
-       SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz";
-       KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~x86"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="
-       !test? ( test )
-"
-
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 imx intel nouveau vc4 virgl 
vivante vmware"
-for card in ${VIDEO_CARDS}; do
-       IUSE_VIDEO_CARDS+=" video_cards_${card}"
-done
-
-IUSE="${IUSE_VIDEO_CARDS}
-       +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +llvm 
lm_sensors
-       opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind vdpau
-       vulkan wayland xa xvmc"
-
-REQUIRED_USE="
-       d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 
video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
-       gles1?  ( egl )
-       gles2?  ( egl )
-       vulkan? ( dri3
-                         || ( video_cards_i965 video_cards_radeonsi )
-                         video_cards_radeonsi? ( llvm ) )
-       wayland? ( egl gbm )
-       video_cards_freedreno?  ( gallium )
-       video_cards_intel?  ( classic )
-       video_cards_i915?   ( || ( classic gallium ) )
-       video_cards_i965?   ( classic )
-       video_cards_imx?    ( gallium video_cards_vivante )
-       video_cards_nouveau? ( || ( classic gallium ) )
-       video_cards_radeon? ( || ( classic gallium )
-                                                 gallium? ( x86? ( llvm ) 
amd64? ( llvm ) ) )
-       video_cards_r100?   ( classic )
-       video_cards_r200?   ( classic )
-       video_cards_r300?   ( gallium x86? ( llvm ) amd64? ( llvm ) )
-       video_cards_r600?   ( gallium )
-       video_cards_radeonsi?   ( gallium llvm )
-       video_cards_vc4? ( gallium )
-       video_cards_virgl? ( gallium )
-       video_cards_vivante? ( gallium gbm )
-       video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.96"
-RDEPEND="
-       !app-eselect/eselect-mesa
-       >=app-eselect/eselect-opengl-1.3.0
-       >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
-       >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
-       >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXdamage-1.1.4-r1:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
-       >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
-       x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-       gallium? (
-               unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
-               llvm? (
-                       video_cards_radeonsi? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-                       video_cards_r600? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-                       video_cards_radeon? (
-                               virtual/libelf:0=[${MULTILIB_USEDEP}]
-                       )
-               )
-               lm_sensors? ( sys-apps/lm_sensors:=[${MULTILIB_USEDEP}] )
-               opencl? (
-                                       
dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
-                                       dev-libs/libclc
-                                       virtual/libelf:0=[${MULTILIB_USEDEP}]
-                               )
-               vaapi? (
-                       >=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
-                       video_cards_nouveau? ( 
!<=x11-libs/libva-vdpau-driver-0.7.4-r3 )
-               )
-               vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
-               xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
-       )
-       wayland? (
-               >=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
-               >=dev-libs/wayland-protocols-1.8
-       )
-       
${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vivante?,video_cards_vmware?,${MULTILIB_USEDEP}]
-
-       video_cards_intel? (
-               !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-       )
-       video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-"
-for card in ${RADEON_CARDS}; do
-       RDEPEND="${RDEPEND}
-               video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
-       "
-done
-RDEPEND="${RDEPEND}
-       video_cards_radeonsi? ( ${LIBDRM_DEPSTRING}[video_cards_amdgpu] )
-"
-
-# Please keep the LLVM dependency block separate. Since LLVM is slotted,
-# we need to *really* make sure we're not pulling one than more slot
-# simultaneously.
-#
-# How to use it:
-# 1. List all the working slots (with min versions) in ||, newest first.
-# 2. Update the := to specify *max* version, e.g. < 8.
-# 3. Specify LLVM_MAX_SLOT, e.g. 7.
-LLVM_MAX_SLOT="7"
-LLVM_DEPSTR="
-       || (
-               sys-devel/llvm:7[${MULTILIB_USEDEP}]
-               sys-devel/llvm:6[${MULTILIB_USEDEP}]
-               sys-devel/llvm:5[${MULTILIB_USEDEP}]
-               sys-devel/llvm:4[${MULTILIB_USEDEP}]
-       )
-       <sys-devel/llvm-8:=[${MULTILIB_USEDEP}]
-"
-LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
-CLANG_DEPSTR_AMDGPU=${CLANG_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
-RDEPEND="${RDEPEND}
-       llvm? (
-               opencl? (
-                       video_cards_r600? (
-                               ${CLANG_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${CLANG_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${CLANG_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${CLANG_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-               !opencl? (
-                       video_cards_r600? (
-                               ${LLVM_DEPSTR_AMDGPU}
-                       )
-                       !video_cards_r600? (
-                               video_cards_radeonsi? (
-                                       ${LLVM_DEPSTR_AMDGPU}
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeonsi? (
-                                       video_cards_radeon? (
-                                               ${LLVM_DEPSTR_AMDGPU}
-                                       )
-                               )
-                       )
-                       !video_cards_r600? (
-                               !video_cards_radeon? (
-                                       !video_cards_radeonsi? (
-                                               ${LLVM_DEPSTR}
-                                       )
-                               )
-                       )
-               )
-       )
-"
-unset {LLVM,CLANG}_DEPSTR{,_AMDGPU}
-
-DEPEND="${RDEPEND}
-       ${PYTHON_DEPS}
-       opencl? (
-               >=sys-devel/gcc-4.6
-       )
-       sys-devel/bison
-       sys-devel/flex
-       sys-devel/gettext
-       virtual/pkgconfig
-       valgrind? ( dev-util/valgrind )
-       x11-base/xorg-proto
-       x11-libs/libXrandr[${MULTILIB_USEDEP}]
-       $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
-"
-
-S="${WORKDIR}/${MY_P}"
-EGIT_CHECKOUT_DIR=${S}
-
-QA_WX_LOAD="
-x86? (
-       !pic? (
-               usr/lib*/libglapi.so.0.0.0
-               usr/lib*/libGLESv1_CM.so.1.0.0
-               usr/lib*/libGLESv2.so.2.0.0
-               usr/lib*/libGL.so.1.2.0
-               usr/lib*/libOSMesa.so.8.0.0
-       )
-)"
-
-PATCHES=(
-       "${FILESDIR}"/${PN}-17-execinfo.patch
-       "${FILESDIR}"/${PN}-17-musl-string_h.patch
-       "${FILESDIR}"/${PN}-18-musl-invocation_name.patch
-       "${FILESDIR}"/${PN}-18-musl-pthread.patch
-       "${FILESDIR}"/${PN}-18-musl-amdgpu-include-pthread.patch
-       "${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
-)
-
-llvm_check_deps() {
-       local flags=${MULTILIB_USEDEP}
-       if use video_cards_r600 || use video_cards_radeon || use 
video_cards_radeonsi
-       then
-               flags+=",llvm_targets_AMDGPU(-)"
-       fi
-
-       if use opencl; then
-               has_version "sys-devel/clang[${flags}]" || return 1
-       fi
-       has_version "sys-devel/llvm[${flags}]"
-}
-
-pkg_pretend() {
-       if use opencl; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi; then
-                       ewarn "Ignoring USE=opencl     since VIDEO_CARDS does 
not contain r600 or radeonsi"
-               fi
-       fi
-
-       if use vaapi; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=vaapi      since VIDEO_CARDS does 
not contain r600, radeonsi, or nouveau"
-               fi
-       fi
-
-       if use vdpau; then
-               if ! use video_cards_r300 &&
-                  ! use video_cards_r600 &&
-                  ! use video_cards_radeonsi &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=vdpau      since VIDEO_CARDS does 
not contain r300, r600, radeonsi, or nouveau"
-               fi
-       fi
-
-       if use xa; then
-               if ! use video_cards_freedreno &&
-                  ! use video_cards_nouveau &&
-                  ! use video_cards_vmware; then
-                       ewarn "Ignoring USE=xa         since VIDEO_CARDS does 
not contain freedreno, nouveau, or vmware"
-               fi
-       fi
-
-       if use xvmc; then
-               if ! use video_cards_r600 &&
-                  ! use video_cards_nouveau; then
-                       ewarn "Ignoring USE=xvmc       since VIDEO_CARDS does 
not contain r600 or nouveau"
-               fi
-       fi
-
-       if ! use gallium; then
-               use lm_sensors && ewarn "Ignoring USE=lm_sensors since USE does 
not contain gallium"
-               use llvm       && ewarn "Ignoring USE=llvm       since USE does 
not contain gallium"
-               use opencl     && ewarn "Ignoring USE=opencl     since USE does 
not contain gallium"
-               use vaapi      && ewarn "Ignoring USE=vaapi      since USE does 
not contain gallium"
-               use vdpau      && ewarn "Ignoring USE=vdpau      since USE does 
not contain gallium"
-               use unwind     && ewarn "Ignoring USE=unwind     since USE does 
not contain gallium"
-               use xa         && ewarn "Ignoring USE=xa         since USE does 
not contain gallium"
-               use xvmc       && ewarn "Ignoring USE=xvmc       since USE does 
not contain gallium"
-       fi
-
-       if ! use llvm; then
-               use opencl     && ewarn "Ignoring USE=opencl     since USE does 
not contain llvm"
-       fi
-}
-
-python_check_deps() {
-       has_version --host-root ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
-       # warning message for bug 459306
-       if use llvm && has_version sys-devel/llvm[!debug=]; then
-               ewarn "Mismatch between debug USE flags in media-libs/mesa and 
sys-devel/llvm"
-               ewarn "detected! This can cause problems. For details, see bug 
459306."
-       fi
-
-       if use llvm; then
-               llvm_pkg_setup
-       fi
-       python-any-r1_pkg_setup
-}
-
-multilib_src_configure() {
-       local emesonargs=()
-
-       if use classic; then
-               # Intel code
-               dri_driver_enable video_cards_i915 i915
-               dri_driver_enable video_cards_i965 i965
-               if ! use video_cards_i915 && \
-                       ! use video_cards_i965; then
-                       dri_driver_enable video_cards_intel i915 i965
-               fi
-
-               # Nouveau code
-               dri_driver_enable video_cards_nouveau nouveau
-
-               # ATI code
-               dri_driver_enable video_cards_r100 r100
-               dri_driver_enable video_cards_r200 r200
-               if ! use video_cards_r100 && \
-                       ! use video_cards_r200; then
-                       dri_driver_enable video_cards_radeon r100 r200
-               fi
-       fi
-
-       emesonargs+=( -Dplatforms=x11,surfaceless$(use wayland && echo 
",wayland")$(use gbm && echo ",drm") )
-
-       if use gallium; then
-               emesonargs+=(
-                       $(meson_use llvm)
-                       $(meson_use lm_sensors lmsensors)
-                       $(meson_use unwind libunwind)
-               )
-
-               if use video_cards_r300 ||
-                  use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau ||
-                  use video_cards_vmware; then
-                       emesonargs+=($(meson_use d3d9 gallium-nine))
-               else
-                       emesonargs+=(-Dgallium-nine=false)
-               fi
-
-               if use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use vaapi gallium-va))
-                       use vaapi && emesonargs+=( 
-Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
-               else
-                       emesonargs+=(-Dgallium-va=false)
-               fi
-
-               if use video_cards_r300 ||
-                  use video_cards_r600 ||
-                  use video_cards_radeonsi ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use vdpau gallium-vdpau))
-               else
-                       emesonargs+=(-Dgallium-vdpau=false)
-               fi
-
-               if use video_cards_freedreno ||
-                  use video_cards_nouveau ||
-                  use video_cards_vmware; then
-                       emesonargs+=($(meson_use xa gallium-xa))
-               else
-                       emesonargs+=(-Dgallium-xa=false)
-               fi
-
-               if use video_cards_r600 ||
-                  use video_cards_nouveau; then
-                       emesonargs+=($(meson_use xvmc gallium-xvmc))
-               else
-                       emesonargs+=(-Dgallium-xvmc=false)
-               fi
-
-               gallium_enable video_cards_vc4 vc4
-               gallium_enable video_cards_vivante etnaviv
-               gallium_enable video_cards_vmware svga
-               gallium_enable video_cards_nouveau nouveau
-               gallium_enable video_cards_imx imx
-
-               # Only one i915 driver (classic vs gallium). Default to classic.
-               if ! use classic; then
-                       gallium_enable video_cards_i915 i915
-                       if ! use video_cards_i915 && \
-                               ! use video_cards_i965; then
-                               gallium_enable video_cards_intel i915
-                       fi
-               fi
-
-               gallium_enable video_cards_r300 r300
-               gallium_enable video_cards_r600 r600
-               gallium_enable video_cards_radeonsi radeonsi
-               if ! use video_cards_r300 && \
-                       ! use video_cards_r600; then
-                       gallium_enable video_cards_radeon r300 r600
-               fi
-
-               gallium_enable video_cards_freedreno freedreno
-               gallium_enable video_cards_virgl virgl
-
-               # opencl stuff
-               emesonargs+=(
-                       -Dgallium-opencl="$(usex opencl icd disabled)"
-               )
-       fi
-
-       if use vulkan; then
-               vulkan_enable video_cards_i965 intel
-               vulkan_enable video_cards_radeonsi amd
-       fi
-
-       # x86 hardened pax_kernel needs glx-rts, bug 240956
-       if [[ ${ABI} == x86 ]]; then
-               emesonargs+=( $(meson_use pax_kernel glx-read-only-text) )
-       fi
-
-       # Disable glx tls support on musl
-       if use elibc_musl; then
-               emesonargs+=( -Dglx-tls=false )
-       fi
-
-       # on abi_x86_32 hardened we need to have asm disable
-       if [[ ${ABI} == x86* ]] && use pic; then
-               emesonargs+=( -Dasm=false )
-       fi
-
-       if use gallium; then
-               gallium_enable -- swrast
-               emesonargs+=( -Dosmesa=$(usex osmesa gallium none) )
-       else
-               dri_driver_enable -- swrast
-               emesonargs+=( -Dosmesa=$(usex osmesa classic none) )
-       fi
-
-       driver_list() {
-               local drivers="$(sort -u <<< "${1// /$'\n'}")"
-               echo "${drivers//$'\n'/,}"
-       }
-
-       emesonargs+=(
-               $(meson_use test build-tests)
-               -Dglx=dri
-               -Dshared-glapi=true
-               $(meson_use dri3)
-               $(meson_use egl)
-               $(meson_use gbm)
-               $(meson_use gles1)
-               $(meson_use gles2)
-               $(meson_use selinux)
-               -Dvalgrind=$(usex valgrind auto false)
-               -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
-               -Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
-               -Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
-               --buildtype $(usex debug debug plain)
-               -Db_ndebug=$(usex debug false true)
-       )
-       meson_src_configure
-}
-
-multilib_src_compile() {
-       meson_src_compile
-}
-
-multilib_src_install() {
-       meson_src_install
-}
-
-multilib_src_install_all() {
-       einstalldocs
-}
-
-multilib_src_test() {
-       meson_src_test
-}
-
-pkg_postinst() {
-       # Switch to the xorg implementation.
-       echo
-       eselect opengl set --use-old ${OPENGL_DIR}
-}
-
-# $1 - VIDEO_CARDS flag (check skipped for "--")
-# other args - names of DRI drivers to enable
-dri_driver_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               DRI_DRIVERS+=("$@")
-       fi
-}
-
-gallium_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               GALLIUM_DRIVERS+=("$@")
-       fi
-}
-
-vulkan_enable() {
-       if [[ $1 == -- ]] || use $1; then
-               shift
-               VULKAN_DRIVERS+=("$@")
-       fi
-}

diff --git a/media-libs/mesa/mesa-18.3.6.ebuild 
b/media-libs/mesa/mesa-19.0.8.ebuild
similarity index 91%
rename from media-libs/mesa/mesa-18.3.6.ebuild
rename to media-libs/mesa/mesa-19.0.8.ebuild
index c97cdda..8ec5d9f 100644
--- a/media-libs/mesa/mesa-18.3.6.ebuild
+++ b/media-libs/mesa/mesa-19.0.8.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-PYTHON_COMPAT=( python3_4 python3_5 python3_6 python3_7 )
+PYTHON_COMPAT=( python3_5 python3_6 python3_7 )
 
 inherit llvm meson multilib-minimal pax-utils python-any-r1
 
@@ -20,7 +20,7 @@ if [[ ${PV} == 9999 ]]; then
        inherit git-r3
 else
        SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz";
-       KEYWORDS="amd64 arm arm64 ~mips ~ppc x86"
+       KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh 
sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~sparc-solaris 
~x64-solaris ~x86-solaris"
 fi
 
 LICENSE="MIT"
@@ -36,9 +36,9 @@ for card in ${VIDEO_CARDS}; do
 done
 
 IUSE="${IUSE_VIDEO_CARDS}
-       +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +llvm 
lm_sensors
-       opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind vdpau
-       vulkan wayland xa xvmc"
+       +classic d3d9 debug +dri3 +egl +gallium +gbm gles1 +gles2 +libglvnd 
+llvm
+       lm_sensors opencl osmesa pax_kernel pic selinux test unwind vaapi 
valgrind
+       vdpau vulkan wayland xa xvmc"
 
 REQUIRED_USE="
        d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 
video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
@@ -67,10 +67,9 @@ REQUIRED_USE="
        video_cards_vmware? ( gallium )
 "
 
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.96"
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.97"
 RDEPEND="
        !app-eselect/eselect-mesa
-       >=app-eselect/eselect-opengl-1.3.0
        >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
        >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
        >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
@@ -80,6 +79,13 @@ RDEPEND="
        >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
        >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
        x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
+       libglvnd? (
+               media-libs/libglvnd[${MULTILIB_USEDEP}]
+               !app-eselect/eselect-opengl
+       )
+       !libglvnd? (
+               >=app-eselect/eselect-opengl-1.3.0
+       )
        gallium? (
                unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
                llvm? (
@@ -132,17 +138,15 @@ RDEPEND="${RDEPEND}
 #
 # How to use it:
 # 1. List all the working slots (with min versions) in ||, newest first.
-# 2. Update the := to specify *max* version, e.g. < 8.
-# 3. Specify LLVM_MAX_SLOT, e.g. 7.
-LLVM_MAX_SLOT="7"
+# 2. Update the := to specify *max* version, e.g. < 9.
+# 3. Specify LLVM_MAX_SLOT, e.g. 8.
+LLVM_MAX_SLOT="8"
 LLVM_DEPSTR="
        || (
+               sys-devel/llvm:8[${MULTILIB_USEDEP}]
                sys-devel/llvm:7[${MULTILIB_USEDEP}]
-               sys-devel/llvm:6[${MULTILIB_USEDEP}]
-               sys-devel/llvm:5[${MULTILIB_USEDEP}]
-               sys-devel/llvm:4[${MULTILIB_USEDEP}]
        )
-       <sys-devel/llvm-8:=[${MULTILIB_USEDEP}]
+       <sys-devel/llvm-9:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
@@ -231,11 +235,9 @@ x86? (
 )"
 
 PATCHES=(
-       "${FILESDIR}"/${PN}-17-execinfo.patch
-       "${FILESDIR}"/${PN}-17-musl-string_h.patch
-       "${FILESDIR}"/${PN}-18-musl-invocation_name.patch
-       "${FILESDIR}"/${PN}-18-musl-pthread.patch
-       "${FILESDIR}"/${PN}-18-musl-amdgpu-include-pthread.patch
+       "${FILESDIR}"/${PN}-execinfo.patch
+       "${FILESDIR}"/${PN}-heap-allocation.patch
+       "${FILESDIR}"/${PN}-19.1.4-musl-upstream-fix.patch
        "${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
 )
 
@@ -247,9 +249,9 @@ llvm_check_deps() {
        fi
 
        if use opencl; then
-               has_version "sys-devel/clang[${flags}]" || return 1
+               has_version "sys-devel/clang:${LLVM_SLOT}[${flags}]" || return 1
        fi
-       has_version "sys-devel/llvm[${flags}]"
+       has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
 }
 
 pkg_pretend() {
@@ -475,6 +477,7 @@ multilib_src_configure() {
                $(meson_use gbm)
                $(meson_use gles1)
                $(meson_use gles2)
+               $(meson_use libglvnd glvnd)
                $(meson_use selinux)
                -Dvalgrind=$(usex valgrind auto false)
                -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
@@ -492,6 +495,8 @@ multilib_src_compile() {
 
 multilib_src_install() {
        meson_src_install
+
+       use libglvnd && rm -f "${D}"/usr/$(get_libdir)/libGLESv{1_CM,2}.so*
 }
 
 multilib_src_install_all() {
@@ -499,7 +504,7 @@ multilib_src_install_all() {
 }
 
 multilib_src_test() {
-       meson_src_test
+       meson test -v -C "${BUILD_DIR}" -t 100
 }
 
 pkg_postinst() {

Reply via email to