Gentoo Archives: gentoo-commits

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