public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2015-07-15 15:01 Anthony G. Basile
  0 siblings, 0 replies; 18+ messages in thread
From: Anthony G. Basile @ 2015-07-15 15:01 UTC (permalink / raw
  To: gentoo-commits

commit:     8cedd5c264d4c49352aa3b058984b913bf893cf1
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 15 15:03:57 2015 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Jul 15 15:03:57 2015 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=8cedd5c2

media-libs/mesa: bring in line with main tree.

Package-Manager: portage-2.2.18
RepoMan-Options: --force
Manifest-Sign-Key: 0xF52D4BBA

 media-libs/mesa/Manifest                           |    6 +-
 .../mesa/files/mesa-10.3.7-format_utils.c.patch    | 1089 ++++++++++++++++++++
 .../mesa/files/mesa-10.5.1-fstat-include.patch     |   37 +
 ...esa-10.3.7-r1.ebuild => mesa-10.3.7-r99.ebuild} |   16 +-
 media-libs/mesa/metadata.xml                       |    3 -
 5 files changed, 1137 insertions(+), 14 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 9f97337..98a9217 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -4,7 +4,9 @@ AUX glx_ro_text_segm.patch 731 SHA256 e36af5b530fdbe2b0e62a035bf4bf4baef267c3dc5
 AUX mesa-10-pthread.patch 695 SHA256 a355933736a39ce9b0e26412ac940377fc6b3eeb25737c53bf8d767fe34c5367 SHA512 7850b543fb8413b9abf65ab884588eb7b15782122253bc9f4baee8735775bfd6bade42c386f295c20c7d43484d9ce82597cf82c8bca97433ccec8816386cc275 WHIRLPOOL ad2b5163a556733f8772ab9bce0ea452ac8373c96dc9be82ab1cf7dd7c59eea9fc7bed90786f1e3237e1639852785ed836f42bcaed78447355a6693501c9560f
 AUX mesa-10.2-dont-require-llvm-for-r300.patch 547 SHA256 83cfeae33b1e8c84b37ed59c353000eb775978ae3d9035ba8ce4f63a167756fc SHA512 d1cb5a989aa001c99f353d27ab5b28ac05d60050614bbfd76ca5d312e00efcc2b1a2459d30d697b68119310c69512b4195afce6c0ed7f31fb9cf14689a740e27 WHIRLPOOL c06669942d275a9d9f132ec8f51d3ecf23d33cb89cb607ba3a7861f209f283b39a9568513b07e22f0dfcc99339a307d7b2a6b03f261ed583fd4518d3b4d0b464
 AUX mesa-10.3.7-dont-use-clrsb.patch 1140 SHA256 23626c6bf1e502f17f4b9236b512063b41bf52be64f56252f0fc5ce456824d58 SHA512 2d9dd9a56c3bab02e8ec1a1ab4d88c2855746d8243548f197cb43de6e980554447c75e53c07dcd270de7e1c282cf7fdf996e5102a24e47b75e484a18f99092e0 WHIRLPOOL 47b222fb61427bbe2a63ac4b738608e9c3491e6373c33e1d68c79198a111d7668b4cafbac9e58820e8cefae55dffca46ab57dbe91ad819feeb734c32f01020f0
+AUX mesa-10.3.7-format_utils.c.patch 34839 SHA256 81ec8d547d798aa5ef5dfc9f0685291af04f95882608f8e9db39a867f44ab431 SHA512 777597b41c37ced0fb375048cc30c4cac701c6020c70bd0f6fbbc2d6f2c1ac9ece0f6d411d81dd042be7f2fbc17e0536176d8230b93f9eed7d7ddf205ac98bb8 WHIRLPOOL 51a213c415d81250a2bc3ad117581b62c4eed13152a9550b2214a9c63f85a6559b1504e013ae0d8e56d5adcaff053c753aa833d7acbe10185d468fdfed5e1b72
+AUX mesa-10.5.1-fstat-include.patch 1008 SHA256 4d44da3882ae9ae7c5d255189e5ca86569337a53d6aece4c65344c753aa588d3 SHA512 6df3167efe198955198b4eb3e1c883f307ebbeb5ebaa63836f8bddf70173382454de6b0d9cb626bb20a5a649fe355a7d25ed5ce27348d5234df27fb9c920b4b4 WHIRLPOOL b05dee0366e35105a7eac143bd4b59e146b0ca369b522e58d2e9a08c8c35b79e929edeacf90154d826dc7ff40ebc7161cc3a6b663e0418388b8f5f5254747066
 AUX mesa-9.1.6-fpclassify.patch 618 SHA256 b02df9b6850d46d251dd51213800d6608195487d0bc91aac79df75616b7bd6d4 SHA512 e7f61451bb05caaeecbe19b24d3c44cecd54a3f10d40701973cf061dc5396c7dc0220c19396e73d5f8d8a8febf34789333476cca62566667d827ed5f68155d4b WHIRLPOOL 4df278e552808cf8656c1319518cd8e37ffd3189e482efae6401dfd43febe733a8e57135d1d4886906fc37b495762c92ca24e5a5f98fe7af59df405e54a4b946
 DIST MesaLib-10.3.7.tar.bz2 7287153 SHA256 43c6ced15e237cbb21b3082d7c0b42777c50c1f731d0d4b5efb5231063fb6a5b SHA512 bbc027c4146c42aaa160990f5281c71a342d32c10ba56f91da1a60dd4cb7d620ff49b72553d24bc1d87470e2baf9be81b5bdee9abe49d6acc57902fccb9e2e5f WHIRLPOOL 7fa32e70c6aabb84a06f2f852f77eac839aea08726c442742b3d3abdb94a0fd9f033439ab0cb16865f4ee14e1538cb86937856bbdfd1f9090e8e7c43eac52e03
-EBUILD mesa-10.3.7-r1.ebuild 14902 SHA256 45718624b57b37693fad5d1ca41c5a8156f2fe364ed95c9709f3b58db34ef27e SHA512 e22136acb270c7e19e0f0ff82ac4b204d5c437c606943455ff6565a930f3a20052dc84a5e4d45a1ded2c1ca029ef81fb34121ea315f0539ac8e6416b3d0602a0 WHIRLPOOL 8a9ad22fad2e133df122ce4babe42ac3ee8f05187b56a76226e6fbaa414eab2990a09c67c9fea280b82510d6960485bc294d39091f4025795d71667e149e5cd5
-MISC metadata.xml 1937 SHA256 b1c243ea287b20ad89f349d4d6274735d0bee6fd4b3309c6a9a0fbc063633c2e SHA512 445b1923de09a43ee10b6df629e48dd114003a2edf482de865f16816b2011d90b058e7cbc5e81face2ffdbac3cb94443f35aeea5cea93a9213f77a8aa822b459 WHIRLPOOL 56eb282ac574bff06e7dbc0bcb26b364ee1fd7827975327d59e3a94530c1cd7e7f843fe6be0bdab9a5956e34301ea3148c17e30b757fb904434a706ae6889023
+EBUILD mesa-10.3.7-r99.ebuild 14707 SHA256 5d7bc944628f494641d79bb39559d0e459f89770f7b2691d79c2f6420d3b7ab9 SHA512 ed82955c3d2741a73ec3082680e5c93b9708a3c159bb836e01298e88cdfc9028591d0050d8ef76dfeb4304f7c0c53e38aee5c130094bbff5d3b93ab609d26391 WHIRLPOOL 26430225f044f046f0229f62f3c3541f169c87b5141973edbc8ffbd6fa57231ba2479ab0d42be0b61ba4ae9dce140277099c20228da2ead18a7b0fd8d2b54423
+MISC metadata.xml 1674 SHA256 f0f164517f72cd4039af02bfad25eff79fa4d2112a5ea80859283ef825988a9c SHA512 f0964d1023805ad6beee2a6e168d7c1539e0180096397fb075dbcdb66d0b035fead201a8ad7082683c1305b8b53de3803418ef10b56fafdcb0f9af0980110892 WHIRLPOOL 557c7fe953399423774d885f726f446ae9181222f54053d7d282c568b4b4786c6b7332ea381fac664d304bd9257d195ed7fa3da3c4242e0a34bfce8dd99432ef

diff --git a/media-libs/mesa/files/mesa-10.3.7-format_utils.c.patch b/media-libs/mesa/files/mesa-10.3.7-format_utils.c.patch
new file mode 100644
index 0000000..e1fba03
--- /dev/null
+++ b/media-libs/mesa/files/mesa-10.3.7-format_utils.c.patch
@@ -0,0 +1,1089 @@
+From cfeb394224f2daeb2139cf4ec489a4dd8297a44d Mon Sep 17 00:00:00 2001
+From: Brian Paul <brianp@vmware.com>
+Date: Fri, 12 Sep 2014 08:31:15 -0600
+Subject: [PATCH] mesa: break up _mesa_swizzle_and_convert() to reduce compile
+ time
+
+This reduces gcc -O3 compile time to 1/4 of what it was on my system.
+Reduces MSVC release build time too.
+
+Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
+---
+ src/mesa/main/format_utils.c | 1030 ++++++++++++++++++++++--------------------
+ 1 file changed, 550 insertions(+), 480 deletions(-)
+
+diff --git a/src/mesa/main/format_utils.c b/src/mesa/main/format_utils.c
+index 240e3bc..29d779a 100644
+--- a/src/mesa/main/format_utils.c
++++ b/src/mesa/main/format_utils.c
+@@ -352,9 +352,14 @@ swizzle_convert_try_memcpy(void *dst, GLenum dst_type, int num_dst_channels,
+  */
+ #define SWIZZLE_CONVERT(DST_TYPE, SRC_TYPE, CONV)                 \
+    do {                                                           \
++      const uint8_t swizzle_x = swizzle[0];                       \
++      const uint8_t swizzle_y = swizzle[1];                       \
++      const uint8_t swizzle_z = swizzle[2];                       \
++      const uint8_t swizzle_w = swizzle[3];                       \
+       const SRC_TYPE *typed_src = void_src;                       \
+       DST_TYPE *typed_dst = void_dst;                             \
+       DST_TYPE tmp[7];                                            \
++      int s, j;                                                   \
+       tmp[4] = 0;                                                 \
+       tmp[5] = one;                                               \
+       switch (num_dst_channels) {                                 \
+@@ -423,7 +428,527 @@ swizzle_convert_try_memcpy(void *dst, GLenum dst_type, int num_dst_channels,
+          }                                                        \
+          break;                                                   \
+       }                                                           \
+-   } while (0);
++   } while (0)
++
++
++static void
++convert_float(void *void_dst, int num_dst_channels,
++              const void *void_src, GLenum src_type, int num_src_channels,
++              const uint8_t swizzle[4], bool normalized, int count)
++{
++   const float one = 1.0f;
++
++   switch (src_type) {
++   case GL_FLOAT:
++      SWIZZLE_CONVERT(float, float, src);
++      break;
++   case GL_HALF_FLOAT:
++      SWIZZLE_CONVERT(float, uint16_t, _mesa_half_to_float(src));
++      break;
++   case GL_UNSIGNED_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(float, uint8_t, unorm_to_float(src, 8));
++      } else {
++         SWIZZLE_CONVERT(float, uint8_t, src);
++      }
++      break;
++   case GL_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(float, int8_t, snorm_to_float(src, 8));
++      } else {
++         SWIZZLE_CONVERT(float, int8_t, src);
++      }
++      break;
++   case GL_UNSIGNED_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(float, uint16_t, unorm_to_float(src, 16));
++      } else {
++         SWIZZLE_CONVERT(float, uint16_t, src);
++      }
++      break;
++   case GL_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(float, int16_t, snorm_to_float(src, 16));
++      } else {
++         SWIZZLE_CONVERT(float, int16_t, src);
++      }
++      break;
++   case GL_UNSIGNED_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(float, uint32_t, unorm_to_float(src, 32));
++      } else {
++         SWIZZLE_CONVERT(float, uint32_t, src);
++      }
++      break;
++   case GL_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(float, int32_t, snorm_to_float(src, 32));
++      } else {
++         SWIZZLE_CONVERT(float, int32_t, src);
++      }
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
++
++static void
++convert_half_float(void *void_dst, int num_dst_channels,
++                   const void *void_src, GLenum src_type, int num_src_channels,
++                   const uint8_t swizzle[4], bool normalized, int count)
++{
++   const uint16_t one = _mesa_float_to_half(1.0f);
++
++   switch (src_type) {
++   case GL_FLOAT:
++      SWIZZLE_CONVERT(uint16_t, float, _mesa_float_to_half(src));
++      break;
++   case GL_HALF_FLOAT:
++      SWIZZLE_CONVERT(uint16_t, uint16_t, src);
++      break;
++   case GL_UNSIGNED_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_half(src, 8));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, uint8_t, _mesa_float_to_half(src));
++      }
++      break;
++   case GL_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_half(src, 8));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, int8_t, _mesa_float_to_half(src));
++      }
++      break;
++   case GL_UNSIGNED_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, uint16_t, unorm_to_half(src, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_float_to_half(src));
++      }
++      break;
++   case GL_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_half(src, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, int16_t, _mesa_float_to_half(src));
++      }
++      break;
++   case GL_UNSIGNED_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_half(src, 32));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, uint32_t, _mesa_float_to_half(src));
++      }
++      break;
++   case GL_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_half(src, 32));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, int32_t, _mesa_float_to_half(src));
++      }
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
++
++static void
++convert_ubyte(void *void_dst, int num_dst_channels,
++              const void *void_src, GLenum src_type, int num_src_channels,
++              const uint8_t swizzle[4], bool normalized, int count)
++{
++   const uint8_t one = normalized ? UINT8_MAX : 1;
++
++   switch (src_type) {
++   case GL_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, float, float_to_unorm(src, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, float, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_HALF_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_unorm(src, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_uint(src));
++      }
++      break;
++   case GL_UNSIGNED_BYTE:
++      SWIZZLE_CONVERT(uint8_t, uint8_t, src);
++      break;
++   case GL_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, int8_t, snorm_to_unorm(src, 8, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, int8_t, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_UNSIGNED_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, uint16_t, unorm_to_unorm(src, 16, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, uint16_t, src);
++      }
++      break;
++   case GL_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, int16_t, snorm_to_unorm(src, 16, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, int16_t, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_UNSIGNED_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, uint32_t, unorm_to_unorm(src, 32, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, uint32_t, src);
++      }
++      break;
++   case GL_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, int32_t, snorm_to_unorm(src, 32, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, int32_t, (src < 0) ? 0 : src);
++      }
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
++
++static void
++convert_byte(void *void_dst, int num_dst_channels,
++             const void *void_src, GLenum src_type, int num_src_channels,
++             const uint8_t swizzle[4], bool normalized, int count)
++{
++   const int8_t one = normalized ? INT8_MAX : 1;
++
++   switch (src_type) {
++   case GL_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, float, float_to_snorm(src, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, float, src);
++      }
++      break;
++   case GL_HALF_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_snorm(src, 8));
++      } else {
++         SWIZZLE_CONVERT(uint8_t, uint16_t, _mesa_half_to_float(src));
++      }
++      break;
++   case GL_UNSIGNED_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(int8_t, uint8_t, unorm_to_snorm(src, 8, 8));
++      } else {
++         SWIZZLE_CONVERT(int8_t, uint8_t, src);
++      }
++      break;
++   case GL_BYTE:
++      SWIZZLE_CONVERT(int8_t, int8_t, src);
++      break;
++   case GL_UNSIGNED_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int8_t, uint16_t, unorm_to_snorm(src, 16, 8));
++      } else {
++         SWIZZLE_CONVERT(int8_t, uint16_t, src);
++      }
++      break;
++   case GL_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int8_t, int16_t, snorm_to_snorm(src, 16, 8));
++      } else {
++         SWIZZLE_CONVERT(int8_t, int16_t, src);
++      }
++      break;
++   case GL_UNSIGNED_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int8_t, uint32_t, unorm_to_snorm(src, 32, 8));
++      } else {
++         SWIZZLE_CONVERT(int8_t, uint32_t, src);
++      }
++      break;
++   case GL_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int8_t, int32_t, snorm_to_snorm(src, 32, 8));
++      } else {
++         SWIZZLE_CONVERT(int8_t, int32_t, src);
++      }
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
++
++static void
++convert_ushort(void *void_dst, int num_dst_channels,
++               const void *void_src, GLenum src_type, int num_src_channels,
++               const uint8_t swizzle[4], bool normalized, int count)
++{
++   const uint16_t one = normalized ? UINT16_MAX : 1;
++   
++   switch (src_type) {
++   case GL_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, float, float_to_unorm(src, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, float, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_HALF_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_unorm(src, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_uint(src));
++      }
++      break;
++   case GL_UNSIGNED_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_unorm(src, 8, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, uint8_t, src);
++      }
++      break;
++   case GL_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_unorm(src, 8, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, int8_t, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_UNSIGNED_SHORT:
++      SWIZZLE_CONVERT(uint16_t, uint16_t, src);
++      break;
++   case GL_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_unorm(src, 16, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, int16_t, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_UNSIGNED_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_unorm(src, 32, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, uint32_t, src);
++      }
++      break;
++   case GL_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_unorm(src, 32, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, int32_t, (src < 0) ? 0 : src);
++      }
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
++
++static void
++convert_short(void *void_dst, int num_dst_channels,
++              const void *void_src, GLenum src_type, int num_src_channels,
++              const uint8_t swizzle[4], bool normalized, int count)
++{
++   const int16_t one = normalized ? INT16_MAX : 1;
++
++   switch (src_type) {
++   case GL_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, float, float_to_snorm(src, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, float, src);
++      }
++      break;
++   case GL_HALF_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_snorm(src, 16));
++      } else {
++         SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_half_to_float(src));
++      }
++      break;
++   case GL_UNSIGNED_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(int16_t, uint8_t, unorm_to_snorm(src, 8, 16));
++      } else {
++         SWIZZLE_CONVERT(int16_t, uint8_t, src);
++      }
++      break;
++   case GL_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(int16_t, int8_t, snorm_to_snorm(src, 8, 16));
++      } else {
++         SWIZZLE_CONVERT(int16_t, int8_t, src);
++      }
++      break;
++   case GL_UNSIGNED_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int16_t, uint16_t, unorm_to_snorm(src, 16, 16));
++      } else {
++         SWIZZLE_CONVERT(int16_t, uint16_t, src);
++      }
++      break;
++   case GL_SHORT:
++      SWIZZLE_CONVERT(int16_t, int16_t, src);
++      break;
++   case GL_UNSIGNED_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int16_t, uint32_t, unorm_to_snorm(src, 32, 16));
++      } else {
++         SWIZZLE_CONVERT(int16_t, uint32_t, src);
++      }
++      break;
++   case GL_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int16_t, int32_t, snorm_to_snorm(src, 32, 16));
++      } else {
++         SWIZZLE_CONVERT(int16_t, int32_t, src);
++      }
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
++static void
++convert_uint(void *void_dst, int num_dst_channels,
++             const void *void_src, GLenum src_type, int num_src_channels,
++             const uint8_t swizzle[4], bool normalized, int count)
++{
++   const uint32_t one = normalized ? UINT32_MAX : 1;
++
++   switch (src_type) {
++   case GL_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, float, float_to_unorm(src, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, float, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_HALF_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_unorm(src, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_uint(src));
++      }
++      break;
++   case GL_UNSIGNED_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, uint8_t, unorm_to_unorm(src, 8, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, uint8_t, src);
++      }
++      break;
++   case GL_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, int8_t, snorm_to_unorm(src, 8, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, int8_t, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_UNSIGNED_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, uint16_t, unorm_to_unorm(src, 16, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, uint16_t, src);
++      }
++      break;
++   case GL_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, int16_t, snorm_to_unorm(src, 16, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, int16_t, (src < 0) ? 0 : src);
++      }
++      break;
++   case GL_UNSIGNED_INT:
++      SWIZZLE_CONVERT(uint32_t, uint32_t, src);
++      break;
++   case GL_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, int32_t, snorm_to_unorm(src, 32, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, int32_t, (src < 0) ? 0 : src);
++      }
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
++
++static void
++convert_int(void *void_dst, int num_dst_channels,
++            const void *void_src, GLenum src_type, int num_src_channels,
++            const uint8_t swizzle[4], bool normalized, int count)
++{
++   const int32_t one = normalized ? INT32_MAX : 12;
++
++   switch (src_type) {
++   case GL_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, float, float_to_snorm(src, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, float, src);
++      }
++      break;
++   case GL_HALF_FLOAT:
++      if (normalized) {
++         SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_snorm(src, 32));
++      } else {
++         SWIZZLE_CONVERT(uint32_t, uint16_t, _mesa_half_to_float(src));
++      }
++      break;
++   case GL_UNSIGNED_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(int32_t, uint8_t, unorm_to_snorm(src, 8, 32));
++      } else {
++         SWIZZLE_CONVERT(int32_t, uint8_t, src);
++      }
++      break;
++   case GL_BYTE:
++      if (normalized) {
++         SWIZZLE_CONVERT(int32_t, int8_t, snorm_to_snorm(src, 8, 32));
++      } else {
++         SWIZZLE_CONVERT(int32_t, int8_t, src);
++      }
++      break;
++   case GL_UNSIGNED_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int32_t, uint16_t, unorm_to_snorm(src, 16, 32));
++      } else {
++         SWIZZLE_CONVERT(int32_t, uint16_t, src);
++      }
++      break;
++   case GL_SHORT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int32_t, int16_t, snorm_to_snorm(src, 16, 32));
++      } else {
++         SWIZZLE_CONVERT(int32_t, int16_t, src);
++      }
++      break;
++   case GL_UNSIGNED_INT:
++      if (normalized) {
++         SWIZZLE_CONVERT(int32_t, uint32_t, unorm_to_snorm(src, 32, 32));
++      } else {
++         SWIZZLE_CONVERT(int32_t, uint32_t, src);
++      }
++      break;
++   case GL_INT:
++      SWIZZLE_CONVERT(int32_t, int32_t, src);
++      break;
++   default:
++      assert(!"Invalid channel type combination");
++   }
++}
++
+ 
+ /**
+  * Convert between array-based color formats.
+@@ -478,499 +1003,44 @@ _mesa_swizzle_and_convert(void *void_dst, GLenum dst_type, int num_dst_channels,
+                           const void *void_src, GLenum src_type, int num_src_channels,
+                           const uint8_t swizzle[4], bool normalized, int count)
+ {
+-   int s, j;
+-   register uint8_t swizzle_x, swizzle_y, swizzle_z, swizzle_w;
+-
+    if (swizzle_convert_try_memcpy(void_dst, dst_type, num_dst_channels,
+                                   void_src, src_type, num_src_channels,
+                                   swizzle, normalized, count))
+       return;
+ 
+-   swizzle_x = swizzle[0];
+-   swizzle_y = swizzle[1];
+-   swizzle_z = swizzle[2];
+-   swizzle_w = swizzle[3];
+-
+    switch (dst_type) {
+    case GL_FLOAT:
+-   {
+-      const float one = 1.0f;
+-      switch (src_type) {
+-      case GL_FLOAT:
+-         SWIZZLE_CONVERT(float, float, src)
+-         break;
+-      case GL_HALF_FLOAT:
+-         SWIZZLE_CONVERT(float, uint16_t, _mesa_half_to_float(src))
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(float, uint8_t, unorm_to_float(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(float, uint8_t, src)
+-         }
+-         break;
+-      case GL_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(float, int8_t, snorm_to_float(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(float, int8_t, src)
+-         }
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(float, uint16_t, unorm_to_float(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(float, uint16_t, src)
+-         }
+-         break;
+-      case GL_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(float, int16_t, snorm_to_float(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(float, int16_t, src)
+-         }
+-         break;
+-      case GL_UNSIGNED_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(float, uint32_t, unorm_to_float(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(float, uint32_t, src)
+-         }
+-         break;
+-      case GL_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(float, int32_t, snorm_to_float(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(float, int32_t, src)
+-         }
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_float(void_dst, num_dst_channels, void_src, src_type,
++                    num_src_channels, swizzle, normalized, count);
++      break;
+    case GL_HALF_FLOAT:
+-   {
+-      const uint16_t one = _mesa_float_to_half(1.0f);
+-      switch (src_type) {
+-      case GL_FLOAT:
+-         SWIZZLE_CONVERT(uint16_t, float, _mesa_float_to_half(src))
+-         break;
+-      case GL_HALF_FLOAT:
+-         SWIZZLE_CONVERT(uint16_t, uint16_t, src)
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_half(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, uint8_t, _mesa_float_to_half(src))
+-         }
+-         break;
+-      case GL_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_half(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, int8_t, _mesa_float_to_half(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, uint16_t, unorm_to_half(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_float_to_half(src))
+-         }
+-         break;
+-      case GL_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_half(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, int16_t, _mesa_float_to_half(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_half(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, uint32_t, _mesa_float_to_half(src))
+-         }
+-         break;
+-      case GL_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_half(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, int32_t, _mesa_float_to_half(src))
+-         }
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_half_float(void_dst, num_dst_channels, void_src, src_type,
++                    num_src_channels, swizzle, normalized, count);
++      break;
+    case GL_UNSIGNED_BYTE:
+-   {
+-      const uint8_t one = normalized ? UINT8_MAX : 1;
+-      switch (src_type) {
+-      case GL_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, float, float_to_unorm(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, float, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_HALF_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_unorm(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_uint(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         SWIZZLE_CONVERT(uint8_t, uint8_t, src)
+-         break;
+-      case GL_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, int8_t, snorm_to_unorm(src, 8, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, int8_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, uint16_t, unorm_to_unorm(src, 16, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, uint16_t, src)
+-         }
+-         break;
+-      case GL_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, int16_t, snorm_to_unorm(src, 16, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, int16_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_UNSIGNED_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, uint32_t, unorm_to_unorm(src, 32, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, uint32_t, src)
+-         }
+-         break;
+-      case GL_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, int32_t, snorm_to_unorm(src, 32, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, int32_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_ubyte(void_dst, num_dst_channels, void_src, src_type,
++                    num_src_channels, swizzle, normalized, count);
++      break;
+    case GL_BYTE:
+-   {
+-      const int8_t one = normalized ? INT8_MAX : 1;
+-      switch (src_type) {
+-      case GL_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, float, float_to_snorm(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, float, src)
+-         }
+-         break;
+-      case GL_HALF_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint8_t, uint16_t, half_to_snorm(src, 8))
+-         } else {
+-            SWIZZLE_CONVERT(uint8_t, uint16_t, _mesa_half_to_float(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int8_t, uint8_t, unorm_to_snorm(src, 8, 8))
+-         } else {
+-            SWIZZLE_CONVERT(int8_t, uint8_t, src)
+-         }
+-         break;
+-      case GL_BYTE:
+-         SWIZZLE_CONVERT(int8_t, int8_t, src)
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int8_t, uint16_t, unorm_to_snorm(src, 16, 8))
+-         } else {
+-            SWIZZLE_CONVERT(int8_t, uint16_t, src)
+-         }
+-         break;
+-      case GL_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int8_t, int16_t, snorm_to_snorm(src, 16, 8))
+-         } else {
+-            SWIZZLE_CONVERT(int8_t, int16_t, src)
+-         }
+-         break;
+-      case GL_UNSIGNED_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int8_t, uint32_t, unorm_to_snorm(src, 32, 8))
+-         } else {
+-            SWIZZLE_CONVERT(int8_t, uint32_t, src)
+-         }
+-         break;
+-      case GL_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int8_t, int32_t, snorm_to_snorm(src, 32, 8))
+-         } else {
+-            SWIZZLE_CONVERT(int8_t, int32_t, src)
+-         }
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_byte(void_dst, num_dst_channels, void_src, src_type,
++                   num_src_channels, swizzle, normalized, count);
++      break;
+    case GL_UNSIGNED_SHORT:
+-   {
+-      const uint16_t one = normalized ? UINT16_MAX : 1;
+-      switch (src_type) {
+-      case GL_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, float, float_to_unorm(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, float, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_HALF_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_unorm(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_uint(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, uint8_t, unorm_to_unorm(src, 8, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, uint8_t, src)
+-         }
+-         break;
+-      case GL_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, int8_t, snorm_to_unorm(src, 8, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, int8_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         SWIZZLE_CONVERT(uint16_t, uint16_t, src)
+-         break;
+-      case GL_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, int16_t, snorm_to_unorm(src, 16, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, int16_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_UNSIGNED_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, uint32_t, unorm_to_unorm(src, 32, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, uint32_t, src)
+-         }
+-         break;
+-      case GL_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, int32_t, snorm_to_unorm(src, 32, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, int32_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_ushort(void_dst, num_dst_channels, void_src, src_type,
++                     num_src_channels, swizzle, normalized, count);
++      break;
+    case GL_SHORT:
+-   {
+-      const int16_t one = normalized ? INT16_MAX : 1;
+-      switch (src_type) {
+-      case GL_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, float, float_to_snorm(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, float, src)
+-         }
+-         break;
+-      case GL_HALF_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint16_t, uint16_t, half_to_snorm(src, 16))
+-         } else {
+-            SWIZZLE_CONVERT(uint16_t, uint16_t, _mesa_half_to_float(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int16_t, uint8_t, unorm_to_snorm(src, 8, 16))
+-         } else {
+-            SWIZZLE_CONVERT(int16_t, uint8_t, src)
+-         }
+-         break;
+-      case GL_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int16_t, int8_t, snorm_to_snorm(src, 8, 16))
+-         } else {
+-            SWIZZLE_CONVERT(int16_t, int8_t, src)
+-         }
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int16_t, uint16_t, unorm_to_snorm(src, 16, 16))
+-         } else {
+-            SWIZZLE_CONVERT(int16_t, uint16_t, src)
+-         }
+-         break;
+-      case GL_SHORT:
+-         SWIZZLE_CONVERT(int16_t, int16_t, src)
+-         break;
+-      case GL_UNSIGNED_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int16_t, uint32_t, unorm_to_snorm(src, 32, 16))
+-         } else {
+-            SWIZZLE_CONVERT(int16_t, uint32_t, src)
+-         }
+-         break;
+-      case GL_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int16_t, int32_t, snorm_to_snorm(src, 32, 16))
+-         } else {
+-            SWIZZLE_CONVERT(int16_t, int32_t, src)
+-         }
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_short(void_dst, num_dst_channels, void_src, src_type,
++                    num_src_channels, swizzle, normalized, count);
++      break;
+    case GL_UNSIGNED_INT:
+-   {
+-      const uint32_t one = normalized ? UINT32_MAX : 1;
+-      switch (src_type) { case GL_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, float, float_to_unorm(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, float, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_HALF_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_unorm(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_uint(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, uint8_t, unorm_to_unorm(src, 8, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, uint8_t, src)
+-         }
+-         break;
+-      case GL_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, int8_t, snorm_to_unorm(src, 8, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, int8_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, uint16_t, unorm_to_unorm(src, 16, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, uint16_t, src)
+-         }
+-         break;
+-      case GL_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, int16_t, snorm_to_unorm(src, 16, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, int16_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      case GL_UNSIGNED_INT:
+-         SWIZZLE_CONVERT(uint32_t, uint32_t, src)
+-         break;
+-      case GL_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, int32_t, snorm_to_unorm(src, 32, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, int32_t, (src < 0) ? 0 : src)
+-         }
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_uint(void_dst, num_dst_channels, void_src, src_type,
++                   num_src_channels, swizzle, normalized, count);
++      break;
+    case GL_INT:
+-   {
+-      const int32_t one = normalized ? INT32_MAX : 1;
+-      switch (src_type) {
+-      case GL_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, float, float_to_snorm(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, float, src)
+-         }
+-         break;
+-      case GL_HALF_FLOAT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(uint32_t, uint16_t, half_to_snorm(src, 32))
+-         } else {
+-            SWIZZLE_CONVERT(uint32_t, uint16_t, _mesa_half_to_float(src))
+-         }
+-         break;
+-      case GL_UNSIGNED_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int32_t, uint8_t, unorm_to_snorm(src, 8, 32))
+-         } else {
+-            SWIZZLE_CONVERT(int32_t, uint8_t, src)
+-         }
+-         break;
+-      case GL_BYTE:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int32_t, int8_t, snorm_to_snorm(src, 8, 32))
+-         } else {
+-            SWIZZLE_CONVERT(int32_t, int8_t, src)
+-         }
+-         break;
+-      case GL_UNSIGNED_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int32_t, uint16_t, unorm_to_snorm(src, 16, 32))
+-         } else {
+-            SWIZZLE_CONVERT(int32_t, uint16_t, src)
+-         }
+-         break;
+-      case GL_SHORT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int32_t, int16_t, snorm_to_snorm(src, 16, 32))
+-         } else {
+-            SWIZZLE_CONVERT(int32_t, int16_t, src)
+-         }
+-         break;
+-      case GL_UNSIGNED_INT:
+-         if (normalized) {
+-            SWIZZLE_CONVERT(int32_t, uint32_t, unorm_to_snorm(src, 32, 32))
+-         } else {
+-            SWIZZLE_CONVERT(int32_t, uint32_t, src)
+-         }
+-         break;
+-      case GL_INT:
+-         SWIZZLE_CONVERT(int32_t, int32_t, src)
+-         break;
+-      default:
+-         assert(!"Invalid channel type combination");
+-      }
+-   }
+-   break;
++      convert_int(void_dst, num_dst_channels, void_src, src_type,
++                  num_src_channels, swizzle, normalized, count);
++      break;
+    default:
+       assert(!"Invalid channel type");
+    }
+-- 
+2.0.5
+

diff --git a/media-libs/mesa/files/mesa-10.5.1-fstat-include.patch b/media-libs/mesa/files/mesa-10.5.1-fstat-include.patch
new file mode 100644
index 0000000..212d00d
--- /dev/null
+++ b/media-libs/mesa/files/mesa-10.5.1-fstat-include.patch
@@ -0,0 +1,37 @@
+From 771cd266b9d00bdcf2cf7acaa3c8363c358d7478 Mon Sep 17 00:00:00 2001
+From: Emil Velikov <emil.l.velikov@gmail.com>
+Date: Wed, 11 Mar 2015 19:12:35 +0000
+Subject: loader: include <sys/stat.h> for non-sysfs builds
+
+Required by fstat(), otherwise we'll error out due to implicit function
+declaration.
+
+Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89530
+Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
+Reported-by: Vadim Rutkovsky <vrutkovs@redhat.com>
+Tested-by: Vadim Rutkovsky <vrutkovs@redhat.com>
+
+diff --git a/src/loader/loader.c b/src/loader/loader.c
+index 9ff5115..17bf133 100644
+--- a/src/loader/loader.c
++++ b/src/loader/loader.c
+@@ -64,6 +64,7 @@
+  *    Rob Clark <robclark@freedesktop.org>
+  */
+ 
++#include <sys/stat.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -80,7 +81,6 @@
+ #endif
+ #endif
+ #ifdef HAVE_SYSFS
+-#include <sys/stat.h>
+ #include <sys/types.h>
+ #endif
+ #include "loader.h"
+-- 
+cgit v0.10.2
+

