Gentoo Archives: gentoo-commits

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