Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mesa/
Date: Mon, 09 May 2022 17:09:53
Message-Id: 1652116173.7a9172096b2a7132f66f6baa5b54698774e6d0fb.mattst88@gentoo
1 commit: 7a9172096b2a7132f66f6baa5b54698774e6d0fb
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 9 15:12:12 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Mon May 9 17:09:33 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a917209
7
8 media-libs/mesa: Add SLOT="amber" branch
9
10 Bug: https://bugs.gentoo.org/843440
11 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
12
13 media-libs/mesa/mesa-21.3.8-r1.ebuild | 203 ++++++++++++++++++++++++++++++++++
14 1 file changed, 203 insertions(+)
15
16 diff --git a/media-libs/mesa/mesa-21.3.8-r1.ebuild b/media-libs/mesa/mesa-21.3.8-r1.ebuild
17 new file mode 100644
18 index 000000000000..8174164bb866
19 --- /dev/null
20 +++ b/media-libs/mesa/mesa-21.3.8-r1.ebuild
21 @@ -0,0 +1,203 @@
22 +# Copyright 1999-2022 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +PYTHON_COMPAT=( python3_{8..10} )
28 +
29 +inherit meson-multilib python-any-r1 linux-info
30 +
31 +MY_P="${P/_/-}"
32 +
33 +DESCRIPTION="OpenGL-like graphic library for Linux"
34 +HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/"
35 +
36 +if [[ ${PV} == 9999 ]]; then
37 + EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
38 + inherit git-r3
39 +else
40 + SRC_URI="https://archive.mesa3d.org/${MY_P}.tar.xz"
41 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
42 +fi
43 +
44 +LICENSE="MIT"
45 +SLOT="amber"
46 +RESTRICT="!test? ( test )"
47 +
48 +RADEON_CARDS="r100 r200 radeon"
49 +VIDEO_CARDS="${RADEON_CARDS} i915 i965 intel nouveau"
50 +for card in ${VIDEO_CARDS}; do
51 + IUSE_VIDEO_CARDS+=" video_cards_${card}"
52 +done
53 +
54 +IUSE="${IUSE_VIDEO_CARDS}
55 + cpu_flags_x86_sse2 debug gles1 +gles2 selinux test valgrind wayland +X
56 + +zstd"
57 +
58 +LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.107"
59 +RDEPEND="
60 + !<=media-libs/mesa-21.3.8
61 +
62 + >=dev-libs/expat-2.1.0-r3:=[${MULTILIB_USEDEP}]
63 + >=media-libs/libglvnd-1.3.2[X?,${MULTILIB_USEDEP}]
64 + >=sys-libs/zlib-1.2.8[${MULTILIB_USEDEP}]
65 + selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
66 + wayland? (
67 + >=dev-libs/wayland-1.18.0:=[${MULTILIB_USEDEP}]
68 + >=dev-libs/wayland-protocols-1.8
69 + )
70 + ${LIBDRM_DEPSTRING}[video_cards_nouveau?,${MULTILIB_USEDEP}]
71 + video_cards_intel? (
72 + !video_cards_i965? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
73 + )
74 + video_cards_i915? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
75 + X? (
76 + >=x11-libs/libX11-1.6.2:=[${MULTILIB_USEDEP}]
77 + >=x11-libs/libxshmfence-1.1:=[${MULTILIB_USEDEP}]
78 + >=x11-libs/libXext-1.3.2:=[${MULTILIB_USEDEP}]
79 + >=x11-libs/libXxf86vm-1.1.3:=[${MULTILIB_USEDEP}]
80 + >=x11-libs/libxcb-1.13:=[${MULTILIB_USEDEP}]
81 + x11-libs/libXfixes:=[${MULTILIB_USEDEP}]
82 + )
83 + zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
84 +"
85 +for card in ${RADEON_CARDS}; do
86 + RDEPEND="${RDEPEND}
87 + video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
88 + "
89 +done
90 +
91 +DEPEND="${RDEPEND}
92 + valgrind? ( dev-util/valgrind )
93 + X? (
94 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
95 + x11-base/xorg-proto
96 + )
97 +"
98 +BDEPEND="
99 + ${PYTHON_DEPS}
100 + sys-devel/bison
101 + sys-devel/flex
102 + virtual/pkgconfig
103 + $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
104 + wayland? ( dev-util/wayland-scanner )
105 +"
106 +
107 +S="${WORKDIR}/${MY_P}"
108 +EGIT_CHECKOUT_DIR=${S}
109 +
110 +QA_WX_LOAD="
111 +x86? (
112 + usr/lib/libGLX_amber.so.0.0.0
113 +)"
114 +
115 +python_check_deps() {
116 + has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
117 +}
118 +
119 +pkg_setup() {
120 + if use video_cards_i965; then
121 + if kernel_is -ge 5 11 3; then
122 + CONFIG_CHECK="~KCMP"
123 + elif kernel_is -ge 5 11; then
124 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
125 + elif kernel_is -ge 5 10 20; then
126 + CONFIG_CHECK="~KCMP"
127 + else
128 + CONFIG_CHECK="~CHECKPOINT_RESTORE"
129 + fi
130 + linux-info_pkg_setup
131 + fi
132 +
133 + python-any-r1_pkg_setup
134 +}
135 +
136 +multilib_src_configure() {
137 + local emesonargs=()
138 +
139 + # Intel code
140 + dri_driver_enable video_cards_i915 i915
141 + dri_driver_enable video_cards_i965 i965
142 + if ! use video_cards_i915 && \
143 + ! use video_cards_i965; then
144 + dri_driver_enable video_cards_intel i915 i965
145 + fi
146 +
147 + # Nouveau code
148 + dri_driver_enable video_cards_nouveau nouveau
149 +
150 + # ATI code
151 + dri_driver_enable video_cards_r100 r100
152 + dri_driver_enable video_cards_r200 r200
153 + if ! use video_cards_r100 && \
154 + ! use video_cards_r200; then
155 + dri_driver_enable video_cards_radeon r100 r200
156 + fi
157 +
158 + local platforms
159 + use X && platforms+="x11"
160 + use wayland && platforms+=",wayland"
161 + emesonargs+=(-Dplatforms=${platforms#,})
162 +
163 + driver_list() {
164 + local drivers="$(sort -u <<< "${1// /$'\n'}")"
165 + echo "${drivers//$'\n'/,}"
166 + }
167 +
168 + emesonargs+=(
169 + -Damber=true
170 + $(meson_use test build-tests)
171 + -Dglx=$(usex X dri disabled)
172 + -Dshared-glapi=enabled
173 + -Ddri3=enabled
174 + -Degl=enabled
175 + -Dgbm=enabled
176 + $(meson_feature gles1)
177 + $(meson_feature gles2)
178 + -Dglvnd=true
179 + -Dosmesa=false
180 + -Dllvm=disabled
181 + $(meson_use selinux)
182 + $(meson_feature zstd)
183 + $(meson_use cpu_flags_x86_sse2 sse2)
184 + -Dvalgrind=$(usex valgrind auto disabled)
185 + -Ddri-drivers=$(driver_list "${DRI_DRIVERS[*]}")
186 + -Dgallium-drivers=''
187 + -Dvulkan-drivers=''
188 + --buildtype $(usex debug debug plain)
189 + -Db_ndebug=$(usex debug false true)
190 + )
191 + meson_src_configure
192 +}
193 +
194 +multilib_src_test() {
195 + meson_src_test -t 100
196 +}
197 +
198 +multilib_src_install_all() {
199 + # These are provided by media-libs/mesa:0
200 + local files=(
201 + "${ED}"/usr/lib*/libgbm.so*
202 + "${ED}"/usr/lib*/libglapi.so*
203 + "${ED}"/usr/include
204 + "${ED}"/usr/lib*/pkgconfig
205 + "${ED}"/usr/share/drirc.d/00-mesa-defaults.conf
206 + )
207 + rm -r "${files[@]}" || die
208 +
209 + # Move i915_dri.so -> i915c_dri.so to not conflict with media-libs/mesa:0.
210 + for dridir in "${ED}"/usr/lib*/dri; do
211 + if [[ -e ${dridir}/i915_dri.so ]]; then
212 + mv ${dridir}/i915{,c}_dri.so || die
213 + fi
214 + done
215 +}
216 +
217 +# $1 - VIDEO_CARDS flag (check skipped for "--")
218 +# other args - names of DRI drivers to enable
219 +dri_driver_enable() {
220 + if [[ $1 == -- ]] || use $1; then
221 + shift
222 + DRI_DRIVERS+=("$@")
223 + fi
224 +}