Gentoo Archives: gentoo-commits

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