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