Gentoo Archives: gentoo-commits

From: Enrico Tagliavini <enrico.tagliavini@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/x11:master commit in: x11-drivers/ati-drivers/
Date: Thu, 28 Apr 2011 16:02:24
Message-Id: ada1094dd2391ae35e0586dd76832542b0c90e50.Enrico@gentoo
1 commit: ada1094dd2391ae35e0586dd76832542b0c90e50
2 Author: Enrico Tagliavini <enrico.tagliavini <AT> gmail <DOT> com>
3 AuthorDate: Thu Apr 28 16:01:18 2011 +0000
4 Commit: Enrico Tagliavini <enrico.tagliavini <AT> gmail <DOT> com>
5 CommitDate: Thu Apr 28 16:01:18 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git;a=commit;h=ada1094d
7
8 version bump to 11.4
9
10 ---
11 x11-drivers/ati-drivers/ati-drivers-11.4.ebuild | 571 +++++++++++++++++++++++
12 1 files changed, 571 insertions(+), 0 deletions(-)
13
14 diff --git a/x11-drivers/ati-drivers/ati-drivers-11.4.ebuild b/x11-drivers/ati-drivers/ati-drivers-11.4.ebuild
15 new file mode 100644
16 index 0000000..64b0282
17 --- /dev/null
18 +++ b/x11-drivers/ati-drivers/ati-drivers-11.4.ebuild
19 @@ -0,0 +1,571 @@
20 +# Copyright 1999-2011 Gentoo Foundation
21 +# Distributed under the terms of the GNU General Public License v2
22 +# $Header: $
23 +
24 +EAPI="2"
25 +
26 +inherit eutils multilib linux-mod toolchain-funcs versionator
27 +
28 +DESCRIPTION="Ati precompiled drivers for r600 (HD Series) and newer chipsets"
29 +HOMEPAGE="http://www.ati.com"
30 +# 8.ble will be used for beta releases.
31 +if [[ $(get_major_version) -gt 8 ]]; then
32 + ATI_URL="https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/"
33 + SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
34 + FOLDER_PREFIX="common/"
35 +else
36 + SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
37 + FOLDER_PREFIX=""
38 +fi
39 +IUSE="debug +modules multilib qt4"
40 +
41 +LICENSE="AMD GPL-2 QPL-1.0 as-is"
42 +KEYWORDS="~amd64 ~x86"
43 +SLOT="1"
44 +
45 +RDEPEND="
46 + <=x11-base/xorg-server-1.10.99
47 + !x11-drivers/ati-drivers:0
48 + !x11-apps/ati-drivers-extra
49 + >=app-admin/eselect-opengl-1.0.7
50 + sys-power/acpid
51 + x11-apps/xauth
52 + x11-libs/libX11
53 + x11-libs/libXext
54 + x11-libs/libXinerama
55 + x11-libs/libXrandr
56 + x11-libs/libXrender
57 + multilib? ( app-emulation/emul-linux-x86-opengl )
58 + qt4? (
59 + x11-libs/libICE
60 + x11-libs/libSM
61 + x11-libs/libXcursor
62 + x11-libs/libXfixes
63 + x11-libs/libXxf86vm
64 + x11-libs/qt-core
65 + x11-libs/qt-gui
66 + )
67 +"
68 +
69 +DEPEND="${RDEPEND}
70 + app-portage/portage-utils
71 + x11-proto/inputproto
72 + x11-proto/xf86miscproto
73 + x11-proto/xf86vidmodeproto
74 + x11-proto/xineramaproto
75 + x11-libs/libXtst
76 +"
77 +
78 +EMULTILIB_PKG="true"
79 +
80 +S="${WORKDIR}"
81 +
82 +# QA Silencing
83 +QA_TEXTRELS="
84 + usr/lib*/opengl/ati/lib/libGL.so.1.2
85 + usr/lib*/libatiadlxx.so
86 + usr/lib*/xorg/modules/glesx.so
87 + usr/lib*/libaticaldd.so
88 + usr/lib*/dri/fglrx_dri.so
89 +"
90 +
91 +QA_EXECSTACK="
92 + opt/bin/atiode
93 + opt/bin/amdcccle
94 + usr/lib*/opengl/ati/lib/libGL.so.1.2
95 + usr/lib*/dri/fglrx_dri.so
96 +"
97 +
98 +QA_WX_LOAD="
99 + usr/lib*/opengl/ati/lib/libGL.so.1.2
100 + usr/lib*/dri/fglrx_dri.so
101 +"
102 +
103 +QA_PRESTRIPPED="
104 + usr/lib\(32\|64\)\?/libXvBAW.so.1.0
105 + usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
106 + usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
107 + usr/lib\(32\|64\)\?/xorg/modules/glesx.so
108 + usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
109 + usr/lib\(32\|64\)\?/libaticaldd.so
110 + usr/lib\(32\|64\)\?/dri/fglrx_dri.so
111 +"
112 +
113 +QA_SONAME="
114 + usr/lib\(32\|64\)\?/libatiadlxx.so
115 + usr/lib\(32\|64\)\?/libaticalcl.so
116 + usr/lib\(32\|64\)\?/libaticaldd.so
117 + usr/lib\(32\|64\)\?/libaticalrt.so
118 +"
119 +
120 +QA_DT_HASH="
121 + opt/bin/amdcccle
122 + opt/bin/aticonfig
123 + opt/bin/atiodcli
124 + opt/bin/atiode
125 + opt/bin/fglrxinfo
126 + opt/sbin/atieventsd
127 + usr/lib\(32\|64\)\?/libaticalcl.so
128 + usr/lib\(32\|64\)\?/libaticalrt.so
129 + usr/lib\(32\|64\)\?/libatiuki.so.1.0
130 + usr/lib\(32\|64\)\?/libatiadlxx.so
131 + usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
132 + usr/lib\(32\|64\)\?/libXvBAW.so.1.0
133 + usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
134 + usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
135 + usr/lib\(32\|64\)\?/xorg/modules/glesx.so
136 + usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
137 + usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
138 + usr/lib\(32\|64\)\?/libaticaldd.so
139 + usr/lib\(32\|64\)\?/dri/fglrx_dri.so
140 + usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
141 + usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
142 + usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
143 + usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
144 +"
145 +
146 +_check_kernel_config() {
147 + local failed=0
148 + local error=""
149 + if ! kernel_is 2 6; then
150 + eerror "You need a 2.6 linux kernel to compile against!"
151 + die "No 2.6 Kernel found"
152 + fi
153 +
154 + if ! linux_chkconfig_present MTRR; then
155 + ewarn "You don't have MTRR support enabled in the kernel."
156 + ewarn "Direct rendering will not work."
157 + fi
158 +
159 + if linux_chkconfig_builtin DRM; then
160 + ewarn "You have DRM support built in to the kernel"
161 + ewarn "Direct rendering will not work."
162 + fi
163 +
164 + if ! linux_chkconfig_present AGP && \
165 + ! linux_chkconfig_present PCIEPORTBUS; then
166 + ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
167 + ewarn "Direct rendering will not work."
168 + fi
169 +
170 + if ! linux_chkconfig_present ACPI; then
171 + eerror "${P} requires the ACPI support in the kernel"
172 + eerror "Please enable it:"
173 + eerror " CONFIG_ACPI=y"
174 + eerror "in /usr/src/linux/.config or"
175 + eerror " Power management and ACPI options --->"
176 + eerror " [*] Power Management support"
177 + eerror "in the 'menuconfig'"
178 + error="${error} CONFIG_ACPI disabled"
179 + failed=1
180 + fi
181 +
182 + if ! linux_chkconfig_present MAGIC_SYSRQ; then
183 + eerror "${P} requires the magic SysRq keys in the kernel."
184 + eerror "Please enable it:"
185 + eerror " CONFIG_MAGIC_SYSRQ=y"
186 + eerror "in /usr/src/linux/.config or"
187 + eerror " Kernel hacking --->"
188 + eerror " [*] Magic SysRq key"
189 + eerror "in the 'menuconfig'"
190 + error="${error} CONFIG_MAGIC_SYSRQ disabled"
191 + failed=1
192 + fi
193 +
194 + if ! linux_chkconfig_present PCI_MSI; then
195 + eerror "${P} requires MSI in the kernel."
196 + eerror "Please enable it:"
197 + eerror " CONFIG_PCI_MSI=y"
198 + eerror "in /usr/src/linux/.config or"
199 + eerror " Bus options (PCI etc.) --->"
200 + eerror " [*] Message Signaled Interrupts (MSI and MSI-X)"
201 + eerror "in the kernel config."
202 + error="${error} CONFIG_PCI_MSI disabled"
203 + failed=1
204 + fi
205 +
206 + if linux_chkconfig_present LOCKDEP; then
207 + eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
208 + eerror "Unfortunately, this option exports the symbol lock_acquire as GPL-only."
209 + eerror "This prevents ${P} from compiling with an error like this:"
210 + eerror "FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
211 + eerror "Please make sure the following options have been unset:"
212 + eerror " Kernel hacking --->"
213 + eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
214 + eerror " [ ] Lock debugging: prove locking correctness"
215 + eerror " [ ] Lock usage statistics"
216 + eerror "in 'menuconfig'"
217 + error="${error} LOCKDEP enabled"
218 + failed=1
219 + fi
220 +
221 + use amd64 && if ! linux_chkconfig_present COMPAT; then
222 + eerror "${P} requires COMPAT."
223 + eerror "Please enable the 32 bit emulation:"
224 + eerror "Executable file formats / Emulations --->"
225 + eerror " [*] IA32 Emulation"
226 + eerror "in the kernel config."
227 + eerror "if this doesn't enable CONFIG_COMPAT add"
228 + eerror " CONFIG_COMPAT=y"
229 + eerror "in /usr/src/linux/.config"
230 + error="${error} COMPAT disabled"
231 + failed=1
232 + fi
233 +
234 + kernel_is ge 2 6 37 && if ! linux_chkconfig_present BKL ; then
235 + eerror "${P} requires BKL."
236 + eerror "Please enable the Big Kernel Lock:"
237 + eerror "Kernel hacking --->"
238 + eerror " [*] Big Kernel Lock"
239 + eerror "in the kernel config."
240 + eerror "or add"
241 + eerror " CONFIG_BKL=y"
242 + eerror "in /usr/src/linux/.config"
243 + error="${error} BKL disabled"
244 + failed=1
245 + fi
246 +
247 + [ "x${failed}" != "x0" ] && die "${error}"
248 +}
249 +
250 +pkg_setup() {
251 + # Define module dir.
252 + MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
253 + # get the xorg-server version and set BASE_DIR for that
254 + local ver_str=$(qatom `best_version x11-base/xorg-server` | cut -d ' ' -f 3)
255 + case ${ver_str} in
256 + 1\.10*) BASE_DIR="${S}/xpic" ;;
257 + 1\.9*) BASE_DIR="${S}/xpic" ;;
258 + 9999*) BASE_DIR="${S}/xpic"
259 + ewarn "Experimental xorg-server-${ver_str}"
260 + ewarn "Picking the last implementation" ;;
261 + *) die "xorg-server-${ver_str} not supported" ;;
262 + esac
263 +
264 + # amd64/x86
265 + if use amd64 ; then
266 + MY_BASE_DIR="${BASE_DIR}_64a"
267 + PKG_LIBDIR=lib64
268 + ARCH_DIR="${S}/arch/x86_64"
269 + else
270 + MY_BASE_DIR="${BASE_DIR}"
271 + PKG_LIBDIR=lib
272 + ARCH_DIR="${S}/arch/x86"
273 + fi
274 +
275 + if use modules; then
276 + MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
277 + BUILD_TARGETS="kmod_build"
278 + linux-mod_pkg_setup
279 + BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
280 + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
281 + if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
282 + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
283 + else
284 + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
285 + fi
286 + _check_kernel_config
287 + fi
288 +
289 + elog
290 + elog "Please note that this driver supports only graphic cards based on"
291 + elog "r600 chipset and newer."
292 + elog "This represent the ATI Radeon HD series at this moment."
293 + elog
294 + elog "If your card is older then usage of ${CATEGORY}/xf86-video-ati"
295 + elog "as replacement is highly recommended. Rather than staying with"
296 + elog "old versions of this driver."
297 + elog "For migration informations please reffer to:"
298 + elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
299 + einfo
300 +}
301 +
302 +src_unpack() {
303 + if [[ $(get_major_version) -gt 8 ]]; then
304 + # Switching to a standard way to extract the files since otherwise no signature file
305 + # would be created
306 + local src="${DISTDIR}/${A}"
307 + sh "${src}" --extract "${S}" 2&>1 /dev/null
308 + else
309 + unpack ${A}
310 + fi
311 +}
312 +
313 +src_prepare() {
314 + # All kernel options for prepare are ment to be in here
315 + if use modules; then
316 + # version patches
317 + # epatch "${FILESDIR}"/kernel/${PV}-*.patch
318 + if use debug; then
319 + sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
320 + "${MODULE_DIR}/firegl_public.c" \
321 + || die "Failed to enable debug output."
322 + fi
323 + fi
324 +
325 + # Fix a known compilation error
326 + epatch "${FILESDIR}"/ati-drivers-fix_compilation-bug-297322.patch
327 +
328 + # These are the userspace utilities that we also have source for.
329 + # We rebuild these later.
330 + rm \
331 + "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
332 + || die "bin rm failed"
333 +
334 + # in this version amdcccle isn't static, thus we depend on qt4
335 + use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
336 +
337 + # ACPI fixups
338 + sed -i \
339 + -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
340 + -e "s:/var/lib/gdm/:/var/gdm/:" \
341 + "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
342 + || die "sed failed."
343 +
344 + # Since "who" is in coreutils, we're using that one instead of "finger".
345 + sed -i -e 's:finger:who:' \
346 + "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
347 + || die "Replacing 'finger' with 'who' failed."
348 + # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
349 + # add function to detect default state.
350 + epatch "${FILESDIR}"/ati-powermode-opt-path-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
351 +
352 + cd "${MODULE_DIR}"
353 +
354 + # bugged fglrx build system, this file should be copied by hand
355 + cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
356 +
357 + convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
358 +
359 + # When built with ati's make.sh it defines a bunch of macros if
360 + # certain .config values are set, falling back to less reliable
361 + # detection methods if linux/autoconf.h is not available. We
362 + # simply use the linux/autoconf.h settings directly, bypassing the
363 + # detection script.
364 + sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
365 + sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
366 + || die "MODVERSIONS sed failed"
367 + cd "${S}"
368 +
369 + mkdir extra || die "mkdir failed"
370 + cd extra
371 + unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
372 +}
373 +
374 +src_compile() {
375 + use modules && linux-mod_src_compile
376 +
377 + ebegin "Building fgl_glxgears"
378 + cd "${S}"/extra/fgl_glxgears
379 + # These extra libs/utils either have an Imakefile that does not
380 + # work very well without tweaking or a Makefile ignoring CFLAGS
381 + # and the like. We bypass those.
382 +
383 + # The -DUSE_GLU is needed to compile using nvidia headers
384 + # according to a comment in ati-drivers-extra-8.33.6.ebuild.
385 + "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
386 + -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
387 + -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
388 + eend $?
389 +}
390 +
391 +src_install() {
392 + use modules && linux-mod_src_install
393 +
394 + # We can do two things here, and neither of them is very nice.
395 +
396 + # For direct rendering libGL has to be able to load one or more
397 + # dri modules (files ending in _dri.so, like fglrx_dri.so).
398 + # Gentoo's mesa looks for these files in the location specified by
399 + # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
400 + # location /usr/$(get_libdir)/dri. Ati's libGL does the same
401 + # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
402 + # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
403 + # 64bit. So we can either put the .so files in that (unusual,
404 + # compared to "normal" mesa libGL) location or set
405 + # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
406 + # 101539.
407 +
408 + # The problem with this approach is that LIBGL_DRIVERS_PATH
409 + # *overrides* the default hardcoded location, it does not extend
410 + # it. So if ati-drivers is merged but a non-ati libGL is selected
411 + # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
412 + # (because it changed in a newer mesa or because it was compiled
413 + # for a different set of multilib abis than we are) stuff breaks.
414 +
415 + # We create one file per ABI to work with "native" multilib, see
416 + # below.
417 +
418 + echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
419 + doenvd "${T}/03ati-colon-sep" || die
420 +
421 + # All libraries that we have a 32 bit and 64 bit version of on
422 + # amd64 are installed in src_install-libs. Everything else
423 + # (including libraries only available in native 64bit on amd64)
424 + # goes in here.
425 +
426 + # There used to be some code here that tried to detect running
427 + # under a "native multilib" portage ((precursor of)
428 + # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
429 + # should just work (only doing some duplicate work). --marienz
430 + if has_multilib_profile; then
431 + local OABI=${ABI}
432 + for ABI in $(get_install_abis); do
433 + src_install-libs
434 + done
435 + ABI=${OABI}
436 + unset OABI
437 + else
438 + src_install-libs
439 + fi
440 +
441 + # This is sorted by the order the files occur in the source tree.
442 +
443 + # X modules.
444 + exeinto /usr/$(get_libdir)/xorg/modules/drivers
445 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so || die
446 + exeinto /usr/$(get_libdir)/xorg/modules/linux
447 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so || die
448 + exeinto /usr/$(get_libdir)/xorg/modules
449 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so} || die
450 +
451 + # Arch-specific files.
452 + # (s)bin.
453 + into /opt
454 + dosbin "${ARCH_DIR}"/usr/sbin/atieventsd || die
455 + # We cleaned out the compilable stuff in src_unpack
456 + dobin "${ARCH_DIR}"/usr/X11R6/bin/* || die
457 +
458 + # lib.
459 + exeinto /usr/$(get_libdir)
460 + # Everything except for the libGL.so installed in src_install-libs.
461 + doexe $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
462 + -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
463 + insinto /usr/$(get_libdir)
464 + doins $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
465 + -maxdepth 1 -type f -not -name '*.so*')
466 +
467 + # Common files.
468 + # etc.
469 + insinto /etc/ati
470 + # Everything except for the authatieventsd.sh script.
471 + doins ${FOLDER_PREFIX}etc/ati/{logo*,control,atiogl.xml,signature,amdpcsdb.default}
472 + insopts -m0755
473 + doins ${FOLDER_PREFIX}etc/ati/authatieventsd.sh || die
474 +
475 + # include.
476 + insinto /usr
477 + doins -r ${FOLDER_PREFIX}usr/include || die
478 + insinto /usr/include/X11/extensions
479 +
480 + # Just the atigetsysteminfo.sh script.
481 + into /usr
482 + dosbin ${FOLDER_PREFIX}usr/sbin/* || die
483 +
484 + # data files for the control panel.
485 + if use qt4 ; then
486 + insinto /usr/share
487 + doins -r ${FOLDER_PREFIX}usr/share/ati || die
488 + insinto /usr/share/pixmaps
489 + doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm || die
490 + make_desktop_entry amdcccle 'ATI Catalyst Control Center' \
491 + ccc_large System
492 + fi
493 +
494 + # doc.
495 + dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx || die
496 +
497 + doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8 || die
498 +
499 + pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
500 +
501 + exeinto /etc/acpi
502 + doexe ati-powermode.sh || die
503 + insinto /etc/acpi/events
504 + doins events/* || die
505 +
506 + popd > /dev/null
507 +
508 + # Done with the "source" tree. Install tools we rebuilt:
509 + dobin extra/fgl_glxgears/fgl_glxgears || die
510 + newdoc extra/fgl_glxgears/README README.fgl_glxgears || die
511 +
512 + # Gentoo-specific stuff:
513 + newinitd "${FILESDIR}"/atieventsd.init atieventsd \
514 + || die "Failed to install atieventsd.init.d"
515 + echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
516 + insopts -m0644
517 + newconfd "${T}"/atieventsd.conf atieventsd || die
518 +}
519 +
520 +src_install-libs() {
521 + if [[ "${ABI}" == "amd64" ]]; then
522 + local EX_BASE_DIR="${BASE_DIR}_64a"
523 + local pkglibdir=lib64
524 + local MY_ARCH_DIR="${S}/arch/x86_64"
525 + else
526 + local EX_BASE_DIR="${BASE_DIR}"
527 + local pkglibdir=lib
528 + local MY_ARCH_DIR="${S}/arch/x86"
529 + fi
530 + einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
531 +
532 + local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
533 + # To make sure we do not miss a spot when these change.
534 + local libmajor=1 libminor=2
535 + local libver=${libmajor}.${libminor}
536 +
537 + # The GLX libraries
538 + # (yes, this really is "lib" even on amd64/multilib --marienz)
539 + exeinto ${ATI_ROOT}/lib
540 + doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/libGL.so.${libver} || die
541 + dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor} || die
542 + dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so || die
543 +
544 + exeinto ${ATI_ROOT}/extensions
545 + doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/libglx.so || die
546 +
547 + # DRI modules, installed into the path used by recent versions of mesa.
548 + exeinto /usr/$(get_libdir)/dri
549 + doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so || die
550 +
551 + # AMD Cal libraries
552 + exeinto /usr/$(get_libdir)
553 + doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so* || die
554 +
555 + local envname="${T}"/04ati-dri-path
556 + if [[ -n ${ABI} ]]; then
557 + envname="${envname}-${ABI}"
558 + fi
559 + echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
560 + doenvd "${envname}" || die
561 +}
562 +
563 +pkg_postinst() {
564 + elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
565 + elog "To change your xorg.conf you can use the bundled \"aticonfig\""
566 + elog
567 + elog "If you experience unexplained segmentation faults and kernel crashes"
568 + elog "with this driver and multi-threaded applications such as wine,"
569 + elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
570 + elog
571 + elog "Fully rebooting the system after an ${PN} update is recommended"
572 + elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
573 + elog "might not work"
574 +
575 + use modules && linux-mod_pkg_postinst
576 + "${ROOT}"/usr/bin/eselect opengl set --use-old ati
577 +}
578 +
579 +pkg_preinst() {
580 + use modules && linux-mod_pkg_preinst
581 +}
582 +
583 +pkg_prerm() {
584 + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
585 +}
586 +
587 +pkg_postrm() {
588 + use modules && linux-mod_pkg_postrm
589 + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
590 +}