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