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