Gentoo Archives: gentoo-commits

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