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