Gentoo Archives: gentoo-commits

From: "Manuel Rüger" <mrueg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-drivers/ati-drivers/, x11-drivers/ati-drivers/files/
Date: Sat, 02 Jan 2016 16:25:28
Message-Id: 1451751907.179aa11ed2f1bd79cf1b190263c3a7a07279fc50.mrueg@gentoo
1 commit: 179aa11ed2f1bd79cf1b190263c3a7a07279fc50
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 2 16:24:30 2016 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 2 16:25:07 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=179aa11e
7
8 x11-drivers/ati-drivers: Version bump. Thanks to Rion.
9
10 Gentoo-Bug: 566846
11
12 Package-Manager: portage-2.2.26
13
14 x11-drivers/ati-drivers/Manifest | 1 +
15 x11-drivers/ati-drivers/ati-drivers-15.12.ebuild | 640 +++++++++++++++++++++
16 .../files/15.11-remove-gpl-symbols.patch | 48 ++
17 3 files changed, 689 insertions(+)
18
19 diff --git a/x11-drivers/ati-drivers/Manifest b/x11-drivers/ati-drivers/Manifest
20 index 0c4db94..c72712e 100644
21 --- a/x11-drivers/ati-drivers/Manifest
22 +++ b/x11-drivers/ati-drivers/Manifest
23 @@ -1,2 +1,3 @@
24 DIST amd-catalyst-15.9-linux-installer-15.201.1151-x86.x86_64.zip 180990551 SHA256 bf3e6e7d5c51db3d075410a3f116f865b82823debc1d66698d187249feec6a91 SHA512 4fc2b3626b818027da974836fc77c436185f08dfb6cdce301a251c129e3d601092e114e4ea15c598845f9e76c57f37f6161cff2b4992f43a990982c8baa76cb4 WHIRLPOOL 2453179cf8599cdaf039689b8625001bbb85c5ad1a174c71cf3f6bac3711d4050bcc8b1d216d69db8c16060119ac28c7f9792632fb5db76cf6fcd949697e5324
25 +DIST radeon-crimson-15.12-15.302-151217a-297685e.zip 185391473 SHA256 704f2dfc14681f76dae3b4120c87b1ded33cf43d5a1d800b6de5ca292bb61e58 SHA512 1658c3109e9dca2a1f0bd972e9042e7ccf17742e9c6110f04151334f342eb53d5a736b9cb63358a26d97562f1efb9e36c281bca85664e06f0cd11c275972f3af WHIRLPOOL 945ae6aa581430b528ef36b208df7f176233acd9eea69c9f4c61f9b29341ef1c31b182b704c7d0e9285dbb0c553f146ba337eee1d4b67b8cd65488c37e9a8189
26 DIST xvba-sdk-0.74-404001.tar.gz 583847 SHA256 731a2c489f2fb5d7318c1976061b26c1057a696f46d09dcf55fbada97fed17eb SHA512 aa1dd52b59eeeabd026d8b76e3b75eaf02587ef286438ba28884afeef5a5efaf50283b5ee4f5b81b12cf79cb4ec77c9a235a886b29fb7cdf850c9779f4b07b35 WHIRLPOOL 69917b746d353a884512e97b9d9a9b89e6f51add3119e69ddd119d51c0c3f2820b93a449fe42bd76d671dc505f92bf25b7f2c5868b33768fc68a19596e460951
27
28 diff --git a/x11-drivers/ati-drivers/ati-drivers-15.12.ebuild b/x11-drivers/ati-drivers/ati-drivers-15.12.ebuild
29 new file mode 100644
30 index 0000000..ae3e4c8
31 --- /dev/null
32 +++ b/x11-drivers/ati-drivers/ati-drivers-15.12.ebuild
33 @@ -0,0 +1,640 @@
34 +# Copyright 1999-2016 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Id$
37 +
38 +EAPI=5
39 +
40 +MULTILIB_COMPAT=( abi_x86_{32,64} )
41 +inherit eutils multilib-build linux-info linux-mod systemd toolchain-funcs versionator pax-utils
42 +
43 +DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
44 +HOMEPAGE="http://www.amd.com"
45 +BUILD_VER=15.302
46 +RUN="${WORKDIR}/fglrx-${BUILD_VER}/amd-driver-installer-${BUILD_VER}-x86.x86_64.run"
47 +SLOT="1"
48 +# Uses javascript for download YESSSS
49 +#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
50 +#DRV_VER="amd-catalyst-${PV}-linux-installer-15.201.1151-x86.x86_64.zip"
51 +DRV_VER="radeon-crimson-${PV}-${BUILD_VER}-151217a-297685e.zip"
52 +DRIVERS_URI="mirror://gentoo/${DRV_VER}"
53 +SDK_VER="xvba-sdk-0.74-404001.tar.gz"
54 +XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/${SDK_VER}"
55 +SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
56 +FOLDER_PREFIX="common/"
57 +IUSE="debug +modules qt4 static-libs pax_kernel gdm-hack"
58 +
59 +LICENSE="AMD GPL-2 QPL-1.0"
60 +KEYWORDS="-* ~amd64 ~x86"
61 +
62 +RESTRICT="bindist test"
63 +
64 +RDEPEND="
65 + <=x11-base/xorg-server-1.17.49[-minimal]
66 + >=app-eselect/eselect-opengl-1.0.7
67 + app-eselect/eselect-opencl
68 + sys-power/acpid
69 + x11-apps/xauth
70 + !x11-libs/xvba-video
71 + virtual/glu[${MULTILIB_USEDEP}]
72 + x11-libs/libX11[${MULTILIB_USEDEP}]
73 + x11-libs/libXext[${MULTILIB_USEDEP}]
74 + x11-libs/libXinerama[${MULTILIB_USEDEP}]
75 + x11-libs/libXrandr[${MULTILIB_USEDEP}]
76 + x11-libs/libXrender[${MULTILIB_USEDEP}]
77 + qt4? (
78 + x11-libs/libICE
79 + x11-libs/libSM
80 + x11-libs/libXcursor
81 + x11-libs/libXfixes
82 + x11-libs/libXxf86vm
83 + dev-qt/qtcore:4
84 + dev-qt/qtgui:4[accessibility]
85 + )
86 + gdm-hack? (
87 + x11-base/xorg-server:=
88 + )
89 +"
90 +if [[ legacy != ${SLOT} ]]; then
91 + RDEPEND="${RDEPEND}
92 + !x11-drivers/ati-drivers:legacy"
93 +else
94 + RDEPEND="${RDEPEND}
95 + !x11-drivers/ati-drivers:1"
96 +fi
97 +
98 +DEPEND="${RDEPEND}
99 + x11-proto/inputproto
100 + x11-proto/xf86miscproto
101 + x11-proto/xf86vidmodeproto
102 + x11-proto/xineramaproto
103 + x11-libs/libXtst
104 + sys-apps/findutils
105 + app-misc/pax-utils
106 + app-arch/unzip
107 +"
108 +
109 +EMULTILIB_PKG="true"
110 +
111 +S="${WORKDIR}"
112 +
113 +# QA Silencing
114 +QA_TEXTRELS="
115 + usr/lib*/opengl/ati/lib/libGL.so.1.2
116 + usr/lib*/libatiadlxx.so
117 + usr/lib*/xorg/modules/glesx.so
118 + usr/lib*/libaticaldd.so
119 + usr/lib*/dri/fglrx_dri.so
120 +"
121 +
122 +QA_EXECSTACK="
123 + opt/bin/atiode
124 + opt/bin/amdcccle
125 + usr/lib*/opengl/ati/lib/libGL.so.1.2
126 + usr/lib*/dri/fglrx_dri.so
127 +"
128 +
129 +QA_WX_LOAD="
130 + usr/lib*/opengl/ati/lib/libGL.so.1.2
131 + usr/lib*/dri/fglrx_dri.so
132 +"
133 +
134 +QA_PRESTRIPPED="
135 + usr/lib\(32\|64\)\?/libXvBAW.so.1.0
136 + usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
137 + usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
138 + usr/lib\(32\|64\)\?/xorg/modules/glesx.so
139 + usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
140 + usr/lib\(32\|64\)\?/libaticaldd.so
141 + usr/lib\(32\|64\)\?/dri/fglrx_dri.so
142 + usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
143 + usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
144 +"
145 +
146 +QA_SONAME="
147 + usr/lib\(32\|64\)\?/libatiadlxx.so
148 + usr/lib\(32\|64\)\?/libaticalcl.so
149 + usr/lib\(32\|64\)\?/libaticaldd.so
150 + usr/lib\(32\|64\)\?/libaticalrt.so
151 + usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
152 + usr/lib\(32\|64\)\?/libamdhsasc\(32\|64\)\?.so
153 +"
154 +
155 +QA_DT_HASH="
156 + opt/bin/amdcccle
157 + opt/bin/aticonfig
158 + opt/bin/atiodcli
159 + opt/bin/atiode
160 + opt/bin/clinfo
161 + opt/bin/fglrxinfo
162 + opt/sbin/atieventsd
163 + opt/sbin/amdnotifyui
164 + usr/lib\(32\|64\)\?/libaticalcl.so
165 + usr/lib\(32\|64\)\?/libaticalrt.so
166 + usr/lib\(32\|64\)\?/libatiuki.so.1.0
167 + usr/lib\(32\|64\)\?/libatiadlxx.so
168 + usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
169 + usr/lib\(32\|64\)\?/libXvBAW.so.1.0
170 + usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
171 + usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
172 + usr/lib\(32\|64\)\?/xorg/modules/glesx.so
173 + usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
174 + usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
175 + usr/lib\(32\|64\)\?/libaticaldd.so
176 + usr/lib\(32\|64\)\?/dri/fglrx_dri.so
177 + usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
178 + usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
179 + usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
180 + usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
181 + usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
182 + usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
183 +"
184 +
185 +pkg_nofetch() {
186 + einfo "The driver packages"
187 + einfo ${A}
188 + einfo "need to be downloaded manually from"
189 + einfo "http://support.amd.com/en-us/download/desktop?os=Linux+x86"
190 + einfo "or http://support.amd.com/en-us/download/desktop?os=Linux+x86_64"
191 + einfo "and ${XVBA_SDK_URI}"
192 +}
193 +
194 +pkg_pretend() {
195 + local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI \
196 + !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
197 + use amd64 && CONFIG_CHECK+=" COMPAT"
198 +
199 + local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
200 + local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a
201 + module and not loaded for direct rendering to work."
202 + local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports
203 + the symbol lock_acquire as GPL-only. This prevents ${P} from
204 + compiling with an error like this:
205 + FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
206 + local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
207 + kernel to reject loading the fglrx module with
208 + \"ERROR: could not insert 'fglrx': Exec format error.\"
209 + You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
210 + local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
211 +
212 + # workaround until bug 365543 is solved
213 + if use modules; then
214 + linux-info_pkg_setup
215 + require_configured_kernel
216 + kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
217 + check_extra_config
218 + if ! linux_chkconfig_present AGP && \
219 + ! linux_chkconfig_present PCIEPORTBUS; then
220 + ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
221 + ewarn "Direct rendering will not work."
222 + fi
223 + fi
224 +
225 + if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
226 + ewarn "You have disabled xattr pax markings for portage."
227 + ewarn "This will likely cause programs using ati-drivers provided"
228 + ewarn "libraries to be killed kernel."
229 + fi
230 +}
231 +
232 +pkg_setup() {
233 + if use modules; then
234 + MODULE_PATH="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x"
235 + MODULE_NAMES="fglrx(video:${MODULE_PATH})"
236 + BUILD_TARGETS="kmod_build"
237 + linux-mod_pkg_setup
238 + BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_OUT_DIR}"
239 + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
240 + if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
241 + BUILD_PARAMS="${BUILD_PARAMS} \
242 + CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
243 + else
244 + BUILD_PARAMS="${BUILD_PARAMS} \
245 + CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
246 + fi
247 + fi
248 + # Define module dir.
249 + MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
250 + # get the xorg-server version and set BASE_DIR for that
251 + BASE_DIR="${S}/xpic"
252 +
253 + # amd64/x86
254 + if use amd64 ; then
255 + MY_BASE_DIR="${BASE_DIR}_64a"
256 + PKG_LIBDIR=lib64
257 + ARCH_DIR="${S}/arch/x86_64"
258 + else
259 + MY_BASE_DIR="${BASE_DIR}"
260 + PKG_LIBDIR=lib
261 + ARCH_DIR="${S}/arch/x86"
262 + fi
263 +
264 + elog
265 + elog "Please note that this driver only supports graphic cards based on"
266 + elog "Evergreen chipset and newer."
267 + elog "This includes the AMD Radeon HD 5400+ series at this moment."
268 + elog
269 + elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
270 + elog "For migration informations please refer to:"
271 + elog "https://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
272 + einfo
273 +}
274 +
275 +src_unpack() {
276 + local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
277 + DRIVERS_DISTFILE=${DRIVERS_URI##*/}
278 + XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
279 +
280 + if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
281 + unpack ${DRIVERS_DISTFILE}
282 + mkdir -p common
283 + mv etc lib usr common || die "Assumed to find etc lib and usr for common"
284 + else
285 + #please note, RUN may be insanely assigned at top near SRC_URI
286 + if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
287 + unpack ${DRIVERS_DISTFILE}
288 + [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
289 + else
290 + RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
291 + fi
292 + sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
293 + fi
294 +
295 + mkdir xvba_sdk
296 + cd xvba_sdk
297 + unpack ${XVBA_SDK_DISTFILE}
298 +
299 + mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
300 + cd "${WORKDIR}/extra"
301 + tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
302 +}
303 +
304 +src_prepare() {
305 + if use modules; then
306 + if use debug; then
307 + sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
308 + "${MODULE_DIR}/firegl_public.c" \
309 + || die "Failed to enable debug output."
310 + fi
311 + fi
312 +
313 + # These are the userspace utilities that we also have source for.
314 + # We rebuild these later.
315 + rm \
316 + "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
317 + || die "bin rm failed"
318 +
319 + # in this version amdcccle isn't static, thus we depend on qt4
320 + use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
321 +
322 + # ACPI fixups
323 + sed -i \
324 + -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
325 + -e "s:/var/lib/gdm/:/var/gdm/:" \
326 + "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
327 + || die "ACPI fixups failed."
328 +
329 + # Since "who" is in coreutils, we're using that one instead of "finger".
330 + sed -i -e 's:finger:who:' \
331 + "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
332 + || die "Replacing 'finger' with 'who' failed."
333 + # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
334 + # add function to detect default state.
335 + epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
336 +
337 + # see http://ati.cchtml.com/show_bug.cgi?id=495
338 + #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
339 + # first hunk applied upstream second (x32 related) was not
340 + epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
341 +
342 + # compile fix for AGP-less kernel, bug #435322
343 + epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
344 +
345 + epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
346 +
347 + # Fix #483400
348 + epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
349 +
350 + # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
351 + use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
352 +
353 + # Compile fix, #526602
354 + # epatch "${FILESDIR}/use-kernel_fpu_begin.patch"
355 +
356 + # Fix #542320
357 + epatch "${FILESDIR}/15.9-preempt.patch"
358 +
359 + # Compile fixes, #548118
360 + epatch "${FILESDIR}/15.11-remove-gpl-symbols.patch"
361 + epatch "${FILESDIR}/15.9-kcl_str.patch"
362 + epatch "${FILESDIR}/15.9-sep_printf.patch"
363 + epatch "${FILESDIR}/15.9-mtrr.patch"
364 +
365 + epatch_user
366 +
367 + cd "${MODULE_DIR}"
368 +
369 + # bugged fglrx build system, this file should be copied by hand
370 + cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
371 +
372 + convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
373 +
374 + # When built with ati's make.sh it defines a bunch of macros if
375 + # certain .config values are set, falling back to less reliable
376 + # detection methods if linux/autoconf.h is not available. We
377 + # simply use the linux/autoconf.h settings directly, bypassing the
378 + # detection script.
379 + sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
380 + sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
381 + || die "MODVERSIONS sed failed"
382 +}
383 +
384 +src_compile() {
385 + use modules && linux-mod_src_compile
386 +
387 + ebegin "Building fgl_glxgears"
388 + cd "${S}"/extra/fgl_glxgears
389 + # These extra libs/utils either have an Imakefile that does not
390 + # work very well without tweaking or a Makefile ignoring CFLAGS
391 + # and the like. We bypass those.
392 + # The -DUSE_GLU is needed to compile using nvidia headers
393 + # according to a comment in ati-drivers-extra-8.33.6.ebuild.
394 + "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
395 + -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
396 + -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
397 + eend $?
398 +}
399 +
400 +src_install() {
401 + use modules && linux-mod_src_install
402 +
403 + # We can do two things here, and neither of them is very nice.
404 +
405 + # For direct rendering libGL has to be able to load one or more
406 + # dri modules (files ending in _dri.so, like fglrx_dri.so).
407 + # Gentoo's mesa looks for these files in the location specified by
408 + # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
409 + # location /usr/$(get_libdir)/dri. Ati's libGL does the same
410 + # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
411 + # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
412 + # 64bit. So we can either put the .so files in that (unusual,
413 + # compared to "normal" mesa libGL) location or set
414 + # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
415 + # 101539.
416 +
417 + # The problem with this approach is that LIBGL_DRIVERS_PATH
418 + # *overrides* the default hardcoded location, it does not extend
419 + # it. So if ati-drivers is merged but a non-ati libGL is selected
420 + # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
421 + # (because it changed in a newer mesa or because it was compiled
422 + # for a different set of multilib abis than we are) stuff breaks.
423 +
424 + # We create one file per ABI to work with "native" multilib, see
425 + # below.
426 +
427 + echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
428 + doenvd "${T}/03ati-colon-sep" || die
429 +
430 + # All libraries that we have a 32 bit and 64 bit version of on
431 + # amd64 are installed in src_install-libs. Everything else
432 + # (including libraries only available in native 64bit on amd64)
433 + # goes in here.
434 + multilib_foreach_abi src_install-libs
435 +
436 + # This is sorted by the order the files occur in the source tree.
437 +
438 + # X modules.
439 + exeinto /usr/$(get_libdir)/xorg/modules/drivers
440 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
441 + exeinto /usr/$(get_libdir)/xorg/modules/linux
442 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
443 + exeinto /usr/$(get_libdir)/xorg/modules
444 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
445 +
446 + #516816
447 + if use gdm-hack; then
448 + sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' \
449 + "${D}/usr/$(get_libdir)/xorg/modules/drivers/fglrx_drv.so" || \
450 + die "Applying gdm-hack failed"
451 + fi
452 +
453 + # Arch-specific files.
454 + # (s)bin.
455 + into /opt
456 + dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
457 + use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
458 + dobin "${ARCH_DIR}"/usr/bin/clinfo
459 + # We cleaned out the compilable stuff in src_unpack
460 + dobin "${ARCH_DIR}"/usr/X11R6/bin/*
461 +
462 + # Common files.
463 + # etc.
464 + insinto /etc/ati
465 + exeinto /etc/ati
466 + # Everything except for the authatieventsd.sh script.
467 + doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
468 + doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
469 +
470 + # include.
471 + insinto /usr
472 + doins -r ${FOLDER_PREFIX}usr/include
473 + insinto /usr/include/X11/extensions
474 +
475 + # Just the atigetsysteminfo.sh script.
476 + into /usr
477 + dosbin ${FOLDER_PREFIX}usr/sbin/*
478 +
479 + # data files for the control panel.
480 + if use qt4 ; then
481 + insinto /usr/share
482 + doins -r ${FOLDER_PREFIX}usr/share/ati
483 + insinto /usr/share/pixmaps
484 + doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
485 + make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
486 + ccc_large System
487 + fi
488 +
489 + # doc.
490 + dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
491 +
492 + doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
493 +
494 + pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
495 +
496 + exeinto /etc/acpi
497 + doexe ati-powermode.sh
498 + insinto /etc/acpi/events
499 + doins events/*
500 +
501 + popd > /dev/null
502 +
503 + # Done with the "source" tree. Install tools we rebuilt:
504 + dobin extra/fgl_glxgears/fgl_glxgears
505 + newdoc extra/fgl_glxgears/README README.fgl_glxgears
506 +
507 + # Gentoo-specific stuff:
508 + newinitd "${FILESDIR}"/atieventsd.init atieventsd
509 + echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
510 + newconfd "${T}"/atieventsd.conf atieventsd
511 + systemd_dounit "${FILESDIR}/atieventsd.service"
512 +
513 + # PowerXpress stuff
514 + exeinto /usr/$(get_libdir)/fglrx
515 + doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
516 + cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
517 + doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
518 +
519 + #516816
520 + use gdm-hack && Xorg -version > "${D}/etc/ati/xvrn" 2>&1
521 +}
522 +
523 +src_install-libs() {
524 + if [[ "${ABI}" == "amd64" ]]; then
525 + local EX_BASE_DIR="${BASE_DIR}_64a"
526 + local pkglibdir=lib64
527 + local MY_ARCH_DIR="${S}/arch/x86_64"
528 + local oclsuffix=64
529 + else
530 + local EX_BASE_DIR="${BASE_DIR}"
531 + local pkglibdir=lib
532 + local MY_ARCH_DIR="${S}/arch/x86"
533 + local oclsuffix=32
534 + fi
535 + einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
536 +
537 + local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
538 + # To make sure we do not miss a spot when these change.
539 + local libmajor=1 libminor=2
540 + local libver=${libmajor}.${libminor}
541 +
542 + # The GLX libraries
543 + # (yes, this really is "lib" even on amd64/multilib --marienz)
544 + exeinto ${ATI_ROOT}/lib
545 + newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
546 + libGL.so.${libver}
547 + dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
548 + dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
549 +
550 + if multilib_is_native_abi; then
551 + exeinto ${ATI_ROOT}/extensions
552 + doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
553 + mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
554 +
555 + #516816
556 + if use gdm-hack; then
557 + sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' \
558 + "${D}/${ATI_ROOT}/extensions/libglx.so" \
559 + || die "Applying gdm-hack failed"
560 + fi
561 + fi
562 +
563 + # other libs
564 + exeinto /usr/$(get_libdir)
565 + # Everything except for the libGL.so installed some row above
566 + doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
567 + -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
568 + insinto /usr/$(get_libdir)
569 + doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
570 + -maxdepth 1 -type f -not -name '*.so*')
571 +
572 + # DRI modules, installed into the path used by recent versions of mesa.
573 + exeinto /usr/$(get_libdir)/dri
574 + doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
575 +
576 + # AMD Cal and OpenCL libraries
577 + exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
578 + doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
579 + doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
580 + dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
581 + exeinto /usr/$(get_libdir)
582 + doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
583 +
584 + # OpenCL vendor files
585 + insinto /etc/OpenCL/vendors/
586 + cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
587 + /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
588 + EOF
589 + doins "${T}"/amdocl${oclsuffix}.icd
590 +
591 + local envname="${T}"/04ati-dri-path
592 + if [[ -n ${ABI} ]]; then
593 + envname="${envname}-${ABI}"
594 + fi
595 + echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
596 + doenvd "${envname}"
597 +
598 + # Silence the QA notice by creating missing soname symlinks
599 + for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
600 + do
601 + local soname=${so##*/}
602 + local soname_one=${soname%.[0-9]}
603 + local soname_zero=${soname_one%.[0-9]}
604 + dosym ${soname} /usr/$(get_libdir)/${soname_one}
605 + dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
606 + done
607 +
608 + # See https://bugs.gentoo.org/show_bug.cgi?id=443466
609 + dodir /etc/revdep-rebuild/
610 + echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
611 +
612 + #remove static libs if not wanted
613 + use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
614 +
615 + #install xvba sdk headers
616 + doheader xvba_sdk/include/amdxvba.h
617 +
618 + # VA-API internal wrapper
619 + dosym /usr/$(get_libdir)/libXvBAW.so.1.0 /usr/$(get_libdir)/va/drivers/fglrx_drv_video.so
620 +
621 + if use pax_kernel; then
622 + pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
623 + fi
624 +}
625 +
626 +pkg_postinst() {
627 + elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
628 + elog "To change your xorg.conf you can use the bundled \"aticonfig\""
629 + elog
630 + elog "If you experience unexplained segmentation faults and kernel crashes"
631 + elog "with this driver and multi-threaded applications such as wine,"
632 + elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
633 + elog
634 + elog "Fully rebooting the system after an ${PN} update is recommended"
635 + elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
636 + elog "might not work"
637 + elog
638 + elog "Some cards need acpid running to handle events"
639 + elog "Please add it to boot runlevel with rc-update add acpid boot"
640 + elog
641 +
642 + use modules && linux-mod_pkg_postinst
643 + "${ROOT}"/usr/bin/eselect opengl set --use-old ati
644 + "${ROOT}"/usr/bin/eselect opencl set --use-old amd
645 +
646 + if has_version "x11-drivers/xf86-video-intel[sna]"; then
647 + ewarn "It is reported that xf86-video-intel built with USE=\"sna\""
648 + ewarn "causes the X server to crash on systems that use hybrid"
649 + ewarn "AMD/Intel graphics. If you experience this crash, downgrade"
650 + ewarn "to xf86-video-intel-2.20.2 or earlier or try disabling sna"
651 + ewarn "for xf86-video-intel."
652 + ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
653 + fi
654 +
655 + if use pax_kernel; then
656 + ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
657 + ewarn "after you have run \"eselect opengl set ati\". Executacle"
658 + ewarn "revdep-pax is part of package sys-apps/elfix."
659 + fi
660 +}
661 +
662 +pkg_preinst() {
663 + use modules && linux-mod_pkg_preinst
664 +}
665 +
666 +pkg_prerm() {
667 + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
668 +}
669 +
670 +pkg_postrm() {
671 + use modules && linux-mod_pkg_postrm
672 + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
673 +}
674
675 diff --git a/x11-drivers/ati-drivers/files/15.11-remove-gpl-symbols.patch b/x11-drivers/ati-drivers/files/15.11-remove-gpl-symbols.patch
676 new file mode 100644
677 index 0000000..5cea796
678 --- /dev/null
679 +++ b/x11-drivers/ati-drivers/files/15.11-remove-gpl-symbols.patch
680 @@ -0,0 +1,48 @@
681 +--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-18 23:57:02.000000000 -0400
682 ++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-18 23:57:11.000000000 -0400
683 +@@ -136,7 +136,6 @@
684 + #include <asm/mman.h>
685 + #include <asm/uaccess.h>
686 + #include <asm/processor.h>
687 +-#include <asm/tlbflush.h> // for flush_tlb_page
688 + #include <asm/cpufeature.h>
689 + #ifdef CONFIG_MTRR
690 + #include <asm/mtrr.h>
691 +@@ -251,6 +250,26 @@
692 + #define WRITE_CR4(x) write_cr4(x)
693 + #endif
694 +
695 ++#define __flush_tlb_one(addr) asm volatile("invlpg (%0)" ::"r" (addr) : "memory")
696 ++#define __flush_tlb() native_write_cr3(native_read_cr3())
697 ++
698 ++static inline void __flush_tlb_all(void)
699 ++{
700 ++ if (cpu_has_pge)
701 ++ {
702 ++ unsigned long flags, cr4;
703 ++ raw_local_irq_save(flags);
704 ++ cr4 = native_read_cr4();
705 ++ native_write_cr4(cr4 & ~X86_CR4_PGE);
706 ++ native_write_cr4(cr4);
707 ++ raw_local_irq_restore(flags);
708 ++ }
709 ++ else
710 ++ {
711 ++ __flush_tlb();
712 ++ }
713 ++}
714 ++
715 + // ============================================================
716 + /* globals */
717 +
718 +--- a/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2015-09-19 00:43:35.000000000 -0400
719 ++++ b/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2015-09-19 00:43:48.000000000 -0400
720 +@@ -868,7 +868,7 @@ void ATI_API_CALL KCL_ACPI_No_Hotplug(vo
721 + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
722 + if(pdev)
723 + {
724 +-#if (UTS_UBUNTU_RELEASE_ABI < 0 && LINUX_VERSION_CODE < KERNEL_VERSION(4,1,3)) || (UTS_UBUNTU_RELEASE_ABI >= 0 && UTS_UBUNTU_RELEASE_ABI < 26 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,19,8))
725 ++#if 0 && (UTS_UBUNTU_RELEASE_ABI < 0 && LINUX_VERSION_CODE < KERNEL_VERSION(4,1,3)) || (UTS_UBUNTU_RELEASE_ABI >= 0 && UTS_UBUNTU_RELEASE_ABI < 26 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,19,8))
726 + pci_ignore_hotplug(pdev);
727 + #else
728 + pdev->ignore_hotplug = 1;