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