Gentoo Archives: gentoo-commits

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