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: ati-drivers-10.4.ebuild ChangeLog
Date: Thu, 29 Apr 2010 23:47:43
Message-Id: 20100429234736.8EFC32C04C@corvid.gentoo.org
1 lu_zero 10/04/29 23:47:35
2
3 Modified: ChangeLog
4 Added: ati-drivers-10.4.ebuild
5 Log:
6 New release version, as usual thanks to Enrico Tagliavini <enrico.tagliavini@×××××.com> for the ebuild and test
7 (Portage version: 2.1.8.3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.213 x11-drivers/ati-drivers/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.213&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.213&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?r1=1.212&r2=1.213
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v
19 retrieving revision 1.212
20 retrieving revision 1.213
21 diff -u -r1.212 -r1.213
22 --- ChangeLog 25 Mar 2010 21:02:00 -0000 1.212
23 +++ ChangeLog 29 Apr 2010 23:47:35 -0000 1.213
24 @@ -1,6 +1,12 @@
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.212 2010/03/25 21:02:00 lu_zero Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v 1.213 2010/04/29 23:47:35 lu_zero Exp $
29 +
30 +*ati-drivers-10.4 (29 Apr 2010)
31 +
32 + 29 Apr 2010; Luca Barbato <lu_zero@g.o> +ati-drivers-10.4.ebuild:
33 + New release version, as usual thanks to Enrico Tagliavini
34 + <enrico.tagliavini@×××××.com> for the ebuild and test
35
36 *ati-drivers-10.3 (25 Mar 2010)
37
38
39
40
41 1.1 x11-drivers/ati-drivers/ati-drivers-10.4.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-10.4.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-10.4.ebuild?rev=1.1&content-type=text/plain
45
46 Index: ati-drivers-10.4.ebuild
47 ===================================================================
48 # Copyright 1999-2010 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-10.4.ebuild,v 1.1 2010/04/29 23:47:35 lu_zero Exp $
51
52 EAPI="2"
53
54 inherit eutils multilib linux-mod toolchain-funcs versionator
55
56 DESCRIPTION="Ati precompiled drivers for r600 (HD Series) and newer chipsets"
57 HOMEPAGE="http://www.ati.com"
58 # 8.ble will be used for beta releases.
59 if [[ $(get_major_version) -gt 8 ]]; then
60 ATI_URL="https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/"
61 SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
62 FOLDER_PREFIX="common/"
63 else
64 SRC_URI="https://launchpad.net/ubuntu/karmic/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
65 FOLDER_PREFIX=""
66 fi
67 IUSE="debug +modules multilib qt4"
68
69 LICENSE="AMD GPL-2 QPL-1.0 as-is"
70 KEYWORDS="~amd64 ~x86"
71 SLOT="1"
72
73 RDEPEND="
74 !>=x11-base/xorg-server-1.8.0
75 !<x11-base/xorg-server-1.7
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-base/xorg-server-1.5.3-r7
82 x11-libs/libXinerama
83 x11-libs/libXrandr
84 multilib? ( app-emulation/emul-linux-x86-xlibs )
85 qt4? (
86 x11-libs/qt-core
87 x11-libs/qt-gui
88 )
89 "
90
91 DEPEND="${RDEPEND}
92 x11-proto/inputproto
93 x11-proto/xf86miscproto
94 x11-proto/xf86vidmodeproto
95 x11-proto/xineramaproto
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 # 2.6.33 kernel support
282 epatch "${FILESDIR}"/ati-drivers-2.6.33.patch
283 # Fix a known compilation error
284 epatch "${FILESDIR}"/ati-drivers-fix_compilation-bug-297322.patch
285
286 # These are the userspace utilities that we also have source for.
287 # We rebuild these later.
288 rm \
289 "${ARCH_DIR}"/usr/X11R6/bin/{fgl_glxgears,fglrx_xgamma} \
290 "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR}/libfglrx_gamma* \
291 || die "bin rm failed"
292
293 # in this version amdcccle isn't static, thus we depend on qt4
294 use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
295
296 # ACPI fixups
297 sed -i \
298 -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
299 -e "s:/var/lib/gdm/:/var/gdm/:" \
300 "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
301 || die "sed failed."
302
303 # Since "who" is in coreutils, we're using that one instead of "finger".
304 sed -i -e 's:finger:who:' \
305 "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
306 || die "Replacing 'finger' with 'who' failed."
307 # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
308 # add function to detect default state.
309 epatch "${FILESDIR}"/ati-powermode-opt-path-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
310
311 cd "${MODULE_DIR}"
312 ln -s "${ARCH_DIR}"/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC$(gcc-major-version) \
313 || die "symlinking precompiled core failed"
314
315 convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
316
317 # When built with ati's make.sh it defines a bunch of macros if
318 # certain .config values are set, falling back to less reliable
319 # detection methods if linux/autoconf.h is not available. We
320 # simply use the linux/autoconf.h settings directly, bypassing the
321 # detection script.
322 sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
323 sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
324 || die "MODVERSIONS sed failed"
325 cd "${S}"
326
327 mkdir extra || die "mkdir failed"
328 cd extra
329 unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
330 sed -i -e 's:include/extensions/extutil.h:X11/extensions/extutil.h:' \
331 lib/fglrx_gamma/fglrx_gamma.c || die "include fixup failed"
332 # Add a category.
333 mv programs/fglrx_gamma/fglrx_xgamma.{man,1} || die "man mv failed"
334 }
335
336 src_compile() {
337 use modules && linux-mod_src_compile
338
339 ebegin "Building fgl_glxgears"
340 cd "${S}"/extra/fgl_glxgears
341 # These extra libs/utils either have an Imakefile that does not
342 # work very well without tweaking or a Makefile ignoring CFLAGS
343 # and the like. We bypass those.
344
345 # The -DUSE_GLU is needed to compile using nvidia headers
346 # according to a comment in ati-drivers-extra-8.33.6.ebuild.
347 "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
348 -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
349 -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
350 eend $?
351
352 ebegin "Building fglrx_gamma lib"
353 cd "${S}"/extra/lib/fglrx_gamma
354 "$(tc-getCC)" -shared -fpic -o libfglrx_gamma.so.1.0 ${CFLAGS} ${LDFLAGS} \
355 -DXF86MISC -Wl,-soname,libfglrx_gamma.so.1.0 fglrx_gamma.c \
356 -lXext || die "fglrx_gamma lib build failed"
357 ln -s libfglrx_gamma.so.1.0 libfglrx_gamma.so || die "ln failed"
358 ln -s libfglrx_gamma.so.1.0 libfglrx_gamma.so.1 || die "ln failed"
359 eend $?
360
361 ebegin "Building fglrx_gamma util"
362 cd "${S}"/extra/programs/fglrx_gamma
363 "$(tc-getCC)" -o fglrx_xgamma ${CFLAGS} ${LDFLAGS} \
364 -I../../../${FOLDER_PREFIX}usr/X11R6/include -L../../lib/fglrx_gamma \
365 fglrx_xgamma.c -lm -lfglrx_gamma -lX11 \
366 || die "fglrx_gamma util build failed"
367 eend $?
368
369 }
370
371 src_install() {
372 use modules && linux-mod_src_install
373
374 # We can do two things here, and neither of them is very nice.
375
376 # For direct rendering libGL has to be able to load one or more
377 # dri modules (files ending in _dri.so, like fglrx_dri.so).
378 # Gentoo's mesa looks for these files in the location specified by
379 # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
380 # location /usr/$(get_libdir)/dri. Ati's libGL does the same
381 # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
382 # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
383 # 64bit. So we can either put the .so files in that (unusual,
384 # compared to "normal" mesa libGL) location or set
385 # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
386 # 101539.
387
388 # The problem with this approach is that LIBGL_DRIVERS_PATH
389 # *overrides* the default hardcoded location, it does not extend
390 # it. So if ati-drivers is merged but a non-ati libGL is selected
391 # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
392 # (because it changed in a newer mesa or because it was compiled
393 # for a different set of multilib abis than we are) stuff breaks.
394
395 # We create one file per ABI to work with "native" multilib, see
396 # below.
397
398 echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
399 doenvd "${T}/03ati-colon-sep" || die
400
401 # All libraries that we have a 32 bit and 64 bit version of on
402 # amd64 are installed in src_install-libs. Everything else
403 # (including libraries only available in native 64bit on amd64)
404 # goes in here.
405
406 # There used to be some code here that tried to detect running
407 # under a "native multilib" portage ((precursor of)
408 # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
409 # should just work (only doing some duplicate work). --marienz
410 if has_multilib_profile; then
411 local OABI=${ABI}
412 for ABI in $(get_install_abis); do
413 src_install-libs
414 done
415 ABI=${OABI}
416 unset OABI
417 else
418 src_install-libs
419 fi
420
421 # This is sorted by the order the files occur in the source tree.
422
423 # X modules.
424 exeinto /usr/$(get_libdir)/xorg/modules/drivers
425 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so || die
426 exeinto /usr/$(get_libdir)/xorg/modules/linux
427 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so || die
428 exeinto /usr/$(get_libdir)/xorg/modules
429 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so} || die
430
431 # Arch-specific files.
432 # (s)bin.
433 into /opt
434 dosbin "${ARCH_DIR}"/usr/sbin/atieventsd || die
435 # We cleaned out the compilable stuff in src_unpack
436 dobin "${ARCH_DIR}"/usr/X11R6/bin/* || die
437
438 # lib.
439 exeinto /usr/$(get_libdir)
440 # Everything except for the libGL.so installed in src_install-libs.
441 doexe $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
442 -maxdepth 1 -type f -name '*.so*' -not -name 'libGL.so*')
443 insinto /usr/$(get_libdir)
444 doins $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
445 -maxdepth 1 -type f -not -name '*.so*')
446
447 # Common files.
448 # etc.
449 insinto /etc/ati
450 # Everything except for the authatieventsd.sh script.
451 doins ${FOLDER_PREFIX}etc/ati/{logo*,control,atiogl.xml,signature,amdpcsdb.default}
452 insopts -m0755
453 doins ${FOLDER_PREFIX}etc/ati/authatieventsd.sh || die
454
455 # include.
456 insinto /usr
457 doins -r ${FOLDER_PREFIX}usr/include || die
458 insinto /usr/include/X11/extensions
459 doins ${FOLDER_PREFIX}usr/X11R6/include/X11/extensions/fglrx_gamma.h || die
460
461 # Just the atigetsysteminfo.sh script.
462 into /usr
463 dosbin ${FOLDER_PREFIX}usr/sbin/* || die
464
465 # data files for the control panel.
466 if use qt4 ; then
467 insinto /usr/share
468 doins -r ${FOLDER_PREFIX}usr/share/ati || die
469 insinto /usr/share/pixmaps
470 doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm || die
471 make_desktop_entry amdcccle 'ATI Catalyst Control Center' \
472 ccc_large System
473 fi
474
475 # doc.
476 dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx || die
477
478 doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8 || die
479
480 pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
481
482 exeinto /etc/acpi
483 doexe ati-powermode.sh || die
484 insinto /etc/acpi/events
485 doins events/* || die
486
487 popd > /dev/null
488
489 # Done with the "source" tree. Install tools we rebuilt:
490 dobin extra/fgl_glxgears/fgl_glxgears || die
491 newdoc extra/fgl_glxgears/README README.fgl_glxgears || die
492
493 dolib extra/lib/fglrx_gamma/*so* || die
494 newdoc extra/lib/fglrx_gamma/README README.libfglrx_gamma || die
495
496 dobin extra/programs/fglrx_gamma/fglrx_xgamma || die
497 doman extra/programs/fglrx_gamma/fglrx_xgamma.1 || die
498 newdoc extra/programs/fglrx_gamma/README README.fglrx_gamma || die
499
500 # Gentoo-specific stuff:
501 newinitd "${FILESDIR}"/atieventsd.init atieventsd \
502 || die "Failed to install atieventsd.init.d"
503 echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
504 newconfd "${T}"/atieventsd.conf atieventsd || die
505 }
506
507 src_install-libs() {
508 if [[ "${ABI}" == "amd64" ]]; then
509 local EX_BASE_DIR="${BASE_DIR}_64a"
510 local pkglibdir=lib64
511 local MY_ARCH_DIR="${S}/arch/x86_64"
512 else
513 local EX_BASE_DIR="${BASE_DIR}"
514 local pkglibdir=lib
515 local MY_ARCH_DIR="${S}/arch/x86"
516 fi
517 einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
518
519 local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
520 # To make sure we do not miss a spot when these change.
521 local libmajor=1 libminor=2
522 local libver=${libmajor}.${libminor}
523
524 # The GLX libraries
525 # (yes, this really is "lib" even on amd64/multilib --marienz)
526 exeinto ${ATI_ROOT}/lib
527 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/libGL.so.${libver} || die
528 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor} || die
529 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so || die
530
531 exeinto ${ATI_ROOT}/extensions
532 doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/* || die
533
534 # DRI modules, installed into the path used by recent versions of mesa.
535 exeinto /usr/$(get_libdir)/dri
536 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so || die
537
538 # AMD Cal libraries
539 exeinto /usr/$(get_libdir)
540 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so* || die
541
542 # warn about removal of .la file
543 # WILL BE NEEDED IN FUTURE
544 #if [[ -e ${ATI_ROOT}/lib/libGL.la ]]; then
545 # ewarn "Since this version the libGL.la is not installed"
546 # ewarn "For fixing this issues please take look on:"
547 # ewarn " dev-util/lafilefixer"
548 # ewarn "This step is needed because the libGL.la is going"
549 # ewarn "to be removed by newer versions of the media-libs/mesa"
550 #fi
551 # Make up a libGL.la. Ati does not provide one, but mesa does. If
552 # a (libtool-based) libfoo is built with libGL.la present a
553 # reference to it is put into libfoo.la, and compiling
554 # (libtool-based) things that link too libfoo.la will complain if
555 # libGL.la disappears. So if we do not make up a libGL.la
556 # switching between mesa and ati becomes painful.
557 local revision=$(printf '%d%02d%02d' $(get_version_components))
558 sed -e "s:\${libmajor}:${libmajor}:g" \
559 -e "s:\${libminor}:${libminor}:g" \
560 -e "s:\${libdir}:$(get_libdir):g" \
561 -e "s:\${revision}:${revision}:g" \
562 "${FILESDIR}"/libGL.la.in > "${D}"/${ATI_ROOT}/lib/libGL.la \
563 || die "sed failed to make libGL.la"
564
565 local envname="${T}"/04ati-dri-path
566 if [[ -n ${ABI} ]]; then
567 envname="${envname}-${ABI}"
568 fi
569 echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
570 doenvd "${envname}" || die
571 }
572
573 pkg_postinst() {
574 elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
575 elog "To change your xorg.conf you can use the bundled \"aticonfig\""
576 elog
577 elog "If you experience unexplained segmentation faults and kernel crashes"
578 elog "with this driver and multi-threaded applications such as wine,"
579 elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
580 elog
581 elog "You will have to source /etc/profile (or logout and back in) for dri"
582 elog "to work, unless you previously had ati-drivers installed."
583
584 # Workaroud screen corruption
585 ewarn "If you experience screen corruption with this driver, try putting"
586 ewarn ' Option "XAANoOffscreenPixmaps" "true"'
587 ewarn "in the Device Section of /etc/X11/xorg.conf."
588
589 use modules && linux-mod_pkg_postinst
590 "${ROOT}"/usr/bin/eselect opengl set --use-old ati
591 }
592
593 pkg_preinst() {
594 use modules && linux-mod_pkg_preinst
595 }
596
597 pkg_prerm() {
598 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
599 }
600
601 pkg_postrm() {
602 use modules && linux-mod_pkg_postrm
603 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
604 }