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: Sat, 02 Apr 2011 12:52:25
Message-Id: aa685a4c39561a03b4d204ba6452854ad9bedb5d.Enrico@gentoo
1 commit: aa685a4c39561a03b4d204ba6452854ad9bedb5d
2 Author: Enrico Tagliavini <enrico.tagliavini <AT> gmail <DOT> com>
3 AuthorDate: Sat Apr 2 12:51:58 2011 +0000
4 Commit: Enrico Tagliavini <enrico.tagliavini <AT> gmail <DOT> com>
5 CommitDate: Sat Apr 2 12:51:58 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git;a=commit;h=aa685a4c
7
8 Bump for the new ati-drivers beta for xorg-server-1.10
9
10 ---
11 x11-drivers/ati-drivers/ati-drivers-8.840.ebuild | 572 ++++++++++++++++++++++
12 1 files changed, 572 insertions(+), 0 deletions(-)
13
14 diff --git a/x11-drivers/ati-drivers/ati-drivers-8.840.ebuild b/x11-drivers/ati-drivers/ati-drivers-8.840.ebuild
15 new file mode 100644
16 index 0000000..3e2c0d7
17 --- /dev/null
18 +++ b/x11-drivers/ati-drivers/ati-drivers-8.840.ebuild
19 @@ -0,0 +1,572 @@
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=""
43 +SLOT="1"
44 +
45 +RDEPEND="
46 + >=x11-base/xorg-server-1.10
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 + 1\.8*|1\.7*) BASE_DIR="${S}/xpic" ;;
262 + *) die "xorg-server-${ver_str} not supported" ;;
263 + esac
264 +
265 + # amd64/x86
266 + if use amd64 ; then
267 + MY_BASE_DIR="${BASE_DIR}_64a"
268 + PKG_LIBDIR=lib64
269 + ARCH_DIR="${S}/arch/x86_64"
270 + else
271 + MY_BASE_DIR="${BASE_DIR}"
272 + PKG_LIBDIR=lib
273 + ARCH_DIR="${S}/arch/x86"
274 + fi
275 +
276 + if use modules; then
277 + MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
278 + BUILD_TARGETS="kmod_build"
279 + linux-mod_pkg_setup
280 + BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
281 + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
282 + if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
283 + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
284 + else
285 + BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
286 + fi
287 + _check_kernel_config
288 + fi
289 +
290 + elog
291 + elog "Please note that this driver supports only graphic cards based on"
292 + elog "r600 chipset and newer."
293 + elog "This represent the ATI Radeon HD series at this moment."
294 + elog
295 + elog "If your card is older then usage of ${CATEGORY}/xf86-video-ati"
296 + elog "as replacement is highly recommended. Rather than staying with"
297 + elog "old versions of this driver."
298 + elog "For migration informations please reffer to:"
299 + elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
300 + einfo
301 +}
302 +
303 +src_unpack() {
304 + if [[ $(get_major_version) -gt 8 ]]; then
305 + # Switching to a standard way to extract the files since otherwise no signature file
306 + # would be created
307 + local src="${DISTDIR}/${A}"
308 + sh "${src}" --extract "${S}" 2&>1 /dev/null
309 + else
310 + unpack ${A}
311 + fi
312 +}
313 +
314 +src_prepare() {
315 + # All kernel options for prepare are ment to be in here
316 + if use modules; then
317 + # version patches
318 + # epatch "${FILESDIR}"/kernel/${PV}-*.patch
319 + if use debug; then
320 + sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
321 + "${MODULE_DIR}/firegl_public.c" \
322 + || die "Failed to enable debug output."
323 + fi
324 + fi
325 +
326 + # Fix a known compilation error
327 + epatch "${FILESDIR}"/ati-drivers-fix_compilation-bug-297322.patch
328 +
329 + # These are the userspace utilities that we also have source for.
330 + # We rebuild these later.
331 + rm \
332 + "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
333 + || die "bin rm failed"
334 +
335 + # in this version amdcccle isn't static, thus we depend on qt4
336 + use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
337 +
338 + # ACPI fixups
339 + sed -i \
340 + -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
341 + -e "s:/var/lib/gdm/:/var/gdm/:" \
342 + "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
343 + || die "sed failed."
344 +
345 + # Since "who" is in coreutils, we're using that one instead of "finger".
346 + sed -i -e 's:finger:who:' \
347 + "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
348 + || die "Replacing 'finger' with 'who' failed."
349 + # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
350 + # add function to detect default state.
351 + epatch "${FILESDIR}"/ati-powermode-opt-path-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
352 +
353 + cd "${MODULE_DIR}"
354 +
355 + # bugged fglrx build system, this file should be copied by hand
356 + cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
357 +
358 + convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
359 +
360 + # When built with ati's make.sh it defines a bunch of macros if
361 + # certain .config values are set, falling back to less reliable
362 + # detection methods if linux/autoconf.h is not available. We
363 + # simply use the linux/autoconf.h settings directly, bypassing the
364 + # detection script.
365 + sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
366 + sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
367 + || die "MODVERSIONS sed failed"
368 + cd "${S}"
369 +
370 + mkdir extra || die "mkdir failed"
371 + cd extra
372 + unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
373 +}
374 +
375 +src_compile() {
376 + use modules && linux-mod_src_compile
377 +
378 + ebegin "Building fgl_glxgears"
379 + cd "${S}"/extra/fgl_glxgears
380 + # These extra libs/utils either have an Imakefile that does not
381 + # work very well without tweaking or a Makefile ignoring CFLAGS
382 + # and the like. We bypass those.
383 +
384 + # The -DUSE_GLU is needed to compile using nvidia headers
385 + # according to a comment in ati-drivers-extra-8.33.6.ebuild.
386 + "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
387 + -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
388 + -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
389 + eend $?
390 +}
391 +
392 +src_install() {
393 + use modules && linux-mod_src_install
394 +
395 + # We can do two things here, and neither of them is very nice.
396 +
397 + # For direct rendering libGL has to be able to load one or more
398 + # dri modules (files ending in _dri.so, like fglrx_dri.so).
399 + # Gentoo's mesa looks for these files in the location specified by
400 + # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
401 + # location /usr/$(get_libdir)/dri. Ati's libGL does the same
402 + # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
403 + # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
404 + # 64bit. So we can either put the .so files in that (unusual,
405 + # compared to "normal" mesa libGL) location or set
406 + # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
407 + # 101539.
408 +
409 + # The problem with this approach is that LIBGL_DRIVERS_PATH
410 + # *overrides* the default hardcoded location, it does not extend
411 + # it. So if ati-drivers is merged but a non-ati libGL is selected
412 + # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
413 + # (because it changed in a newer mesa or because it was compiled
414 + # for a different set of multilib abis than we are) stuff breaks.
415 +
416 + # We create one file per ABI to work with "native" multilib, see
417 + # below.
418 +
419 + echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
420 + doenvd "${T}/03ati-colon-sep" || die
421 +
422 + # All libraries that we have a 32 bit and 64 bit version of on
423 + # amd64 are installed in src_install-libs. Everything else
424 + # (including libraries only available in native 64bit on amd64)
425 + # goes in here.
426 +
427 + # There used to be some code here that tried to detect running
428 + # under a "native multilib" portage ((precursor of)
429 + # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
430 + # should just work (only doing some duplicate work). --marienz
431 + if has_multilib_profile; then
432 + local OABI=${ABI}
433 + for ABI in $(get_install_abis); do
434 + src_install-libs
435 + done
436 + ABI=${OABI}
437 + unset OABI
438 + else
439 + src_install-libs
440 + fi
441 +
442 + # This is sorted by the order the files occur in the source tree.
443 +
444 + # X modules.
445 + exeinto /usr/$(get_libdir)/xorg/modules/drivers
446 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so || die
447 + exeinto /usr/$(get_libdir)/xorg/modules/linux
448 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so || die
449 + exeinto /usr/$(get_libdir)/xorg/modules
450 + doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so} || die
451 +
452 + # Arch-specific files.
453 + # (s)bin.
454 + into /opt
455 + dosbin "${ARCH_DIR}"/usr/sbin/atieventsd || die
456 + # We cleaned out the compilable stuff in src_unpack
457 + dobin "${ARCH_DIR}"/usr/X11R6/bin/* || die
458 +
459 + # lib.
460 + exeinto /usr/$(get_libdir)
461 + # Everything except for the libGL.so installed in src_install-libs.
462 + doexe $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
463 + -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
464 + insinto /usr/$(get_libdir)
465 + doins $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
466 + -maxdepth 1 -type f -not -name '*.so*')
467 +
468 + # Common files.
469 + # etc.
470 + insinto /etc/ati
471 + # Everything except for the authatieventsd.sh script.
472 + doins ${FOLDER_PREFIX}etc/ati/{logo*,control,atiogl.xml,signature,amdpcsdb.default}
473 + insopts -m0755
474 + doins ${FOLDER_PREFIX}etc/ati/authatieventsd.sh || die
475 +
476 + # include.
477 + insinto /usr
478 + doins -r ${FOLDER_PREFIX}usr/include || die
479 + insinto /usr/include/X11/extensions
480 +
481 + # Just the atigetsysteminfo.sh script.
482 + into /usr
483 + dosbin ${FOLDER_PREFIX}usr/sbin/* || die
484 +
485 + # data files for the control panel.
486 + if use qt4 ; then
487 + insinto /usr/share
488 + doins -r ${FOLDER_PREFIX}usr/share/ati || die
489 + insinto /usr/share/pixmaps
490 + doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm || die
491 + make_desktop_entry amdcccle 'ATI Catalyst Control Center' \
492 + ccc_large System
493 + fi
494 +
495 + # doc.
496 + dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx || die
497 +
498 + doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8 || die
499 +
500 + pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
501 +
502 + exeinto /etc/acpi
503 + doexe ati-powermode.sh || die
504 + insinto /etc/acpi/events
505 + doins events/* || die
506 +
507 + popd > /dev/null
508 +
509 + # Done with the "source" tree. Install tools we rebuilt:
510 + dobin extra/fgl_glxgears/fgl_glxgears || die
511 + newdoc extra/fgl_glxgears/README README.fgl_glxgears || die
512 +
513 + # Gentoo-specific stuff:
514 + newinitd "${FILESDIR}"/atieventsd.init atieventsd \
515 + || die "Failed to install atieventsd.init.d"
516 + echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
517 + insopts -m0644
518 + newconfd "${T}"/atieventsd.conf atieventsd || die
519 +}
520 +
521 +src_install-libs() {
522 + if [[ "${ABI}" == "amd64" ]]; then
523 + local EX_BASE_DIR="${BASE_DIR}_64a"
524 + local pkglibdir=lib64
525 + local MY_ARCH_DIR="${S}/arch/x86_64"
526 + else
527 + local EX_BASE_DIR="${BASE_DIR}"
528 + local pkglibdir=lib
529 + local MY_ARCH_DIR="${S}/arch/x86"
530 + fi
531 + einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
532 +
533 + local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
534 + # To make sure we do not miss a spot when these change.
535 + local libmajor=1 libminor=2
536 + local libver=${libmajor}.${libminor}
537 +
538 + # The GLX libraries
539 + # (yes, this really is "lib" even on amd64/multilib --marienz)
540 + exeinto ${ATI_ROOT}/lib
541 + doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/libGL.so.${libver} || die
542 + dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor} || die
543 + dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so || die
544 +
545 + exeinto ${ATI_ROOT}/extensions
546 + doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/libglx.so || die
547 +
548 + # DRI modules, installed into the path used by recent versions of mesa.
549 + exeinto /usr/$(get_libdir)/dri
550 + doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so || die
551 +
552 + # AMD Cal libraries
553 + exeinto /usr/$(get_libdir)
554 + doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so* || die
555 +
556 + local envname="${T}"/04ati-dri-path
557 + if [[ -n ${ABI} ]]; then
558 + envname="${envname}-${ABI}"
559 + fi
560 + echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
561 + doenvd "${envname}" || die
562 +}
563 +
564 +pkg_postinst() {
565 + elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
566 + elog "To change your xorg.conf you can use the bundled \"aticonfig\""
567 + elog
568 + elog "If you experience unexplained segmentation faults and kernel crashes"
569 + elog "with this driver and multi-threaded applications such as wine,"
570 + elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
571 + elog
572 + elog "Fully rebooting the system after an ${PN} update is raccomended"
573 + elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
574 + elog "might not work"
575 +
576 + use modules && linux-mod_pkg_postinst
577 + "${ROOT}"/usr/bin/eselect opengl set --use-old ati
578 +}
579 +
580 +pkg_preinst() {
581 + use modules && linux-mod_pkg_preinst
582 +}
583 +
584 +pkg_prerm() {
585 + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
586 +}
587 +
588 +pkg_postrm() {
589 + use modules && linux-mod_pkg_postrm
590 + "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
591 +}