diff --git a/media-libs/mesa/mesa-10.3.7-r1.ebuild b/media-libs/mesa/mesa-10.3.7-r99.ebuild
similarity index 96%
rename from media-libs/mesa/mesa-10.3.7-r1.ebuild
rename to media-libs/mesa/mesa-10.3.7-r99.ebuild
index 5417c73..8581f62 100644
--- a/media-libs/mesa/mesa-10.3.7-r1.ebuild
+++ b/media-libs/mesa/mesa-10.3.7-r99.ebuild
@@ -11,7 +11,7 @@ if [[ ${PV} = 9999* ]]; then
 	EXPERIMENTAL="true"
 fi
 
-PYTHON_COMPAT=( python{2_6,2_7} )
+PYTHON_COMPAT=( python2_7 )
 
 inherit base autotools multilib multilib-minimal flag-o-matic \
 	python-any-r1 toolchain-funcs pax-utils ${GIT_ECLASS}
@@ -40,6 +40,7 @@ fi
 LICENSE="MIT SGI-B-2.0"
 SLOT="0"
 KEYWORDS="amd64 arm ~mips ppc x86"
+RESTRICT="!bindist? ( bindist )"
 
 INTEL_CARDS="i915 i965 ilo intel"
 RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
@@ -50,7 +51,7 @@ done
 
 IUSE="${IUSE_VIDEO_CARDS}
 	bindist +classic debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm +nptl
-	opencl openvg osmesa pax_kernel openmax pic r600-llvm-compiler selinux
+	opencl openvg osmesa pax_kernel openmax pic selinux
 	+udev vdpau wayland xvmc xa kernel_FreeBSD kernel_linux"
 
 REQUIRED_USE="
@@ -59,14 +60,10 @@ REQUIRED_USE="
 	opencl? (
 		gallium
 		llvm
-		video_cards_r600? ( r600-llvm-compiler )
-		video_cards_radeon? ( r600-llvm-compiler )
-		video_cards_radeonsi? ( r600-llvm-compiler )
 	)
 	openmax? ( gallium )
 	gles1?  ( egl )
 	gles2?  ( egl )
-	r600-llvm-compiler? ( gallium llvm || ( video_cards_r600 video_cards_radeonsi video_cards_radeon ) )
 	wayland? ( egl gbm )
 	xa?  ( gallium )
 	video_cards_freedreno?  ( gallium )
@@ -119,6 +116,7 @@ RDEPEND="
 				) )
 		)
 		>=sys-devel/llvm-3.3-r3:=[${MULTILIB_USEDEP}]
+		<sys-devel/llvm-3.6
 		video_cards_radeonsi? ( >=sys-devel/llvm-3.4.2:=[${MULTILIB_USEDEP}] )
 	)
 	opencl? (
@@ -146,7 +144,6 @@ done
 DEPEND="${RDEPEND}
 	${PYTHON_DEPS}
 	llvm? (
-		r600-llvm-compiler? ( sys-devel/llvm[video_cards_radeon] )
 		video_cards_radeonsi? ( sys-devel/llvm[video_cards_radeon] )
 	)
 	opencl? (
@@ -207,6 +204,8 @@ src_prepare() {
 	fi
 
 	epatch "${FILESDIR}"/${PN}-10.3.7-dont-use-clrsb.patch
+	epatch "${FILESDIR}"/${PN}-10.3.7-format_utils.c.patch
+	epatch "${FILESDIR}"/${PN}-10.5.1-fstat-include.patch
 
 	# relax the requirement that r300 must have llvm, bug 380303
 	epatch "${FILESDIR}"/${PN}-10.2-dont-require-llvm-for-r300.patch
@@ -266,7 +265,6 @@ multilib_src_configure() {
 			$(use_enable openvg)
 			$(use_enable openvg gallium-egl)
 			$(use_enable openmax omx)
-			$(use_enable r600-llvm-compiler)
 			$(use_enable vdpau)
 			$(use_enable xa)
 			$(use_enable xvmc)
@@ -307,7 +305,7 @@ multilib_src_configure() {
 		"
 	fi
 
-	# on abi_x86_32 hardened we need to have asm disable  
+	# on abi_x86_32 hardened we need to have asm disable
 	if [[ ${ABI} == x86* ]] && use pic; then
 		myconf+=" --disable-asm"
 	fi

diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml
index fe098a4..d5ef123 100644
--- a/media-libs/mesa/metadata.xml
+++ b/media-libs/mesa/metadata.xml
@@ -5,12 +5,10 @@
 <use>
 	<flag name='bindist'>Disable patent-encumbered ARB_texture_float, EXT_texture_shared_exponent, and EXT_packed_float extensions.</flag>
 	<flag name='classic'>Build drivers based on the classic architecture.</flag>
-	<flag name='d3d9'>Enable Direct 3D9 API through Nine state tracker. Can be used together with patched wine.</flag>
 	<flag name='dri3'>Enable DRI3 support.</flag>
 	<flag name='egl'>Enable EGL support.</flag>
 	<flag name='gallium'>Build drivers based on Gallium3D, the new architecture for 3D graphics drivers.</flag>
 	<flag name='gbm'>Enable the Graphics Buffer Manager for EGL on KMS.</flag>
-	<flag name='gles'>Enable GLES (both v1 and v2) support.</flag>
 	<flag name='gles1'>Enable GLESv1 support.</flag>
 	<flag name='gles2'>Enable GLESv2 support.</flag>
 	<flag name='llvm'>Enable LLVM backend for Gallium3D.</flag>
@@ -20,7 +18,6 @@
 	<flag name='osmesa'>Build the Mesa library for off-screen rendering.</flag>
 	<flag name='pax_kernel'>Enable if the user plans to run the package under a pax enabled hardened kernel</flag>
 	<flag name='pic'>disable optimized assembly code that is not PIC friendly</flag>
-	<flag name='r600-llvm-compiler'>Build the LLVM based r600 shader compiler.</flag>
 	<flag name='vdpau'>Enable the VDPAU acceleration interface for the Gallium3D Video Layer.</flag>
 	<flag name='wayland'>Enable support for dev-libs/wayland</flag>
 	<flag name='xa'>Enable the XA (X Acceleration) API for Gallium3D.</flag>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2017-03-19 20:35 Aric Belsito
  0 siblings, 0 replies; 18+ messages in thread
From: Aric Belsito @ 2017-03-19 20:35 UTC (permalink / raw
  To: gentoo-commits

commit:     8881a5b73e3b7289a4a170b30dc04525097a8427
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Sun Mar 19 20:33:43 2017 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Sun Mar 19 20:33:43 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=8881a5b7

media-libs/mesa: add most recent versions

reliance on __GLIBC__ in `u_endian.h` causes build for radeon and other gallium
cards to be broken.

Also add an `execinfo.h` patch that should fix USE=debug builds.

 media-libs/mesa/Manifest                           |  10 +
 media-libs/mesa/files/eselect-mesa.conf.9.2        |  38 ++
 media-libs/mesa/files/mesa-11-execinfo.patch       |  68 +++
 ...er-Work-around-build-failure-with-AltiVec.patch |  70 +++
 media-libs/mesa/files/mesa-13-musl_endian.patch    |  12 +
 ...er-Work-around-build-failure-with-AltiVec.patch |  69 +++
 media-libs/mesa/mesa-13.0.5.ebuild                 | 513 ++++++++++++++++++++
 media-libs/mesa/mesa-17.0.1.ebuild                 | 518 +++++++++++++++++++++
 media-libs/mesa/metadata.xml                       |  38 ++
 9 files changed, 1336 insertions(+)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
new file mode 100644
index 0000000..d1af0fa
--- /dev/null
+++ b/media-libs/mesa/Manifest
@@ -0,0 +1,10 @@
+AUX eselect-mesa.conf.9.2 1630 SHA256 c1ca0e3fddc12b49c5db1739f2d57a0afd6856824d677b16f5903972bc0b631d SHA512 0fa9a23b4fba10599268266a82c7fa8dc5bfa1a0d565732875064c381dc4ff40c23faddb02b5849b1522eb9b7fd2ec2a0fac14406442a4aa0afa44bf760b42b5 WHIRLPOOL 6df6aa625cf445f68d69742184a75f9472cc7d59b068f2755ddac4201f1ad8d4518d04f62cb1228061a7d75e1e7b31048c16e8a50ec64480a3347a0a0a3850b8
+AUX mesa-11-execinfo.patch 3063 SHA256 150a0f8f6324db046538756fcf79a082fb1e64afe46bd679cc7965b0ebd71d15 SHA512 f30d4b79f5120dc8ff338a16b8c0c3cd1dc25dae3854f9e1c20eeb1a8115f48f01167dd11d316c788f715723815d37a21d65cf6026d65ef424335a481cb93090 WHIRLPOOL da15270c3efba6a1ff1968fa131f63b6d2472b05111a51d5da7d29095a9089f715d8b4bbfbba31e3858076b4ef6e5f3f9ed6c83b6faee44c48c4022756535489
+AUX mesa-13-clover-Work-around-build-failure-with-AltiVec.patch 2317 SHA256 02dd7e59ea5d08d4a66b2f7353bb427b71ed8e6638b50da593d35165a032ac42 SHA512 6b3cd038c0a61b4d64ec0b645086d7cf2c74b97bd0febe5229c88d78e8dc3a4cbd2876a06ca2394f819dd04b0397722fc76c4ce5939c5c58f40ef0d2e2bcbe84 WHIRLPOOL 0200946c578dfb47782533052e86804c8534d2da056670dad0712e694ca22a6983e433f0a355f489472814969c74558f113b03f01c3fd4c3bb671f09a2bf49b0
+AUX mesa-13-musl_endian.patch 417 SHA256 3686132ef3a57b607c223705a18f32da7fa7f58fecd5b118f3d7f5df3697cd11 SHA512 6b351de61e0d3ed5cc37233df8f915ca3e3d80291944556124c88408da2471c3b65fb5c355f1e78ca24a8ed1e007e3efd7c7fc52d08b509eaa66fc368b751ab2 WHIRLPOOL 7d1c0cfbb6a914df589c9f41939e6e7054aa6bfe8b2bed79e25a2d1bc44cb4d7b01a21b5e39aeeca27d9ebffdf0fb7f9af651a845316a131826521f11197ffc1
+AUX mesa-17-clover-Work-around-build-failure-with-AltiVec.patch 2176 SHA256 d26cb6f3abd2c4e3190dc1621f4bd27ec0dbb3d16ac599b9614e809428935de3 SHA512 35e1df05720e2911d01403e588b500102792b730c2bea6276560a6e6bb506afbe11e2aa59d3929eca550509605eef190a64826934f7c28ef235b2274c182aedf WHIRLPOOL 614fd2985a26d3f764720722186a20600aaf5a2dd29e85ce23bf899839bb858bc1eafd1733137577a8436a622e7515e423754e669c495aa37d36de141db10993
+DIST mesa-13.0.5.tar.xz 9171480 SHA256 bfcea7e2c801525a60895c8aff11aa68457ee9aa35d01a4638e1f310a3f5ef87 SHA512 db5f6a97b40ee6e45ba81280ab4543354e9f274c7112c5a43b8970244f329902a22f68d5eeddad5b64502507f462ffbcc028efc5dff93822adf95d30ba5903c1 WHIRLPOOL 164116608908331d4e8d69c4d2b92dc22e8e6d98725a20e8c2da5cc24b4e9ae9e05ee9c7209d55371b419e0f4e6c1d4752a46d149a968a6b83612aa77f7e480e
+DIST mesa-17.0.1.tar.xz 9447712 SHA256 96fd70ef5f31d276a17e424e7e1bb79447ccbbe822b56844213ef932e7ad1b0c SHA512 f3a807fbf30327a1dccb690e484276ab1b2b1e33b0440884b6476607e08aa3513d5c9d4b6dd345415decb93747d334c70bffe9e49eae787b48ef6c08989aeb7c WHIRLPOOL 955800014b4155eba5dea6f4ae50e7a302467d4063a5ff0378b6c3b833f924787fd923248f8746bdbbef3e57135ae44eb1a38248c08112ad5435b645fc955ec4
+EBUILD mesa-13.0.5.ebuild 13682 SHA256 c0941589335d956bff393fbd26114b2017d1f71fae94e06becaae8a1c52f0b0c SHA512 e407f73610a8d6c7e3456a051dac01bb577a4714128568f276c7e8811b9fc7ac050f29e2770861c1addb561a6828006cfb9f3f18a215448df61b6f9f03f9a7df WHIRLPOOL 71ebf88582419ef5175a04a5ea2d286fe8d2946c95ab354bc2a3a52386ba7100010d5bf92dc9c0c1f0ee4d65353636e2482ef911663b55f932547613d0520b48
+EBUILD mesa-17.0.1.ebuild 13718 SHA256 2b7031253f392cd3040e9cab0b5037668fa65c09ec62bf8725908bdc67af5039 SHA512 204824c9e7940660cc8167e702f24a8404a98a6de8e330411705a9a31a1f56591a2946d5cd9bfd6494c98b122143a68709f7bd7a978fcccf0fc0402eaad4a622 WHIRLPOOL 79f8decd28b033ff7c545f912f5af38bd21dd587f4d9a5e9e6e2cfb365ee532463dd6b307f35e7a258c75dcbf287bff99ffbc53a922b232f1eed8a338d368511
+MISC metadata.xml 2440 SHA256 98874315e8480a14f26b8395eb2573b85dbe402a8bb30a72aa2cc884bc0512a2 SHA512 47237a5fd95a9c58b1857b27da2558ecf46266630eeb7514db2f276f0a8c82a0751122d71a27b4949a1a66df75bbe9e5a833b1f12a86214614e6777849d4c5d8 WHIRLPOOL 5742264ad29f82e98a96044efb74fb230e7a8cc4d58ad569676e8ffc9a86873d5148de86e8a101a11ee465e204cae47f1ec8d50ba8a8c0d75070cb705a03eef8

diff --git a/media-libs/mesa/files/eselect-mesa.conf.9.2 b/media-libs/mesa/files/eselect-mesa.conf.9.2
new file mode 100644
index 0000000..18bfaff
--- /dev/null
+++ b/media-libs/mesa/files/eselect-mesa.conf.9.2
@@ -0,0 +1,38 @@
+# mesa classic/gallium implementations in this release
+
+# Syntax description:
+# * MESA_IMPLEMENTATIONS contains a space-delimited list of switchable
+#   classic/gallium implementations.
+# * MESA_DRIVERS is an associative array, for each member "foo" of
+#   MESA_IMPLEMENTATIONS it contains the following elements:
+#   foo,description - Human-readable description of the driver
+#   foo,classicdriver - Filename of the classic driver
+#   foo,galliumdriver - Filename of the gallium driver
+#   foo,default - which of classic or gallium is chosen by default
+
+MESA_IMPLEMENTATIONS="i915 i965 r300 r600 sw"
+declare -A MESA_DRIVERS || die "MESA_DRIVERS already in environment and not associative."
+
+MESA_DRIVERS[i915,description]="i915 (Intel 915, 945)"
+MESA_DRIVERS[i915,classicdriver]="i915_dri.so"
+MESA_DRIVERS[i915,galliumdriver]="i915g_dri.so"
+MESA_DRIVERS[i915,default]="gallium"
+
+MESA_DRIVERS[i965,description]="i965 (Intel GMA 965, G/Q3x, G/Q4x, HD)"
+MESA_DRIVERS[i965,classicdriver]="i965_dri.so"
+MESA_DRIVERS[i965,default]="classic"
+
+MESA_DRIVERS[r300,description]="r300 (Radeon R300-R500)"
+MESA_DRIVERS[r300,classicdriver]="r300_dri.so"
+MESA_DRIVERS[r300,galliumdriver]="r300g_dri.so"
+MESA_DRIVERS[r300,default]="gallium"
+
+MESA_DRIVERS[r600,description]="r600 (Radeon R600-R700, Evergreen, Northern Islands)"
+MESA_DRIVERS[r600,classicdriver]="r600_dri.so"
+MESA_DRIVERS[r600,galliumdriver]="r600g_dri.so"
+MESA_DRIVERS[r600,default]="gallium"
+
+MESA_DRIVERS[sw,description]="sw (Software renderer)"
+MESA_DRIVERS[sw,classicdriver]="swrast_dri.so"
+MESA_DRIVERS[sw,galliumdriver]="swrastg_dri.so"
+MESA_DRIVERS[sw,default]="gallium"

diff --git a/media-libs/mesa/files/mesa-11-execinfo.patch b/media-libs/mesa/files/mesa-11-execinfo.patch
new file mode 100644
index 0000000..0eefba8
--- /dev/null
+++ b/media-libs/mesa/files/mesa-11-execinfo.patch
@@ -0,0 +1,68 @@
+diff -Naur mesa-11.1.2.orig/configure.ac mesa-11.1.2/configure.ac
+--- mesa-11.1.2.orig/configure.ac	2016-02-10 15:57:54.000000000 -0800
++++ mesa-11.1.2/configure.ac	2016-03-09 13:27:47.979302937 -0800
+@@ -681,6 +681,7 @@
+ AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
+ AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
+ AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
++AC_CHECK_HEADER([execinfo.h], [DEFINES="$DEFINES -DHAVE_EXECINFO_H"])
+ 
+ dnl Check to see if dlopen is in default libraries (like Solaris, which
+ dnl has it in libc), or if libdl is needed to get it.
+diff -Naur mesa-11.1.2.orig/src/gallium/auxiliary/util/u_debug_symbol.c mesa-11.1.2/src/gallium/auxiliary/util/u_debug_symbol.c
+--- mesa-11.1.2.orig/src/gallium/auxiliary/util/u_debug_symbol.c	2016-01-17 23:39:26.000000000 -0800
++++ mesa-11.1.2/src/gallium/auxiliary/util/u_debug_symbol.c	2016-03-09 13:29:27.255060988 -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
+diff -Naur mesa-11.1.2.orig/src/mapi/glapi/gen/gl_gentable.py mesa-11.1.2/src/mapi/glapi/gen/gl_gentable.py
+--- mesa-11.1.2.orig/src/mapi/glapi/gen/gl_gentable.py	2016-02-10 15:57:54.000000000 -0800
++++ mesa-11.1.2/src/mapi/glapi/gen/gl_gentable.py	2016-03-09 13:28:14.624506395 -0800
+@@ -44,7 +44,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-11.1.2.orig/src/mapi/glapi/glapi_gentable.c mesa-11.1.2/src/mapi/glapi/glapi_gentable.c
+--- mesa-11.1.2.orig/src/mapi/glapi/glapi_gentable.c	2016-02-10 16:24:49.000000000 -0800
++++ mesa-11.1.2/src/mapi/glapi/glapi_gentable.c	2016-03-09 13:28:38.411688029 -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-11.1.2.orig/src/mesa/drivers/dri/i915/intel_regions.c mesa-11.1.2/src/mesa/drivers/dri/i915/intel_regions.c
+--- mesa-11.1.2.orig/src/mesa/drivers/dri/i915/intel_regions.c	2016-01-17 23:39:26.000000000 -0800
++++ mesa-11.1.2/src/mesa/drivers/dri/i915/intel_regions.c	2016-03-09 13:30:18.483460168 -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-13-clover-Work-around-build-failure-with-AltiVec.patch b/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch
new file mode 100644
index 0000000..0d2c65a
--- /dev/null
+++ b/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch
@@ -0,0 +1,70 @@
+From 71a2b2e8a580d2c0bee84b898d8531b27f3c7811 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Thu, 2 Mar 2017 04:43:21 +0000
+Subject: [PATCH] clover: Work around build failure with AltiVec.
+
+Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=587210
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68504
+Acked-by: Francisco Jerez <currojerez@riseup.net>
+(cherry picked from commit 7d1195c1e4d071fe796bf5f210c468ea1cc86225)
+---
+ configure.ac                                  | 14 ++++++++++++++
+ src/gallium/state_trackers/clover/Makefile.am |  3 +++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index fd78fbb..3646e45 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1974,6 +1974,20 @@ if test "x$enable_opencl" = xyes; then
+     if test "x$have_libelf" != xyes; then
+        AC_MSG_ERROR([Clover requires libelf])
+     fi
++
++    if test "x${ac_cv_cxx_compiler_gnu}" = xyes; then
++        altivec_enabled=no
++        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
++        #if !defined(__VEC__) || !defined(__ALTIVEC__)
++        #error "AltiVec not enabled"
++        #endif
++        ])], altivec_enabled=yes)
++
++        if test "$altivec_enabled" = yes; then
++            CLOVER_STD_OVERRIDE="-std=gnu++11"
++        fi
++        AC_SUBST([CLOVER_STD_OVERRIDE])
++    fi
+ fi
+ AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
+ AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
+diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
+index 8abcfec..edf1e26 100644
+--- a/src/gallium/state_trackers/clover/Makefile.am
++++ b/src/gallium/state_trackers/clover/Makefile.am
+@@ -33,6 +33,7 @@ noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
+ 
+ libcltgsi_la_CXXFLAGS = \
+ 	-std=c++11 \
++	$(CLOVER_STD_OVERRIDE) \
+ 	$(VISIBILITY_CXXFLAGS)
+ 
+ libcltgsi_la_SOURCES = $(TGSI_SOURCES)
+@@ -41,6 +42,7 @@ libclllvm_la_CXXFLAGS = \
+ 	-std=c++11 \
+ 	$(VISIBILITY_CXXFLAGS) \
+ 	$(LLVM_CXXFLAGS) \
++	$(CLOVER_STD_OVERRIDE) \
+ 	$(DEFINES) \
+ 	$(LIBELF_CFLAGS) \
+ 	-DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
+@@ -51,6 +53,7 @@ libclllvm_la_SOURCES = $(LLVM_SOURCES)
+ 
+ libclover_la_CXXFLAGS = \
+ 	-std=c++11 \
++	$(CLOVER_STD_OVERRIDE) \
+ 	$(VISIBILITY_CXXFLAGS)
+ 
+ libclover_la_LIBADD = \
+-- 
+2.10.2
+

diff --git a/media-libs/mesa/files/mesa-13-musl_endian.patch b/media-libs/mesa/files/mesa-13-musl_endian.patch
new file mode 100644
index 0000000..1276605
--- /dev/null
+++ b/media-libs/mesa/files/mesa-13-musl_endian.patch
@@ -0,0 +1,12 @@
+diff -Naur mesa-13.0.5.orig/src/util/u_endian.h mesa-13.0.5/src/util/u_endian.h
+--- mesa-13.0.5.orig/src/util/u_endian.h	2017-03-19 12:40:43.808781967 -0700
++++ mesa-13.0.5/src/util/u_endian.h	2017-03-19 12:49:01.731158551 -0700
+@@ -27,7 +27,7 @@
+ #ifndef U_ENDIAN_H
+ #define U_ENDIAN_H
+ 
+-#if defined(__GLIBC__) || defined(ANDROID)
++#if defined(__linux__)
+ #include <endian.h>
+ 
+ #if __BYTE_ORDER == __LITTLE_ENDIAN

diff --git a/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch b/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch
new file mode 100644
index 0000000..87f5f9d
--- /dev/null
+++ b/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch
@@ -0,0 +1,69 @@
+From 7d1195c1e4d071fe796bf5f210c468ea1cc86225 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Thu, 2 Mar 2017 04:43:21 +0000
+Subject: [PATCH] clover: Work around build failure with AltiVec.
+
+Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=587210
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68504
+Acked-by: Francisco Jerez <currojerez@riseup.net>
+---
+ configure.ac                                  | 14 ++++++++++++++
+ src/gallium/state_trackers/clover/Makefile.am |  3 +++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index a3d1a00..57c4b1e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2033,6 +2033,20 @@ if test "x$enable_opencl" = xyes; then
+        AC_MSG_ERROR([Clover requires libelf])
+     fi
+ 
++    if test "x${ac_cv_cxx_compiler_gnu}" = xyes; then
++        altivec_enabled=no
++        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
++        #if !defined(__VEC__) || !defined(__ALTIVEC__)
++        #error "AltiVec not enabled"
++        #endif
++        ])], altivec_enabled=yes)
++
++        if test "$altivec_enabled" = yes; then
++            CLOVER_STD_OVERRIDE="-std=gnu++11"
++        fi
++        AC_SUBST([CLOVER_STD_OVERRIDE])
++    fi
++
+     llvm_require_version $LLVM_REQUIRED_OPENCL "opencl"
+ 
+     llvm_add_default_components "opencl"
+diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
+index a657e5b..3213935 100644
+--- a/src/gallium/state_trackers/clover/Makefile.am
++++ b/src/gallium/state_trackers/clover/Makefile.am
+@@ -32,6 +32,7 @@ noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
+ 
+ libcltgsi_la_CXXFLAGS = \
+ 	-std=c++11 \
++	$(CLOVER_STD_OVERRIDE) \
+ 	$(VISIBILITY_CXXFLAGS)
+ 
+ libcltgsi_la_SOURCES = $(TGSI_SOURCES)
+@@ -40,6 +41,7 @@ libclllvm_la_CXXFLAGS = \
+ 	-std=c++11 \
+ 	$(VISIBILITY_CXXFLAGS) \
+ 	$(LLVM_CXXFLAGS) \
++	$(CLOVER_STD_OVERRIDE) \
+ 	$(DEFINES) \
+ 	$(LIBELF_CFLAGS) \
+ 	-DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
+@@ -50,6 +52,7 @@ libclllvm_la_SOURCES = $(LLVM_SOURCES)
+ 
+ libclover_la_CXXFLAGS = \
+ 	-std=c++11 \
++	$(CLOVER_STD_OVERRIDE) \
+ 	$(VISIBILITY_CXXFLAGS)
+ 
+ libclover_la_LIBADD = \
+-- 
+2.10.2
+

