diff options
author | Nicholas Fish <gentoo@seaofdirac.net> | 2018-06-03 18:30:38 +0200 |
---|---|---|
committer | Nicholas Fish <gentoo@seaofdirac.net> | 2018-06-03 18:30:38 +0200 |
commit | 8193df3f2abb7796d9fd3c77ee744df66b09835c (patch) | |
tree | bb25a2ab45fa4cad6f2e457f967655991600e920 /media-libs/mesa | |
parent | dev-qt/qtnetwork: add LibreSSL compatible qtnetwork-5.11.x (diff) | |
download | ennui-8193df3f2abb7796d9fd3c77ee744df66b09835c.tar.gz ennui-8193df3f2abb7796d9fd3c77ee744df66b09835c.tar.bz2 ennui-8193df3f2abb7796d9fd3c77ee744df66b09835c.zip |
media-libs/mesa: add 18.1.0, stop building EGL libs moved to Wayland
Diffstat (limited to 'media-libs/mesa')
-rw-r--r-- | media-libs/mesa/Manifest | 9 | ||||
-rw-r--r-- | media-libs/mesa/files/mesa-17-musl-string_h.patch | 63 | ||||
-rw-r--r-- | media-libs/mesa/files/mesa-17-musl_endian.patch | 12 | ||||
-rw-r--r-- | media-libs/mesa/files/mesa-18-intel-missing-time_t.patch | 11 | ||||
-rw-r--r-- | media-libs/mesa/files/mesa-18-musl-pthread.patch | 11 | ||||
-rw-r--r-- | media-libs/mesa/mesa-18.1.0.ebuild | 594 | ||||
-rw-r--r-- | media-libs/mesa/mesa-9999.ebuild | 6 |
7 files changed, 687 insertions, 19 deletions
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest index cc7d6c1..a3cbfdd 100644 --- a/media-libs/mesa/Manifest +++ b/media-libs/mesa/Manifest @@ -1,7 +1,10 @@ AUX eselect-mesa.conf.9.2 1630 BLAKE2B 6c67ef9b5dc94f2f26378c004a459680b05084900a9199107a23f9c55514b59438265bce9ca207b05e2d20c3aa43e475d3f228c283dc965402c962a4cd0b6ebf SHA512 0fa9a23b4fba10599268266a82c7fa8dc5bfa1a0d565732875064c381dc4ff40c23faddb02b5849b1522eb9b7fd2ec2a0fac14406442a4aa0afa44bf760b42b5 AUX mesa-17-musl-invocation_name.patch 2200 BLAKE2B a3caf41314e2526d2b7f299ed93f19e8b6c57e68a59b8af0c2ea48086dc642ddde8c1eba9f33476f4b9b790f19ea0ca341599c27ff94818a4edc596bf4c151a9 SHA512 3a22dca8e6bf29a2db81ffa17ce95ad86f5d7425006d25606e465a829691cee3d723bc9dcd20c958a035fe0c9460498b975f66aa2ddbedfa196a4ae67e764c09 -AUX mesa-17-musl_endian.patch 463 BLAKE2B cc768590fc4e63680c05ab3b08ad88c31d58459ae51b301f347138222e4a66f3488189441870daf2bc9874cfbe31063905ce8da7b693051cb7a3cc73c3c3da34 SHA512 7305c4c49e8268727f2505d1879edb8e214c68eebbfd5889e7c743b60eb9ba82e9b24b267c380ddcd993dcc2339d5d4551b0768801bdcc416f74730970a1d9ba +AUX mesa-17-musl-string_h.patch 2476 BLAKE2B 49981ba73960c81e830c59390ed1bd143b7a0bd9aabd27902440052c4a71da667f210a465dd7e44b3e1dabbfe7c243b2fd70eaf0c0bfa42efe89fe2ae438f3f8 SHA512 a4b9de000d3bccace9cab0d9ef623684b0d95cf8eb0a475ea436ad9110a9a47e32845a9de86c194b8f2c657b4a36274ddf993270a9475824e5b66d751beda9bf AUX mesa-18-execinfo.patch 2583 BLAKE2B 1c4d091cca06c8d282458c154d25d1f69f831b6d6bee06df8b220520a68188fcdd72603ea121e833e509f24aa175f00c5e229bd65ee769ab9d7418baa3d4cb8d SHA512 7c4e5488d0596968384aff1e44ac651d1fd87605cbdaceddcf7caaf287fee102deccec32c50846689d9dbdd3a807cb9f38bc2b5a6dfae6991abb1c082659d95b +AUX mesa-18-intel-missing-time_t.patch 475 BLAKE2B e8378aafc5ace88e03b425309dda7c6c72564c1fa854977387d4924d3d7768fccef3c56a63fd2a6e286e1076446526f6f224c12c424cb8351c9f4de444f1df72 SHA512 1d2a200388977087320c6018dfb2514ccf73366cb76ee646646ede83ec8e8f8a741d8fdf99ebd987e3d03a5ace543067d293b7a15a6fed11738b8c5a06a764c3 AUX mesa-18-musl-increase-pthread-stack-size.patch 929 BLAKE2B b4bb448cdaaddcb8d91cfbcacf6c27792aa6c5beba732933d7324f9a060b3f8b2a6800bc5c0ae1c7422ddbfe6389f89174aca81c4a5dd1f219ebdedcde25800c SHA512 c1dcdb7be316114aa2114b8923ad88f17050fbaee906d7e5976e3b8cd5c2b333a48dfc851e4342e9587b14cb62d9c6088dbab1e094b4ba77cc72dd3ad71a90e7 -AUX mesa-18-musl-pthread.patch 1920 BLAKE2B 6900ecf2ada8ff339c01cddb97a235f8c6d251fe213325b1b05bf5a2a746b06581d6d5491fb23982e12a3459434e5ab6a13a4a587157b9270b4b050b9690b0c9 SHA512 8696af0b7591b0a2cb05cfed5aeb216b97e599e618036a8451755632fdf0e3548c2bcbe944f97f7891f954b5fe834572af348f79dd1e51453aa140c733e5e121 -EBUILD mesa-9999.ebuild 15409 BLAKE2B e968fc2fb1a5315662d762327737e36dc0456caa322ef0a6110cb85b017b26edd52a21409857577b4741bc7f9bf5ebab9ecee0204c8649021425d1f3f98c9d70 SHA512 ede215a0a17a2c773ee535fab811e9c7fd4e422e28e993d8c9c40fa546a9d9428ac83aaea63a4d4fede9708a4db08b6fdee54dfcebe5605f44ba4b37d854d03c +AUX mesa-18-musl-pthread.patch 2404 BLAKE2B 8c1207116d407b0739145271c353be513b279a4ea4ccdb70c85e1a45e156cc1d3a1b0fecae92d05333bdf5fb845927e3bcef718a73a92d0119445c5f8f59f744 SHA512 7c80b0cf70ea0dbcec85371de6db634e02321042fc80983ad61a75896c4fea1f88fe891993f181932d00b2f8474acc389530aeccf7e2ee48319c555bfb3c2331 +DIST mesa-18.1.0.tar.xz 11118776 BLAKE2B 0da5486e96596b3f919f15d2db9cd12de825811a0f2222bb76859bb7d275914dda0cc19a518b269fa0745d52982b92d5d645b6da639a870709193db721262658 SHA512 8b26af2df8b94373cbc339521974cd568c1d4ff4204986ee7b439e4cf3ebe14d822ea081a7769b68eca9263b7bc6dbca01836b8bb0d6495d2e2614c4e3d601ad +EBUILD mesa-18.1.0.ebuild 15383 BLAKE2B af0f53d38e07d15531979bd02cca4911e72bfb394e13179aacf0cb6087965696b97424b40021f2760a817f0c09070c1eb986b01bb7d646669c16e0f2223c9431 SHA512 d8d5a5abb815a8fdd0b87fc35ceb2400a53769c7fa0ae138b78a9d329fdb0b8b4dcd576fc03e5a8241ce8d73fa514ded8c32c4c71aae931443820a26274e0a95 +EBUILD mesa-9999.ebuild 15272 BLAKE2B 28c04dfab46118d90bcbd711478efe61e18466a89fe2d9e9f0a9eeaae24813184ae557f22611696ac90e95d42c4967b31845860b61e7b4a290cf6ee2f7544510 SHA512 373ae8c1926e2e92ec47006ab8eb8e0949b00f0763025cfcc9213f103969d69e036c63b6f724a9de8f4b0b91b63e670196fe0887183e8c1802ea365cb240dba3 diff --git a/media-libs/mesa/files/mesa-17-musl-string_h.patch b/media-libs/mesa/files/mesa-17-musl-string_h.patch new file mode 100644 index 0000000..f3ec9e9 --- /dev/null +++ b/media-libs/mesa/files/mesa-17-musl-string_h.patch @@ -0,0 +1,63 @@ +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-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-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/files/mesa-18-musl-pthread.patch b/media-libs/mesa/files/mesa-18-musl-pthread.patch index 2db1667..344cc22 100644 --- a/media-libs/mesa/files/mesa-18-musl-pthread.patch +++ b/media-libs/mesa/files/mesa-18-musl-pthread.patch @@ -38,3 +38,14 @@ diff -Naur mesa-18.0.0-rc2.orig/src/util/u_thread.h mesa-18.0.0-rc2/src/util/u_t return pthread_equal(pthread_self(), thread); # endif #endif +diff -u mesa-18.1.0/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h{.orig,} +--- mesa-18.1.0/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h.orig 2018-05-21 12:18:17.572276918 +0200 ++++ mesa-18.1.0/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h 2018-05-21 12:18:27.223270274 +0200 +@@ -28,6 +28,7 @@ + #ifndef RADV_AMDGPU_WINSYS_H + #define RADV_AMDGPU_WINSYS_H + ++#include <pthread.h> + #include "radv_radeon_winsys.h" + #include "ac_gpu_info.h" + #include "addrlib/addrinterface.h" diff --git a/media-libs/mesa/mesa-18.1.0.ebuild b/media-libs/mesa/mesa-18.1.0.ebuild new file mode 100644 index 0000000..14fb865 --- /dev/null +++ b/media-libs/mesa/mesa-18.1.0.ebuild @@ -0,0 +1,594 @@ +# Copyright 1999-2018 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.91" +# 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.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}] + ) + openmax? ( + >=media-libs/libomxil-bellagio-0.9.3:=[${MULTILIB_USEDEP}] + x11-misc/xdg-utils + ) + 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: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-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() { + [[ ${PV} == 9999 ]] && eautoreconf + eapply "${FILESDIR}"/${PN}-17-musl-string_h.patch + eapply "${FILESDIR}"/${PN}-18-execinfo.patch + eapply "${FILESDIR}"/${PN}-17-musl-invocation_name.patch + eapply "${FILESDIR}"/${PN}-18-intel-missing-time_t.patch + eapply "${FILESDIR}"/${PN}-18-musl-pthread.patch + eapply "${FILESDIR}"/${PN}-18-musl-increase-pthread-stack-size.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 + # trim Wayland platform -- the wayland-egl.so frontend library is provided by Wayland itself now + myconf+=" --with-platforms=x11,surfaceless$(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 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 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 /usr/share/doc/${P}/patents.txt.bz2 for an" + elog "explanation." + 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-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild index 55d542a..a7a7751 100644 --- a/media-libs/mesa/mesa-9999.ebuild +++ b/media-libs/mesa/mesa-9999.ebuild @@ -285,7 +285,6 @@ pkg_setup() { src_prepare() { [[ ${PV} == 9999 ]] && eautoreconf -# eapply "${FILESDIR}"/${PN}-17-musl_endian.patch eapply "${FILESDIR}"/${PN}-18-execinfo.patch eapply "${FILESDIR}"/${PN}-17-musl-invocation_name.patch eapply "${FILESDIR}"/${PN}-18-musl-pthread.patch @@ -324,7 +323,8 @@ multilib_src_configure() { fi if use egl; then - myconf+=" --with-platforms=x11,surfaceless$(use wayland && echo ",wayland")$(use gbm && echo ",drm")" + # trim Wayland platform -- the wayland-egl.so frontend library is provided by Wayland itself now + myconf+=" --with-platforms=x11,surfaceless$(use gbm && echo ",drm")" fi if use gallium; then @@ -473,8 +473,6 @@ multilib_src_install() { doenvd "${T}"/99mesaxdgomx keepdir /usr/share/mesa/xdg fi - - rm /var/tmp/portage/media-libs/mesa-9999/image/usr/lib/libwayland-egl.so* /var/tmp/portage/media-libs/mesa-9999/image/usr/lib/pkgconfig/wayland-egl.pc } multilib_src_install_all() { |