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