diff --git a/media-libs/mesa/mesa-13.0.5.ebuild b/media-libs/mesa/mesa-13.0.5.ebuild
new file mode 100644
index 0000000..b8fca01
--- /dev/null
+++ b/media-libs/mesa/mesa-13.0.5.ebuild
@@ -0,0 +1,513 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
+
+if [[ ${PV} = 9999 ]]; then
+	GIT_ECLASS="git-r3"
+	EXPERIMENTAL="true"
+fi
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
+
+OPENGL_DIR="xorg-x11"
+
+MY_P="${P/_/-}"
+FOLDER="${PV/_rc*/}"
+
+DESCRIPTION="OpenGL-like graphic library for Linux"
+HOMEPAGE="https://www.mesa3d.org/"
+
+if [[ $PV == 9999 ]]; then
+	SRC_URI=""
+else
+	SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_P}.tar.xz"
+	KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+RESTRICT="!bindist? ( bindist )"
+
+INTEL_CARDS="i915 i965 intel"
+RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
+VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vc4 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 gcrypt gles1 gles2
+	libressl +llvm +nettle +nptl opencl osmesa pax_kernel openmax openssl pic
+	selinux vaapi valgrind vdpau vulkan wayland xvmc xa"
+
+REQUIRED_USE="
+	|| ( gcrypt libressl nettle openssl )
+	d3d9?   ( dri3 gallium )
+	llvm?   ( gallium )
+	opencl? ( gallium llvm )
+	openmax? ( gallium )
+	gles1?  ( egl )
+	gles2?  ( egl )
+	vaapi? ( gallium )
+	vdpau? ( gallium )
+	vulkan? ( video_cards_i965 )
+	wayland? ( egl gbm )
+	xa?  ( gallium )
+	video_cards_freedreno?  ( gallium )
+	video_cards_intel?  ( classic )
+	video_cards_i915?   ( || ( classic gallium ) )
+	video_cards_i965?   ( classic )
+	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_vmware? ( gallium )
+	${PYTHON_REQUIRED_USE}
+"
+
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.72"
+# keep correct libdrm and dri2proto dep
+# keep blocks in rdepend for binpkg
+RDEPEND="
+	!<x11-base/xorg-server-1.7
+	!<=x11-proto/xf86driproto-2.0.3
+	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
+	classic? ( app-eselect/eselect-mesa )
+	gallium? ( app-eselect/eselect-mesa )
+	>=app-eselect/eselect-opengl-1.3.0
+	>=dev-libs/expat-2.1.0-r3:=[${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.9.3:=[${MULTILIB_USEDEP}]
+	x11-libs/libXfixes:=[${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}]
+		)
+		>=sys-devel/llvm-3.6.0:0=[${MULTILIB_USEDEP}]
+	)
+	nettle? ( dev-libs/nettle:=[${MULTILIB_USEDEP}] )
+	!nettle? (
+		gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
+		!gcrypt? (
+			libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
+			!libressl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
+		)
+	)
+	opencl? (
+				app-eselect/eselect-opencl
+				dev-libs/libclc
+				virtual/libelf:0=[${MULTILIB_USEDEP}]
+			)
+	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
+	vaapi? (
+		>=x11-libs/libva-1.6.0:=[${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.2.0:=[${MULTILIB_USEDEP}] )
+	xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
+	${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vmware?,${MULTILIB_USEDEP}]
+"
+for card in ${INTEL_CARDS}; do
+	RDEPEND="${RDEPEND}
+		video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
+	"
+done
+
+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] )
+"
+
+# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
+# LLVM < 3.9 is out of the game
+DEPEND="${RDEPEND}
+	llvm? (
+		video_cards_radeonsi? ( || (
+			sys-devel/llvm[llvm_targets_AMDGPU]
+			sys-devel/llvm[video_cards_radeon]
+		) )
+	)
+	opencl? (
+				>=sys-devel/llvm-3.4.2:0=[${MULTILIB_USEDEP}]
+				>=sys-devel/clang-3.4.2:0=[${MULTILIB_USEDEP}]
+				>=sys-devel/gcc-4.6
+	)
+	sys-devel/gettext
+	virtual/pkgconfig
+	valgrind? ( dev-util/valgrind )
+	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
+	dri3? (
+		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
+		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
+	)
+	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
+	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
+	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
+	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
+"
+[[ ${PV} == 9999 ]] && DEPEND+="
+	sys-devel/bison
+	sys-devel/flex
+	${PYTHON_DEPS}
+	$(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
+	)
+)"
+
+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
+
+	python-any-r1_pkg_setup
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-11-execinfo.patch
+	epatch "${FILESDIR}"/${PN}-13-musl_endian.patch
+	epatch "${FILESDIR}"/${PN}-13-clover-Work-around-build-failure-with-AltiVec.patch
+
+	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-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
+	fi
+
+	if use gallium; then
+		myconf+="
+			$(use_enable d3d9 nine)
+			$(use_enable llvm gallium-llvm)
+			$(use_enable openmax omx)
+			$(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_vmware svga
+		gallium_enable video_cards_nouveau nouveau
+		gallium_enable video_cards_i915 i915
+		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
+	fi
+
+	if use vulkan; then
+		vulkan_enable video_cards_i965 intel
+
+		# radv is disabled due to dependence on >=llvm-3.9, bug 607660
+		#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 \
+		--disable-shader-cache \
+		$(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) \
+		--enable-valgrind=$(usex valgrind auto no) \
+		--enable-llvm-shared-libs \
+		--with-dri-drivers=${DRI_DRIVERS} \
+		--with-gallium-drivers=${GALLIUM_DRIVERS} \
+		--with-vulkan-drivers=${VULKAN_DRIVERS} \
+		--with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \
+		PYTHON2="${PYTHON}" \
+		${myconf}
+}
+
+multilib_src_install() {
+	emake install DESTDIR="${D}"
+
+	if use classic || use gallium; then
+			ebegin "Moving DRI/Gallium drivers for dynamic switching"
+			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
+			keepdir /usr/$(get_libdir)/dri
+			dodir /usr/$(get_libdir)/mesa
+			for x in ${gallium_drivers[@]}; do
+				if [ -f "$(get_libdir)/gallium/${x}" ]; then
+					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
+						|| die "Failed to move ${x}"
+				fi
+			done
+			if use classic; then
+				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
+			fi
+			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
+				if [ -f ${x} -o -L ${x} ]; then
+					mv -f "${x}" "${x/dri/mesa}" \
+						|| die "Failed to move ${x}"
+				fi
+			done
+			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
+			ln -s ../mesa/*.so . || die "Creating symlink failed"
+			# remove symlinks to drivers known to eselect
+			for x in ${gallium_drivers[@]}; do
+				if [ -f ${x} -o -L ${x} ]; then
+					rm "${x}" || die "Failed to remove ${x}"
+				fi
+			done
+			popd
+		eend $?
+	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
+
+	if use openmax; then
+		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
+		doenvd "${T}"/99mesaxdgomx
+		keepdir /usr/share/mesa/xdg
+	fi
+}
+
+multilib_src_install_all() {
+	prune_libtool_files --all
+	einstalldocs
+
+	if use !bindist; then
+		dodoc docs/patents.txt
+	fi
+
+	# Install config file for eselect mesa
+	insinto /usr/share/mesa
+	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
+
+	# Mesa should not install these
+	if use vulkan; then
+		rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} || die
+	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}
+
+	# Select classic/gallium drivers
+	if use classic || use gallium; then
+		eselect mesa set --auto
+	fi
+
+	# Switch to mesa opencl
+	if use opencl; then
+		eselect opencl set --use-old ${PN}
+	fi
+
+	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
+	if use openmax; then
+		ebegin "Registering OpenMAX drivers"
+		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
+			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
+			omxregister-bellagio
+		eend $?
+	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 patents.txt for an explanation."
+	fi
+
+	if ! has_version media-libs/libtxc_dxtn; then
+		elog "Note that in order to have full S3TC support, it is necessary to install"
+		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
+		elog "textures in some apps, and some others even require this to run."
+	fi
+}
+
+pkg_prerm() {
+	if use openmax; then
+		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
+	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-17.0.1.ebuild b/media-libs/mesa/mesa-17.0.1.ebuild
new file mode 100644
index 0000000..4638859
--- /dev/null
+++ b/media-libs/mesa/mesa-17.0.1.ebuild
@@ -0,0 +1,518 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
+
+if [[ $PV == 9999 ]]; then
+	SRC_URI=""
+else
+	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+RESTRICT="!bindist? ( bindist )"
+
+INTEL_CARDS="i915 i965 intel"
+RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
+VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 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 +llvm
+	+nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind vdpau
+	vulkan wayland xvmc xa"
+
+REQUIRED_USE="
+	d3d9?   ( dri3 gallium )
+	llvm?   ( gallium )
+	opencl? ( gallium llvm )
+	openmax? ( gallium )
+	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_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_vivante? ( gallium gbm )
+	video_cards_vmware? ( gallium )
+	${PYTHON_REQUIRED_USE}
+"
+
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.74"
+# keep correct libdrm and dri2proto dep
+# keep blocks in rdepend for binpkg
+RDEPEND="
+	!<x11-base/xorg-server-1.7
+	!<=x11-proto/xf86driproto-2.0.3
+	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
+	classic? ( app-eselect/eselect-mesa )
+	gallium? ( app-eselect/eselect-mesa )
+	>=app-eselect/eselect-opengl-1.3.0
+	>=dev-libs/expat-2.1.0-r3:=[${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.9.3:=[${MULTILIB_USEDEP}]
+	x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
+	llvm? (
+		video_cards_radeonsi? (
+			virtual/libelf:0=[${MULTILIB_USEDEP}]
+			vulkan? (
+				|| (
+					sys-devel/llvm:4[${MULTILIB_USEDEP}]
+					>=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}] ) )
+		)
+		video_cards_r600? (
+			virtual/libelf:0=[${MULTILIB_USEDEP}]
+		)
+		video_cards_radeon? (
+			virtual/libelf:0=[${MULTILIB_USEDEP}]
+		)
+		|| (
+			sys-devel/llvm:4[${MULTILIB_USEDEP}]
+			>=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
+		)
+		<sys-devel/llvm-5:=[${MULTILIB_USEDEP}]
+	)
+	opencl? (
+				app-eselect/eselect-opencl
+				dev-libs/libclc
+				virtual/libelf:0=[${MULTILIB_USEDEP}]
+			)
+	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
+	vaapi? (
+		>=x11-libs/libva-1.6.0:=[${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.11.0:=[${MULTILIB_USEDEP}] )
+	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}]
+"
+for card in ${INTEL_CARDS}; do
+	RDEPEND="${RDEPEND}
+		video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
+	"
+done
+
+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] )
+"
+
+# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
+# LLVM < 3.9 is out of the game
+DEPEND="${RDEPEND}
+	llvm? (
+		video_cards_radeonsi? ( || (
+			sys-devel/llvm[llvm_targets_AMDGPU]
+			sys-devel/llvm[video_cards_radeon]
+		) )
+	)
+	opencl? (
+		|| (
+			sys-devel/llvm:4[${MULTILIB_USEDEP}]
+			>=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
+		)
+		|| (
+			sys-devel/clang:4[${MULTILIB_USEDEP}]
+			>=sys-devel/clang-3.6.0:0[${MULTILIB_USEDEP}]
+		)
+		>=sys-devel/gcc-4.6
+	)
+	sys-devel/gettext
+	virtual/pkgconfig
+	valgrind? ( dev-util/valgrind )
+	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
+	dri3? (
+		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
+		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
+	)
+	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
+	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
+	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
+	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
+"
+[[ ${PV} == 9999 ]] && DEPEND+="
+	sys-devel/bison
+	sys-devel/flex
+	${PYTHON_DEPS}
+	$(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
+	)
+)"
+
+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 || use opencl; then
+		LLVM_MAX_SLOT=4 llvm_pkg_setup
+	fi
+	python-any-r1_pkg_setup
+}
+
+src_prepare() {
+	eapply "${FILESDIR}"/${PN}-11-execinfo.patch
+	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
+	eapply "${FILESDIR}"/${PN}-17-clover-Work-around-build-failure-with-AltiVec.patch
+
+	eautoreconf
+
+	eapply_user
+}
+
+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-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
+	fi
+
+	if use gallium; then
+		myconf+="
+			$(use_enable d3d9 nine)
+			$(use_enable llvm gallium-llvm)
+			$(use_enable openmax omx)
+			$(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
+	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) \
+		--enable-valgrind=$(usex valgrind auto no) \
+		--enable-llvm-shared-libs \
+		--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 classic || use gallium; then
+			ebegin "Moving DRI/Gallium drivers for dynamic switching"
+			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
+			keepdir /usr/$(get_libdir)/dri
+			dodir /usr/$(get_libdir)/mesa
+			for x in ${gallium_drivers[@]}; do
+				if [ -f "$(get_libdir)/gallium/${x}" ]; then
+					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
+						|| die "Failed to move ${x}"
+				fi
+			done
+			if use classic; then
+				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
+			fi
+			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
+				if [ -f ${x} -o -L ${x} ]; then
+					mv -f "${x}" "${x/dri/mesa}" \
+						|| die "Failed to move ${x}"
+				fi
+			done
+			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
+			ln -s ../mesa/*.so . || die "Creating symlink failed"
+			# remove symlinks to drivers known to eselect
+			for x in ${gallium_drivers[@]}; do
+				if [ -f ${x} -o -L ${x} ]; then
+					rm "${x}" || die "Failed to remove ${x}"
+				fi
+			done
+			popd
+		eend $?
+	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
+
+	if use openmax; then
+		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
+		doenvd "${T}"/99mesaxdgomx
+		keepdir /usr/share/mesa/xdg
+	fi
+}
+
+multilib_src_install_all() {
+	find "${ED}" -name '*.la' -delete
+	einstalldocs
+
+	if use !bindist; then
+		dodoc docs/patents.txt
+	fi
+
+	# Install config file for eselect mesa
+	insinto /usr/share/mesa
+	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
+}
+
+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}
+
+	# Select classic/gallium drivers
+	if use classic || use gallium; then
+		eselect mesa set --auto
+	fi
+
+	# Switch to mesa opencl
+	if use opencl; then
+		eselect opencl set --use-old ${PN}
+	fi
+
+	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
+	if use openmax; then
+		ebegin "Registering OpenMAX drivers"
+		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
+			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
+			omxregister-bellagio
+		eend $?
+	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 patents.txt for an explanation."
+	fi
+
+	if ! has_version media-libs/libtxc_dxtn; then
+		elog "Note that in order to have full S3TC support, it is necessary to install"
+		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
+		elog "textures in some apps, and some others even require this to run."
+	fi
+}
+
+pkg_prerm() {
+	if use openmax; then
+		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
+	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/metadata.xml b/media-libs/mesa/metadata.xml
new file mode 100644
index 0000000..054cb72
--- /dev/null
+++ b/media-libs/mesa/metadata.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>x11@gentoo.org</email>
+		<name>X11</name>
+	</maintainer>
+	<use>
+		<flag name="bindist">Disable patent-encumbered ARB_texture_float, EXT_texture_shared_exponent, and EXT_packed_float extensions.</flag>
+		<flag name="classic">Build drivers based on the classic architecture.</flag>
+		<flag name="d3d9">Enable Direct 3D9 API through Nine state tracker. Can be used together with patched wine.</flag>
+		<flag name="dri3">Enable DRI3 support.</flag>
+		<flag name="egl">Enable EGL support.</flag>
+		<flag name="gallium">Build drivers based on Gallium3D, the new architecture for 3D graphics drivers.</flag>
+		<flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> for low level sha1 utility functions.</flag>
+		<flag name="gbm">Enable the Graphics Buffer Manager for EGL on KMS.</flag>
+		<flag name="gles1">Enable GLESv1 support.</flag>
+		<flag name="gles2">Enable GLESv2 support.</flag>
+		<flag name="libressl">Use <pkg>dev-libs/libressl</pkg> for low level sha1 utility functions.</flag>
+		<flag name="llvm">Enable LLVM backend for Gallium3D.</flag>
+		<flag name="nettle">Use <pkg>dev-libs/nettle</pkg> for low level sha1 utility functions.</flag>
+		<flag name="opencl">Enable the Clover Gallium OpenCL state tracker.</flag>
+		<flag name="openmax">Enable OpenMAX video decode/encode acceleration for Gallium3D.</flag>
+		<flag name="openssl">Use <pkg>dev-libs/openssl</pkg> for low level sha1 utility functions. May cause issues with games from Steam.</flag>
+		<flag name="osmesa">Build the Mesa library for off-screen rendering.</flag>
+		<flag name="pax_kernel">Enable if the user plans to run the package under a pax enabled hardened kernel</flag>
+		<flag name="pic">disable optimized assembly code that is not PIC friendly</flag>
+		<flag name="valgrind">Compile in valgrind memory hints</flag>
+		<flag name="vdpau">Enable the VDPAU acceleration interface for the Gallium3D Video Layer.</flag>
+		<flag name="vulkan">Enable Vulkan drivers</flag>
+		<flag name="wayland">Enable support for dev-libs/wayland</flag>
+		<flag name="xa">Enable the XA (X Acceleration) API for Gallium3D.</flag>
+		<flag name="xvmc">Enable the XvMC acceleration interface for the Gallium3D Video Layer.</flag>
+	</use>
+	<upstream>
+		<remote-id type="sourceforge">mesa3d</remote-id>
+	</upstream>
+</pkgmetadata>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2017-03-20 21:37 Aric Belsito
  0 siblings, 0 replies; 18+ messages in thread
From: Aric Belsito @ 2017-03-20 21:37 UTC (permalink / raw
  To: gentoo-commits

commit:     a7fa6e9a3a8bae2b2b5bcb773a5ff524f69a9a49
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Mon Mar 20 21:36:33 2017 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Mon Mar 20 21:36:33 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=a7fa6e9a

media-libs/mesa: version bump to 13.0.6/17.0.2

 media-libs/mesa/Manifest                           |  7 +-
 ...er-Work-around-build-failure-with-AltiVec.patch | 69 ------------------
 .../{mesa-17.0.1.ebuild => mesa-13.0.6.ebuild}     | 82 ++++++++++------------
 .../{mesa-17.0.1.ebuild => mesa-17.0.2.ebuild}     |  1 -
 4 files changed, 42 insertions(+), 117 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index d1af0fa..d9697c9 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -2,9 +2,10 @@ AUX eselect-mesa.conf.9.2 1630 SHA256 c1ca0e3fddc12b49c5db1739f2d57a0afd6856824d
 AUX mesa-11-execinfo.patch 3063 SHA256 150a0f8f6324db046538756fcf79a082fb1e64afe46bd679cc7965b0ebd71d15 SHA512 f30d4b79f5120dc8ff338a16b8c0c3cd1dc25dae3854f9e1c20eeb1a8115f48f01167dd11d316c788f715723815d37a21d65cf6026d65ef424335a481cb93090 WHIRLPOOL da15270c3efba6a1ff1968fa131f63b6d2472b05111a51d5da7d29095a9089f715d8b4bbfbba31e3858076b4ef6e5f3f9ed6c83b6faee44c48c4022756535489
 AUX mesa-13-clover-Work-around-build-failure-with-AltiVec.patch 2317 SHA256 02dd7e59ea5d08d4a66b2f7353bb427b71ed8e6638b50da593d35165a032ac42 SHA512 6b3cd038c0a61b4d64ec0b645086d7cf2c74b97bd0febe5229c88d78e8dc3a4cbd2876a06ca2394f819dd04b0397722fc76c4ce5939c5c58f40ef0d2e2bcbe84 WHIRLPOOL 0200946c578dfb47782533052e86804c8534d2da056670dad0712e694ca22a6983e433f0a355f489472814969c74558f113b03f01c3fd4c3bb671f09a2bf49b0
 AUX mesa-13-musl_endian.patch 417 SHA256 3686132ef3a57b607c223705a18f32da7fa7f58fecd5b118f3d7f5df3697cd11 SHA512 6b351de61e0d3ed5cc37233df8f915ca3e3d80291944556124c88408da2471c3b65fb5c355f1e78ca24a8ed1e007e3efd7c7fc52d08b509eaa66fc368b751ab2 WHIRLPOOL 7d1c0cfbb6a914df589c9f41939e6e7054aa6bfe8b2bed79e25a2d1bc44cb4d7b01a21b5e39aeeca27d9ebffdf0fb7f9af651a845316a131826521f11197ffc1
-AUX mesa-17-clover-Work-around-build-failure-with-AltiVec.patch 2176 SHA256 d26cb6f3abd2c4e3190dc1621f4bd27ec0dbb3d16ac599b9614e809428935de3 SHA512 35e1df05720e2911d01403e588b500102792b730c2bea6276560a6e6bb506afbe11e2aa59d3929eca550509605eef190a64826934f7c28ef235b2274c182aedf WHIRLPOOL 614fd2985a26d3f764720722186a20600aaf5a2dd29e85ce23bf899839bb858bc1eafd1733137577a8436a622e7515e423754e669c495aa37d36de141db10993
 DIST mesa-13.0.5.tar.xz 9171480 SHA256 bfcea7e2c801525a60895c8aff11aa68457ee9aa35d01a4638e1f310a3f5ef87 SHA512 db5f6a97b40ee6e45ba81280ab4543354e9f274c7112c5a43b8970244f329902a22f68d5eeddad5b64502507f462ffbcc028efc5dff93822adf95d30ba5903c1 WHIRLPOOL 164116608908331d4e8d69c4d2b92dc22e8e6d98725a20e8c2da5cc24b4e9ae9e05ee9c7209d55371b419e0f4e6c1d4752a46d149a968a6b83612aa77f7e480e
-DIST mesa-17.0.1.tar.xz 9447712 SHA256 96fd70ef5f31d276a17e424e7e1bb79447ccbbe822b56844213ef932e7ad1b0c SHA512 f3a807fbf30327a1dccb690e484276ab1b2b1e33b0440884b6476607e08aa3513d5c9d4b6dd345415decb93747d334c70bffe9e49eae787b48ef6c08989aeb7c WHIRLPOOL 955800014b4155eba5dea6f4ae50e7a302467d4063a5ff0378b6c3b833f924787fd923248f8746bdbbef3e57135ae44eb1a38248c08112ad5435b645fc955ec4
+DIST mesa-13.0.6.tar.xz 9179236 SHA256 29ef104a7fc082d352b1599bd6cb1d040be424ccd22f5e0eb7ee9b0e9acd3597 SHA512 2455e044647f674c2f1dd524143b61b8630713fa929bbf6fe1c981436a9c08dc933553d638a22b32d2799afb77be746355b48b1b20af172141c5b63891e94441 WHIRLPOOL 1fdaaf29de96225cf41a3bdeb559a35cf20fda524f80985b2bfdc52095dcb7f6b320704b7ccf754a6f80555925a6a80dfa2b1115a4bdd9bdc1ebb672f115208a
+DIST mesa-17.0.2.tar.xz 9451056 SHA256 f8f191f909e01e65de38d5bdea5fb057f21649a3aed20948be02348e77a689d4 SHA512 df0cb47d01dee16d1d72e0a5fd9d49ab412294761ca647cbb6b411e16892b8be503d87911591339d4630d16b7c948897bfa4321b2c5a8a4219fa58b347015471 WHIRLPOOL 3cb03a48da994202e6a39f4adc97e8b40f2bcc713f5fb859fbbdc0a068f3842a59bc916fa0e36138cf560c4bf25c3b70425d6ed9ea8096acc8bbd9ddebfd1acc
 EBUILD mesa-13.0.5.ebuild 13682 SHA256 c0941589335d956bff393fbd26114b2017d1f71fae94e06becaae8a1c52f0b0c SHA512 e407f73610a8d6c7e3456a051dac01bb577a4714128568f276c7e8811b9fc7ac050f29e2770861c1addb561a6828006cfb9f3f18a215448df61b6f9f03f9a7df WHIRLPOOL 71ebf88582419ef5175a04a5ea2d286fe8d2946c95ab354bc2a3a52386ba7100010d5bf92dc9c0c1f0ee4d65353636e2482ef911663b55f932547613d0520b48
-EBUILD mesa-17.0.1.ebuild 13718 SHA256 2b7031253f392cd3040e9cab0b5037668fa65c09ec62bf8725908bdc67af5039 SHA512 204824c9e7940660cc8167e702f24a8404a98a6de8e330411705a9a31a1f56591a2946d5cd9bfd6494c98b122143a68709f7bd7a978fcccf0fc0402eaad4a622 WHIRLPOOL 79f8decd28b033ff7c545f912f5af38bd21dd587f4d9a5e9e6e2cfb365ee532463dd6b307f35e7a258c75dcbf287bff99ffbc53a922b232f1eed8a338d368511
+EBUILD mesa-13.0.6.ebuild 13608 SHA256 1eec6bc2746825886f65b2ea71742a63c6a1c3822da6e380751248e5e869de2b SHA512 562514a18f7c9a0606ca358404abaaab86ed78671f0056480eaae2d70581a4ed3a96daa28316021a026f4bb7c1b35d32d8d3ec7a4b2af378d0e1e16cb08dc67d WHIRLPOOL 8856f1a7a347b517d4ba74af483c086b3fec49c8cdf62edbc161de9d3eef5e1ce805bbbac16d5ff58b8cb2095558f888d2f65562a9c45a21e15e1ff54c3ed9de
+EBUILD mesa-17.0.2.ebuild 13635 SHA256 38045d4ddd3751f2446b74330cc416583d6c5e2cc913c2627e679940477fbca9 SHA512 8981e0da8ca573c6a4a7ef3c7fc565b208c236bfaffe9b5557f2795363f93edea9c1a4ee7fcac93e40e4286077604df6b855f934bad5af631615f3d5badd7313 WHIRLPOOL 5feb6d17ccaf72a14ac88b391b8e5996fe27bc7fb548a32258106b525318297271939743b2e619c3d8ba1e389b3a4f8323ec6c2d4ed1e47775da9068599655f8
 MISC metadata.xml 2440 SHA256 98874315e8480a14f26b8395eb2573b85dbe402a8bb30a72aa2cc884bc0512a2 SHA512 47237a5fd95a9c58b1857b27da2558ecf46266630eeb7514db2f276f0a8c82a0751122d71a27b4949a1a66df75bbe9e5a833b1f12a86214614e6777849d4c5d8 WHIRLPOOL 5742264ad29f82e98a96044efb74fb230e7a8cc4d58ad569676e8ffc9a86873d5148de86e8a101a11ee465e204cae47f1ec8d50ba8a8c0d75070cb705a03eef8

diff --git a/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch b/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch
deleted file mode 100644
index 87f5f9d..0000000
--- a/media-libs/mesa/files/mesa-17-clover-Work-around-build-failure-with-AltiVec.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 7d1195c1e4d071fe796bf5f210c468ea1cc86225 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Thu, 2 Mar 2017 04:43:21 +0000
-Subject: [PATCH] clover: Work around build failure with AltiVec.
-
-Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=587210
-Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68504
-Acked-by: Francisco Jerez <currojerez@riseup.net>
----
- configure.ac                                  | 14 ++++++++++++++
- src/gallium/state_trackers/clover/Makefile.am |  3 +++
- 2 files changed, 17 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index a3d1a00..57c4b1e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -2033,6 +2033,20 @@ if test "x$enable_opencl" = xyes; then
-        AC_MSG_ERROR([Clover requires libelf])
-     fi
- 
-+    if test "x${ac_cv_cxx_compiler_gnu}" = xyes; then
-+        altivec_enabled=no
-+        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-+        #if !defined(__VEC__) || !defined(__ALTIVEC__)
-+        #error "AltiVec not enabled"
-+        #endif
-+        ])], altivec_enabled=yes)
-+
-+        if test "$altivec_enabled" = yes; then
-+            CLOVER_STD_OVERRIDE="-std=gnu++11"
-+        fi
-+        AC_SUBST([CLOVER_STD_OVERRIDE])
-+    fi
-+
-     llvm_require_version $LLVM_REQUIRED_OPENCL "opencl"
- 
-     llvm_add_default_components "opencl"
-diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
-index a657e5b..3213935 100644
---- a/src/gallium/state_trackers/clover/Makefile.am
-+++ b/src/gallium/state_trackers/clover/Makefile.am
-@@ -32,6 +32,7 @@ noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
- 
- libcltgsi_la_CXXFLAGS = \
- 	-std=c++11 \
-+	$(CLOVER_STD_OVERRIDE) \
- 	$(VISIBILITY_CXXFLAGS)
- 
- libcltgsi_la_SOURCES = $(TGSI_SOURCES)
-@@ -40,6 +41,7 @@ libclllvm_la_CXXFLAGS = \
- 	-std=c++11 \
- 	$(VISIBILITY_CXXFLAGS) \
- 	$(LLVM_CXXFLAGS) \
-+	$(CLOVER_STD_OVERRIDE) \
- 	$(DEFINES) \
- 	$(LIBELF_CFLAGS) \
- 	-DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
-@@ -50,6 +52,7 @@ libclllvm_la_SOURCES = $(LLVM_SOURCES)
- 
- libclover_la_CXXFLAGS = \
- 	-std=c++11 \
-+	$(CLOVER_STD_OVERRIDE) \
- 	$(VISIBILITY_CXXFLAGS)
- 
- libclover_la_LIBADD = \
--- 
-2.10.2
-

diff --git a/media-libs/mesa/mesa-17.0.1.ebuild b/media-libs/mesa/mesa-13.0.6.ebuild
similarity index 87%
copy from media-libs/mesa/mesa-17.0.1.ebuild
copy to media-libs/mesa/mesa-13.0.6.ebuild
index 4638859..c24d7d5 100644
--- a/media-libs/mesa/mesa-17.0.1.ebuild
+++ b/media-libs/mesa/mesa-13.0.6.ebuild
@@ -1,9 +1,9 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=5
 
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
+EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
 
 if [[ ${PV} = 9999 ]]; then
 	GIT_ECLASS="git-r3"
@@ -12,11 +12,12 @@ fi
 
 PYTHON_COMPAT=( python2_7 )
 
-inherit autotools llvm multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
+inherit autotools multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
 
 OPENGL_DIR="xorg-x11"
 
 MY_P="${P/_/-}"
+FOLDER="${PV/_rc*/}"
 
 DESCRIPTION="OpenGL-like graphic library for Linux"
 HOMEPAGE="https://www.mesa3d.org/"
@@ -24,7 +25,7 @@ HOMEPAGE="https://www.mesa3d.org/"
 if [[ $PV == 9999 ]]; then
 	SRC_URI=""
 else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
+	SRC_URI="ftp://ftp.freedesktop.org/pub/mesa/${FOLDER}/${MY_P}.tar.xz"
 	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
 fi
 
@@ -34,17 +35,18 @@ RESTRICT="!bindist? ( bindist )"
 
 INTEL_CARDS="i915 i965 intel"
 RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 vivante vmware"
+VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vc4 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 +llvm
-	+nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind vdpau
-	vulkan wayland xvmc xa"
+	bindist +classic d3d9 debug +dri3 +egl +gallium +gbm gcrypt gles1 gles2
+	libressl +llvm +nettle +nptl opencl osmesa pax_kernel openmax openssl pic
+	selinux vaapi valgrind vdpau vulkan wayland xvmc xa"
 
 REQUIRED_USE="
+	|| ( gcrypt libressl nettle openssl )
 	d3d9?   ( dri3 gallium )
 	llvm?   ( gallium )
 	opencl? ( gallium llvm )
@@ -53,15 +55,13 @@ REQUIRED_USE="
 	gles2?  ( egl )
 	vaapi? ( gallium )
 	vdpau? ( gallium )
-	vulkan? ( || ( video_cards_i965 video_cards_radeonsi )
-	          video_cards_radeonsi? ( llvm ) )
+	vulkan? ( video_cards_i965 )
 	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_nouveau? ( || ( classic gallium ) )
 	video_cards_radeon? ( || ( classic gallium )
 						  gallium? ( x86? ( llvm ) amd64? ( llvm ) ) )
@@ -70,12 +70,11 @@ REQUIRED_USE="
 	video_cards_r300?   ( gallium x86? ( llvm ) amd64? ( llvm ) )
 	video_cards_r600?   ( gallium )
 	video_cards_radeonsi?   ( gallium llvm )
-	video_cards_vivante? ( gallium gbm )
 	video_cards_vmware? ( gallium )
 	${PYTHON_REQUIRED_USE}
 "
 
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.74"
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.72"
 # keep correct libdrm and dri2proto dep
 # keep blocks in rdepend for binpkg
 RDEPEND="
@@ -96,10 +95,6 @@ RDEPEND="
 	llvm? (
 		video_cards_radeonsi? (
 			virtual/libelf:0=[${MULTILIB_USEDEP}]
-			vulkan? (
-				|| (
-					sys-devel/llvm:4[${MULTILIB_USEDEP}]
-					>=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}] ) )
 		)
 		video_cards_r600? (
 			virtual/libelf:0=[${MULTILIB_USEDEP}]
@@ -107,11 +102,15 @@ RDEPEND="
 		video_cards_radeon? (
 			virtual/libelf:0=[${MULTILIB_USEDEP}]
 		)
-		|| (
-			sys-devel/llvm:4[${MULTILIB_USEDEP}]
-			>=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
+		>=sys-devel/llvm-3.6.0:0=[${MULTILIB_USEDEP}]
+	)
+	nettle? ( dev-libs/nettle:=[${MULTILIB_USEDEP}] )
+	!nettle? (
+		gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
+		!gcrypt? (
+			libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
+			!libressl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
 		)
-		<sys-devel/llvm-5:=[${MULTILIB_USEDEP}]
 	)
 	opencl? (
 				app-eselect/eselect-opencl
@@ -124,9 +123,9 @@ RDEPEND="
 		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.11.0:=[${MULTILIB_USEDEP}] )
+	wayland? ( >=dev-libs/wayland-1.2.0:=[${MULTILIB_USEDEP}] )
 	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}]
+	${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vmware?,${MULTILIB_USEDEP}]
 "
 for card in ${INTEL_CARDS}; do
 	RDEPEND="${RDEPEND}
@@ -153,15 +152,9 @@ DEPEND="${RDEPEND}
 		) )
 	)
 	opencl? (
-		|| (
-			sys-devel/llvm:4[${MULTILIB_USEDEP}]
-			>=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
-		)
-		|| (
-			sys-devel/clang:4[${MULTILIB_USEDEP}]
-			>=sys-devel/clang-3.6.0:0[${MULTILIB_USEDEP}]
-		)
-		>=sys-devel/gcc-4.6
+				>=sys-devel/llvm-3.4.2:0=[${MULTILIB_USEDEP}]
+				>=sys-devel/clang-3.4.2:0=[${MULTILIB_USEDEP}]
+				>=sys-devel/gcc-4.6
 	)
 	sys-devel/gettext
 	virtual/pkgconfig
