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