Gentoo Archives: gentoo-commits

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