Gentoo Archives: gentoo-commits

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