@@ -204,20 +197,14 @@ pkg_setup() {
 		ewarn "detected! This can cause problems. For details, see bug 459306."
 	fi
 
-	if use llvm || use opencl; then
-		LLVM_MAX_SLOT=4 llvm_pkg_setup
-	fi
 	python-any-r1_pkg_setup
 }
 
 src_prepare() {
-	eapply "${FILESDIR}"/${PN}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-	eapply "${FILESDIR}"/${PN}-17-clover-Work-around-build-failure-with-AltiVec.patch
+	epatch "${FILESDIR}"/${PN}-11-execinfo.patch
+	epatch "${FILESDIR}"/${PN}-13-musl_endian.patch
 
 	eautoreconf
-
-	eapply_user
 }
 
 multilib_src_configure() {
@@ -265,11 +252,9 @@ multilib_src_configure() {
 
 		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
@@ -295,7 +280,9 @@ multilib_src_configure() {
 
 	if use vulkan; then
 		vulkan_enable video_cards_i965 intel
-		vulkan_enable video_cards_radeonsi radeon
+
+		# radv is disabled due to dependence on >=llvm-3.9, bug 607660
+		#vulkan_enable video_cards_radeonsi radeon
 	fi
 
 	# x86 hardened pax_kernel needs glx-rts, bug 240956
@@ -322,6 +309,7 @@ multilib_src_configure() {
 		--enable-dri \
 		--enable-glx \
 		--enable-shared-glapi \
+		--disable-shader-cache \
 		$(use_enable !bindist texture-float) \
 		$(use_enable d3d9 nine) \
 		$(use_enable debug) \
@@ -336,6 +324,7 @@ multilib_src_configure() {
 		--with-dri-drivers=${DRI_DRIVERS} \
 		--with-gallium-drivers=${GALLIUM_DRIVERS} \
 		--with-vulkan-drivers=${VULKAN_DRIVERS} \
+		--with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \
 		PYTHON2="${PYTHON}" \
 		${myconf}
 }
@@ -397,7 +386,7 @@ multilib_src_install() {
 }
 
 multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
+	prune_libtool_files --all
 	einstalldocs
 
 	if use !bindist; then
@@ -407,6 +396,11 @@ multilib_src_install_all() {
 	# Install config file for eselect mesa
 	insinto /usr/share/mesa
 	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
+
+	# Mesa should not install these
+	if use vulkan; then
+		rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} || die
+	fi
 }
 
 multilib_src_test() {

diff --git a/media-libs/mesa/mesa-17.0.1.ebuild b/media-libs/mesa/mesa-17.0.2.ebuild
similarity index 99%
rename from media-libs/mesa/mesa-17.0.1.ebuild
rename to media-libs/mesa/mesa-17.0.2.ebuild
index 4638859..69263ea 100644
--- a/media-libs/mesa/mesa-17.0.1.ebuild
+++ b/media-libs/mesa/mesa-17.0.2.ebuild
@@ -213,7 +213,6 @@ pkg_setup() {
 src_prepare() {
 	eapply "${FILESDIR}"/${PN}-11-execinfo.patch
 	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-	eapply "${FILESDIR}"/${PN}-17-clover-Work-around-build-failure-with-AltiVec.patch
 
 	eautoreconf
 


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2017-12-11 21:03 Aric Belsito
  0 siblings, 0 replies; 18+ messages in thread
From: Aric Belsito @ 2017-12-11 21:03 UTC (permalink / raw
  To: gentoo-commits

commit:     f4596331954ede41b1f9a34997e36665bc775979
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Mon Dec 11 21:02:49 2017 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Mon Dec 11 21:02:49 2017 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=f4596331

media-libs/mesa: version bump to 17.2.6/17.3.0

Cleanup and sync with tree

 media-libs/mesa/Manifest                           |  19 +-
 ...er-Work-around-build-failure-with-AltiVec.patch |  70 ---
 .../mesa/files/mesa-17-missing-fcntl_h.patch       |  11 -
 media-libs/mesa/mesa-13.0.5.ebuild                 | 512 ------------------
 media-libs/mesa/mesa-13.0.6.ebuild                 | 511 ------------------
 media-libs/mesa/mesa-17.0.6.ebuild                 | 516 ------------------
 media-libs/mesa/mesa-17.1.10.ebuild                |   2 +-
 media-libs/mesa/mesa-17.1.8.ebuild                 | 507 ------------------
 media-libs/mesa/mesa-17.1.9.ebuild                 | 507 ------------------
 media-libs/mesa/mesa-17.2.0.ebuild                 | 508 ------------------
 media-libs/mesa/mesa-17.2.1.ebuild                 | 583 --------------------
 media-libs/mesa/mesa-17.2.2.ebuild                 | 583 --------------------
 media-libs/mesa/mesa-17.2.3.ebuild                 | 586 --------------------
 media-libs/mesa/mesa-17.2.4.ebuild                 | 586 --------------------
 .../{mesa-17.2.5.ebuild => mesa-17.2.6.ebuild}     |   2 +-
 .../{mesa-17.3.0_rc3.ebuild => mesa-17.3.0.ebuild} |  13 +-
 media-libs/mesa/mesa-17.3.0_rc2.ebuild             | 589 ---------------------
 media-libs/mesa/mesa-17.3.0_rc4.ebuild             | 589 ---------------------
 media-libs/mesa/mesa-17.3.0_rc5.ebuild             | 589 ---------------------
 media-libs/mesa/metadata.xml                       |   4 -
 20 files changed, 9 insertions(+), 7278 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 820519b..64ff7f6 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,16 +1,3 @@
-DIST mesa-13.0.5.tar.xz 9171480 SHA256 bfcea7e2c801525a60895c8aff11aa68457ee9aa35d01a4638e1f310a3f5ef87 SHA512 db5f6a97b40ee6e45ba81280ab4543354e9f274c7112c5a43b8970244f329902a22f68d5eeddad5b64502507f462ffbcc028efc5dff93822adf95d30ba5903c1 WHIRLPOOL 164116608908331d4e8d69c4d2b92dc22e8e6d98725a20e8c2da5cc24b4e9ae9e05ee9c7209d55371b419e0f4e6c1d4752a46d149a968a6b83612aa77f7e480e
-DIST mesa-13.0.6.tar.xz 9179236 SHA256 29ef104a7fc082d352b1599bd6cb1d040be424ccd22f5e0eb7ee9b0e9acd3597 SHA512 2455e044647f674c2f1dd524143b61b8630713fa929bbf6fe1c981436a9c08dc933553d638a22b32d2799afb77be746355b48b1b20af172141c5b63891e94441 WHIRLPOOL 1fdaaf29de96225cf41a3bdeb559a35cf20fda524f80985b2bfdc52095dcb7f6b320704b7ccf754a6f80555925a6a80dfa2b1115a4bdd9bdc1ebb672f115208a
-DIST mesa-17.0.6.tar.xz 9494872 SHA256 89ecf3bcd0f18dcca5aaa42bf36bb52a2df33be89889f94aaaad91f7a504a69d SHA512 537d28aa694c2d48811d2467e33b3adc841067d5f1cdb7e0809ba100f71869090285bbb246e57e5f0177401a539b44cc32b1ccfcb32a1855c14b011b92d32eaf WHIRLPOOL f3ee87377e87cbd23bd9009d840e6c0ae50ccbbb30cfa7be61f3023cbe9519f5b50f22c59dbcc207a106a6e357d77074fcaee63916ee091b920cbc3d511ec2ab
-DIST mesa-17.1.10.tar.xz 9872168 SHA256 cbc0d681cc4df47d8deb5a36f45b420978128522fd665b2cd4c7096316f11bdb SHA512 728dbd41f5d3a7a1c33fc18c08a8b8eb1f6d236c5f00781209f46b144dd66a27ecd723ab1635868b7ad77de3a18ad53f1a88c932f17c0be97605a2775e3b3a9b WHIRLPOOL d33cc0b7620e01822ce6ca2708f01eccc6c7796c1ed19f3642dab733521d17d794658dbc47bcca7d71f94f99c81637a28738dc6c45c4d1ccc7e2855f07a5f961
-DIST mesa-17.1.8.tar.xz 9902800 SHA256 75ed2eaeae26ddd536150f294386468ae2e1a7717948c41cd14b7875be5269db SHA512 d29fd999d75967683f5aa836cf0b701705f54de428ebbbac059c3e335e94552c0b455aa67fa2870464a086dc58994f2f320710a1abc265dea363241aede71c5b WHIRLPOOL 8faad2f3da8546d48ee9b5470d147de7507a0dc39787a876f6513933e958baa94571d285095fced7c34c674364ab897a896acc39374849fb22026dd05a9bd27f
-DIST mesa-17.1.9.tar.xz 9908296 SHA256 5f51ad94341696097d5df7b838183534478216858ac0fc8de183671a36ffea1a SHA512 359da171deaba0a1a5ce7112d49d7b48be38d24d0211264fcdcc3218f1f35be9419e5be1d08d56b6ca15654d3f93107b1706ff18a5e31d3746f7a3191b808cdf WHIRLPOOL a4b76204005ed15cee799a0e7e590d5e9f5078f65d83fccec26f00ab397c4144f70ff6eac652f13197af3bbdf4c4096c531329766297caa9875aee47bc3e4d67
-DIST mesa-17.2.0.tar.xz 10335284 SHA256 3123448f770eae58bc73e15480e78909defb892f10ab777e9116c9b218094943 SHA512 6ac39274fcf86a26ea5fe51aed486ba3d45b75e0d2f7cc17e1e71d4cf9a85420a832fe559a2ac7b215eda615fab99a2bd290c8388a48c52e13737e7e4ef8d4fd WHIRLPOOL 3fec3810c23aa12f49c0fe561b6dbdbd5724a3bff513b21c273d5796c85eebdd889fb405a03f7cc0fe926a8289794e1872a0d04799c31122061a268faceacf36
-DIST mesa-17.2.1.tar.xz 10414776 SHA256 77385d17827cff24a3bae134342234f2efe7f7f990e778109682571dbbc9ba1e SHA512 19a7d6c2e2d439b1c73199bffd4154b42017bccc138be954a893c3b70e885f07988de84dc8aa2aff36e06295e91f0181d5b95372152f6f0f80b7afe4b3846b6a WHIRLPOOL b9048aa4d512307c3f558a925afb39949ea84b7e52ca52e2ba39cf6fba38c284ef527b25fdbfa7ec22ca6c9e17a8628ce41fc8916bfaafc7f5142c3476750b6d
-DIST mesa-17.2.2.tar.xz 10359156 SHA256 cf522244d6a5a1ecde3fc00e7c96935253fe22f808f064cab98be6f3faa65782 SHA512 641342c68989b8d801c37e668b012d3b7c4ad43d8ca01b74f8cbb3a1ec25b7390f69fe7ebc84b29dab1c6a4ac01c882ec9fd4a6b331505629461bdbbe6aa3f7e WHIRLPOOL 74271721fb38a0c62f6f35d84ba9196e000f2fe2a32e75120288e77649a87e225464572d347fc149190b573d22c32dfee3e174d6a2578b3c649c4b72375a94ec
-DIST mesa-17.2.3.tar.xz 10344180 SHA256 a0b0ec8f7b24dd044d7ab30a8c7e6d3767521e245f88d4ed5dd93315dc56f837 SHA512 749a0a46b772974633e405804ace7f509afb79f47811dbbdd390333721d744f2ac64f985ff1fd6c5aa3019b700be70bc1f75f60745ed9f4c5b08a9a8f77dfc76 WHIRLPOOL 333bdb9dd15726a4a19fa7a87d2044aba6ebaea2eb83dd436f916020221a8bc46d667e8710a701c52930217292ecdfd468b654a7846357aa8881356987f394c0
-DIST mesa-17.2.4.tar.xz 10381984 SHA256 5ba408fecd6e1132e5490eec1a2f04466214e4c65c8b89b331be844768c2e550 SHA512 665b63aab6af3f8f263f182d85d9ad71db7a23bcbaf67d62fe53c258cb0f600266ac82e72d681ec20cf7c66b47d4076aad5c3f553519f19110ee577da2707085 WHIRLPOOL 29750c50a496cb27e0b4466bf0d1496434330a96259616dd7c368adc3d9478aa6ba1facf11ec4ff231a244f890781c12637327b1675c423786693c40f787945d
-DIST mesa-17.2.5.tar.xz 10386312 SHA256 7f7f914b7b9ea0b15f2d9d01a4375e311b0e90e55683b8e8a67ce8691eb1070f SHA512 c4b0f7f48b0b57fdf610de3d61e127774f8223e755acfde6cf2649818eec985e8f925abf8a15d530ecdb882cb8d7268fd01e5d94c8ac6934551b8a74272353c7 WHIRLPOOL 51d066640824964acebc69e78ec368753c18833b0c0cdb940e6afb8326edc2a75c657d81c043d728ca66968608e59a128295e3f4863980c2dcaf6716f55d14d3
-DIST mesa-17.3.0-rc2.tar.xz 10658696 SHA256 13b2c085a54836465a3b6814ad4bc2dae0a502f43405e75ced67789d5afc18cd SHA512 749cca3e0875dbff7b6fab4d646974ecbcc7659ec82ad025bc386372d6e0e050d84d5e05fb68c5099e685557d85daf55c6a5db7bd89a7323778ae7e87e01215e WHIRLPOOL 4007e6641de55145b9bf8bf7aa567c284d3a4b29ea6b83fb5ba3324abf757cf72cf1f1bc0cd3011e58b3d0c6cc6fa7f7c03b1affb7f0ba7c4a5e7ade398bf2f3
-DIST mesa-17.3.0-rc3.tar.xz 10664384 SHA256 1f3677429018f6ef4167b31db9eef558827a649239aa685f54c1a400ff5462d9 SHA512 403da79ac87325f2f0962e9be406edf4d009b6f5d479c2943be5bc1a26ad201d96072461a0d041b5a59abe327829eeba0dfb44abce217074079c47811729b058 WHIRLPOOL 91a5f65bc1dc9dc27bcd8492d82c80d2827d2408030890fdcaa653993d9a1deec983b00cb48c0675f3234d36512396c03cc7659bd30cadd6e536f5bef90d65d9
-DIST mesa-17.3.0-rc4.tar.xz 10662396 SHA256 90c9283caa21c047aef013395776ca44037662450bbed188b4eea679084239be SHA512 410a43852944899fbc9d7ab887510dffda3cb98330d7acd5d529cb01abafe1886b353d050c918cd63ecb1b7afb9350e5ceddf8eabf6e8fd6bd4e6f87343f68cb WHIRLPOOL 43fa0b83683526abec04744a418f932d08ee2a566950ae0473c4795ec7905ff5edf6e7f75a64e1fb52ba7865a7b0b46de0c00eefd84715424b68a01eecb8e577
-DIST mesa-17.3.0-rc5.tar.xz 10663464 SHA256 c59f4e007fdac9b95168c35ec2e98d5de10ef753a90a8d3486b632ccdabaa7a0 SHA512 b53e40f39850067e97dcf9d1eb10d1f5d3a8729933057bacf3648b86ef55c43d7b2f2f5444ae8c6f1b8677c2c3fd12f7484ee08139bd388dc4cebd8dbaf28c83 WHIRLPOOL 7c42a70fdb52d7117ef89255cbca779a5ffaca6d49ddef6befa745d2365ea5b5b954404de66e9a073859ceff8658aff8c1b3c19d0e776024470fdd52300436b2
+DIST mesa-17.1.10.tar.xz 9872168 BLAKE2B 205ece7b016fcc1de5bb72711775cd8f4b90f5d6c26db77d1576752fcd4a99a36cbcd902bb6ad1041d476d1c3b32479baceb4087c902ce598ede3d57851c6b9d SHA512 728dbd41f5d3a7a1c33fc18c08a8b8eb1f6d236c5f00781209f46b144dd66a27ecd723ab1635868b7ad77de3a18ad53f1a88c932f17c0be97605a2775e3b3a9b
+DIST mesa-17.2.6.tar.xz 10387604 BLAKE2B 43bd60f9e61bb04e3a2afe4bc6e18099a524cdec3c7948d9ccfffa5bfe50eb3e0625ba6da7bb3b32959ef4a5e3db982daf2f90d3ee555cf65084d70849b3ca12 SHA512 739645d963da2ff79fa0f2bfcc4948516c4f0a768f9d21f98eff049edc88218847afd3786003ccf7b10deec585f4f1d7f70fcc5e5f6e33186ebbb86cd8cb0202
+DIST mesa-17.3.0.tar.xz 10667896 BLAKE2B 4786f1ac3fa2d2f07895c829f2c0770861d64f606d72635eb206cb9f0a1e84c061950fbf33b2c7b27055399da43d705ed9abd5d8f46c7bb3e3d9a6497f4bd71d SHA512 b0a616ce9a534a19c42eb0a626a178c6a7171aae1989351ea7c2a9e775a7478758b805dbfb754056720b1ef0454c3d3beb64aa59543be27f249ce97efae8e47e

diff --git a/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch b/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch
deleted file mode 100644
index 0d2c65a..0000000
--- a/media-libs/mesa/files/mesa-13-clover-Work-around-build-failure-with-AltiVec.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 71a2b2e8a580d2c0bee84b898d8531b27f3c7811 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Thu, 2 Mar 2017 04:43:21 +0000
-Subject: [PATCH] clover: Work around build failure with AltiVec.
-
-Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=587210
-Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68504
-Acked-by: Francisco Jerez <currojerez@riseup.net>
-(cherry picked from commit 7d1195c1e4d071fe796bf5f210c468ea1cc86225)
----
- configure.ac                                  | 14 ++++++++++++++
- src/gallium/state_trackers/clover/Makefile.am |  3 +++
- 2 files changed, 17 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index fd78fbb..3646e45 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -1974,6 +1974,20 @@ if test "x$enable_opencl" = xyes; then
-     if test "x$have_libelf" != xyes; then
-        AC_MSG_ERROR([Clover requires libelf])
-     fi
-+
-+    if test "x${ac_cv_cxx_compiler_gnu}" = xyes; then
-+        altivec_enabled=no
-+        AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-+        #if !defined(__VEC__) || !defined(__ALTIVEC__)
-+        #error "AltiVec not enabled"
-+        #endif
-+        ])], altivec_enabled=yes)
-+
-+        if test "$altivec_enabled" = yes; then
-+            CLOVER_STD_OVERRIDE="-std=gnu++11"
-+        fi
-+        AC_SUBST([CLOVER_STD_OVERRIDE])
-+    fi
- fi
- AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
- AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)
-diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am
-index 8abcfec..edf1e26 100644
---- a/src/gallium/state_trackers/clover/Makefile.am
-+++ b/src/gallium/state_trackers/clover/Makefile.am
-@@ -33,6 +33,7 @@ noinst_LTLIBRARIES = libclover.la libcltgsi.la libclllvm.la
- 
- libcltgsi_la_CXXFLAGS = \
- 	-std=c++11 \
-+	$(CLOVER_STD_OVERRIDE) \
- 	$(VISIBILITY_CXXFLAGS)
- 
- libcltgsi_la_SOURCES = $(TGSI_SOURCES)
-@@ -41,6 +42,7 @@ libclllvm_la_CXXFLAGS = \
- 	-std=c++11 \
- 	$(VISIBILITY_CXXFLAGS) \
- 	$(LLVM_CXXFLAGS) \
-+	$(CLOVER_STD_OVERRIDE) \
- 	$(DEFINES) \
- 	$(LIBELF_CFLAGS) \
- 	-DLIBCLC_INCLUDEDIR=\"$(LIBCLC_INCLUDEDIR)/\" \
-@@ -51,6 +53,7 @@ libclllvm_la_SOURCES = $(LLVM_SOURCES)
- 
- libclover_la_CXXFLAGS = \
- 	-std=c++11 \
-+	$(CLOVER_STD_OVERRIDE) \
- 	$(VISIBILITY_CXXFLAGS)
- 
- libclover_la_LIBADD = \
--- 
-2.10.2
-

diff --git a/media-libs/mesa/files/mesa-17-missing-fcntl_h.patch b/media-libs/mesa/files/mesa-17-missing-fcntl_h.patch
deleted file mode 100644
index b0cfa84..0000000
--- a/media-libs/mesa/files/mesa-17-missing-fcntl_h.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -Naur mesa-17.1.0-rc4.orig/src/util/rand_xor.c mesa-17.1.0-rc4/src/util/rand_xor.c
---- mesa-17.1.0-rc4.orig/src/util/rand_xor.c	2017-05-08 23:04:16.742060503 -0700
-+++ mesa-17.1.0-rc4/src/util/rand_xor.c	2017-05-08 23:04:52.664702908 -0700
-@@ -25,6 +25,7 @@
- #if defined(__linux__)
- #include <sys/file.h>
- #include <unistd.h>
-+#include <fcntl.h>
- #else
- #include <time.h>
- #endif

diff --git a/media-libs/mesa/mesa-13.0.5.ebuild b/media-libs/mesa/mesa-13.0.5.ebuild
deleted file mode 100644
index 6563005..0000000
--- a/media-libs/mesa/mesa-13.0.5.ebuild
+++ /dev/null
@@ -1,512 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
-
-if [[ ${PV} = 9999 ]]; then
-	GIT_ECLASS="git-r3"
-	EXPERIMENTAL="true"
-fi
-
-PYTHON_COMPAT=( python2_7 )
-
-inherit autotools multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
-
-OPENGL_DIR="xorg-x11"
-
-MY_P="${P/_/-}"
-FOLDER="${PV/_rc*/}"
-
-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/${FOLDER}/${MY_P}.tar.xz"
-	KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="!bindist? ( bindist )"
-
-INTEL_CARDS="i915 i965 intel"
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vc4 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 gcrypt gles1 gles2
-	libressl +llvm +nettle +nptl opencl osmesa pax_kernel openmax openssl pic
-	selinux vaapi valgrind vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	|| ( gcrypt libressl nettle openssl )
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	gles1?  ( egl )
-	gles2?  ( egl )
-	vaapi? ( gallium )
-	vdpau? ( gallium )
-	vulkan? ( video_cards_i965 )
-	wayland? ( egl gbm )
-	xa?  ( gallium )
-	video_cards_freedreno?  ( gallium )
-	video_cards_intel?  ( classic )
-	video_cards_i915?   ( || ( classic gallium ) )
-	video_cards_i965?   ( classic )
-	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_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.72"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( app-eselect/eselect-mesa )
-	>=app-eselect/eselect-opengl-1.3.0
-	>=dev-libs/expat-2.1.0-r3:=[${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.9.3:=[${MULTILIB_USEDEP}]
-	x11-libs/libXfixes:=[${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}]
-		)
-		>=sys-devel/llvm-3.6.0:0=[${MULTILIB_USEDEP}]
-	)
-	nettle? ( dev-libs/nettle:=[${MULTILIB_USEDEP}] )
-	!nettle? (
-		gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
-		!gcrypt? (
-			libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
-			!libressl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
-		)
-	)
-	opencl? (
-				app-eselect/eselect-opencl
-				dev-libs/libclc
-				virtual/libelf:0=[${MULTILIB_USEDEP}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
-	vaapi? (
-		>=x11-libs/libva-1.6.0:=[${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.2.0:=[${MULTILIB_USEDEP}] )
-	xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
-	${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vmware?,${MULTILIB_USEDEP}]
-"
-for card in ${INTEL_CARDS}; do
-	RDEPEND="${RDEPEND}
-		video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-	"
-done
-
-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] )
-"
-
-# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
-# LLVM < 3.9 is out of the game
-DEPEND="${RDEPEND}
-	${PYTHON_DEPS}
-	llvm? (
-		video_cards_radeonsi? ( || (
-			sys-devel/llvm[llvm_targets_AMDGPU]
-			sys-devel/llvm[video_cards_radeon]
-		) )
-	)
-	opencl? (
-				>=sys-devel/llvm-3.4.2:0=[${MULTILIB_USEDEP}]
-				>=sys-devel/clang-3.4.2:0=[${MULTILIB_USEDEP}]
-				>=sys-devel/gcc-4.6
-	)
-	sys-devel/gettext
-	virtual/pkgconfig
-	valgrind? ( dev-util/valgrind )
-	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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
-	)
-)"
-
-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
-
-	python-any-r1_pkg_setup
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-11-execinfo.patch
-	epatch "${FILESDIR}"/${PN}-13-musl_endian.patch
-	epatch "${FILESDIR}"/${PN}-13-clover-Work-around-build-failure-with-AltiVec.patch
-
-	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-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
-	fi
-
-	if use gallium; then
-		myconf+="
-			$(use_enable d3d9 nine)
-			$(use_enable llvm gallium-llvm)
-			$(use_enable openmax omx)
-			$(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_vmware svga
-		gallium_enable video_cards_nouveau nouveau
-		gallium_enable video_cards_i915 i915
-		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
-	fi
-
-	if use vulkan; then
-		vulkan_enable video_cards_i965 intel
-
-		# radv is disabled due to dependence on >=llvm-3.9, bug 607660
-		#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 \
-		--disable-shader-cache \
-		$(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) \
-		--enable-valgrind=$(usex valgrind auto no) \
-		--enable-llvm-shared-libs \
-		--with-dri-drivers=${DRI_DRIVERS} \
-		--with-gallium-drivers=${GALLIUM_DRIVERS} \
-		--with-vulkan-drivers=${VULKAN_DRIVERS} \
-		--with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \
-		PYTHON2="${PYTHON}" \
-		${myconf}
-}
-
-multilib_src_install() {
-	emake install DESTDIR="${D}"
-
-	if use classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	prune_libtool_files --all
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-
-	# Mesa should not install these
-	if use vulkan; then
-		rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} || die
-	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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-13.0.6.ebuild b/media-libs/mesa/mesa-13.0.6.ebuild
deleted file mode 100644
index 43e257e..0000000
--- a/media-libs/mesa/mesa-13.0.6.ebuild
+++ /dev/null
@@ -1,511 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/mesa/mesa.git"
-
-if [[ ${PV} = 9999 ]]; then
-	GIT_ECLASS="git-r3"
-	EXPERIMENTAL="true"
-fi
-
-PYTHON_COMPAT=( python2_7 )
-
-inherit autotools multilib-minimal python-any-r1 pax-utils ${GIT_ECLASS}
-
-OPENGL_DIR="xorg-x11"
-
-MY_P="${P/_/-}"
-FOLDER="${PV/_rc*/}"
-
-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/${FOLDER}/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="!bindist? ( bindist )"
-
-INTEL_CARDS="i915 i965 intel"
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vc4 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 gcrypt gles1 gles2
-	libressl +llvm +nettle +nptl opencl osmesa pax_kernel openmax openssl pic
-	selinux vaapi valgrind vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	|| ( gcrypt libressl nettle openssl )
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	gles1?  ( egl )
-	gles2?  ( egl )
-	vaapi? ( gallium )
-	vdpau? ( gallium )
-	vulkan? ( video_cards_i965 )
-	wayland? ( egl gbm )
-	xa?  ( gallium )
-	video_cards_freedreno?  ( gallium )
-	video_cards_intel?  ( classic )
-	video_cards_i915?   ( || ( classic gallium ) )
-	video_cards_i965?   ( classic )
-	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_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.72"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( app-eselect/eselect-mesa )
-	>=app-eselect/eselect-opengl-1.3.0
-	>=dev-libs/expat-2.1.0-r3:=[${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.9.3:=[${MULTILIB_USEDEP}]
-	x11-libs/libXfixes:=[${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}]
-		)
-		>=sys-devel/llvm-3.6.0:0=[${MULTILIB_USEDEP}]
-	)
-	nettle? ( dev-libs/nettle:=[${MULTILIB_USEDEP}] )
-	!nettle? (
-		gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
-		!gcrypt? (
-			libressl? ( dev-libs/libressl:=[${MULTILIB_USEDEP}] )
-			!libressl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
-		)
-	)
-	opencl? (
-				app-eselect/eselect-opencl
-				dev-libs/libclc
-				virtual/libelf:0=[${MULTILIB_USEDEP}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
-	vaapi? (
-		>=x11-libs/libva-1.6.0:=[${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.2.0:=[${MULTILIB_USEDEP}] )
-	xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
-	${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vc4?,video_cards_vmware?,${MULTILIB_USEDEP}]
-"
-for card in ${INTEL_CARDS}; do
-	RDEPEND="${RDEPEND}
-		video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-	"
-done
-
-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] )
-"
-
-# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
-# LLVM < 3.9 is out of the game
-DEPEND="${RDEPEND}
-	${PYTHON_DEPS}
-	llvm? (
-		video_cards_radeonsi? ( || (
-			sys-devel/llvm[llvm_targets_AMDGPU]
-			sys-devel/llvm[video_cards_radeon]
-		) )
-	)
-	opencl? (
-				>=sys-devel/llvm-3.4.2:0=[${MULTILIB_USEDEP}]
-				>=sys-devel/clang-3.4.2:0=[${MULTILIB_USEDEP}]
-				>=sys-devel/gcc-4.6
-	)
-	sys-devel/gettext
-	virtual/pkgconfig
-	valgrind? ( dev-util/valgrind )
-	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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
-	)
-)"
-
-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
-
-	python-any-r1_pkg_setup
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-11-execinfo.patch
-	epatch "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	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-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
-	fi
-
-	if use gallium; then
-		myconf+="
-			$(use_enable d3d9 nine)
-			$(use_enable llvm gallium-llvm)
-			$(use_enable openmax omx)
-			$(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_vmware svga
-		gallium_enable video_cards_nouveau nouveau
-		gallium_enable video_cards_i915 i915
-		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
-	fi
-
-	if use vulkan; then
-		vulkan_enable video_cards_i965 intel
-
-		# radv is disabled due to dependence on >=llvm-3.9, bug 607660
-		#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 \
-		--disable-shader-cache \
-		$(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) \
-		--enable-valgrind=$(usex valgrind auto no) \
-		--enable-llvm-shared-libs \
-		--with-dri-drivers=${DRI_DRIVERS} \
-		--with-gallium-drivers=${GALLIUM_DRIVERS} \
-		--with-vulkan-drivers=${VULKAN_DRIVERS} \
-		--with-sha1=$(usex nettle libnettle $(usex gcrypt libgcrypt libcrypto)) \
-		PYTHON2="${PYTHON}" \
-		${myconf}
-}
-
-multilib_src_install() {
-	emake install DESTDIR="${D}"
-
-	if use classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	prune_libtool_files --all
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-
-	# Mesa should not install these
-	if use vulkan; then
-		rm "${ED}"/usr/include/vulkan/{vulkan.h,vk_platform.h} || die
-	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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.0.6.ebuild b/media-libs/mesa/mesa-17.0.6.ebuild
deleted file mode 100644
index 135b1d3..0000000
--- a/media-libs/mesa/mesa-17.0.6.ebuild
+++ /dev/null
@@ -1,516 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="!bindist? ( bindist )"
-
-INTEL_CARDS="i915 i965 intel"
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 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 +llvm
-	+nptl opencl osmesa pax_kernel openmax pic selinux vaapi valgrind vdpau
-	vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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_vivante? ( gallium gbm )
-	video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.74"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( app-eselect/eselect-mesa )
-	>=app-eselect/eselect-opengl-1.3.0
-	>=dev-libs/expat-2.1.0-r3:=[${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.9.3:=[${MULTILIB_USEDEP}]
-	x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-	llvm? (
-		video_cards_radeonsi? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-			vulkan? (
-				|| (
-					sys-devel/llvm:4[${MULTILIB_USEDEP}]
-					>=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}] ) )
-		)
-		video_cards_r600? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		video_cards_radeon? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		|| (
-			sys-devel/llvm:4[${MULTILIB_USEDEP}]
-			>=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
-		)
-		<sys-devel/llvm-5:=[${MULTILIB_USEDEP}]
-	)
-	opencl? (
-				app-eselect/eselect-opencl
-				dev-libs/libclc
-				virtual/libelf:0=[${MULTILIB_USEDEP}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] )
-	vaapi? (
-		>=x11-libs/libva-1.6.0:=[${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.11.0:=[${MULTILIB_USEDEP}] )
-	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}]
-"
-for card in ${INTEL_CARDS}; do
-	RDEPEND="${RDEPEND}
-		video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-	"
-done
-
-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] )
-"
-
-# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
-# LLVM < 3.9 is out of the game
-DEPEND="${RDEPEND}
-	${PYTHON_DEPS}
-	llvm? (
-		video_cards_radeonsi? ( || (
-			sys-devel/llvm[llvm_targets_AMDGPU]
-			sys-devel/llvm[video_cards_radeon]
-		) )
-	)
-	opencl? (
-		|| (
-			sys-devel/llvm:4[${MULTILIB_USEDEP}]
-			>=sys-devel/llvm-3.6.0:0[${MULTILIB_USEDEP}]
-		)
-		|| (
-			sys-devel/clang:4[${MULTILIB_USEDEP}]
-			>=sys-devel/clang-3.6.0:0[${MULTILIB_USEDEP}]
-		)
-		>=sys-devel/gcc-4.6
-	)
-	sys-devel/gettext
-	virtual/pkgconfig
-	valgrind? ( dev-util/valgrind )
-	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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
-	)
-)"
-
-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 || use opencl; then
-		LLVM_MAX_SLOT=4 llvm_pkg_setup
-	fi
-	python-any-r1_pkg_setup
-}
-
-src_prepare() {
-	eapply "${FILESDIR}"/${PN}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")"
-	fi
-
-	if use gallium; then
-		myconf+="
-			$(use_enable d3d9 nine)
-			$(use_enable llvm gallium-llvm)
-			$(use_enable openmax omx)
-			$(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
-	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) \
-		--enable-valgrind=$(usex valgrind auto no) \
-		--enable-llvm-shared-libs \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.1.10.ebuild b/media-libs/mesa/mesa-17.1.10.ebuild
index 89c42db..de69592 100644
--- a/media-libs/mesa/mesa-17.1.10.ebuild
+++ b/media-libs/mesa/mesa-17.1.10.ebuild
@@ -25,7 +25,7 @@ if [[ $PV == 9999 ]]; then
 	SRC_URI=""
 else
 	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+	KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
 fi
 
 LICENSE="MIT"

diff --git a/media-libs/mesa/mesa-17.1.8.ebuild b/media-libs/mesa/mesa-17.1.8.ebuild
deleted file mode 100644
index c568579..0000000
--- a/media-libs/mesa/mesa-17.1.8.ebuild
+++ /dev/null
@@ -1,507 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
-
-if [[ $PV == 9999 ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="alpha ~amd64 arm ~arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="!bindist? ( bindist )"
-
-INTEL_CARDS="i915 i965 intel"
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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_vivante? ( gallium gbm )
-	video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.77"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${MULTILIB_USEDEP}]
-	x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-	unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
-	llvm? (
-		video_cards_radeonsi? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-			vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] )
-		)
-		video_cards_r600? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		video_cards_radeon? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		>=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
-	)
-	opencl? (
-				app-eselect/eselect-opencl
-				dev-libs/libclc
-				virtual/libelf:0=[${MULTILIB_USEDEP}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.0:=[${MULTILIB_USEDEP}] )
-	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}]
-"
-for card in ${INTEL_CARDS}; do
-	RDEPEND="${RDEPEND}
-		video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-	"
-done
-
-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] )
-"
-
-# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
-# LLVM < 3.9 is out of the game
-DEPEND="${RDEPEND}
-	${PYTHON_DEPS}
-	llvm? (
-		video_cards_radeonsi? ( || (
-			sys-devel/llvm[llvm_targets_AMDGPU]
-			sys-devel/llvm[video_cards_radeon]
-		) )
-	)
-	opencl? (
-				>=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
-				>=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}]
-				>=sys-devel/gcc-4.6
-	)
-	sys-devel/gettext
-	virtual/pkgconfig
-	valgrind? ( dev-util/valgrind )
-	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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
-	)
-)"
-
-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 || use opencl; then
-		llvm_pkg_setup
-	fi
-	python-any-r1_pkg_setup
-}
-
-src_prepare() {
-	eapply "${FILESDIR}"/${PN}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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-egl-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 openmax omx)
-			$(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
-	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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.1.9.ebuild b/media-libs/mesa/mesa-17.1.9.ebuild
deleted file mode 100644
index 89c42db..0000000
--- a/media-libs/mesa/mesa-17.1.9.ebuild
+++ /dev/null
@@ -1,507 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
-
-if [[ $PV == 9999 ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="!bindist? ( bindist )"
-
-INTEL_CARDS="i915 i965 intel"
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno imx nouveau vc4 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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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_vivante? ( gallium gbm )
-	video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.77"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${MULTILIB_USEDEP}]
-	x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-	unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
-	llvm? (
-		video_cards_radeonsi? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-			vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] )
-		)
-		video_cards_r600? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		video_cards_radeon? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		>=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
-	)
-	opencl? (
-				app-eselect/eselect-opencl
-				dev-libs/libclc
-				virtual/libelf:0=[${MULTILIB_USEDEP}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.0:=[${MULTILIB_USEDEP}] )
-	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}]
-"
-for card in ${INTEL_CARDS}; do
-	RDEPEND="${RDEPEND}
-		video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
-	"
-done
-
-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] )
-"
-
-# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
-# LLVM < 3.9 is out of the game
-DEPEND="${RDEPEND}
-	${PYTHON_DEPS}
-	llvm? (
-		video_cards_radeonsi? ( || (
-			sys-devel/llvm[llvm_targets_AMDGPU]
-			sys-devel/llvm[video_cards_radeon]
-		) )
-	)
-	opencl? (
-				>=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
-				>=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}]
-				>=sys-devel/gcc-4.6
-	)
-	sys-devel/gettext
-	virtual/pkgconfig
-	valgrind? ( dev-util/valgrind )
-	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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
-	)
-)"
-
-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 || use opencl; then
-		llvm_pkg_setup
-	fi
-	python-any-r1_pkg_setup
-}
-
-src_prepare() {
-	eapply "${FILESDIR}"/${PN}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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-egl-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 openmax omx)
-			$(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
-	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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.2.0.ebuild b/media-libs/mesa/mesa-17.2.0.ebuild
deleted file mode 100644
index 84b26ef..0000000
--- a/media-libs/mesa/mesa-17.2.0.ebuild
+++ /dev/null
@@ -1,508 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
-
-if [[ $PV == 9999 ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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_vivante? ( gallium gbm )
-	video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.82"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${MULTILIB_USEDEP}]
-	x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
-	unwind? ( sys-libs/libunwind[${MULTILIB_USEDEP}] )
-	llvm? (
-		video_cards_radeonsi? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-			vulkan? ( >=sys-devel/llvm-3.9.0:=[${MULTILIB_USEDEP}] )
-		)
-		video_cards_r600? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		video_cards_radeon? (
-			virtual/libelf:0=[${MULTILIB_USEDEP}]
-		)
-		>=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
-	)
-	opencl? (
-				app-eselect/eselect-opencl
-				dev-libs/libclc
-				virtual/libelf:0=[${MULTILIB_USEDEP}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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] )
-"
-
-# FIXME: kill the sys-devel/llvm[video_cards_radeon] compat once
-# LLVM < 3.9 is out of the game
-DEPEND="${RDEPEND}
-	${PYTHON_DEPS}
-	llvm? (
-		video_cards_radeonsi? ( || (
-			sys-devel/llvm[llvm_targets_AMDGPU]
-			sys-devel/llvm[video_cards_radeon]
-		) )
-	)
-	opencl? (
-				>=sys-devel/llvm-3.6.0:=[${MULTILIB_USEDEP}]
-				>=sys-devel/clang-3.6.0:=[${MULTILIB_USEDEP}]
-				>=sys-devel/gcc-4.6
-	)
-	sys-devel/gettext
-	virtual/pkgconfig
-	valgrind? ( dev-util/valgrind )
-	>=x11-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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
-	)
-)"
-
-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 || use opencl; then
-		llvm_pkg_setup
-	fi
-	python-any-r1_pkg_setup
-}
-
-src_prepare() {
-	eapply "${FILESDIR}"/${PN}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx)
-			$(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
-	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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.2.1.ebuild b/media-libs/mesa/mesa-17.2.1.ebuild
deleted file mode 100644
index 789541f..0000000
--- a/media-libs/mesa/mesa-17.2.1.ebuild
+++ /dev/null
@@ -1,583 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
-
-if [[ $PV == 9999 ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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_vivante? ( gallium gbm )
-	video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.82"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${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}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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="5"
-LLVM_DEPSTR="
-	|| (
-		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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx)
-			$(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
-	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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.2.2.ebuild b/media-libs/mesa/mesa-17.2.2.ebuild
deleted file mode 100644
index 789541f..0000000
--- a/media-libs/mesa/mesa-17.2.2.ebuild
+++ /dev/null
@@ -1,583 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
-
-if [[ $PV == 9999 ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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_vivante? ( gallium gbm )
-	video_cards_vmware? ( gallium )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.82"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${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}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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="5"
-LLVM_DEPSTR="
-	|| (
-		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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx)
-			$(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
-	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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.2.3.ebuild b/media-libs/mesa/mesa-17.2.3.ebuild
deleted file mode 100644
index 827ebae..0000000
--- a/media-libs/mesa/mesa-17.2.3.ebuild
+++ /dev/null
@@ -1,586 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
-
-if [[ $PV == 9999 ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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.82"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${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}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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="5"
-LLVM_DEPSTR="
-	|| (
-		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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx)
-			$(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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.2.4.ebuild b/media-libs/mesa/mesa-17.2.4.ebuild
deleted file mode 100644
index 827ebae..0000000
--- a/media-libs/mesa/mesa-17.2.4.ebuild
+++ /dev/null
@@ -1,586 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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/"
-
-if [[ $PV == 9999 ]]; then
-	SRC_URI=""
-else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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_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.82"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${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}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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="5"
-LLVM_DEPSTR="
-	|| (
-		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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_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}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx)
-			$(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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.2.5.ebuild b/media-libs/mesa/mesa-17.2.6.ebuild
similarity index 99%
rename from media-libs/mesa/mesa-17.2.5.ebuild
rename to media-libs/mesa/mesa-17.2.6.ebuild
index 827ebae..084bed6 100644
--- a/media-libs/mesa/mesa-17.2.5.ebuild
+++ b/media-libs/mesa/mesa-17.2.6.ebuild
@@ -153,7 +153,7 @@ LLVM_DEPSTR="
 		sys-devel/llvm:4[${MULTILIB_USEDEP}]
 		>=sys-devel/llvm-3.9.0:0[${MULTILIB_USEDEP}]
 	)
-	sys-devel/llvm:=[${MULTILIB_USEDEP}]
+	<sys-devel/llvm-6:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}

diff --git a/media-libs/mesa/mesa-17.3.0_rc3.ebuild b/media-libs/mesa/mesa-17.3.0.ebuild
similarity index 97%
rename from media-libs/mesa/mesa-17.3.0_rc3.ebuild
rename to media-libs/mesa/mesa-17.3.0.ebuild
index 1887909..1513134 100644
--- a/media-libs/mesa/mesa-17.3.0_rc3.ebuild
+++ b/media-libs/mesa/mesa-17.3.0.ebuild
@@ -146,14 +146,14 @@ RDEPEND="${RDEPEND}
 # 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="5"
 LLVM_DEPSTR="
 	|| (
-		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}]
+	<sys-devel/llvm-6:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
@@ -518,13 +518,8 @@ pkg_postinst() {
 	# 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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
+		elog "enabled. Please see /usr/share/doc/${P}/patents.txt.bz2 for an"
+		elog "explanation."
 	fi
 }
 

diff --git a/media-libs/mesa/mesa-17.3.0_rc2.ebuild b/media-libs/mesa/mesa-17.3.0_rc2.ebuild
deleted file mode 100644
index 1887909..0000000
--- a/media-libs/mesa/mesa-17.3.0_rc2.ebuild
+++ /dev/null
@@ -1,589 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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.85"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${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}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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_DEPSTR="
-	|| (
-		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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
-	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}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx-bellagio)
-			$(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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.3.0_rc4.ebuild b/media-libs/mesa/mesa-17.3.0_rc4.ebuild
deleted file mode 100644
index 1887909..0000000
--- a/media-libs/mesa/mesa-17.3.0_rc4.ebuild
+++ /dev/null
@@ -1,589 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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.85"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${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}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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_DEPSTR="
-	|| (
-		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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
-	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}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx-bellagio)
-			$(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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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-17.3.0_rc5.ebuild b/media-libs/mesa/mesa-17.3.0_rc5.ebuild
deleted file mode 100644
index 1887909..0000000
--- a/media-libs/mesa/mesa-17.3.0_rc5.ebuild
+++ /dev/null
@@ -1,589 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 openmax pic selinux vaapi valgrind
-	vdpau vulkan wayland xvmc xa"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 gallium )
-	llvm?   ( gallium )
-	opencl? ( gallium llvm )
-	openmax? ( gallium )
-	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.85"
-# keep correct libdrm and dri2proto dep
-# keep blocks in rdepend for binpkg
-RDEPEND="
-	!<x11-base/xorg-server-1.7
-	!<=x11-proto/xf86driproto-2.0.3
-	abi_x86_32? ( !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)] )
-	classic? ( app-eselect/eselect-mesa )
-	gallium? ( 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.9.3:=[${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}]
-			)
-	openmax? ( >=media-libs/libomxil-bellagio-0.9.3:=[${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.11.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_DEPSTR="
-	|| (
-		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-proto/dri2proto-2.8-r1:=[${MULTILIB_USEDEP}]
-	dri3? (
-		>=x11-proto/dri3proto-1.0:=[${MULTILIB_USEDEP}]
-		>=x11-proto/presentproto-1.0:=[${MULTILIB_USEDEP}]
-	)
-	>=x11-proto/glproto-1.4.17-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xextproto-7.2.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86driproto-2.1.1-r1:=[${MULTILIB_USEDEP}]
-	>=x11-proto/xf86vidmodeproto-2.3.1-r1:=[${MULTILIB_USEDEP}]
-	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}-11-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-13-musl_endian.patch
-
-	eautoreconf
-
-	eapply_user
-}
-
-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 openmax omx-bellagio)
-			$(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 \
-		--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 classic || use gallium; then
-			ebegin "Moving DRI/Gallium drivers for dynamic switching"
-			local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
-			keepdir /usr/$(get_libdir)/dri
-			dodir /usr/$(get_libdir)/mesa
-			for x in ${gallium_drivers[@]}; do
-				if [ -f "$(get_libdir)/gallium/${x}" ]; then
-					mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			if use classic; then
-				emake -C "${BUILD_DIR}/src/mesa/drivers/dri" DESTDIR="${D}" install
-			fi
-			for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
-				if [ -f ${x} -o -L ${x} ]; then
-					mv -f "${x}" "${x/dri/mesa}" \
-						|| die "Failed to move ${x}"
-				fi
-			done
-			pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
-			ln -s ../mesa/*.so . || die "Creating symlink failed"
-			# remove symlinks to drivers known to eselect
-			for x in ${gallium_drivers[@]}; do
-				if [ -f ${x} -o -L ${x} ]; then
-					rm "${x}" || die "Failed to remove ${x}"
-				fi
-			done
-			popd
-		eend $?
-	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
-
-	if use openmax; then
-		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share/mesa/xdg\"" > "${T}/99mesaxdgomx"
-		doenvd "${T}"/99mesaxdgomx
-		keepdir /usr/share/mesa/xdg
-	fi
-}
-
-multilib_src_install_all() {
-	find "${ED}" -name '*.la' -delete
-	einstalldocs
-
-	if use !bindist; then
-		dodoc docs/patents.txt
-	fi
-
-	# Install config file for eselect mesa
-	insinto /usr/share/mesa
-	newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
-}
-
-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}
-
-	# Select classic/gallium drivers
-	if use classic || use gallium; then
-		eselect mesa set --auto
-	fi
-
-	# Switch to mesa opencl
-	if use opencl; then
-		eselect opencl set --use-old ${PN}
-	fi
-
-	# run omxregister-bellagio to make the OpenMAX drivers known system-wide
-	if use openmax; then
-		ebegin "Registering OpenMAX drivers"
-		BELLAGIO_SEARCH_PATH="${EPREFIX}/usr/$(get_libdir)/libomxil-bellagio0" \
-			OMX_BELLAGIO_REGISTRY=${EPREFIX}/usr/share/mesa/xdg/.omxregister \
-			omxregister-bellagio
-		eend $?
-	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 patents.txt for an explanation."
-	fi
-
-	if ! has_version media-libs/libtxc_dxtn; then
-		elog "Note that in order to have full S3TC support, it is necessary to install"
-		elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
-		elog "textures in some apps, and some others even require this to run."
-	fi
-}
-
-pkg_prerm() {
-	if use openmax; then
-		rm "${EPREFIX}"/usr/share/mesa/xdg/.omxregister
-	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/metadata.xml b/media-libs/mesa/metadata.xml
index b7a97ca..8e1144c 100644
--- a/media-libs/mesa/metadata.xml
+++ b/media-libs/mesa/metadata.xml
@@ -12,16 +12,12 @@
 		<flag name="dri3">Enable DRI3 support.</flag>
 		<flag name="egl">Enable EGL support.</flag>
 		<flag name="gallium">Build drivers based on Gallium3D, the new architecture for 3D graphics drivers.</flag>
-		<flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> for low level sha1 utility functions.</flag>
 		<flag name="gbm">Enable the Graphics Buffer Manager for EGL on KMS.</flag>
 		<flag name="gles1">Enable GLESv1 support.</flag>
 		<flag name="gles2">Enable GLESv2 support.</flag>
-		<flag name="libressl">Use <pkg>dev-libs/libressl</pkg> for low level sha1 utility functions.</flag>
 		<flag name="llvm">Enable LLVM backend for Gallium3D.</flag>
-		<flag name="nettle">Use <pkg>dev-libs/nettle</pkg> for low level sha1 utility functions.</flag>
 		<flag name="opencl">Enable the Clover Gallium OpenCL state tracker.</flag>
 		<flag name="openmax">Enable OpenMAX video decode/encode acceleration for Gallium3D.</flag>
-		<flag name="openssl">Use <pkg>dev-libs/openssl</pkg> for low level sha1 utility functions. May cause issues with games from Steam.</flag>
 		<flag name="osmesa">Build the Mesa library for off-screen rendering.</flag>
 		<flag name="pax_kernel">Enable if the user plans to run the package under a pax enabled hardened kernel</flag>
 		<flag name="pic">disable optimized assembly code that is not PIC friendly</flag>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2018-04-22 21:59 Aric Belsito
  0 siblings, 0 replies; 18+ messages in thread
From: Aric Belsito @ 2018-04-22 21:59 UTC (permalink / raw
  To: gentoo-commits

commit:     6fa47e8d2271a73abae0b108dbc0c0770bf9a2a4
Author:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
AuthorDate: Sun Apr 22 21:58:25 2018 +0000
Commit:     Aric Belsito <lluixhi <AT> gmail <DOT> com>
CommitDate: Sun Apr 22 21:58:25 2018 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=6fa47e8d

media-libs/mesa: add patch for missing header

 media-libs/mesa/files/mesa-18-intel-missing-time_t.patch | 11 +++++++++++
 media-libs/mesa/mesa-18.1.0_rc1.ebuild                   |  1 +
 2 files changed, 12 insertions(+)

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
new file mode 100644
index 0000000..353f8f2
--- /dev/null
+++ b/media-libs/mesa/files/mesa-18-intel-missing-time_t.patch
@@ -0,0 +1,11 @@
+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/mesa-18.1.0_rc1.ebuild b/media-libs/mesa/mesa-18.1.0_rc1.ebuild
index 40771c8..9d597ac 100644
--- a/media-libs/mesa/mesa-18.1.0_rc1.ebuild
+++ b/media-libs/mesa/mesa-18.1.0_rc1.ebuild
@@ -287,6 +287,7 @@ src_prepare() {
 	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
 
 	eautoreconf
 


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2018-07-08  9:01 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2018-07-08  9:01 UTC (permalink / raw
  To: gentoo-commits

commit:     9aa4cb5f04ad7cb0bde81bb6238582ac0de1fd8b
Author:     Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  8 09:01:06 2018 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Sun Jul  8 09:01:06 2018 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=9aa4cb5f

media-libs/mesa: Fix missing includes in mesa-18.1.3

 .../mesa/files/mesa-18-missing-includes.patch      | 53 ++++++++++++++++++++++
 media-libs/mesa/mesa-18.1.3.ebuild                 |  1 +
 2 files changed, 54 insertions(+)

diff --git a/media-libs/mesa/files/mesa-18-missing-includes.patch b/media-libs/mesa/files/mesa-18-missing-includes.patch
new file mode 100644
index 0000000..3f7bd62
--- /dev/null
+++ b/media-libs/mesa/files/mesa-18-missing-includes.patch
@@ -0,0 +1,53 @@
+From 456b660306e475a30f170a3bcecc0445124d7e2b Mon Sep 17 00:00:00 2001
+From: 
+Date: Sun, 8 Jul 2018 03:57:11 -0500
+Subject: [PATCH] Fix all missing includes for mesa
+
+Signed-off-by: 
+---
+ src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h | 1 +
+ src/gallium/winsys/svga/drm/vmw_screen.h          | 2 +-
+ src/util/rand_xor.c                               | 2 ++
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
+index d6af605..6eee83f 100644
+--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
++++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
+@@ -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/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
+index f21cabb..20d03f8 100644
+--- a/src/gallium/winsys/svga/drm/vmw_screen.h
++++ b/src/gallium/winsys/svga/drm/vmw_screen.h
+@@ -34,7 +34,7 @@
+ #ifndef VMW_SCREEN_H_
+ #define VMW_SCREEN_H_
+ 
+-
++#include <sys/stat.h>
+ #include "pipe/p_compiler.h"
+ #include "pipe/p_state.h"
+ 
+diff --git a/src/util/rand_xor.c b/src/util/rand_xor.c
+index de04bbc..08d507f 100644
+--- a/src/util/rand_xor.c
++++ b/src/util/rand_xor.c
+@@ -24,6 +24,8 @@
+ 
+ #if defined(__linux__)
+ #include <sys/file.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #else
+-- 
+2.18.0
+

diff --git a/media-libs/mesa/mesa-18.1.3.ebuild b/media-libs/mesa/mesa-18.1.3.ebuild
index 256a07b..1a602e6 100644
--- a/media-libs/mesa/mesa-18.1.3.ebuild
+++ b/media-libs/mesa/mesa-18.1.3.ebuild
@@ -276,6 +276,7 @@ src_prepare() {
 	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-missing-includes.patch
 
 	eapply_user
 	[[ ${PV} == 9999 ]] && eautoreconf


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2019-03-14 23:29 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2019-03-14 23:29 UTC (permalink / raw
  To: gentoo-commits

commit:     c2ac367b649aeab3ce9cbf8e1184f204f255ad93
Author:     Jory A. Pratt <anarchy <AT> bull <DOT> penguingeek>
AuthorDate: Thu Mar 14 23:26:27 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Thu Mar 14 23:26:27 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=c2ac367b

media-libs/mesa - address bug #670052 with upstream patch to disable tls

 .../mesa-18.2.4-add-disable-tls-support.patch      | 46 ++++++++++++++++++++++
 media-libs/mesa/mesa-18.2.4.ebuild                 |  6 +++
 2 files changed, 52 insertions(+)

diff --git a/media-libs/mesa/files/mesa-18.2.4-add-disable-tls-support.patch b/media-libs/mesa/files/mesa-18.2.4-add-disable-tls-support.patch
new file mode 100644
index 0000000..7eebc0d
--- /dev/null
+++ b/media-libs/mesa/files/mesa-18.2.4-add-disable-tls-support.patch
@@ -0,0 +1,46 @@
+From beca1b215950f4e917c21f916fd3c16fb09fb3fa Mon Sep 17 00:00:00 2001
+From: root <root@bull.penguingeek>
+Date: Wed, 6 Mar 2019 15:52:59 -0600
+Subject: [PATCH] Allow disable tls for musl
+
+---
+ meson.build       | 5 ++++-
+ meson_options.txt | 6 ++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 5b0eea1..d6a7675 100644
+--- a/meson.build
++++ b/meson.build
+@@ -327,7 +327,10 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless)
+   endif
+ endif
+ 
+-pre_args += '-DGLX_USE_TLS'
++if get_option('glx-tls')
++  pre_args += '-DGLX_USE_TLS'
++endif
++
+ if with_glx != 'disabled'
+   if not (with_platform_x11 and with_any_opengl)
+     error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
+diff --git a/meson_options.txt b/meson_options.txt
+index 5bb560b..3b721a6 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -277,6 +277,12 @@ option(
+   choices : ['none', 'classic', 'gallium'],
+   description : 'Build OSmesa.'
+ )
++option(
++  'glx-tls',
++  type : 'boolean',
++  value : true,
++  description : 'Enable thread-local storage in GLX and EGL'
++)
+ option(
+   'osmesa-bits',
+   type : 'combo',
+-- 
+2.21.0
+

diff --git a/media-libs/mesa/mesa-18.2.4.ebuild b/media-libs/mesa/mesa-18.2.4.ebuild
index ab4c917..09f49a9 100644
--- a/media-libs/mesa/mesa-18.2.4.ebuild
+++ b/media-libs/mesa/mesa-18.2.4.ebuild
@@ -238,6 +238,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-18-musl-invocation_name.patch
 	"${FILESDIR}"/${PN}-18-musl-pthread.patch
 	"${FILESDIR}"/${PN}-18-musl-amdgpu-include-pthread.patch
+	"${FILESDIR}"/${P}-add-disable-tls-support.patch
 )
 
 llvm_check_deps() {
@@ -451,6 +452,11 @@ multilib_src_configure() {
 		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 )


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2019-03-27  1:29 Anthony G. Basile
  0 siblings, 0 replies; 18+ messages in thread
From: Anthony G. Basile @ 2019-03-27  1:29 UTC (permalink / raw
  To: gentoo-commits

commit:     7c5001885455f64a6fecf3b8343e6225828b2ee0
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 27 01:29:41 2019 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Mar 27 01:29:41 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=7c500188

media-libs/mesa: sync with upstream and forward port patches

Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11

 media-libs/mesa/Manifest                           |   7 +-
 media-libs/mesa/files/mesa-11-execinfo.patch       |  68 ---
 media-libs/mesa/files/mesa-13-musl_endian.patch    |  12 -
 media-libs/mesa/files/mesa-17-musl_endian.patch    |  12 -
 .../mesa/files/mesa-18-missing-includes.patch      |  53 ---
 .../mesa/files/mesa-18-musl-larger-stacksize.patch |  52 ---
 ...2.4-meson-link-gallium-nine-with-pthreads.patch |  34 --
 media-libs/mesa/mesa-18.1.6-r1.ebuild              | 520 ---------------------
 media-libs/mesa/mesa-18.1.6.ebuild                 | 519 --------------------
 media-libs/mesa/mesa-18.1.9-r1.ebuild              | 520 ---------------------
 .../{mesa-18.2.4.ebuild => mesa-18.2.8.ebuild}     |  27 +-
 .../{mesa-18.2.1.ebuild => mesa-18.3.4.ebuild}     |  90 ++--
 .../{mesa-18.2.4.ebuild => mesa-18.3.5.ebuild}     |  37 +-
 .../{mesa-18.2.4.ebuild => mesa-19.0.0.ebuild}     |  58 ++-
 media-libs/mesa/metadata.xml                       |   2 +-
 15 files changed, 86 insertions(+), 1925 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 2e5ff61..7c11ac6 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,4 +1,5 @@
-DIST mesa-18.1.6.tar.xz 11142884 BLAKE2B fdd156fe7debf5223285dfa238070a2bd7d8ec684dec168afab78b9d2d38d53c10d939aaa64f34c2910e542dce3869adfca6383fca6a854c6dd03287a044b0e3 SHA512 2966210800215f5ced2720691063a8519b51ebeab9fb1e99bde4b1bd7ccc719d6395a1c29f25c88efe62d1592cf14ceafc163aca349490b1f8cee81070d46fcc
 DIST mesa-18.1.9.tar.xz 11146188 BLAKE2B 753f0fa3780502d56927f9b0e6124b4728cb5aa3600de78585487fb8e178c6987a72b79fb56e6c310757d157f9f85f12b73a6889bd361b51b62fb1dc1c20eecd SHA512 22db2950d25a3d9393e7c622c783bd177c21695569c8a95683bf77e92318e1db85672a134d4bea30c1f49a24e52bc3a2c1a0ac15deafb3a8fcbfb6de6a18adc2
-DIST mesa-18.2.1.tar.xz 11374476 BLAKE2B f0f3b766d68550f8c395a1b1d1ffc7a9e532c22ee6b91d698db33a270c152e03ab656d4219301bc2e0e95ba6f0583017c4361add928ad8ab26378a1ec6958f36 SHA512 d249bdf79aad36db9a8d291b3a1a100d283893ac741f58f85ae7e5c90ca25c37f80a5fa6fc57945ffeb0b67b788e7ea146543ec790b22f144578fc4c1525b84d
-DIST mesa-18.2.4.tar.xz 11377556 BLAKE2B b11c33ade744fb976862fecccbcc4c97196a005e40a00ef02bd8d409b66b3aa11f97baee13f2aa92f2d7c5461b2ef44beae3103687dea9ee29e92439a068f08a SHA512 088d43b087f4005752e4db75eaa6897e0fcb6de7b9a1f2d2b2ce3b5557d1dff829022e0092e8b1038ff01182c863ca0f26c97b9adde34bca462d3fa24502bfde
+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-19.0.0.tar.xz 11959360 BLAKE2B e58144bb22f296175d7feb59d2c7940ca795dd417b0b014735d8842a29292cf07a6197184942febfdc85ad062267a55059e0ebd1532a886610dabf888cc68b8f SHA512 5759b85275bcd145513cf14a9ef7505595766fb33b82c53738f74ede462e5850580d48ab4af326b41209e7f4b05aab75539f2bfebf67c3098a4680ea95c37591

diff --git a/media-libs/mesa/files/mesa-11-execinfo.patch b/media-libs/mesa/files/mesa-11-execinfo.patch
deleted file mode 100644
index 0eefba8..0000000
--- a/media-libs/mesa/files/mesa-11-execinfo.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-diff -Naur mesa-11.1.2.orig/configure.ac mesa-11.1.2/configure.ac
---- mesa-11.1.2.orig/configure.ac	2016-02-10 15:57:54.000000000 -0800
-+++ mesa-11.1.2/configure.ac	2016-03-09 13:27:47.979302937 -0800
-@@ -681,6 +681,7 @@
- AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
- AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
- AC_CHECK_FUNC([mkostemp], [DEFINES="$DEFINES -DHAVE_MKOSTEMP"])
-+AC_CHECK_HEADER([execinfo.h], [DEFINES="$DEFINES -DHAVE_EXECINFO_H"])
- 
- dnl Check to see if dlopen is in default libraries (like Solaris, which
- dnl has it in libc), or if libdl is needed to get it.
-diff -Naur mesa-11.1.2.orig/src/gallium/auxiliary/util/u_debug_symbol.c mesa-11.1.2/src/gallium/auxiliary/util/u_debug_symbol.c
---- mesa-11.1.2.orig/src/gallium/auxiliary/util/u_debug_symbol.c	2016-01-17 23:39:26.000000000 -0800
-+++ mesa-11.1.2/src/gallium/auxiliary/util/u_debug_symbol.c	2016-03-09 13:29:27.255060988 -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
-diff -Naur mesa-11.1.2.orig/src/mapi/glapi/gen/gl_gentable.py mesa-11.1.2/src/mapi/glapi/gen/gl_gentable.py
---- mesa-11.1.2.orig/src/mapi/glapi/gen/gl_gentable.py	2016-02-10 15:57:54.000000000 -0800
-+++ mesa-11.1.2/src/mapi/glapi/gen/gl_gentable.py	2016-03-09 13:28:14.624506395 -0800
-@@ -44,7 +44,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-11.1.2.orig/src/mapi/glapi/glapi_gentable.c mesa-11.1.2/src/mapi/glapi/glapi_gentable.c
---- mesa-11.1.2.orig/src/mapi/glapi/glapi_gentable.c	2016-02-10 16:24:49.000000000 -0800
-+++ mesa-11.1.2/src/mapi/glapi/glapi_gentable.c	2016-03-09 13:28:38.411688029 -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-11.1.2.orig/src/mesa/drivers/dri/i915/intel_regions.c mesa-11.1.2/src/mesa/drivers/dri/i915/intel_regions.c
---- mesa-11.1.2.orig/src/mesa/drivers/dri/i915/intel_regions.c	2016-01-17 23:39:26.000000000 -0800
-+++ mesa-11.1.2/src/mesa/drivers/dri/i915/intel_regions.c	2016-03-09 13:30:18.483460168 -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-13-musl_endian.patch b/media-libs/mesa/files/mesa-13-musl_endian.patch
deleted file mode 100644
index 1276605..0000000
--- a/media-libs/mesa/files/mesa-13-musl_endian.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur mesa-13.0.5.orig/src/util/u_endian.h mesa-13.0.5/src/util/u_endian.h
---- mesa-13.0.5.orig/src/util/u_endian.h	2017-03-19 12:40:43.808781967 -0700
-+++ mesa-13.0.5/src/util/u_endian.h	2017-03-19 12:49:01.731158551 -0700
-@@ -27,7 +27,7 @@
- #ifndef U_ENDIAN_H
- #define U_ENDIAN_H
- 
--#if defined(__GLIBC__) || defined(ANDROID)
-+#if defined(__linux__)
- #include <endian.h>
- 
- #if __BYTE_ORDER == __LITTLE_ENDIAN

diff --git a/media-libs/mesa/files/mesa-17-musl_endian.patch b/media-libs/mesa/files/mesa-17-musl_endian.patch
deleted file mode 100644
index 74e3d1d..0000000
--- a/media-libs/mesa/files/mesa-17-musl_endian.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur mesa-17.3.1.orig/src/util/u_endian.h mesa-17.3.1/src/util/u_endian.h
---- mesa-17.3.1.orig/src/util/u_endian.h	2017-12-29 14:19:33.532915798 -0800
-+++ mesa-17.3.1/src/util/u_endian.h	2017-12-29 14:21:55.547913255 -0800
-@@ -27,7 +27,7 @@
- #ifndef U_ENDIAN_H
- #define U_ENDIAN_H
- 
--#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
-+#if defined(__linux__) || defined(__CYGWIN__)
- #include <endian.h>
- 
- #if __BYTE_ORDER == __LITTLE_ENDIAN

diff --git a/media-libs/mesa/files/mesa-18-missing-includes.patch b/media-libs/mesa/files/mesa-18-missing-includes.patch
deleted file mode 100644
index 3f7bd62..0000000
--- a/media-libs/mesa/files/mesa-18-missing-includes.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 456b660306e475a30f170a3bcecc0445124d7e2b Mon Sep 17 00:00:00 2001
-From: 
-Date: Sun, 8 Jul 2018 03:57:11 -0500
-Subject: [PATCH] Fix all missing includes for mesa
-
-Signed-off-by: 
----
- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h | 1 +
- src/gallium/winsys/svga/drm/vmw_screen.h          | 2 +-
- src/util/rand_xor.c                               | 2 ++
- 3 files changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
-index d6af605..6eee83f 100644
---- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
-+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
-@@ -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/src/gallium/winsys/svga/drm/vmw_screen.h b/src/gallium/winsys/svga/drm/vmw_screen.h
-index f21cabb..20d03f8 100644
---- a/src/gallium/winsys/svga/drm/vmw_screen.h
-+++ b/src/gallium/winsys/svga/drm/vmw_screen.h
-@@ -34,7 +34,7 @@
- #ifndef VMW_SCREEN_H_
- #define VMW_SCREEN_H_
- 
--
-+#include <sys/stat.h>
- #include "pipe/p_compiler.h"
- #include "pipe/p_state.h"
- 
-diff --git a/src/util/rand_xor.c b/src/util/rand_xor.c
-index de04bbc..08d507f 100644
---- a/src/util/rand_xor.c
-+++ b/src/util/rand_xor.c
-@@ -24,6 +24,8 @@
- 
- #if defined(__linux__)
- #include <sys/file.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
- #include <unistd.h>
- #include <fcntl.h>
- #else
--- 
-2.18.0
-

diff --git a/media-libs/mesa/files/mesa-18-musl-larger-stacksize.patch b/media-libs/mesa/files/mesa-18-musl-larger-stacksize.patch
deleted file mode 100644
index cfc3bc5..0000000
--- a/media-libs/mesa/files/mesa-18-musl-larger-stacksize.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-# [main/mesa: use larger stack size for new threads #4847](https://github.com/alpinelinux/aports/pull/4847)
-
-[prspkt (prspkt) · GitHub](https://github.com/prspkt) commented
-2018-07-25T12:34:00Z
-
-Since the introduction of the mesa 18.1.* series, applications that use OpenGL
-have been consistently segfaulting. I can locally reproduce using
-`community/mpv` for video playback. This has also been discovered
-[here](https://github.com/gentoo/musl/issues/136) and the
-[patch](https://github.com/void-linux/void-packages/blob/18838a6cd6b00b1d309d6cc712b7d54660597221/srcpkgs/libGL/patches/musl-stacksize.patch)
-was imported after following a discussion
-[here](https://github.com/void-linux/void-packages/issues/933).
-
-Increasing the stacksise consistently fixes the issue.
-
-## References
-
-[Segfaults with mesa-18.1.0_rc* · Issue #136 · gentoo/musl · GitHub](https://github.com/gentoo/musl/issues/136)
-[RetroArch segfaults after recent update of various gfx libraries: mesa-ati-dri, libGL, etc. · Issue #933 · void-linux/void-packages · GitHub](https://github.com/void-linux/void-packages/issues/933)
-
---- a/include/c11/threads_posix.h
-+++ b/include/c11/threads_posix.h
-@@ -281,15 +281,29 @@ static inline int
- thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
- {
-     struct impl_thrd_param *pack;
-+#ifdef __GLIBC__
-+    pthread_attr_t *attrp = NULL;
-+#else
-+    pthread_attr_t attr = { 0 };
-+    pthread_attr_init(&attr);
-+    pthread_attr_setstacksize(&attr, 8388608);
-+    pthread_attr_t *attrp = &attr;
-+#endif
-     assert(thr != NULL);
-     pack = (struct impl_thrd_param *)malloc(sizeof(struct impl_thrd_param));
-     if (!pack) return thrd_nomem;
-     pack->func = func;
-     pack->arg = arg;
--    if (pthread_create(thr, NULL, impl_thrd_routine, pack) != 0) {
-+    if (pthread_create(thr, attrp, impl_thrd_routine, pack) != 0) {
-+#ifndef __GLIBC__
-+        pthread_attr_destroy(&attr);
-+#endif
-         free(pack);
-         return thrd_error;
-     }
-+#ifndef __GLIBC__
-+    pthread_attr_destroy(&attr);
-+#endif
-     return thrd_success;
- }

diff --git a/media-libs/mesa/files/mesa-18.2.4-meson-link-gallium-nine-with-pthreads.patch b/media-libs/mesa/files/mesa-18.2.4-meson-link-gallium-nine-with-pthreads.patch
deleted file mode 100644
index 11d4f9c..0000000
--- a/media-libs/mesa/files/mesa-18.2.4-meson-link-gallium-nine-with-pthreads.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 7652931d33b36c93b2e84713baa8c283d568402e Mon Sep 17 00:00:00 2001
-From: Dylan Baker <dylan@pnwbakers.com>
-Date: Thu, 1 Nov 2018 14:12:57 -0700
-Subject: [PATCH] meson: link gallium nine with pthreads
-
-In some cases (not building with llvm, which automatically pulls in
-pthreads) nine needs to be directly linked with pthreads. Fixes building
-on x86 (32 bit) without llvm.
-
-Distro bug: https://bugs.gentoo.org/670094
-Fixes: 6b4c7047d57178d3362a710ad503057c6a582ca3
-       ("meson: build gallium nine state_tracker")
-Tested-by: Rafal Lalik <rafallalik@gmail.com>
-Reviewed-by: Matt Turner <mattst88@gmail.com>
----
- src/gallium/targets/d3dadapter9/meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/gallium/targets/d3dadapter9/meson.build b/src/gallium/targets/d3dadapter9/meson.build
-index bd05b4f9692..bc72b1110a0 100644
---- a/src/gallium/targets/d3dadapter9/meson.build
-+++ b/src/gallium/targets/d3dadapter9/meson.build
-@@ -53,7 +53,7 @@ libgallium_nine = shared_library(
-     libswkmsdri,
-   ],
-   dependencies : [
--    dep_selinux, dep_expat, dep_libdrm, dep_llvm,
-+    dep_selinux, dep_expat, dep_libdrm, dep_llvm, dep_thread,
-     driver_swrast, driver_r300, driver_r600, driver_radeonsi, driver_nouveau,
-     driver_i915, driver_svga,
-   ],
--- 
-2.16.4
-

diff --git a/media-libs/mesa/mesa-18.1.6-r1.ebuild b/media-libs/mesa/mesa-18.1.6-r1.ebuild
deleted file mode 100644
index 8e43662..0000000
--- a/media-libs/mesa/mesa-18.1.6-r1.ebuild
+++ /dev/null
@@ -1,520 +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 ~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 "${FILESDIR}"/${PN}-18-musl-larger-stacksize.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.1.6.ebuild b/media-libs/mesa/mesa-18.1.6.ebuild
deleted file mode 100644
index 3145d0d..0000000
--- a/media-libs/mesa/mesa-18.1.6.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 ~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.1.9-r1.ebuild b/media-libs/mesa/mesa-18.1.9-r1.ebuild
deleted file mode 100644
index ca6486f..0000000
--- a/media-libs/mesa/mesa-18.1.9-r1.ebuild
+++ /dev/null
@@ -1,520 +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 "${FILESDIR}"/${PN}-18-musl-larger-stacksize.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.4.ebuild b/media-libs/mesa/mesa-18.2.8.ebuild
similarity index 94%
copy from media-libs/mesa/mesa-18.2.4.ebuild
copy to media-libs/mesa/mesa-18.2.8.ebuild
index 09f49a9..68f8024 100644
--- a/media-libs/mesa/mesa-18.2.4.ebuild
+++ b/media-libs/mesa/mesa-18.2.8.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -41,7 +41,7 @@ IUSE="${IUSE_VIDEO_CARDS}
 	vulkan wayland xa xvmc"
 
 REQUIRED_USE="
-	d3d9?   ( dri3 )
+	d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
 	gles1?  ( egl )
 	gles2?  ( egl )
 	vulkan? ( dri3
@@ -132,8 +132,8 @@ 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. < 7.
-# 3. Specify LLVM_MAX_SLOT, e.g. 6.
+# 2. Update the := to specify *max* version, e.g. < 8.
+# 3. Specify LLVM_MAX_SLOT, e.g. 7.
 LLVM_MAX_SLOT="7"
 LLVM_DEPSTR="
 	|| (
@@ -141,9 +141,8 @@ LLVM_DEPSTR="
 		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}]
+	<sys-devel/llvm-8:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
@@ -232,13 +231,12 @@ x86? (
 )"
 
 PATCHES=(
-	"${FILESDIR}"/${P}-meson-link-gallium-nine-with-pthreads.patch
 	"${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}"/${P}-add-disable-tls-support.patch
+	"${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
 )
 
 llvm_check_deps() {
@@ -255,16 +253,6 @@ llvm_check_deps() {
 }
 
 pkg_pretend() {
-	if use d3d9; then
-		if ! use video_cards_r300 &&
-		   ! use video_cards_r600 &&
-		   ! use video_cards_radeonsi &&
-		   ! use video_cards_nouveau &&
-		   ! use video_cards_vmware; then
-			ewarn "Ignoring USE=d3d9       since VIDEO_CARDS does not contain r300, r600, radeonsi, nouveau, or vmware"
-		fi
-	fi
-
 	if use opencl; then
 		if ! use video_cards_r600 &&
 		   ! use video_cards_radeonsi; then
@@ -305,7 +293,6 @@ pkg_pretend() {
 	fi
 
 	if ! use gallium; then
-		use d3d9       && ewarn "Ignoring USE=d3d9       since USE does not contain gallium"
 		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"
@@ -381,7 +368,7 @@ multilib_src_configure() {
 		   use video_cards_radeonsi ||
 		   use video_cards_nouveau; then
 			emesonargs+=($(meson_use vaapi gallium-va))
-			use vaapi && emesonargs+=( -Dva-libs-path=/usr/$(get_libdir)/va/drivers )
+			use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
 		else
 			emesonargs+=(-Dgallium-va=false)
 		fi

diff --git a/media-libs/mesa/mesa-18.2.1.ebuild b/media-libs/mesa/mesa-18.3.4.ebuild
similarity index 87%
rename from media-libs/mesa/mesa-18.2.1.ebuild
rename to media-libs/mesa/mesa-18.3.4.ebuild
index e128919..0b02534 100644
--- a/media-libs/mesa/mesa-18.2.1.ebuild
+++ b/media-libs/mesa/mesa-18.3.4.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_4 python3_5 python3_6 python3_7 )
 
 inherit llvm meson multilib-minimal pax-utils python-any-r1
 
@@ -41,7 +41,7 @@ IUSE="${IUSE_VIDEO_CARDS}
 	vulkan wayland xa xvmc"
 
 REQUIRED_USE="
-	d3d9?   ( dri3 )
+	d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
 	gles1?  ( egl )
 	gles2?  ( egl )
 	vulkan? ( dri3
@@ -67,7 +67,7 @@ REQUIRED_USE="
 	video_cards_vmware? ( gallium )
 "
 
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.93"
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.96"
 RDEPEND="
 	!app-eselect/eselect-mesa
 	>=app-eselect/eselect-opengl-1.3.0
@@ -95,7 +95,7 @@ RDEPEND="
 		)
 		lm_sensors? ( sys-apps/lm_sensors:=[${MULTILIB_USEDEP}] )
 		opencl? (
-					app-eselect/eselect-opencl
+					dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
 					dev-libs/libclc
 					virtual/libelf:0=[${MULTILIB_USEDEP}]
 				)
@@ -132,8 +132,8 @@ 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. < 7.
-# 3. Specify LLVM_MAX_SLOT, e.g. 6.
+# 2. Update the := to specify *max* version, e.g. < 8.
+# 3. Specify LLVM_MAX_SLOT, e.g. 7.
 LLVM_MAX_SLOT="7"
 LLVM_DEPSTR="
 	|| (
@@ -141,9 +141,8 @@ LLVM_DEPSTR="
 		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}]
+	<sys-devel/llvm-8:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
@@ -231,6 +230,15 @@ 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}-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
@@ -245,16 +253,6 @@ llvm_check_deps() {
 }
 
 pkg_pretend() {
-	if use d3d9; then
-		if ! use video_cards_r300 &&
-		   ! use video_cards_r600 &&
-		   ! use video_cards_radeonsi &&
-		   ! use video_cards_nouveau &&
-		   ! use video_cards_vmware; then
-			ewarn "Ignoring USE=d3d9       since VIDEO_CARDS does not contain r300, r600, radeonsi, nouveau, or vmware"
-		fi
-	fi
-
 	if use opencl; then
 		if ! use video_cards_r600 &&
 		   ! use video_cards_radeonsi; then
@@ -295,7 +293,6 @@ pkg_pretend() {
 	fi
 
 	if ! use gallium; then
-		use d3d9       && ewarn "Ignoring USE=d3d9       since USE does not contain gallium"
 		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"
@@ -311,6 +308,10 @@ pkg_pretend() {
 	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
@@ -324,16 +325,6 @@ pkg_setup() {
 	python-any-r1_pkg_setup
 }
 
-src_prepare() {
-	eapply "${FILESDIR}"/${PN}-17-execinfo.patch
-	eapply "${FILESDIR}"/${PN}-17-musl-string_h.patch
-	eapply "${FILESDIR}"/${PN}-18-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
-}
-
 multilib_src_configure() {
 	local emesonargs=()
 
@@ -381,7 +372,7 @@ multilib_src_configure() {
 		   use video_cards_radeonsi ||
 		   use video_cards_nouveau; then
 			emesonargs+=($(meson_use vaapi gallium-va))
-			use vaapi && emesonargs+=( -Dva-libs-path=/usr/$(get_libdir)/va/drivers )
+			use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
 		else
 			emesonargs+=(-Dgallium-va=false)
 		fi
@@ -434,14 +425,12 @@ multilib_src_configure() {
 		fi
 
 		gallium_enable video_cards_freedreno freedreno
-		# opencl stuff
-		if use opencl; then
-			emesonargs+=(
-				-Dgallium-opencl="$(usex opencl standalone disabled)"
-			)
-		fi
-
 		gallium_enable video_cards_virgl virgl
+
+		# opencl stuff
+		emesonargs+=(
+			-Dgallium-opencl="$(usex opencl icd disabled)"
+		)
 	fi
 
 	if use vulkan; then
@@ -454,6 +443,11 @@ multilib_src_configure() {
 		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 )
@@ -498,21 +492,6 @@ multilib_src_compile() {
 
 multilib_src_install() {
 	meson_src_install
-
-	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() {
@@ -527,11 +506,6 @@ 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
 }
 
 # $1 - VIDEO_CARDS flag (check skipped for "--")

diff --git a/media-libs/mesa/mesa-18.2.4.ebuild b/media-libs/mesa/mesa-18.3.5.ebuild
similarity index 93%
copy from media-libs/mesa/mesa-18.2.4.ebuild
copy to media-libs/mesa/mesa-18.3.5.ebuild
index 09f49a9..f49d518 100644
--- a/media-libs/mesa/mesa-18.2.4.ebuild
+++ b/media-libs/mesa/mesa-18.3.5.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_4 python3_5 python3_6 python3_7 )
 
 inherit llvm meson multilib-minimal pax-utils python-any-r1
 
@@ -36,12 +36,12 @@ for card in ${VIDEO_CARDS}; do
 done
 
 IUSE="${IUSE_VIDEO_CARDS}
-	+classic d3d9 debug +dri3 +egl +gallium +gbm gles1 gles2 +llvm lm_sensors
+	+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 )
+	d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
 	gles1?  ( egl )
 	gles2?  ( egl )
 	vulkan? ( dri3
@@ -67,7 +67,7 @@ REQUIRED_USE="
 	video_cards_vmware? ( gallium )
 "
 
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.93"
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.96"
 RDEPEND="
 	!app-eselect/eselect-mesa
 	>=app-eselect/eselect-opengl-1.3.0
@@ -132,8 +132,8 @@ 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. < 7.
-# 3. Specify LLVM_MAX_SLOT, e.g. 6.
+# 2. Update the := to specify *max* version, e.g. < 8.
+# 3. Specify LLVM_MAX_SLOT, e.g. 7.
 LLVM_MAX_SLOT="7"
 LLVM_DEPSTR="
 	|| (
@@ -141,9 +141,8 @@ LLVM_DEPSTR="
 		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}]
+	<sys-devel/llvm-8:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
@@ -232,13 +231,12 @@ x86? (
 )"
 
 PATCHES=(
-	"${FILESDIR}"/${P}-meson-link-gallium-nine-with-pthreads.patch
 	"${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}"/${P}-add-disable-tls-support.patch
+	"${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
 )
 
 llvm_check_deps() {
@@ -255,16 +253,6 @@ llvm_check_deps() {
 }
 
 pkg_pretend() {
-	if use d3d9; then
-		if ! use video_cards_r300 &&
-		   ! use video_cards_r600 &&
-		   ! use video_cards_radeonsi &&
-		   ! use video_cards_nouveau &&
-		   ! use video_cards_vmware; then
-			ewarn "Ignoring USE=d3d9       since VIDEO_CARDS does not contain r300, r600, radeonsi, nouveau, or vmware"
-		fi
-	fi
-
 	if use opencl; then
 		if ! use video_cards_r600 &&
 		   ! use video_cards_radeonsi; then
@@ -305,7 +293,6 @@ pkg_pretend() {
 	fi
 
 	if ! use gallium; then
-		use d3d9       && ewarn "Ignoring USE=d3d9       since USE does not contain gallium"
 		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"
@@ -321,6 +308,10 @@ pkg_pretend() {
 	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
@@ -381,7 +372,7 @@ multilib_src_configure() {
 		   use video_cards_radeonsi ||
 		   use video_cards_nouveau; then
 			emesonargs+=($(meson_use vaapi gallium-va))
-			use vaapi && emesonargs+=( -Dva-libs-path=/usr/$(get_libdir)/va/drivers )
+			use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
 		else
 			emesonargs+=(-Dgallium-va=false)
 		fi

diff --git a/media-libs/mesa/mesa-18.2.4.ebuild b/media-libs/mesa/mesa-19.0.0.ebuild
similarity index 91%
rename from media-libs/mesa/mesa-18.2.4.ebuild
rename to media-libs/mesa/mesa-19.0.0.ebuild
index 09f49a9..16fe459 100644
--- a/media-libs/mesa/mesa-18.2.4.ebuild
+++ b/media-libs/mesa/mesa-19.0.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_4 python3_5 python3_6 python3_7 )
 
 inherit llvm meson multilib-minimal pax-utils python-any-r1
 
@@ -36,12 +36,12 @@ 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 )
+	d3d9?   ( dri3 || ( video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
 	gles1?  ( egl )
 	gles2?  ( egl )
 	vulkan? ( dri3
@@ -67,10 +67,9 @@ REQUIRED_USE="
 	video_cards_vmware? ( gallium )
 "
 
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.93"
+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,18 +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. < 7.
-# 3. Specify LLVM_MAX_SLOT, e.g. 6.
-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-3.9.0:0[${MULTILIB_USEDEP}]
 	)
-	sys-devel/llvm:=[${MULTILIB_USEDEP}]
+	<sys-devel/llvm-9:=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
@@ -232,13 +235,12 @@ x86? (
 )"
 
 PATCHES=(
-	"${FILESDIR}"/${P}-meson-link-gallium-nine-with-pthreads.patch
 	"${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}"/${P}-add-disable-tls-support.patch
+	"${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
 )
 
 llvm_check_deps() {
@@ -255,16 +257,6 @@ llvm_check_deps() {
 }
 
 pkg_pretend() {
-	if use d3d9; then
-		if ! use video_cards_r300 &&
-		   ! use video_cards_r600 &&
-		   ! use video_cards_radeonsi &&
-		   ! use video_cards_nouveau &&
-		   ! use video_cards_vmware; then
-			ewarn "Ignoring USE=d3d9       since VIDEO_CARDS does not contain r300, r600, radeonsi, nouveau, or vmware"
-		fi
-	fi
-
 	if use opencl; then
 		if ! use video_cards_r600 &&
 		   ! use video_cards_radeonsi; then
@@ -305,7 +297,6 @@ pkg_pretend() {
 	fi
 
 	if ! use gallium; then
-		use d3d9       && ewarn "Ignoring USE=d3d9       since USE does not contain gallium"
 		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"
@@ -321,6 +312,10 @@ pkg_pretend() {
 	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
@@ -381,7 +376,7 @@ multilib_src_configure() {
 		   use video_cards_radeonsi ||
 		   use video_cards_nouveau; then
 			emesonargs+=($(meson_use vaapi gallium-va))
-			use vaapi && emesonargs+=( -Dva-libs-path=/usr/$(get_libdir)/va/drivers )
+			use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
 		else
 			emesonargs+=(-Dgallium-va=false)
 		fi
@@ -484,6 +479,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[*]}")
@@ -501,6 +497,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() {

diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml
index f978f99..23679a7 100644
--- a/media-libs/mesa/metadata.xml
+++ b/media-libs/mesa/metadata.xml
@@ -6,7 +6,6 @@
 		<name>X11</name>
 	</maintainer>
 	<use>
-		<flag name="bindist">Disable patent-encumbered ARB_texture_float, EXT_texture_shared_exponent, and EXT_packed_float extensions.</flag>
 		<flag name="classic">Build drivers based on the classic architecture.</flag>
 		<flag name="d3d9">Enable Direct 3D9 API through Nine state tracker. Can be used together with patched wine.</flag>
 		<flag name="dri3">Enable DRI3 support.</flag>
@@ -15,6 +14,7 @@
 		<flag name="gbm">Enable the Graphics Buffer Manager for EGL on KMS.</flag>
 		<flag name="gles1">Enable GLESv1 support.</flag>
 		<flag name="gles2">Enable GLESv2 support.</flag>
+		<flag name="libglvnd">Use libglvnd for dispatch.</flag>
 		<flag name="llvm">Enable LLVM backend for Gallium3D.</flag>
 		<flag name="opencl">Enable the Clover Gallium OpenCL state tracker.</flag>
 		<flag name="osmesa">Build the Mesa library for off-screen rendering.</flag>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2019-05-08  3:07 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2019-05-08  3:07 UTC (permalink / raw
  To: gentoo-commits

commit:     377a82974ad1468f1a2f5defdf1fe4f47124c60a
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Wed May  8 03:07:06 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Wed May  8 03:07:06 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=377a8297

media-libs/mesa: Version bump 19.1.0_rc1

Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 media-libs/mesa/Manifest                         |   1 +
 media-libs/mesa/files/mesa-19.1.0-execinfo.patch |  90 ++++
 media-libs/mesa/mesa-19.1.0_rc1.ebuild           | 545 +++++++++++++++++++++++
 media-libs/mesa/metadata.xml                     |   1 +
 4 files changed, 637 insertions(+)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 3dc4f61..7e2648b 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -4,3 +4,4 @@ DIST mesa-18.3.4.tar.xz 11875224 BLAKE2B 81d34349c644cc93b3ca525046cdd63a5aa2a16
 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.3.tar.xz 11963844 BLAKE2B 7d8bae717c0a2a6143d3aee35852145a2032d40ad7f4edcd76eec46392f3917787592d13f9695de54a15ea5bcb3dec3181c418ddfb5b69a3e1b52fb796f04eab SHA512 aa170577252aa4157e4bd49076bbf6207e4aada9fc9f23b255de332e816f9c63e5661f752f2f276dd43e232a8926866004e2a2ff9ad4b411330969c2a9a7ffa0
+DIST mesa-19.1.0-rc1.tar.xz 10877180 BLAKE2B 1ea358595875fbe46b58f5445762cec0c0bd6ee087ce9819237373e2b41aacb64365ac9832b20b9f5fb8838c3d2c6c929cd642bba18b99c7ef153ca124135918 SHA512 a56215882a7c22b7b8fe57d5703914d674841e4045676e2cc2e7834d17f4d5a765516bec4f01eea6772c50e1d979cc430e032302f38c6e7a4274bc43a4d647b1

diff --git a/media-libs/mesa/files/mesa-19.1.0-execinfo.patch b/media-libs/mesa/files/mesa-19.1.0-execinfo.patch
new file mode 100644
index 0000000..473b9a8
--- /dev/null
+++ b/media-libs/mesa/files/mesa-19.1.0-execinfo.patch
@@ -0,0 +1,90 @@
+From 46036cd6b8c0da94262aaccd5c8bcaad0c93babd Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Tue, 7 May 2019 21:47:40 -0500
+Subject: [PATCH] Fix execinfo.h inclusion for libc's that do not support
+
+---
+ 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 f72bdc9..6b7200c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -1040,7 +1040,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 22e6c8c..d8380b7 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 9d8923c..92e1a54 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 fee7348..803ea93 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/mesa-19.1.0_rc1.ebuild b/media-libs/mesa/mesa-19.1.0_rc1.ebuild
new file mode 100644
index 0000000..c15e899
--- /dev/null
+++ b/media-libs/mesa/mesa-19.1.0_rc1.ebuild
@@ -0,0 +1,545 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( 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="~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"
+SLOT="0"
+RESTRICT="
+	!test? ( test )
+"
+
+RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
+VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris 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 +libglvnd +llvm
+	lm_sensors opencl osmesa pax_kernel pic selinux test unwind vaapi valgrind
+	vdpau vulkan vulkan-overlay wayland xa xvmc"
+
+REQUIRED_USE="
+	d3d9?   ( dri3 || ( video_cards_iris 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_iris video_cards_radeonsi )
+			  video_cards_radeonsi? ( llvm ) )
+	vulkan-overlay? ( vulkan )
+	wayland? ( egl gbm )
+	video_cards_freedreno?  ( gallium )
+	video_cards_intel?  ( classic )
+	video_cards_i915?   ( || ( classic gallium ) )
+	video_cards_i965?   ( classic )
+	video_cards_iris?   ( gallium )
+	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.97"
+RDEPEND="
+	!app-eselect/eselect-mesa
+	>=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}]
+	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? (
+			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. < 10.
+# 3. Specify LLVM_MAX_SLOT, e.g. 9.
+LLVM_MAX_SLOT="9"
+LLVM_DEPSTR="
+	|| (
+		sys-devel/llvm:9[${MULTILIB_USEDEP}]
+		sys-devel/llvm:8[${MULTILIB_USEDEP}]
+		sys-devel/llvm:7[${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/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}-19.1.0-execinfo.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_iris ||
+		   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
+
+		if use video_cards_freedreno ||
+		   use video_cards_vc4 ||
+		   use video_cards_vivante; then
+			gallium_enable -- kmsro
+		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
+
+		# 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_iris iris
+
+		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_iris 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
+
+	# 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 libglvnd glvnd)
+		$(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[*]}")
+		$(meson_use vulkan-overlay vulkan-overlay-layer)
+		--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
+
+	use libglvnd && rm -f "${D}"/usr/$(get_libdir)/libGLESv{1_CM,2}.so*
+}
+
+multilib_src_install_all() {
+	einstalldocs
+}
+
+multilib_src_test() {
+	meson test -v -C "${BUILD_DIR}" -t 100
+}
+
+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/metadata.xml b/media-libs/mesa/metadata.xml
index 23679a7..1adb4bf 100644
--- a/media-libs/mesa/metadata.xml
+++ b/media-libs/mesa/metadata.xml
@@ -24,6 +24,7 @@
 		<flag name="valgrind">Compile in valgrind memory hints</flag>
 		<flag name="vdpau">Enable the VDPAU acceleration interface for the Gallium3D Video Layer.</flag>
 		<flag name="vulkan">Enable Vulkan drivers</flag>
+		<flag name="vulkan-overlay">Build vulkan-overlay-layer which displays Frames Per Second and other statistics</flag>
 		<flag name="wayland">Enable support for dev-libs/wayland</flag>
 		<flag name="xa">Enable the XA (X Acceleration) API for Gallium3D.</flag>
 		<flag name="xvmc">Enable the XvMC acceleration interface for the Gallium3D Video Layer.</flag>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2019-08-22  3:05 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2019-08-22  3:05 UTC (permalink / raw
  To: gentoo-commits

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 <anarchy@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 <mattst88@gmail.com>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+Reviewed-by: Eric Engestrom <eric.engestrom@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 <anarchy@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 <mattst88@gmail.com>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+Reviewed-by: Eric Engestrom <eric.engestrom@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() {


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2019-08-22 19:57 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2019-08-22 19:57 UTC (permalink / raw
  To: gentoo-commits

commit:     7f7ec1213d2a7488a0e1ee1aa3eb873fb463917e
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 22 19:57:26 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 19:57:26 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=7f7ec121

media-libs/mesa: Version bump to 19.2.0_rc1

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

 media-libs/mesa/Manifest                           |   1 +
 .../mesa-19.2.0-add-disable-tls-support.patch      |  45 ++
 media-libs/mesa/mesa-19.2.0_rc1.ebuild             | 552 +++++++++++++++++++++
 3 files changed, 598 insertions(+)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index aec3d15..a6d098c 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,2 +1,3 @@
 DIST mesa-19.0.8.tar.xz 11967592 BLAKE2B 91a46b67bdb8cb3ab4c7337be7c2b0dc6ab5ec8cc126afc2d8af8d056bff0392a5b443c26304bf4c68472eb6ba16d29ca248c1fc0c0f2dd6af03d3e10d3ec1b3 SHA512 fbddc3a74f223564343027380af776b3fa5d63fe1af4e34121273235d1c6eced96439f601eb19bf658eb927aff3965b520f0329fcbd4650f3112167303e1746d
 DIST mesa-19.1.4.tar.xz 10938008 BLAKE2B 4745fc7e844397378fe1adf61bcd5b54aad11ec0b375ced85fd80ced01227432b491ad8b7ba7d9013190cfbb451bc11cdb7c8af0e1f298dd5d793d3ce43aa92b SHA512 234032d917c9b378c3f6ceb921677b64e549344c3957331810b50fd73e0dccd2f4f62e2bd39e619590f389bc58fdab10fab4b88f7c117557cbeb1dda049b9fc5
+DIST mesa-19.2.0-rc1.tar.xz 11452972 BLAKE2B 64a844a06110c64f4badd8d64a63cee4fbb25c6e2bb17062277e54094c8a5342eac7058ae7ba7b0aefc4e0795aac371caac26e54cc3612afaf54d41b94e09b18 SHA512 babafb6ec668834e041a62e966452fe315e4f5afef8e1f7d35e038993c73b32ea6ad9929399edae4686f44cd11704fd9a8801821befc1d1767bc0662d4c39fac

diff --git a/media-libs/mesa/files/mesa-19.2.0-add-disable-tls-support.patch b/media-libs/mesa/files/mesa-19.2.0-add-disable-tls-support.patch
new file mode 100644
index 0000000..c5d7db2
--- /dev/null
+++ b/media-libs/mesa/files/mesa-19.2.0-add-disable-tls-support.patch
@@ -0,0 +1,45 @@
+From 9054be01240cf9d9e8a92fc7289e2d861bf530d6 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Thu, 22 Aug 2019 14:42:59 -0500
+Subject: [PATCH] Add option to control elf-tls
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+---
+ meson.build       | 3 +--
+ meson_options.txt | 6 ++++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index bf61511..328ff66 100644
+--- a/meson.build
++++ b/meson.build
+@@ -377,8 +377,7 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless or with_plat
+   endif
+ endif
+ 
+-# Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
+-if not with_platform_android or get_option('platform-sdk-version') >= 29
++if get_option('elf-tls')
+   pre_args += '-DUSE_ELF_TLS'
+ endif
+ 
+diff --git a/meson_options.txt b/meson_options.txt
+index b768c15..2c19e9e 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -285,6 +285,12 @@ option(
+   value : false,
+   description : 'Build an SELinux-aware Mesa'
+ )
++option(
++  'elf-tls',
++  type : 'boolean',
++  value : true,
++  description : 'Enable thread-local storage in GLX and EGL'
++)
+ option(
+   'osmesa',
+   type : 'combo',
+-- 
+2.23.0
+

diff --git a/media-libs/mesa/mesa-19.2.0_rc1.ebuild b/media-libs/mesa/mesa-19.2.0_rc1.ebuild
new file mode 100644
index 0000000..a38b28c
--- /dev/null
+++ b/media-libs/mesa/mesa-19.2.0_rc1.ebuild
@@ -0,0 +1,552 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( 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"
+	inherit git-r3
+else
+	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
+	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"
+SLOT="0"
+RESTRICT="
+	!test? ( test )
+"
+
+RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
+VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost 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 +libglvnd +llvm
+	lm_sensors opencl osmesa pax_kernel selinux test unwind vaapi valgrind
+	vdpau vulkan vulkan-overlay wayland +X xa xvmc"
+
+REQUIRED_USE="
+	d3d9?   ( dri3 || ( video_cards_iris 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_iris video_cards_radeonsi )
+			  video_cards_radeonsi? ( llvm ) )
+	vulkan-overlay? ( vulkan )
+	wayland? ( egl gbm )
+	video_cards_freedreno?  ( gallium )
+	video_cards_intel?  ( classic )
+	video_cards_i915?   ( || ( classic gallium ) )
+	video_cards_i965?   ( classic )
+	video_cards_iris?   ( gallium )
+	video_cards_lima?   ( gallium )
+	video_cards_nouveau? ( || ( classic gallium ) )
+	video_cards_panfrost? ( 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 )
+	xa? ( X )
+	xvmc? ( X )
+"
+
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.99"
+RDEPEND="
+	!app-eselect/eselect-mesa
+	>=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
+	>=sys-libs/zlib-1.2.8[${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? (
+			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] )
+	vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
+	X? (
+		>=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}]
+	)
+"
+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. < 10.
+# 3. Specify LLVM_MAX_SLOT, e.g. 9.
+LLVM_MAX_SLOT="10"
+LLVM_DEPSTR="
+	|| (
+		sys-devel/llvm:10[${MULTILIB_USEDEP}]
+		sys-devel/llvm:9[${MULTILIB_USEDEP}]
+		sys-devel/llvm:8[${MULTILIB_USEDEP}]
+		sys-devel/llvm:7[${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}
+	valgrind? ( dev-util/valgrind )
+	X? (
+		x11-libs/libXrandr[${MULTILIB_USEDEP}]
+		x11-base/xorg-proto
+	)
+"
+BDEPEND="
+	${PYTHON_DEPS}
+	opencl? (
+		>=sys-devel/gcc-4.6
+	)
+	sys-devel/bison
+	sys-devel/flex
+	sys-devel/gettext
+	virtual/pkgconfig
+	$(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
+"
+
+S="${WORKDIR}/${MY_P}"
+EGIT_CHECKOUT_DIR=${S}
+
+QA_WX_LOAD="
+x86? (
+	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}-19.2.0-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:${LLVM_SLOT}[${flags}]" || return 1
+	fi
+	has_version "sys-devel/llvm:${LLVM_SLOT}[${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 -b ">=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=surfaceless$(use X && echo ",x11")$(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_iris ||
+		   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
+
+		if use video_cards_freedreno ||
+		   use video_cards_lima ||
+		   use video_cards_panfrost ||
+		   use video_cards_vc4 ||
+		   use video_cards_vivante; then
+			gallium_enable -- kmsro
+		fi
+
+		gallium_enable video_cards_lima lima
+		gallium_enable video_cards_panfrost panfrost
+		gallium_enable video_cards_vc4 vc4
+		gallium_enable video_cards_vivante etnaviv
+		gallium_enable video_cards_vmware svga
+		gallium_enable video_cards_nouveau nouveau
+
+		# 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_iris iris
+
+		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_iris 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+=( -Delf-tls=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=$(usex X dri disabled)
+		-Dshared-glapi=true
+		$(meson_use dri3)
+		$(meson_use egl)
+		$(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[*]}")
+		-Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
+		-Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
+		$(meson_use vulkan-overlay vulkan-overlay-layer)
+		--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 test -v -C "${BUILD_DIR}" -t 100
+}
+
+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
+}


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2019-10-20 22:10 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2019-10-20 22:10 UTC (permalink / raw
  To: gentoo-commits

commit:     3679d1f346ac7d37f44d2c9d695aecc401f30ac8
Author:     stefson <herrtimson <AT> yahoo <DOT> de>
AuthorDate: Sun Oct 20 14:17:21 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Sun Oct 20 22:10:28 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=3679d1f3

media-libs/mesa: add stable v19.1.7, remove old

Closes: https://github.com/gentoo/musl/pull/270

Signed-off-by: Steffen Kuhn <nielson2 <AT> yandex.com>
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 media-libs/mesa/Manifest                           |   3 +-
 .../mesa/files/mesa-19.1.4-musl-upstream-fix.patch | 227 ---------
 media-libs/mesa/mesa-19.0.8.ebuild                 | 535 ---------------------
 .../{mesa-19.1.4.ebuild => mesa-19.1.7.ebuild}     |   3 +-
 4 files changed, 2 insertions(+), 766 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index d5e1046..4bd3cb8 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,3 +1,2 @@
-DIST mesa-19.0.8.tar.xz 11967592 BLAKE2B 91a46b67bdb8cb3ab4c7337be7c2b0dc6ab5ec8cc126afc2d8af8d056bff0392a5b443c26304bf4c68472eb6ba16d29ca248c1fc0c0f2dd6af03d3e10d3ec1b3 SHA512 fbddc3a74f223564343027380af776b3fa5d63fe1af4e34121273235d1c6eced96439f601eb19bf658eb927aff3965b520f0329fcbd4650f3112167303e1746d
-DIST mesa-19.1.4.tar.xz 10938008 BLAKE2B 4745fc7e844397378fe1adf61bcd5b54aad11ec0b375ced85fd80ced01227432b491ad8b7ba7d9013190cfbb451bc11cdb7c8af0e1f298dd5d793d3ce43aa92b SHA512 234032d917c9b378c3f6ceb921677b64e549344c3957331810b50fd73e0dccd2f4f62e2bd39e619590f389bc58fdab10fab4b88f7c117557cbeb1dda049b9fc5
+DIST mesa-19.1.7.tar.xz 10941152 BLAKE2B 6be14ddac404668bdd8b7b8756388019c3610ac41b65a7723a419b97b7eccbca666ad6d904f4cde186c4b171e056636a8a6a5727e30963c8fa177d7861bd6cfb SHA512 0865b5f91e5daa00e1da2b3d8b65fe5d2ff6332372bf8fec7d671d05d8d64ec5a7abea1858cdfc506c76b7226d2bea0af3426565f156b796d8e0f949ea33dc15
 DIST mesa-19.2.1.tar.xz 11468492 BLAKE2B 9f6a1a5426343213a19dccb07917326b887ddc6ec02426b0604bea35a529f33c18ca46e2db09eb44c5b4a3b6e70da5f8fc7e049b1a0febd35d0de8f2ec4d2641 SHA512 decd74976fe866bf67fac4ae55a62d8e33ad24278dd58effe533e7d258b249f0ead848360e7e71444265184c6d9d9b04361caf0c6df99504e33599e7a0cd6c5d

diff --git a/media-libs/mesa/files/mesa-19.1.4-musl-upstream-fix.patch b/media-libs/mesa/files/mesa-19.1.4-musl-upstream-fix.patch
deleted file mode 100644
index 5c02abd..0000000
--- a/media-libs/mesa/files/mesa-19.1.4-musl-upstream-fix.patch
+++ /dev/null
@@ -1,227 +0,0 @@
-From 9c411e020d164563fb6fcd92a28a435277bf0745 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Wed, 24 Jul 2019 18:26:49 -0700
-Subject: [PATCH 1/5] util: Drop preprocessor guards for glibc-2.12
-
-glibc-2.12 was released in 2010. No one is building new Mesa against 9
-year old glibc, and removing these checks allows the code to work on
-other C libraries like musl.
-
-Acked-by: Eric Engestrom <eric.engestrom@intel.com>
----
- src/util/u_thread.h | 7 -------
- 1 file changed, 7 deletions(-)
-
-diff --git a/src/util/u_thread.h b/src/util/u_thread.h
-index a46c18d3db2..8c8cc803199 100644
---- a/src/util/u_thread.h
-+++ b/src/util/u_thread.h
-@@ -61,11 +61,7 @@ static inline thrd_t u_thread_create(int (*routine)(void *), void *param)
- 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__)
-    pthread_setname_np(pthread_self(), name);
--#  endif
- #endif
-    (void)name;
- }
-@@ -150,10 +146,7 @@ u_thread_get_time_nano(thrd_t thread)
- 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))
-    return pthread_equal(pthread_self(), thread);
--#  endif
- #endif
-    return false;
- }
--- 
-2.21.0
-
-
-From 9cc4311d86a797bba26448bcaf24db4887c6ec8d Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Wed, 24 Jul 2019 18:28:38 -0700
-Subject: [PATCH 2/5] st/nine: Drop preprocessor guards for glibc-2.12
-
-Same rationale as the previous patch, but additionally these checks just
-seem entirely unnecessary. pthread_self() has been used in Mesa since at
-least 1999.
-
-Acked-by: Eric Engestrom <eric.engestrom@intel.com>
----
- src/gallium/state_trackers/nine/nine_debug.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/src/gallium/state_trackers/nine/nine_debug.c b/src/gallium/state_trackers/nine/nine_debug.c
-index 904a40fde83..784d535d213 100644
---- a/src/gallium/state_trackers/nine/nine_debug.c
-+++ b/src/gallium/state_trackers/nine/nine_debug.c
-@@ -73,11 +73,8 @@ _nine_debug_printf( unsigned long flag,
-     }
- 
- #if defined(HAVE_PTHREAD)
--#  if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
--      (__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
-     if (dbg_flags & DBG_TID)
-         tid = pthread_self();
--#  endif
- #endif
- 
-     if (dbg_flags & flag) {
--- 
-2.21.0
-
-
-From c96407f37ef8325db11ae5fdb16e372cbc663bf4 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Wed, 24 Jul 2019 18:44:35 -0700
-Subject: [PATCH 3/5] meson: Test for random_r()
-
-It's better to test for needed functions instead of using external
-knowledge about presence in this or that C library.
-
-Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
----
- meson.build       | 2 +-
- src/glx/glxhash.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 542c35d525b..8dc431cfc5b 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1029,7 +1029,7 @@ foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'
-   endif
- endforeach
- 
--foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create']
-+foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_create', 'random_r']
-   if cc.has_function(f)
-     pre_args += '-DHAVE_@0@'.format(f.to_upper())
-   endif
-diff --git a/src/glx/glxhash.c b/src/glx/glxhash.c
-index b76ec323459..5a89bf99b1c 100644
---- a/src/glx/glxhash.c
-+++ b/src/glx/glxhash.c
-@@ -88,7 +88,7 @@
- 
- #define HASH_ALLOC malloc
- #define HASH_FREE  free
--#ifndef __GLIBC__
-+#ifndef HAVE_RANDOM_R
- #define HASH_RANDOM_DECL	char *ps, rs[256]
- #define HASH_RANDOM_INIT(seed)	ps = initstate(seed, rs, sizeof(rs))
- #define HASH_RANDOM		random()
--- 
-2.21.0
-
-
-From 597bddad47e831474a33cde054c40bbd2cbc0600 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Mon, 29 Jul 2019 15:31:34 -0700
-Subject: [PATCH 4/5] scons: Test for random_r()
-
-Suggested-by: Eric Engestrom <eric.engestrom@intel.com>
----
- scons/gallium.py | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/scons/gallium.py b/scons/gallium.py
-index 27727612d14..6d5b2fccc17 100755
---- a/scons/gallium.py
-+++ b/scons/gallium.py
-@@ -368,6 +368,9 @@ def generate(env):
-         if check_functions(env, ['strtod_l', 'strtof_l']):
-             cppdefines += ['HAVE_STRTOD_L']
- 
-+        if check_functions(env, 'random_r'):
-+            cppdefines += ['HAVE_RANDOM_R']
-+
-         if check_functions(env, ['timespec_get']):
-             cppdefines += ['HAVE_TIMESPEC_GET']
- 
--- 
-2.21.0
-
-
-From c9b86cf52692f1d76314dce345080af8ce786792 Mon Sep 17 00:00:00 2001
-From: Matt Turner <mattst88@gmail.com>
-Date: Mon, 29 Jul 2019 13:51:55 -0700
-Subject: [PATCH 5/5] meson: Test for program_invocation_name
-
-program_invocation_name and program_invocation_short_name are both GNU
-extensions. I don't believe one can exist without the other, so only
-check for program_invocation_name.
-
-Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
----
- meson.build                                         | 7 +++++++
- src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c | 2 +-
- src/util/u_process.c                                | 8 ++------
- 3 files changed, 10 insertions(+), 7 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 8dc431cfc5b..c9f96e7135d 100644
---- a/meson.build
-+++ b/meson.build
-@@ -1035,6 +1035,13 @@ foreach f : ['strtof', 'mkostemp', 'posix_memalign', 'timespec_get', 'memfd_crea
-   endif
- endforeach
- 
-+if cc.has_header_symbol('errno.h', 'program_invocation_name',
-+                        args : '-D_GNU_SOURCE')
-+   pre_args += '-DHAVE_PROGRAM_INVOCATION_NAME'
-+elif with_tools.contains('intel')
-+  error('Intel tools require the program_invocation_name variable')
-+endif
-+
- # strtod locale support
- if cc.links('''
-     #define _GNU_SOURCE
-diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c b/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
-index 58005df5595..42a58a6dcc1 100644
---- a/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
-+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_socket.c
-@@ -125,7 +125,7 @@ static int virgl_vtest_send_init(struct virgl_vtest_winsys *vws)
-    ret = os_get_process_name(cmdline, 63);
-    if (ret == FALSE)
-       strcpy(cmdline, nstr);
--#if defined(__GLIBC__) || defined(__CYGWIN__)
-+#if defined(HAVE_PROGRAM_INVOCATION_NAME)
-    if (!strcmp(cmdline, "shader_runner")) {
-       const char *name;
-       /* hack to get better testname */
-diff --git a/src/util/u_process.c b/src/util/u_process.c
-index 94c975df396..cbccf48ed01 100644
---- a/src/util/u_process.c
-+++ b/src/util/u_process.c
-@@ -32,11 +32,7 @@
- 
- #undef GET_PROGRAM_NAME
- 
--#if (defined(__GNU_LIBRARY__) || defined(__GLIBC__)) && !defined(__UCLIBC__)
--#    if !defined(__GLIBC__) || (__GLIBC__ < 2)
--/* These aren't declared in any libc5 header */
--extern char *program_invocation_name, *program_invocation_short_name;
--#    endif
-+#if defined(__linux__) && defined(HAVE_PROGRAM_INVOCATION_NAME)
- static const char *
- __getProgramName()
- {
-@@ -79,7 +75,7 @@ __getProgramName()
-    return program_invocation_name;
- }
- #    define GET_PROGRAM_NAME() __getProgramName()
--#elif defined(__CYGWIN__)
-+#elif defined(HAVE_PROGRAM_INVOCATION_NAME)
- #    define GET_PROGRAM_NAME() program_invocation_short_name
- #elif defined(__FreeBSD__) && (__FreeBSD__ >= 2)
- #    include <osreldate.h>
--- 
-2.21.0
-

diff --git a/media-libs/mesa/mesa-19.0.8.ebuild b/media-libs/mesa/mesa-19.0.8.ebuild
deleted file mode 100644
index 8be5b50..0000000
--- a/media-libs/mesa/mesa-19.0.8.ebuild
+++ /dev/null
@@ -1,535 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( 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="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
-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 +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 ) )
-	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.97"
-RDEPEND="
-	>=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}]
-	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? (
-			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}]
-		)
-		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. < 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-9:=[${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}-19.0.8-execinfo.patch
-	"${FILESDIR}"/${PN}-19.0.8-heap-allocation.patch
-	"${FILESDIR}"/${PN}-19.1.4-musl-upstream-fix.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:${LLVM_SLOT}[${flags}]" || return 1
-	fi
-	has_version "sys-devel/llvm:${LLVM_SLOT}[${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 libglvnd glvnd)
-		$(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
-
-	use libglvnd && rm -f "${D}"/usr/$(get_libdir)/libGLESv{1_CM,2}.so*
-}
-
-multilib_src_install_all() {
-	einstalldocs
-}
-
-multilib_src_test() {
-	meson test -v -C "${BUILD_DIR}" -t 100
-}
-
-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-19.1.4.ebuild b/media-libs/mesa/mesa-19.1.7.ebuild
similarity index 98%
rename from media-libs/mesa/mesa-19.1.4.ebuild
rename to media-libs/mesa/mesa-19.1.7.ebuild
index db12dee..f5f56c6 100644
--- a/media-libs/mesa/mesa-19.1.4.ebuild
+++ b/media-libs/mesa/mesa-19.1.7.ebuild
@@ -20,7 +20,7 @@ if [[ ${PV} == 9999 ]]; then
 	inherit git-r3
 else
 	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+	KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
 fi
 
 LICENSE="MIT"
@@ -238,7 +238,6 @@ x86? (
 )"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-19.1.4-musl-upstream-fix.patch
 	"${FILESDIR}"/${PN}-18.2.4-add-disable-tls-support.patch
 )
 


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2020-04-14 12:40 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2020-04-14 12:40 UTC (permalink / raw
  To: gentoo-commits

commit:     987bbf44350beea8c805775f0e8bc7fcd7df0b30
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 14 12:39:54 2020 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Tue Apr 14 12:39:54 2020 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=987bbf44

media-libs/mesa: Revbump in order to rebuild against libdrm

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 ...ify-the-maximum-required-libdrm-in-dri.pc.patch | 33 ++++++++++++++++++++++
 .../{mesa-20.0.4.ebuild => mesa-20.0.4-r1.ebuild}  |  3 +-
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/media-libs/mesa/files/mesa-20.0.4-meson-Specify-the-maximum-required-libdrm-in-dri.pc.patch b/media-libs/mesa/files/mesa-20.0.4-meson-Specify-the-maximum-required-libdrm-in-dri.pc.patch
new file mode 100644
index 0000000..0989752
--- /dev/null
+++ b/media-libs/mesa/files/mesa-20.0.4-meson-Specify-the-maximum-required-libdrm-in-dri.pc.patch
@@ -0,0 +1,33 @@
+From 316b352e946a9993a20f28abc741d34455a957a8 Mon Sep 17 00:00:00 2001
+From: Matt Turner <mattst88@gmail.com>
+Date: Mon, 13 Apr 2020 09:20:18 -0700
+Subject: [PATCH] meson: Specify the maximum required libdrm in dri.pc
+
+When dealing with a regression in libdrm-2.4.101, I masked the package
+in Gentoo. In doing so, we discovered that Mesa's dri.pc specifies a
+version requirement in dri.pc for >= the version of libdrm Mesa was
+built against, thus preventing packages from being rebuilt with the
+older version of libdrm installed.
+
+Let's reduce this version requirement to the latest libdrm required by
+Mesa instead, since libdrm is backward compatible.
+---
+ src/mesa/drivers/dri/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mesa/drivers/dri/meson.build b/src/mesa/drivers/dri/meson.build
+index acf7d2eb128..b09ca16e38a 100644
+--- a/src/mesa/drivers/dri/meson.build
++++ b/src/mesa/drivers/dri/meson.build
+@@ -86,7 +86,7 @@ endif
+ if with_dri
+   dri_req_private = []
+   if dep_libdrm.found()
+-    dri_req_private = ['libdrm >= ' + dep_libdrm.version()]
++    dri_req_private = ['libdrm >= ' + _drm_ver]
+   endif
+ 
+   pkg.generate(
+-- 
+2.24.1
+

diff --git a/media-libs/mesa/mesa-20.0.4.ebuild b/media-libs/mesa/mesa-20.0.4-r1.ebuild
similarity index 99%
rename from media-libs/mesa/mesa-20.0.4.ebuild
rename to media-libs/mesa/mesa-20.0.4-r1.ebuild
index 2861ed0..0f4c37a 100644
--- a/media-libs/mesa/mesa-20.0.4.ebuild
+++ b/media-libs/mesa/mesa-20.0.4-r1.ebuild
@@ -98,7 +98,7 @@ RDEPEND="
 		)
 		lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
 		opencl? (
-					dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
+					>=virtual/opencl-3[${MULTILIB_USEDEP}]
 					dev-libs/libclc
 					virtual/libelf:0=[${MULTILIB_USEDEP}]
 				)
@@ -248,6 +248,7 @@ x86? (
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-19.3.0-add-disable-tls-support.patch
+	"${FILESDIR}"/${P}-meson-Specify-the-maximum-required-libdrm-in-dri.pc.patch
 )
 
 llvm_check_deps() {


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2020-09-04 22:03 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2020-09-04 22:03 UTC (permalink / raw
  To: gentoo-commits

commit:     2a4337eff9d86aa71eaae25eba8275cead3830b3
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  4 22:03:28 2020 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Fri Sep  4 22:03:28 2020 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=2a4337ef

media-libs/mesa: Update tls patch for musl users

Package-Manager: Portage-3.0.5, Repoman-3.0.1
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 media-libs/mesa/Manifest                           |  2 +-
 .../mesa-20.2.0-add-disable-tls-support.patch      | 44 ++++++++++
 .../{mesa-19.3.5.ebuild => mesa-20.2.0_rc4.ebuild} | 98 +++++++++++++---------
 media-libs/mesa/metadata.xml                       |  3 +-
 4 files changed, 105 insertions(+), 42 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index d4b8a71..2c19fa4 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,2 +1,2 @@
-DIST mesa-19.3.5.tar.xz 12064980 BLAKE2B a20ebfb149624f13951795e07154ab70dc1856a7a1261b339b0bdf0009511111756c88439e7b8729f768b0b4b298301b9a3c0c10d7f2fab3abd91649c12ba51c SHA512 413929573fab31e1bb2a1a04c0c770161c2db464a5aab3f0567d27603fff889ede70e1f6e197e7ff1c1639dc4cc543457bcf45761f0f8e6dffafccfa773a4e3f
 DIST mesa-20.0.8.tar.xz 12360736 BLAKE2B 19e3f8a40b34b5f17ed76077c5d92f728a134b2479c43d86674ed1818ab99639a9b732041f67488251df808564f6abe5b587d756ef9c7c13dcada87cd0fc05de SHA512 d906330c412899907dd05a84034a929107fccaf3044814c4b1f30ba5690cbcf1587b5f17534c6345111f3cb7cf292afd5984a60486643ff6f534b57cec615374
+DIST mesa-20.2.0-rc4.tar.xz 13569628 BLAKE2B 54068c298a57f2c19113828e2e9b94dd15070ecc0c899f7e3dc527b27579e4f8c3c84c7b841c8d0b8313556cca41bfefd3e08b360dd0e364cbc29e0609ff6f3d SHA512 1f718bfbadbc15b7216864226adb737f3a4a7801dc60ca9294effd4be5f260fffd31c988eed9550e8a7a7430acb05ba0c7d65693c1f375eab4b95d2d029755bb

diff --git a/media-libs/mesa/files/mesa-20.2.0-add-disable-tls-support.patch b/media-libs/mesa/files/mesa-20.2.0-add-disable-tls-support.patch
new file mode 100644
index 0000000..bc4f5e9
--- /dev/null
+++ b/media-libs/mesa/files/mesa-20.2.0-add-disable-tls-support.patch
@@ -0,0 +1,44 @@
+From 97365c36582ad77db40e957931f29f958074edec Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Tue, 1 Sep 2020 18:04:56 -0500
+Subject: [PATCH] Allow to disable glx_tls for musl users
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+---
+ meson.build       | 2 +-
+ meson_options.txt | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 4f9c589..2c388e7 100644
+--- a/meson.build
++++ b/meson.build
+@@ -424,7 +424,7 @@ endif
+ 
+ # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
+ use_elf_tls = false
+-if not ['windows', 'freebsd', 'openbsd'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
++if get_option('elf-tls')
+   pre_args += '-DUSE_ELF_TLS'
+   use_elf_tls = true
+ endif
+diff --git a/meson_options.txt b/meson_options.txt
+index 2d39d13..a3d1de5 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -313,6 +313,12 @@ option(
+   value : false,
+   description : 'Build an SELinux-aware Mesa'
+ )
++option(
++  'elf-tls',
++  type : 'boolean',
++  value : true,
++  description : 'Enable thread-local storage in GLX and EGL'
++)
+ option(
+   'osmesa',
+   type : 'combo',
+-- 
+2.28.0
+

diff --git a/media-libs/mesa/mesa-19.3.5.ebuild b/media-libs/mesa/mesa-20.2.0_rc4.ebuild
similarity index 85%
rename from media-libs/mesa/mesa-19.3.5.ebuild
rename to media-libs/mesa/mesa-20.2.0_rc4.ebuild
index f272c2b..7d2dc42 100644
--- a/media-libs/mesa/mesa-19.3.5.ebuild
+++ b/media-libs/mesa/mesa-20.2.0_rc4.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit llvm meson multilib-minimal pax-utils python-any-r1
+inherit llvm meson multilib-minimal python-any-r1 linux-info
 
 OPENGL_DIR="xorg-x11"
 
@@ -18,8 +18,8 @@ if [[ ${PV} == 9999 ]]; then
 	EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
 	inherit git-r3
 else
-	SRC_URI="https://mesa.freedesktop.org/archive/${MY_P}.tar.xz"
-	KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 x86"
+	SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
 fi
 
 LICENSE="MIT"
@@ -29,22 +29,21 @@ RESTRICT="
 "
 
 RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost vc4 virgl vivante vmware"
+VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost v3d 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 +libglvnd +llvm
-	lm-sensors opencl osmesa pax_kernel selinux test unwind vaapi valgrind
-	vdpau vulkan vulkan-overlay wayland +X xa xvmc"
+	lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
+	vulkan-overlay wayland +X xa xvmc zink +zstd"
 
 REQUIRED_USE="
 	d3d9?   ( dri3 || ( video_cards_iris 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_iris video_cards_radeonsi )
 			  video_cards_radeonsi? ( llvm ) )
 	vulkan-overlay? ( vulkan )
 	wayland? ( egl gbm )
@@ -63,12 +62,14 @@ REQUIRED_USE="
 	video_cards_r300?   ( gallium x86? ( llvm ) amd64? ( llvm ) )
 	video_cards_r600?   ( gallium )
 	video_cards_radeonsi?   ( gallium llvm )
+	video_cards_v3d? ( gallium )
 	video_cards_vc4? ( gallium )
 	video_cards_virgl? ( gallium )
 	video_cards_vivante? ( gallium gbm )
 	video_cards_vmware? ( gallium )
 	xa? ( X )
 	xvmc? ( X )
+	zink? ( gallium vulkan )
 "
 
 LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.100"
@@ -77,7 +78,7 @@ RDEPEND="
 	>=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
 	>=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
 	libglvnd? (
-		>=media-libs/libglvnd-1.2.0-r1[X?,${MULTILIB_USEDEP}]
+		>=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
 		!app-eselect/eselect-opengl
 	)
 	!libglvnd? (
@@ -98,7 +99,7 @@ RDEPEND="
 		)
 		lm-sensors? ( sys-apps/lm-sensors:=[${MULTILIB_USEDEP}] )
 		opencl? (
-					dev-libs/ocl-icd[khronos-headers,${MULTILIB_USEDEP}]
+					>=virtual/opencl-3[${MULTILIB_USEDEP}]
 					dev-libs/libclc
 					virtual/libelf:0=[${MULTILIB_USEDEP}]
 				)
@@ -128,6 +129,8 @@ RDEPEND="
 		>=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
 		x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
 	)
+	zink? ( media-libs/vulkan-loader:=[${MULTILIB_USEDEP}] )
+	zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
 "
 for card in ${RADEON_CARDS}; do
 	RDEPEND="${RDEPEND}
@@ -146,13 +149,13 @@ RDEPEND="${RDEPEND}
 # 1. List all the working slots (with min versions) in ||, newest first.
 # 2. Update the := to specify *max* version, e.g. < 10.
 # 3. Specify LLVM_MAX_SLOT, e.g. 9.
-LLVM_MAX_SLOT="9"
+LLVM_MAX_SLOT="10"
 LLVM_DEPSTR="
 	|| (
+		sys-devel/llvm:10[${MULTILIB_USEDEP}]
 		sys-devel/llvm:9[${MULTILIB_USEDEP}]
-		sys-devel/llvm:8[${MULTILIB_USEDEP}]
 	)
-	sys-devel/llvm:=[${MULTILIB_USEDEP}]
+	<sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${MULTILIB_USEDEP}]
 "
 LLVM_DEPSTR_AMDGPU=${LLVM_DEPSTR//]/,llvm_targets_AMDGPU(-)]}
 CLANG_DEPSTR=${LLVM_DEPSTR//llvm/clang}
@@ -227,7 +230,6 @@ BDEPEND="
 	)
 	sys-devel/bison
 	sys-devel/flex
-	sys-devel/gettext
 	virtual/pkgconfig
 	$(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
 "
@@ -246,7 +248,7 @@ x86? (
 )"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-19.3.0-add-disable-tls-support.patch
+	"${FILESDIR}"/${PN}-20.2.0-add-disable-tls-support.patch
 )
 
 llvm_check_deps() {
@@ -263,6 +265,14 @@ llvm_check_deps() {
 }
 
 pkg_pretend() {
+	if use vulkan; then
+		if ! use video_cards_i965 &&
+		   ! use video_cards_iris &&
+		   ! use video_cards_radeonsi; then
+			ewarn "Ignoring USE=vulkan     since VIDEO_CARDS does not contain i965, iris, or radeonsi"
+		fi
+	fi
+
 	if use opencl; then
 		if ! use video_cards_r600 &&
 		   ! use video_cards_radeonsi; then
@@ -329,7 +339,14 @@ pkg_setup() {
 		ewarn "detected! This can cause problems. For details, see bug 459306."
 	fi
 
-	if use llvm; then
+	if use video_cards_i965 ||
+	   use video_cards_iris ||
+	   use video_cards_radeonsi; then
+		CONFIG_CHECK="~CHECKPOINT_RESTORE"
+		linux-info_pkg_setup
+	fi
+
+	if use gallium && use llvm; then
 		llvm_pkg_setup
 	fi
 	python-any-r1_pkg_setup
@@ -359,13 +376,16 @@ multilib_src_configure() {
 		fi
 	fi
 
-	emesonargs+=( -Dplatforms=$(use X && echo "x11,")$(use wayland && echo "wayland,")$(use gbm && echo "drm,")surfaceless )
+	local platforms
+	use X && platforms+="x11"
+	use wayland && platforms+=",wayland"
+	[[ -n $platforms ]] && emesonargs+=(-Dplatforms=${platforms#,})
 
 	if use gallium; then
 		emesonargs+=(
-			$(meson_use llvm)
-			$(meson_use lm-sensors lmsensors)
-			$(meson_use unwind libunwind)
+			$(meson_feature llvm)
+			$(meson_feature lm-sensors lmsensors)
+			$(meson_feature unwind libunwind)
 		)
 
 		if use video_cards_iris ||
@@ -382,39 +402,40 @@ multilib_src_configure() {
 		if use video_cards_r600 ||
 		   use video_cards_radeonsi ||
 		   use video_cards_nouveau; then
-			emesonargs+=($(meson_use vaapi gallium-va))
+			emesonargs+=($(meson_feature vaapi gallium-va))
 			use vaapi && emesonargs+=( -Dva-libs-path="${EPREFIX}"/usr/$(get_libdir)/va/drivers )
 		else
-			emesonargs+=(-Dgallium-va=false)
+			emesonargs+=(-Dgallium-va=disabled)
 		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))
+			emesonargs+=($(meson_feature vdpau gallium-vdpau))
 		else
-			emesonargs+=(-Dgallium-vdpau=false)
+			emesonargs+=(-Dgallium-vdpau=disabled)
 		fi
 
 		if use video_cards_freedreno ||
 		   use video_cards_nouveau ||
 		   use video_cards_vmware; then
-			emesonargs+=($(meson_use xa gallium-xa))
+			emesonargs+=($(meson_feature xa gallium-xa))
 		else
-			emesonargs+=(-Dgallium-xa=false)
+			emesonargs+=(-Dgallium-xa=disabled)
 		fi
 
 		if use video_cards_r600 ||
 		   use video_cards_nouveau; then
-			emesonargs+=($(meson_use xvmc gallium-xvmc))
+			emesonargs+=($(meson_feature xvmc gallium-xvmc))
 		else
-			emesonargs+=(-Dgallium-xvmc=false)
+			emesonargs+=(-Dgallium-xvmc=disabled)
 		fi
 
 		if use video_cards_freedreno ||
 		   use video_cards_lima ||
 		   use video_cards_panfrost ||
+		   use video_cards_v3d ||
 		   use video_cards_vc4 ||
 		   use video_cards_vivante; then
 			gallium_enable -- kmsro
@@ -422,10 +443,12 @@ multilib_src_configure() {
 
 		gallium_enable video_cards_lima lima
 		gallium_enable video_cards_panfrost panfrost
+		gallium_enable video_cards_v3d v3d
 		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 zink zink
 
 		# Only one i915 driver (classic vs gallium). Default to classic.
 		if ! use classic; then
@@ -461,11 +484,6 @@ multilib_src_configure() {
 		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+=( -Delf-tls=false )
@@ -487,18 +505,20 @@ multilib_src_configure() {
 	emesonargs+=(
 		$(meson_use test build-tests)
 		-Dglx=$(usex X dri disabled)
-		-Dshared-glapi=true
-		$(meson_use dri3)
-		$(meson_use egl)
-		$(meson_use gbm)
-		$(meson_use gles1)
-		$(meson_use gles2)
+		-Dshared-glapi=enabled
+		$(meson_feature dri3)
+		$(meson_feature egl)
+		$(meson_feature gbm)
+		$(meson_feature gles1)
+		$(meson_feature gles2)
 		$(meson_use libglvnd glvnd)
 		$(meson_use selinux)
+		$(meson_feature zstd)
 		-Dvalgrind=$(usex valgrind auto false)
 		-Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
 		-Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
 		-Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
+		$(meson_use vulkan vulkan-device-select-layer)
 		$(meson_use vulkan-overlay vulkan-overlay-layer)
 		--buildtype $(usex debug debug plain)
 		-Db_ndebug=$(usex debug false true)
@@ -512,8 +532,6 @@ multilib_src_compile() {
 
 multilib_src_install() {
 	meson_src_install
-
-	use libglvnd && rm -f "${D}"/usr/$(get_libdir)/pkgconfig/{egl,gl}.pc
 }
 
 multilib_src_install_all() {

diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml
index 9e9a04a..8aecc5f 100644
--- a/media-libs/mesa/metadata.xml
+++ b/media-libs/mesa/metadata.xml
@@ -16,9 +16,9 @@
 		<flag name="gles2">Enable GLESv2 support.</flag>
 		<flag name="libglvnd">Use libglvnd for dispatch.</flag>
 		<flag name="llvm">Enable LLVM backend for Gallium3D.</flag>
+		<flag name="lm-sensors">Enable Gallium HUD lm-sensors support.</flag>
 		<flag name="opencl">Enable the Clover Gallium OpenCL state tracker.</flag>
 		<flag name="osmesa">Build the Mesa library for off-screen rendering.</flag>
-		<flag name="pax_kernel">Enable if the user plans to run the package under a pax enabled hardened kernel</flag>
 		<flag name="valgrind">Compile in valgrind memory hints</flag>
 		<flag name="vdpau">Enable the VDPAU acceleration interface for the Gallium3D Video Layer.</flag>
 		<flag name="vulkan">Enable Vulkan drivers</flag>
@@ -26,6 +26,7 @@
 		<flag name="wayland">Enable support for dev-libs/wayland</flag>
 		<flag name="xa">Enable the XA (X Acceleration) API for Gallium3D.</flag>
 		<flag name="xvmc">Enable the XvMC acceleration interface for the Gallium3D Video Layer.</flag>
+		<flag name="zink">Enable the Zink OpenGL-over-Vulkan Gallium driver</flag>
 	</use>
 	<upstream>
 		<remote-id type="cpe">cpe:/a:mesa3d:mesa</remote-id>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2021-03-10 15:19 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2021-03-10 15:19 UTC (permalink / raw
  To: gentoo-commits

commit:     412af79d1e12ddca4d625dde09e24f9e02726f04
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 10 15:19:43 2021 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Wed Mar 10 15:19:43 2021 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=412af79d

media-libs/mesa: use upstream patch for git_sha1 generation missing

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 .../mesa/files/mesa-20.3.4-intel-git_sha1.patch    | 25 ----------
 .../mesa/files/mesa-20.3.4-missing-git_sha1.patch  | 57 ++++++++++++++++++++++
 media-libs/mesa/mesa-20.3.4.ebuild                 |  2 +-
 3 files changed, 58 insertions(+), 26 deletions(-)

diff --git a/media-libs/mesa/files/mesa-20.3.4-intel-git_sha1.patch b/media-libs/mesa/files/mesa-20.3.4-intel-git_sha1.patch
deleted file mode 100644
index 2919d57..0000000
--- a/media-libs/mesa/files/mesa-20.3.4-intel-git_sha1.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 4ffaff669266dd5b633d2e44ca842c49f0a1d2fb Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Wed, 10 Mar 2021 08:48:37 -0600
-Subject: [PATCH] ensure git_sha1.h is generated for use
-
----
- src/intel/common/meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/intel/common/meson.build b/src/intel/common/meson.build
-index 66e0967..422d22a 100644
---- a/src/intel/common/meson.build
-+++ b/src/intel/common/meson.build
-@@ -42,7 +42,7 @@ files_libintel_common = files(
- )
- 
- libintel_common = static_library(
--  ['intel_common', genX_xml_h],
-+  ['intel_common', genX_xml_h, sha1_h],
-   files_libintel_common,
-   include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel],
-   c_args : [no_override_init_args],
--- 
-2.26.2
-

diff --git a/media-libs/mesa/files/mesa-20.3.4-missing-git_sha1.patch b/media-libs/mesa/files/mesa-20.3.4-missing-git_sha1.patch
new file mode 100644
index 0000000..c994a7a
--- /dev/null
+++ b/media-libs/mesa/files/mesa-20.3.4-missing-git_sha1.patch
@@ -0,0 +1,57 @@
+From 434da21a7c81acbe03f0e1621e80904313c0b05c Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Wed, 16 Dec 2020 00:48:25 -0800
+Subject: [PATCH] meson: add missing dependency on generated git_sha1.h
+
+Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8121>
+---
+ src/freedreno/common/meson.build           | 1 +
+ src/gallium/frontends/lavapipe/meson.build | 2 +-
+ src/intel/common/meson.build               | 4 ++--
+ 3 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/src/freedreno/common/meson.build b/src/freedreno/common/meson.build
+index 2da6c1eacf8..30ef23043a7 100644
+--- a/src/freedreno/common/meson.build
++++ b/src/freedreno/common/meson.build
+@@ -27,6 +27,7 @@ libfreedreno_common = static_library(
+     'freedreno_uuid.c',
+     'freedreno_uuid.h',
+     'freedreno_guardband.h',
++    sha1_h,
+   ],
+   include_directories : [inc_freedreno, inc_include, inc_src, inc_gallium],
+   c_args : [no_override_init_args],
+diff --git a/src/gallium/frontends/lavapipe/meson.build b/src/gallium/frontends/lavapipe/meson.build
+index 972735fcff9..94c68d14d23 100644
+--- a/src/gallium/frontends/lavapipe/meson.build
++++ b/src/gallium/frontends/lavapipe/meson.build
+@@ -57,7 +57,7 @@ endif
+ 
+ liblavapipe_st = static_library(
+   'lavapipe_st',
+-  [liblvp_files, lvp_entrypoints, lvp_extensions_c ],
++  [liblvp_files, lvp_entrypoints, lvp_extensions_c, sha1_h],
+   link_with : [ libvulkan_wsi ],
+   c_args : [ lvp_flags ],
+   gnu_symbol_visibility : 'hidden',
+diff --git a/src/intel/common/meson.build b/src/intel/common/meson.build
+index 2586b4cf956..53c458f447d 100644
+--- a/src/intel/common/meson.build
++++ b/src/intel/common/meson.build
+@@ -42,8 +42,8 @@ files_libintel_common = files(
+ )
+ 
+ libintel_common = static_library(
+-  ['intel_common', genX_xml_h],
+-  files_libintel_common,
++  'intel_common',
++  [files_libintel_common, genX_xml_h, sha1_h],
+   include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel],
+   c_args : [no_override_init_args],
+   gnu_symbol_visibility : 'hidden',
+-- 
+GitLab
+

diff --git a/media-libs/mesa/mesa-20.3.4.ebuild b/media-libs/mesa/mesa-20.3.4.ebuild
index acdeb09..001daa0 100644
--- a/media-libs/mesa/mesa-20.3.4.ebuild
+++ b/media-libs/mesa/mesa-20.3.4.ebuild
@@ -243,7 +243,7 @@ x86? (
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-20.2.0-add-disable-tls-support.patch
-	"${FILESDIR}"/${PN}-20.3.4-intel-git_sha1.patch
+	"${FILESDIR}"/${PN}-20.3.4-missing-git_sha1.patch
 )
 
 llvm_check_deps() {


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2021-06-07 13:22 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2021-06-07 13:22 UTC (permalink / raw
  To: gentoo-commits

commit:     13adabf0033a58c9b1a9d0587c5fee5ffffc4962
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  7 13:22:18 2021 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Mon Jun  7 13:22:18 2021 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=13adabf0

media-libs/mesa: sync with ::gentoo

Package-Manager: Portage-3.0.19, Repoman-3.0.2
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 media-libs/mesa/Manifest                           |   3 +-
 .../mesa-20.1.7-add-disable-tls-support.patch      |  45 --
 .../mesa-20.2.0-add-disable-tls-support.patch      |  44 --
 .../mesa/files/mesa-20.3.4-missing-git_sha1.patch  |  57 ---
 .../mesa-21.0.3-add-disable-tls-support.patch      |  41 ++
 media-libs/mesa/mesa-20.1.10.ebuild                | 552 ---------------------
 .../{mesa-20.3.5.ebuild => mesa-21.0.3.ebuild}     |  22 +-
 7 files changed, 52 insertions(+), 712 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 36782df..0583fc1 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,2 +1 @@
-DIST mesa-20.1.10.tar.xz 12918420 BLAKE2B 408f4bc6eb0dc11199cd161d6914b77cb57313bca94f26794cbfd05332922c45dc216a64e33df9fad64cd41e1ad8b2de6c2e5f99cad234870f7a5b970a62dcbd SHA512 0d4016abfcc733c853d7b6c3c997ddc554a44088c0a4d9a7edb51ab5ad7d9e1234728b61ffcb9c82a6c5fee1429091a1c31cbeabcb1b50411337b99ee550d28a
-DIST mesa-20.3.5.tar.xz 14367412 BLAKE2B 7bad876ce702158e727a752eda6722e7165b497fd3a485dae4e989f22b13288a93f51bcd5e6a69b979f0bbe41599fa237c08f3bbb81cb9c6dc4c06827f8ad5f4 SHA512 481e710ed80d8f215a8d541cfe51b960862c2403c2b9e7e6932c8236b8decb5d478871d6c73559d6d795ada143803764f3a93b2329588c80f62e2e5ec98c78a9
+DIST mesa-21.0.3.tar.xz 14710004 BLAKE2B f2165da4487824931d8ff90e4f13624546a297b0d3577d69b7cfd6078a965282b4a732cb720cbb08ea83a3a987603cfe67876fb18022fa444b011fcc9b7df352 SHA512 4a8aee48a8ea7f32e8aa3bbbd91db26c6053b9a43e62ff88256929e6bc147884f0fef988726b5a3d59d7008663f017c746a0352fd3fcc1c476b8190af4a2531f

diff --git a/media-libs/mesa/files/mesa-20.1.7-add-disable-tls-support.patch b/media-libs/mesa/files/mesa-20.1.7-add-disable-tls-support.patch
deleted file mode 100644
index b64b429..0000000
--- a/media-libs/mesa/files/mesa-20.1.7-add-disable-tls-support.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 6be4bac8f5a7c8c0ae0f95582e9905f485095988 Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Wed, 6 Nov 2019 13:26:34 -0600
-Subject: [PATCH] Add option to control elf-tls
-
-Signed-off-by: Jory Pratt <anarchy@gentoo.org>
----
- meson.build       | 2 +-
- meson_options.txt | 6 ++++++
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 4eda551..87fe071 100644
---- a/meson.build
-+++ b/meson.build
-@@ -427,7 +427,7 @@ else
- endif
- 
- # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
--if not ['windows', 'freebsd'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
-+if get_option('elf-tls')
-   pre_args += '-DUSE_ELF_TLS'
- endif
- 
-diff --git a/meson_options.txt b/meson_options.txt
-index 626baf3..d30a238 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -293,6 +293,12 @@ option(
-   value : false,
-   description : 'Build an SELinux-aware Mesa'
- )
-+option(
-+  'elf-tls',
-+  type : 'boolean',
-+  value : true,
-+  description : 'Enable thread-local storage in GLX and EGL'
-+)
- option(
-   'osmesa',
-   type : 'combo',
--- 
-2.24.0
-
-

diff --git a/media-libs/mesa/files/mesa-20.2.0-add-disable-tls-support.patch b/media-libs/mesa/files/mesa-20.2.0-add-disable-tls-support.patch
deleted file mode 100644
index bc4f5e9..0000000
--- a/media-libs/mesa/files/mesa-20.2.0-add-disable-tls-support.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 97365c36582ad77db40e957931f29f958074edec Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Tue, 1 Sep 2020 18:04:56 -0500
-Subject: [PATCH] Allow to disable glx_tls for musl users
-
-Signed-off-by: Jory Pratt <anarchy@gentoo.org>
----
- meson.build       | 2 +-
- meson_options.txt | 6 ++++++
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 4f9c589..2c388e7 100644
---- a/meson.build
-+++ b/meson.build
-@@ -424,7 +424,7 @@ endif
- 
- # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
- use_elf_tls = false
--if not ['windows', 'freebsd', 'openbsd'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
-+if get_option('elf-tls')
-   pre_args += '-DUSE_ELF_TLS'
-   use_elf_tls = true
- endif
-diff --git a/meson_options.txt b/meson_options.txt
-index 2d39d13..a3d1de5 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -313,6 +313,12 @@ option(
-   value : false,
-   description : 'Build an SELinux-aware Mesa'
- )
-+option(
-+  'elf-tls',
-+  type : 'boolean',
-+  value : true,
-+  description : 'Enable thread-local storage in GLX and EGL'
-+)
- option(
-   'osmesa',
-   type : 'combo',
--- 
-2.28.0
-

diff --git a/media-libs/mesa/files/mesa-20.3.4-missing-git_sha1.patch b/media-libs/mesa/files/mesa-20.3.4-missing-git_sha1.patch
deleted file mode 100644
index c994a7a..0000000
--- a/media-libs/mesa/files/mesa-20.3.4-missing-git_sha1.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 434da21a7c81acbe03f0e1621e80904313c0b05c Mon Sep 17 00:00:00 2001
-From: Michael Forney <mforney@mforney.org>
-Date: Wed, 16 Dec 2020 00:48:25 -0800
-Subject: [PATCH] meson: add missing dependency on generated git_sha1.h
-
-Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
-Reviewed-by: Eric Anholt <eric@anholt.net>
-Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8121>
----
- src/freedreno/common/meson.build           | 1 +
- src/gallium/frontends/lavapipe/meson.build | 2 +-
- src/intel/common/meson.build               | 4 ++--
- 3 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/src/freedreno/common/meson.build b/src/freedreno/common/meson.build
-index 2da6c1eacf8..30ef23043a7 100644
---- a/src/freedreno/common/meson.build
-+++ b/src/freedreno/common/meson.build
-@@ -27,6 +27,7 @@ libfreedreno_common = static_library(
-     'freedreno_uuid.c',
-     'freedreno_uuid.h',
-     'freedreno_guardband.h',
-+    sha1_h,
-   ],
-   include_directories : [inc_freedreno, inc_include, inc_src, inc_gallium],
-   c_args : [no_override_init_args],
-diff --git a/src/gallium/frontends/lavapipe/meson.build b/src/gallium/frontends/lavapipe/meson.build
-index 972735fcff9..94c68d14d23 100644
---- a/src/gallium/frontends/lavapipe/meson.build
-+++ b/src/gallium/frontends/lavapipe/meson.build
-@@ -57,7 +57,7 @@ endif
- 
- liblavapipe_st = static_library(
-   'lavapipe_st',
--  [liblvp_files, lvp_entrypoints, lvp_extensions_c ],
-+  [liblvp_files, lvp_entrypoints, lvp_extensions_c, sha1_h],
-   link_with : [ libvulkan_wsi ],
-   c_args : [ lvp_flags ],
-   gnu_symbol_visibility : 'hidden',
-diff --git a/src/intel/common/meson.build b/src/intel/common/meson.build
-index 2586b4cf956..53c458f447d 100644
---- a/src/intel/common/meson.build
-+++ b/src/intel/common/meson.build
-@@ -42,8 +42,8 @@ files_libintel_common = files(
- )
- 
- libintel_common = static_library(
--  ['intel_common', genX_xml_h],
--  files_libintel_common,
-+  'intel_common',
-+  [files_libintel_common, genX_xml_h, sha1_h],
-   include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_intel],
-   c_args : [no_override_init_args],
-   gnu_symbol_visibility : 'hidden',
--- 
-GitLab
-

diff --git a/media-libs/mesa/files/mesa-21.0.3-add-disable-tls-support.patch b/media-libs/mesa/files/mesa-21.0.3-add-disable-tls-support.patch
new file mode 100644
index 0000000..e6f9e18
--- /dev/null
+++ b/media-libs/mesa/files/mesa-21.0.3-add-disable-tls-support.patch
@@ -0,0 +1,41 @@
+From 7af845bca9eafb67b32c2f5e2de7bc2a56772aa4 Mon Sep 17 00:00:00 2001
+From: 
+Date: Fri, 28 May 2021 11:48:26 -0500
+Subject: [PATCH] Allow to disable glx_tls for musl users
+
+---
+ meson.build       | 3 ++-
+ meson_options.txt | 6 ++++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 26cfd01..38d4802 100644
+--- a/meson.build
++++ b/meson.build
+@@ -448,7 +448,8 @@ endif
+ 
+ # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
+ use_elf_tls = false
+-if not ['windows', 'freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
++with_use_elf_tls = get_option('use-elf-tls')
++if with_use_elf_tls and not ['windows', 'freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and (not with_platform_android or get_option('platform-sdk-version') >= 29)
+   pre_args += '-DUSE_ELF_TLS'
+   use_elf_tls = true
+ endif
+diff --git a/meson_options.txt b/meson_options.txt
+index fc73f6e..edd3886 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -464,3 +464,9 @@ option(
+   value : true,
+   description : 'use msse2 flag for mingw x86. Default: true',
+ )
++option(
++  'use-elf-tls',
++  type : 'boolean',
++  value : false,
++  description : 'Build support for initial-exec TLS model'
++)
+-- 
+2.31.1
+

diff --git a/media-libs/mesa/mesa-20.1.10.ebuild b/media-libs/mesa/mesa-20.1.10.ebuild
deleted file mode 100644
index a0615fe..0000000
--- a/media-libs/mesa/mesa-20.1.10.ebuild
+++ /dev/null
@@ -1,552 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-
-inherit llvm meson multilib-minimal python-any-r1 linux-info
-
-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"
-	inherit git-r3
-else
-	SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
-	KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 x86"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-RESTRICT="
-	!test? ( test )
-"
-
-RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
-VIDEO_CARDS="${RADEON_CARDS} freedreno i915 i965 intel iris lima nouveau panfrost 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 selinux test unwind vaapi valgrind vdpau vulkan
-	vulkan-overlay wayland +X xa xvmc +zstd"
-
-REQUIRED_USE="
-	d3d9?   ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
-	gles1?  ( egl )
-	gles2?  ( egl )
-	vulkan? ( dri3
-			  video_cards_radeonsi? ( llvm ) )
-	vulkan-overlay? ( vulkan )
-	wayland? ( egl gbm )
-	video_cards_freedreno?  ( gallium )
-	video_cards_intel?  ( classic )
-	video_cards_i915?   ( || ( classic gallium ) )
-	video_cards_i965?   ( classic )
-	video_cards_iris?   ( gallium )
-	video_cards_lima?   ( gallium )
-	video_cards_nouveau? ( || ( classic gallium ) )
-	video_cards_panfrost? ( 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 )
-	xa? ( X )
-	xvmc? ( X )
-"
-
-LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.100"
-RDEPEND="
-	!app-eselect/eselect-mesa
-	>=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
-	>=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
-	>=sys-libs/zlib-1.2.8[${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? (
-					>=virtual/opencl-3[${MULTILIB_USEDEP}]
-					dev-libs/libclc
-					virtual/libelf:0=[${MULTILIB_USEDEP}]
-				)
-		vaapi? (
-			>=x11-libs/libva-1.7.3:=[${MULTILIB_USEDEP}]
-		)
-		vdpau? ( >=x11-libs/libvdpau-1.1:=[${MULTILIB_USEDEP}] )
-		xvmc? ( >=x11-libs/libXvMC-1.0.8:=[${MULTILIB_USEDEP}] )
-	)
-	selinux? ( sys-libs/libselinux[${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] )
-	vulkan-overlay? ( dev-util/glslang:0=[${MULTILIB_USEDEP}] )
-	X? (
-		>=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}]
-	)
-	zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
-"
-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. < 10.
-# 3. Specify LLVM_MAX_SLOT, e.g. 9.
-LLVM_MAX_SLOT="10"
-LLVM_DEPSTR="
-	|| (
-		sys-devel/llvm:10[${MULTILIB_USEDEP}]
-		sys-devel/llvm:9[${MULTILIB_USEDEP}]
-	)
-	<sys-devel/llvm-$((LLVM_MAX_SLOT + 1)):=[${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}
-	gallium? (
-		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}
-	valgrind? ( dev-util/valgrind )
-	X? (
-		x11-libs/libXrandr[${MULTILIB_USEDEP}]
-		x11-base/xorg-proto
-	)
-"
-BDEPEND="
-	${PYTHON_DEPS}
-	opencl? (
-		>=sys-devel/gcc-4.6
-	)
-	sys-devel/bison
-	sys-devel/flex
-	sys-devel/gettext
-	virtual/pkgconfig
-	$(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
-"
-
-S="${WORKDIR}/${MY_P}"
-EGIT_CHECKOUT_DIR=${S}
-
-QA_WX_LOAD="
-x86? (
-	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
-	usr/lib/libGLX_mesa.so.0.0.0
-)"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-20.1.7-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:${LLVM_SLOT}[${flags}]" || return 1
-	fi
-	has_version "sys-devel/llvm:${LLVM_SLOT}[${flags}]"
-}
-
-pkg_pretend() {
-	if use vulkan; then
-		if ! use video_cards_i965 &&
-		   ! use video_cards_iris &&
-		   ! use video_cards_radeonsi; then
-			ewarn "Ignoring USE=vulkan     since VIDEO_CARDS does not contain i965, iris, or radeonsi"
-		fi
-	fi
-
-	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 -b ">=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 video_cards_i965 ||
-	   use video_cards_iris ||
-	   use video_cards_radeonsi; then
-		CONFIG_CHECK="~CHECKPOINT_RESTORE"
-		linux-info_pkg_setup
-	fi
-
-	if use gallium && 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=$(use X && echo "x11,")$(use wayland && echo "wayland,")$(use gbm && echo "drm,")surfaceless )
-
-	if use gallium; then
-		emesonargs+=(
-			$(meson_use llvm)
-			$(meson_use lm-sensors lmsensors)
-			$(meson_use unwind libunwind)
-		)
-
-		if use video_cards_iris ||
-		   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
-
-		if use video_cards_freedreno ||
-		   use video_cards_lima ||
-		   use video_cards_panfrost ||
-		   use video_cards_vc4 ||
-		   use video_cards_vivante; then
-			gallium_enable -- kmsro
-		fi
-
-		gallium_enable video_cards_lima lima
-		gallium_enable video_cards_panfrost panfrost
-		gallium_enable video_cards_vc4 vc4
-		gallium_enable video_cards_vivante etnaviv
-		gallium_enable video_cards_vmware svga
-		gallium_enable video_cards_nouveau nouveau
-
-		# 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_iris iris
-
-		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_iris intel
-		vulkan_enable video_cards_radeonsi amd
-	fi
-
-	# Disable glx tls support on musl
-	if use elibc_musl; then
-		emesonargs+=( -Delf-tls=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=$(usex X dri disabled)
-		-Dglvnd=true
-		-Dshared-glapi=true
-		$(meson_use dri3)
-		$(meson_use egl)
-		$(meson_use gbm)
-		$(meson_use gles1)
-		$(meson_use gles2)
-		$(meson_use selinux)
-		$(meson_use zstd)
-		-Dvalgrind=$(usex valgrind auto false)
-		-Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
-		-Dgallium-drivers=$(driver_list "${GALLIUM_DRIVERS[*]}")
-		-Dvulkan-drivers=$(driver_list "${VULKAN_DRIVERS[*]}")
-		$(meson_use vulkan vulkan-device-select-layer)
-		$(meson_use vulkan-overlay vulkan-overlay-layer)
-		--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 test -v -C "${BUILD_DIR}" -t 100 || die "tests failed"
-}
-
-# $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-20.3.5.ebuild b/media-libs/mesa/mesa-21.0.3.ebuild
similarity index 97%
rename from media-libs/mesa/mesa-20.3.5.ebuild
rename to media-libs/mesa/mesa-21.0.3.ebuild
index 469b19e..fdca704 100644
--- a/media-libs/mesa/mesa-20.3.5.ebuild
+++ b/media-libs/mesa/mesa-21.0.3.ebuild
@@ -43,6 +43,7 @@ REQUIRED_USE="
 	d3d9?   ( dri3 || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
 	gles1?  ( egl )
 	gles2?  ( egl )
+	osmesa? ( gallium )
 	vulkan? ( dri3
 			  video_cards_radeonsi? ( llvm ) )
 	vulkan-overlay? ( vulkan )
@@ -104,7 +105,7 @@ RDEPEND="
 	)
 	selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
 	wayland? (
-		>=dev-libs/wayland-1.15.0:=[${MULTILIB_USEDEP}]
+		>=dev-libs/wayland-1.18.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}]
@@ -116,7 +117,6 @@ RDEPEND="
 	X? (
 		>=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}]
@@ -225,6 +225,7 @@ BDEPEND="
 	sys-devel/flex
 	virtual/pkgconfig
 	$(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
+	wayland? ( dev-util/wayland-scanner[${MULTILIB_USEDEP}] )
 "
 
 S="${WORKDIR}/${MY_P}"
@@ -241,8 +242,7 @@ x86? (
 )"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-20.2.0-add-disable-tls-support.patch
-	"${FILESDIR}"/${PN}-20.3.4-missing-git_sha1.patch
+	"${FILESDIR}"/${PN}-21.0.3-add-disable-tls-support.patch
 )
 
 llvm_check_deps() {
@@ -321,6 +321,10 @@ pkg_pretend() {
 	if ! use llvm; then
 		use opencl     && ewarn "Ignoring USE=opencl     since USE does not contain llvm"
 	fi
+
+	if use osmesa && ! use llvm; then
+		ewarn "OSMesa will be slow without enabling USE=llvm"
+	fi
 }
 
 python_check_deps() {
@@ -455,6 +459,7 @@ multilib_src_configure() {
 			gallium_enable -- kmsro
 		fi
 
+		gallium_enable -- swrast
 		gallium_enable video_cards_lima lima
 		gallium_enable video_cards_panfrost panfrost
 		gallium_enable video_cards_v3d v3d
@@ -499,14 +504,6 @@ multilib_src_configure() {
 		vulkan_enable video_cards_v3d broadcom
 	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'/,}"
@@ -521,6 +518,7 @@ multilib_src_configure() {
 		$(meson_feature gbm)
 		$(meson_feature gles1)
 		$(meson_feature gles2)
+		$(meson_use osmesa)
 		$(meson_use selinux)
 		$(meson_feature zstd)
 		-Dvalgrind=$(usex valgrind auto false)


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2022-01-21  3:51 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2022-01-21  3:51 UTC (permalink / raw
  To: gentoo-commits

commit:     35fa4d2f59a272a53e02f54b6c962217d8d67554
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 21 03:50:56 2022 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Fri Jan 21 03:50:56 2022 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=35fa4d2f

media-libs/mesa: backport patches for non glibc users

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 media-libs/mesa/Manifest                           |   2 +-
 .../mesa-21.1.4-add-disable-tls-support.patch      |  42 -------
 media-libs/mesa/files/mesa-tls-2.patch             |  60 +++++++++
 media-libs/mesa/files/mesa-tls.patch               | 134 +++++++++++++++++++++
 .../{mesa-21.2.6.ebuild => mesa-21.3.4.ebuild}     |  30 ++---
 media-libs/mesa/metadata.xml                       |   2 -
 6 files changed, 204 insertions(+), 66 deletions(-)

diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 9cc0fbb3..6fdb1557 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1 +1 @@
-DIST mesa-21.2.6.tar.xz 15868208 BLAKE2B aaa6447a2f5a472c2ee2b7d6b12effb79d02804684358fd233aa00bda945c66efa3850931cd9114c51ddd492033b9f66372380395540a11fe40229edfe7ee125 SHA512 e65d77e2609cba85bd2cdbd4ba2072729c1556a43defdd24a91e708e3223f84b23657e63a91b16c5729684ea12fe31f45bae88294c572e057f2981a5d6c0f5a0
+DIST mesa-21.3.4.tar.xz 16497248 BLAKE2B 3fe2543bb6286a0d84a247785dbb4b5dd6df905eab748a89854589008d9db5aae6c52e473c58cff8d03694d46d3ce2a2680fddc8c978f898dc9bcdec02ca9b6b SHA512 7aeea3dba0d39f4ac9f23c54aa0e6853d48000f50c4dd484618c28debe705cdd765ae8fafb5ddea0773976f7189849d9128be3f2282fea74394b59019cb786b9

diff --git a/media-libs/mesa/files/mesa-21.1.4-add-disable-tls-support.patch b/media-libs/mesa/files/mesa-21.1.4-add-disable-tls-support.patch
deleted file mode 100644
index 8e7089c9..00000000
--- a/media-libs/mesa/files/mesa-21.1.4-add-disable-tls-support.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From a9b290ecff1ed3fdfd95bae551ce47dea8fa13fb Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Tue, 6 Jul 2021 07:54:09 -0500
-Subject: [PATCH] Add disable glx support for musl
-
----
- meson.build       | 4 +++-
- meson_options.txt | 6 ++++++
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index e1e94e7..b355f94 100644
---- a/meson.build
-+++ b/meson.build
-@@ -447,7 +447,9 @@ endif
- 
- # Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
- use_elf_tls = false
--if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
-+with_use_elf_tls = get_option('use-elf-tls')
-+if with_use_elf_tls and
-+    (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
-     (not with_platform_android or get_option('platform-sdk-version') >= 29) and
-     (not with_platform_windows or not with_shared_glapi))
-   pre_args += '-DUSE_ELF_TLS'
-diff --git a/meson_options.txt b/meson_options.txt
-index a7030ab..73bd28e 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -465,3 +465,9 @@ option(
-   value : true,
-   description : 'use msse2 flag for mingw x86. Default: true',
- )
-+option(
-+  'use-elf-tls',
-+  type : 'boolean',
-+  value : false,
-+  description : 'Build support for initial-exec TLS model'
-+)
--- 
-2.31.1
-

diff --git a/media-libs/mesa/files/mesa-tls-2.patch b/media-libs/mesa/files/mesa-tls-2.patch
new file mode 100644
index 00000000..c849e27d
--- /dev/null
+++ b/media-libs/mesa/files/mesa-tls-2.patch
@@ -0,0 +1,60 @@
+From 60d95c5d0feef4e4b2820a26c4708aff10f5730d Mon Sep 17 00:00:00 2001
+From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
+Date: Thu, 2 Sep 2021 12:19:53 -0400
+Subject: [PATCH] Auto-enable TLSDESC support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+TLSDESC speeds up access to dynamic TLS. This is especially important
+for non-glibc targets, but is also helpful for non-initial-exec TLS
+variables.
+
+The entry asm does not support TLSDESC, but it only accesses
+initial-exec symbols, so it is not necessary to handle that separately.
+
+Acked-by: Tapani Pälli <tapani.palli@intel.com>
+Acked-by: Jesse Natalie <jenatali@microsoft.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12722>
+---
+ meson.build | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index a7ace23677c..29f0c3f3912 100644
+--- a/meson.build
++++ b/meson.build
+@@ -520,6 +520,30 @@ if not with_platform_windows or not with_shared_glapi
+     c_args += '-fno-emulated-tls'
+     cpp_args += '-fno-emulated-tls'
+   endif
++
++  # -mtls-dialect=gnu2 speeds up non-initial-exec TLS significantly but requires
++  # full toolchain (including libc) support.
++  have_mtls_dialect = false
++  foreach c_arg : get_option('c_args')
++    if c_arg.startswith('-mtls-dialect=')
++      have_mtls_dialect = true
++      break
++    endif
++  endforeach
++  if not have_mtls_dialect
++    # need .run to check libc support. meson aborts when calling .run when
++    # cross-compiling, but because this is just an optimization we can skip it
++    if meson.is_cross_build()
++      warning('cannot auto-detect -mtls-dialect when cross-compiling, using compiler default')
++    else
++      # -fpic to force dynamic tls, otherwise TLS relaxation defeats check
++      gnu2_test = cc.run('int __thread x; int main() { return x; }', args: ['-mtls-dialect=gnu2', '-fpic'], name: '-mtls-dialect=gnu2')
++      if gnu2_test.returncode() == 0
++        c_args += '-mtls-dialect=gnu2'
++        cpp_args += '-mtls-dialect=gnu2'
++      endif
++    endif
++  endif
+ endif
+ 
+ if with_glx != 'disabled'
+-- 
+GitLab
+

diff --git a/media-libs/mesa/files/mesa-tls.patch b/media-libs/mesa/files/mesa-tls.patch
new file mode 100644
index 00000000..f445c934
--- /dev/null
+++ b/media-libs/mesa/files/mesa-tls.patch
@@ -0,0 +1,134 @@
+From 8570a2a280587a1e43ac11ad46ad62dfdd6c7b39 Mon Sep 17 00:00:00 2001
+From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
+Date: Thu, 2 Sep 2021 11:58:32 -0400
+Subject: [PATCH] Use initial-exec TLS for glibc only, enable TLS elsewhere
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It is not portable to use initial-exec TLS in dlopened libraries. glibc
+and FreeBSD allocate extra memory for extra initial-exec variables
+specifically for libGL, but other libcs including musl do not.
+
+Keep initial-exec disabled on FreeBSD since it is apparently broken for
+some reason:
+
+https://gitlab.freedesktop.org/mesa/mesa/-/issues/966#note_394512
+https://github.com/jbeich/mesa/commit/81dbdb15d55054242eded0eb2f32621d583c1aaf
+
+Enable TLS on OpenBSD and Haiku based on the u_thread.h comment that
+emutls is better than pthread_getspecific, which seems plausible given
+that emutls has strictly more information to work with.
+
+Fixes #966.
+
+Acked-by: Tapani Pälli <tapani.palli@intel.com>
+Acked-by: Jesse Natalie <jenatali@microsoft.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12722>
+---
+ meson.build         |  7 ++-----
+ src/mapi/entry.c    | 28 ++++++++++++++--------------
+ src/util/u_thread.h | 16 ++++++----------
+ 3 files changed, 22 insertions(+), 29 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index cf2b5f4b939..a7ace23677c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -508,15 +508,12 @@ foreach platform : _platforms
+   pre_args += '-DHAVE_@0@_PLATFORM'.format(platform.to_upper())
+ endforeach
+ 
+-# Android uses emutls for versions <= P/28. For USE_ELF_TLS we need ELF TLS.
+ use_elf_tls = false
+-if (not ['freebsd', 'openbsd', 'haiku'].contains(host_machine.system()) and
+-    (not with_platform_android or get_option('platform-sdk-version') >= 29) and
+-    (not with_platform_windows or not with_shared_glapi))
++if not with_platform_windows or not with_shared_glapi
+   pre_args += '-DUSE_ELF_TLS'
+   use_elf_tls = true
+ 
+-  if with_platform_android
++  if with_platform_android and get_option('platform-sdk-version') >= 29
+     # By default the NDK compiler, at least, emits emutls references instead of
+     # ELF TLS, even when building targeting newer API levels.  Make it actually do
+     # ELF TLS instead.
+diff --git a/src/mapi/entry.c b/src/mapi/entry.c
+index 7ff3c8f8c8c..b120eae31a1 100644
+--- a/src/mapi/entry.c
++++ b/src/mapi/entry.c
+@@ -31,6 +31,7 @@
+ #include "entry.h"
+ #include "u_current.h"
+ #include "util/u_endian.h"
++#include "util/u_thread.h"
+ 
+ #define _U_STRINGIFY(x) #x
+ #define U_STRINGIFY(x) _U_STRINGIFY(x)
+@@ -45,20 +46,19 @@
+ #define ENTRY_CURRENT_TABLE_GET U_STRINGIFY(u_current_get_table_internal)
+ #endif
+ 
+-#if defined(USE_X86_ASM) && defined(__GNUC__)
+-#   ifdef USE_ELF_TLS
+-#      include "entry_x86_tls.h"
+-#   else                 
+-#      include "entry_x86_tsd.h"
+-#   endif
+-#elif defined(USE_X86_64_ASM) && defined(__GNUC__) && defined(USE_ELF_TLS)
+-#   include "entry_x86-64_tls.h"
+-#elif defined(USE_PPC64LE_ASM) && defined(__GNUC__) && UTIL_ARCH_LITTLE_ENDIAN
+-#   ifdef USE_ELF_TLS
+-#      include "entry_ppc64le_tls.h"
+-#   else
+-#      include "entry_ppc64le_tsd.h"
+-#   endif
++/* REALLY_INITIAL_EXEC implies USE_ELF_TLS and __GNUC__ */
++/* Use TSD stubs for non-IE ELF TLS even though first access is slower because
++ * future accesses will be patched */
++#if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC)
++#include "entry_x86_tls.h"
++#elif defined(USE_X86_ASM) && !defined(GLX_X86_READONLY_TEXT) && defined(__GNUC__)
++#include "entry_x86_tsd.h"
++#elif defined(USE_X86_64_ASM) && defined(REALLY_INITIAL_EXEC)
++#include "entry_x86-64_tls.h"
++#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(REALLY_INITIAL_EXEC)
++#include "entry_ppc64le_tls.h"
++#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(__GNUC__)
++#include "entry_ppc64le_tsd.h"
+ #else
+ 
+ static inline const struct _glapi_table *
+diff --git a/src/util/u_thread.h b/src/util/u_thread.h
+index 0fb474f32ba..a4215452d35 100644
+--- a/src/util/u_thread.h
++++ b/src/util/u_thread.h
+@@ -75,19 +75,15 @@
+  * still want to use normal TLS (which involves a function call, but not the
+  * expensive pthread_getspecific() or its equivalent).
+  */
++#ifdef USE_ELF_TLS
+ #ifdef _MSC_VER
+ #define __THREAD_INITIAL_EXEC __declspec(thread)
+-#elif defined(ANDROID)
+-/* Android 29 gained ELF TLS support, but it doesn't support initial-exec and
+- * it will throw:
+- *
+- *     dlopen failed: TLS symbol "(null)" in dlopened
+- *     "/vendor/lib64/egl/libEGL_mesa.so" referenced from
+- *     "/vendor/lib64/egl/libEGL_mesa.so" using IE access model.
+- */
+-#define __THREAD_INITIAL_EXEC __thread
+-#else
++#elif defined(__GLIBC__)
+ #define __THREAD_INITIAL_EXEC __thread __attribute__((tls_model("initial-exec")))
++#define REALLY_INITIAL_EXEC
++#else
++#define __THREAD_INITIAL_EXEC __thread
++#endif
+ #endif
+ 
+ static inline int
+-- 
+GitLab
+

diff --git a/media-libs/mesa/mesa-21.2.6.ebuild b/media-libs/mesa/mesa-21.3.4.ebuild
similarity index 96%
rename from media-libs/mesa/mesa-21.2.6.ebuild
rename to media-libs/mesa/mesa-21.3.4.ebuild
index dfa0eb93..ec0dad18 100644
--- a/media-libs/mesa/mesa-21.2.6.ebuild
+++ b/media-libs/mesa/mesa-21.3.4.ebuild
@@ -17,7 +17,7 @@ if [[ ${PV} == 9999 ]]; then
 	inherit git-r3
 else
 	SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
-	KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 x86"
+	KEYWORDS="amd64 arm arm64 ~mips ~ppc ~ppc64 x86"
 fi
 
 LICENSE="MIT"
@@ -33,18 +33,15 @@ for card in ${VIDEO_CARDS}; do
 done
 
 IUSE="${IUSE_VIDEO_CARDS}
-	+classic cpu_flags_x86_sse2 d3d9 debug +egl +gallium +gbm gles1 +gles2 +llvm
+	+classic cpu_flags_x86_sse2 d3d9 debug +gallium gles1 +gles2 +llvm
 	lm-sensors opencl osmesa selinux test unwind vaapi valgrind vdpau vulkan
 	vulkan-overlay wayland +X xa xvmc zink +zstd"
 
 REQUIRED_USE="
 	d3d9?   ( || ( video_cards_iris video_cards_r300 video_cards_r600 video_cards_radeonsi video_cards_nouveau video_cards_vmware ) )
-	gles1?  ( egl )
-	gles2?  ( egl )
 	osmesa? ( gallium )
 	vulkan? ( video_cards_radeonsi? ( llvm ) )
 	vulkan-overlay? ( vulkan )
-	wayland? ( egl gbm )
 	video_cards_crocus? ( gallium )
 	video_cards_freedreno?  ( gallium )
 	video_cards_intel?  ( classic )
@@ -64,7 +61,7 @@ REQUIRED_USE="
 	video_cards_v3d? ( gallium )
 	video_cards_vc4? ( gallium )
 	video_cards_virgl? ( gallium )
-	video_cards_vivante? ( gallium gbm )
+	video_cards_vivante? ( gallium )
 	video_cards_vmware? ( gallium )
 	xa? ( X )
 	xvmc? ( X )
@@ -224,7 +221,7 @@ BDEPEND="
 	sys-devel/flex
 	virtual/pkgconfig
 	$(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
-	wayland? ( dev-util/wayland-scanner[${MULTILIB_USEDEP}] )
+	wayland? ( dev-util/wayland-scanner )
 "
 
 S="${WORKDIR}/${MY_P}"
@@ -241,7 +238,8 @@ x86? (
 )"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-21.1.4-add-disable-tls-support.patch
+	"${FILESDIR}"/mesa-tls.patch
+	"${FILESDIR}"/mesa-tls-2.patch
 )
 
 llvm_check_deps() {
@@ -388,17 +386,6 @@ multilib_src_configure() {
 	use wayland && platforms+=",wayland"
 	emesonargs+=(-Dplatforms=${platforms#,})
 
-	if use X || use egl; then
-		emesonargs+=(-Dglvnd=true)
-	else
-		emesonargs+=(-Dglvnd=false)
-	fi
-
-	# Disable glx tls support on musl
-	if use elibc_musl; then
-		emesonargs+=( -Duse-elf-tls=false )
-	fi
-
 	if use gallium; then
 		emesonargs+=(
 			$(meson_feature llvm)
@@ -521,8 +508,9 @@ multilib_src_configure() {
 		-Dglx=$(usex X dri disabled)
 		-Dshared-glapi=enabled
 		-Ddri3=enabled
-		$(meson_feature egl)
-		$(meson_feature gbm)
+		-Degl=true
+		-Dgbm=true
+		-Dglvnd=true
 		$(meson_feature gles1)
 		$(meson_feature gles2)
 		$(meson_use osmesa)

diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml
index 2b18aba1..b181eed2 100644
--- a/media-libs/mesa/metadata.xml
+++ b/media-libs/mesa/metadata.xml
@@ -8,9 +8,7 @@
 	<use>
 		<flag name="classic">Build drivers based on the classic architecture.</flag>
 		<flag name="d3d9">Enable Direct 3D9 API through Nine state tracker. Can be used together with patched wine.</flag>
-		<flag name="egl">Enable EGL support.</flag>
 		<flag name="gallium">Build drivers based on Gallium3D, the new architecture for 3D graphics drivers.</flag>
-		<flag name="gbm">Enable the Graphics Buffer Manager for EGL on KMS.</flag>
 		<flag name="gles1">Enable GLESv1 support.</flag>
 		<flag name="gles2">Enable GLESv2 support.</flag>
 		<flag name="llvm">Enable LLVM backend for Gallium3D.</flag>


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/
@ 2022-01-29  1:54 Jory Pratt
  0 siblings, 0 replies; 18+ messages in thread
From: Jory Pratt @ 2022-01-29  1:54 UTC (permalink / raw
  To: gentoo-commits

commit:     33f9ed07de27dc089a336b3bffbb80dd86e61615
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 29 01:54:24 2022 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Sat Jan 29 01:54:24 2022 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=33f9ed07

media-libs/mesa: Fix build for x86 users

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 .../files/mesa-tls-3-fix-non-initial-exec.patch    | 122 +++++++++++++++++++++
 media-libs/mesa/mesa-21.3.4.ebuild                 |   1 +
 2 files changed, 123 insertions(+)

diff --git a/media-libs/mesa/files/mesa-tls-3-fix-non-initial-exec.patch b/media-libs/mesa/files/mesa-tls-3-fix-non-initial-exec.patch
new file mode 100644
index 00000000..4ae45ca0
--- /dev/null
+++ b/media-libs/mesa/files/mesa-tls-3-fix-non-initial-exec.patch
@@ -0,0 +1,122 @@
+From 3aab34171d464f907ed4488ab87c48270381ecde Mon Sep 17 00:00:00 2001
+From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
+Date: Tue, 23 Nov 2021 15:24:38 -0500
+Subject: [PATCH] Fix TSD stubs for non-initial-exec case (fixes #5667).
+
+ppc64le TSD disabled for now since I am insufficiently familiar with ppc
+asm. x86 pthread stubs deleted because adding USE_ELF_TLS to the #if is
+isn't worth the effort since it only saves a single function call on
+initial entry (TSD stubs are not used for read-only text now). also
+potentially fix non-pthread TSD builds (_glapi_Dispatch was undefined),
+but untested (could still be broken).
+
+Tested-by: Jesse Natalie <jenatali@microsoft.com>
+Tested-by: Jan Beich <jbeich@freebsd.org>
+Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13935>
+---
+ src/mapi/entry.c                 |  5 ++---
+ src/mapi/entry_x86_tsd.h         |  2 +-
+ src/mapi/glapi/gen/gl_x86_asm.py | 28 +++-------------------------
+ 3 files changed, 6 insertions(+), 29 deletions(-)
+
+diff --git a/src/mapi/entry.c b/src/mapi/entry.c
+index b120eae31a1..5ebd85011c6 100644
+--- a/src/mapi/entry.c
++++ b/src/mapi/entry.c
+@@ -47,8 +47,6 @@
+ #endif
+ 
+ /* REALLY_INITIAL_EXEC implies USE_ELF_TLS and __GNUC__ */
+-/* Use TSD stubs for non-IE ELF TLS even though first access is slower because
+- * future accesses will be patched */
+ #if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC)
+ #include "entry_x86_tls.h"
+ #elif defined(USE_X86_ASM) && !defined(GLX_X86_READONLY_TEXT) && defined(__GNUC__)
+@@ -57,7 +55,8 @@
+ #include "entry_x86-64_tls.h"
+ #elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(REALLY_INITIAL_EXEC)
+ #include "entry_ppc64le_tls.h"
+-#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && defined(__GNUC__)
++/* ppc64le non-IE TSD stubs are possible but not currently implemented */
++#elif defined(USE_PPC64LE_ASM) && UTIL_ARCH_LITTLE_ENDIAN && !defined(USE_ELF_TLS) && defined(__GNUC__)
+ #include "entry_ppc64le_tsd.h"
+ #else
+ 
+diff --git a/src/mapi/entry_x86_tsd.h b/src/mapi/entry_x86_tsd.h
+index f5d9c41253f..2aa724a70f3 100644
+--- a/src/mapi/entry_x86_tsd.h
++++ b/src/mapi/entry_x86_tsd.h
+@@ -69,7 +69,7 @@ __asm__(".balign 32\n"
+    "popl %ecx\n\t"                  \
+    "addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx\n\t" \
+    LOC_END_SET_ECX                                \
+-   "movl " ENTRY_CURRENT_TABLE "@GOT(%ecx), %eax\n\t" \
++   "movl _glapi_Dispatch@GOT(%ecx), %eax\n\t" \
+    "mov (%eax), %eax\n\t"           \
+    "testl %eax, %eax\n\t"           \
+    "jne 1f\n\t"                     \
+diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py
+index 4b10db37d7f..057aa54ba3f 100644
+--- a/src/mapi/glapi/gen/gl_x86_asm.py
++++ b/src/mapi/glapi/gen/gl_x86_asm.py
+@@ -70,7 +70,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
+         print('#endif')
+         print('')
+         print('')
+-        print('#ifdef USE_ELF_TLS')
++        print('#ifdef REALLY_INITIAL_EXEC')
+         print('')
+         print('#ifdef GLX_X86_READONLY_TEXT')
+         print('# define CTX_INSNS MOV_L(GS:(EAX), EAX)')
+@@ -86,17 +86,6 @@ class PrintGenericStubs(gl_XML.gl_print_base):
+         print('\tCTX_INSNS ;					\\')
+         print('\tJMP(GL_OFFSET(off))')
+         print('')
+-        print('#elif defined(HAVE_PTHREAD)')
+-        print('#  define GL_STUB(fn,off,fn_alt)\t\t\t\\')
+-        print('ALIGNTEXT16;\t\t\t\t\t\t\\')
+-        print('GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\')
+-        print('GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\')
+-        print('\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\')
+-        print('\tTEST_L(EAX, EAX) ;\t\t\t\t\\')
+-        print('\tJE(1f) ;\t\t\t\t\t\\')
+-        print('\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\')
+-        print('1:\tCALL(_x86_get_dispatch) ;\t\t\t\\')
+-        print('\tJMP(GL_OFFSET(off))')
+         print('#else')
+         print('#  define GL_STUB(fn,off,fn_alt)\t\t\t\\')
+         print('ALIGNTEXT16;\t\t\t\t\t\t\\')
+@@ -121,7 +110,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
+         print('')
+         print('SEG_TEXT')
+         print('')
+-        print('#ifdef USE_ELF_TLS')
++        print('#ifdef REALLY_INITIAL_EXEC')
+         print('')
+         print('\tGLOBL\tGLNAME(_x86_get_dispatch)')
+         print('\tHIDDEN(GLNAME(_x86_get_dispatch))')
+@@ -133,19 +122,8 @@ class PrintGenericStubs(gl_XML.gl_print_base):
+         print('\tmovl	_glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax')
+         print('\tret')
+         print('')
+-        print('#elif defined(HAVE_PTHREAD)')
+-        print('EXTERN GLNAME(_glapi_Dispatch)')
+-        print('EXTERN GLNAME(_gl_DispatchTSD)')
+-        print('EXTERN GLNAME(pthread_getspecific)')
+-        print('')
+-        print('ALIGNTEXT16')
+-        print('GLNAME(_x86_get_dispatch):')
+-        print('\tSUB_L(CONST(24), ESP)')
+-        print('\tPUSH_L(GLNAME(_gl_DispatchTSD))')
+-        print('\tCALL(GLNAME(pthread_getspecific))')
+-        print('\tADD_L(CONST(28), ESP)')
+-        print('\tRET')
+         print('#else')
++        print('EXTERN GLNAME(_glapi_Dispatch)')
+         print('EXTERN GLNAME(_glapi_get_dispatch)')
+         print('#endif')
+         print('')
+-- 
+GitLab
+

diff --git a/media-libs/mesa/mesa-21.3.4.ebuild b/media-libs/mesa/mesa-21.3.4.ebuild
index ec0dad18..f9fd08f6 100644
--- a/media-libs/mesa/mesa-21.3.4.ebuild
+++ b/media-libs/mesa/mesa-21.3.4.ebuild
@@ -240,6 +240,7 @@ x86? (
 PATCHES=(
 	"${FILESDIR}"/mesa-tls.patch
 	"${FILESDIR}"/mesa-tls-2.patch
+	"${FILESDIR}"/mesa-tls-3-fix-non-initial-exec.patch
 )
 
 llvm_check_deps() {


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-01-29  1:54 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08  3:07 [gentoo-commits] proj/musl:master commit in: media-libs/mesa/, media-libs/mesa/files/ Jory Pratt
  -- strict thread matches above, loose matches on Subject: below --
2022-01-29  1:54 Jory Pratt
2022-01-21  3:51 Jory Pratt
2021-06-07 13:22 Jory Pratt
2021-03-10 15:19 Jory Pratt
2020-09-04 22:03 Jory Pratt
2020-04-14 12:40 Jory Pratt
2019-10-20 22:10 Jory Pratt
2019-08-22 19:57 Jory Pratt
2019-08-22  3:05 Jory Pratt
2019-03-27  1:29 Anthony G. Basile
2019-03-14 23:29 Jory Pratt
2018-07-08  9:01 Jory Pratt
2018-04-22 21:59 Aric Belsito
2017-12-11 21:03 Aric Belsito
2017-03-20 21:37 Aric Belsito
2017-03-19 20:35 Aric Belsito
2015-07-15 15:01 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox