/[gentoo-x86]/x11-drivers/ati-drivers/ati-drivers-13.1.ebuild
Gentoo

Contents of /x11-drivers/ati-drivers/ati-drivers-13.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Jan 18 23:13:47 2013 UTC (21 months ago) by chithanh
Branch: MAIN
Version bump. Remove old.

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=5
6
7 inherit eutils multilib linux-info linux-mod toolchain-funcs versionator
8
9 DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
10 HOMEPAGE="http://www.amd.com"
11 MY_V=( $(get_version_components) )
12 #RUN="${WORKDIR}/amd-driver-installer-9.00-x86.x86_64.run"
13 DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-${PV}-linux-x86.x86_64.zip"
14 XVBA_SDK_URI="http://developer.amd.com.php53-23.ord1-1.websitetestlink.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
15 SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
16 FOLDER_PREFIX="common/"
17 IUSE="debug +modules multilib qt4 static-libs disable-watermark"
18
19 LICENSE="AMD GPL-2 QPL-1.0"
20 KEYWORDS="-* ~amd64 ~x86"
21 SLOT="1"
22
23 RESTRICT="bindist"
24
25 RDEPEND="
26 <=x11-base/xorg-server-1.13.49[-minimal]
27 >=app-admin/eselect-opengl-1.0.7
28 app-admin/eselect-opencl
29 sys-power/acpid
30 x11-apps/xauth
31 x11-libs/libX11
32 x11-libs/libXext
33 x11-libs/libXinerama
34 x11-libs/libXrandr
35 x11-libs/libXrender
36 virtual/glu
37 multilib? (
38 app-emulation/emul-linux-x86-opengl
39 app-emulation/emul-linux-x86-xlibs
40 )
41 qt4? (
42 x11-libs/libICE
43 x11-libs/libSM
44 x11-libs/libXcursor
45 x11-libs/libXfixes
46 x11-libs/libXxf86vm
47 x11-libs/qt-core:4
48 x11-libs/qt-gui:4[accessibility]
49 )
50 "
51
52 DEPEND="${RDEPEND}
53 x11-proto/inputproto
54 x11-proto/xf86miscproto
55 x11-proto/xf86vidmodeproto
56 x11-proto/xineramaproto
57 x11-libs/libXtst
58 sys-apps/findutils
59 app-misc/pax-utils
60 app-arch/unzip
61 "
62
63 EMULTILIB_PKG="true"
64
65 S="${WORKDIR}"
66
67 # QA Silencing
68 QA_TEXTRELS="
69 usr/lib*/opengl/ati/lib/libGL.so.1.2
70 usr/lib*/libatiadlxx.so
71 usr/lib*/xorg/modules/glesx.so
72 usr/lib*/libaticaldd.so
73 usr/lib*/dri/fglrx_dri.so
74 "
75
76 QA_EXECSTACK="
77 opt/bin/atiode
78 opt/bin/amdcccle
79 usr/lib*/opengl/ati/lib/libGL.so.1.2
80 usr/lib*/dri/fglrx_dri.so
81 "
82
83 QA_WX_LOAD="
84 usr/lib*/opengl/ati/lib/libGL.so.1.2
85 usr/lib*/dri/fglrx_dri.so
86 "
87
88 QA_PRESTRIPPED="
89 usr/lib\(32\|64\)\?/libXvBAW.so.1.0
90 usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
91 usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
92 usr/lib\(32\|64\)\?/xorg/modules/glesx.so
93 usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
94 usr/lib\(32\|64\)\?/libaticaldd.so
95 usr/lib\(32\|64\)\?/dri/fglrx_dri.so
96 "
97
98 QA_SONAME="
99 usr/lib\(32\|64\)\?/libatiadlxx.so
100 usr/lib\(32\|64\)\?/libaticalcl.so
101 usr/lib\(32\|64\)\?/libaticaldd.so
102 usr/lib\(32\|64\)\?/libaticalrt.so
103 usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
104 "
105
106 QA_DT_HASH="
107 opt/bin/amdcccle
108 opt/bin/aticonfig
109 opt/bin/atiodcli
110 opt/bin/atiode
111 opt/bin/clinfo
112 opt/bin/fglrxinfo
113 opt/sbin/atieventsd
114 opt/sbin/amdnotifyui
115 usr/lib\(32\|64\)\?/libaticalcl.so
116 usr/lib\(32\|64\)\?/libaticalrt.so
117 usr/lib\(32\|64\)\?/libatiuki.so.1.0
118 usr/lib\(32\|64\)\?/libatiadlxx.so
119 usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
120 usr/lib\(32\|64\)\?/libXvBAW.so.1.0
121 usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
122 usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
123 usr/lib\(32\|64\)\?/xorg/modules/glesx.so
124 usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
125 usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
126 usr/lib\(32\|64\)\?/libaticaldd.so
127 usr/lib\(32\|64\)\?/dri/fglrx_dri.so
128 usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
129 usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
130 usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
131 usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
132 usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
133 usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
134 "
135
136 _check_kernel_config() {
137 local failed=0
138 local error=""
139 if ! kernel_is ge 2 6; then
140 eerror "You need a 2.6 linux kernel to compile against!"
141 die "No 2.6 Kernel found"
142 fi
143
144 if ! linux_chkconfig_present MTRR; then
145 ewarn "You don't have MTRR support enabled in the kernel."
146 ewarn "Direct rendering will not work."
147 fi
148
149 if linux_chkconfig_builtin DRM; then
150 ewarn "You have DRM support built in to the kernel"
151 ewarn "Direct rendering will not work."
152 fi
153
154 if ! linux_chkconfig_present AGP && \
155 ! linux_chkconfig_present PCIEPORTBUS; then
156 ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
157 ewarn "Direct rendering will not work."
158 fi
159
160 if ! linux_chkconfig_present ACPI; then
161 eerror "${P} requires the ACPI support in the kernel"
162 eerror "Please enable it:"
163 eerror " CONFIG_ACPI=y"
164 eerror "in /usr/src/linux/.config or"
165 eerror " Power management and ACPI options --->"
166 eerror " [*] Power Management support"
167 eerror "in the 'menuconfig'"
168 error+=" CONFIG_ACPI disabled;"
169 failed=1
170 fi
171
172 if ! linux_chkconfig_present PCI_MSI; then
173 eerror "${P} requires MSI in the kernel."
174 eerror "Please enable it:"
175 eerror " CONFIG_PCI_MSI=y"
176 eerror "in /usr/src/linux/.config or"
177 eerror " Bus options (PCI etc.) --->"
178 eerror " [*] Message Signaled Interrupts (MSI and MSI-X)"
179 eerror "in the kernel config."
180 error+=" CONFIG_PCI_MSI disabled;"
181 failed=1
182 fi
183
184 if linux_chkconfig_present LOCKDEP; then
185 eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
186 eerror "Unfortunately, this option exports the symbol lock_acquire as GPL-only."
187 eerror "This prevents ${P} from compiling with an error like this:"
188 eerror "FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
189 eerror "Please make sure the following options have been unset:"
190 eerror " Kernel hacking --->"
191 eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
192 eerror " [ ] Lock debugging: prove locking correctness"
193 eerror " [ ] Lock usage statistics"
194 eerror "in 'menuconfig'"
195 error+=" LOCKDEP enabled;"
196 failed=1
197 fi
198
199 use amd64 && if ! linux_chkconfig_present COMPAT; then
200 eerror "${P} requires COMPAT."
201 eerror "Please enable the 32 bit emulation:"
202 eerror "Executable file formats / Emulations --->"
203 eerror " [*] IA32 Emulation"
204 eerror "in the kernel config."
205 eerror "if this doesn't enable CONFIG_COMPAT add"
206 eerror " CONFIG_COMPAT=y"
207 eerror "in /usr/src/linux/.config"
208 error+=" COMPAT disabled;"
209 failed=1
210 fi
211
212 kernel_is ge 2 6 37 && kernel_is le 2 6 38 && if ! linux_chkconfig_present BKL ; then
213 eerror "${P} requires BKL."
214 eerror "Please enable the Big Kernel Lock:"
215 eerror "Kernel hacking --->"
216 eerror " [*] Big Kernel Lock"
217 eerror "in the kernel config."
218 eerror "or add"
219 eerror " CONFIG_BKL=y"
220 eerror "in /usr/src/linux/.config"
221 error+=" BKL disabled;"
222 failed=1
223 fi
224
225 [[ ${failed} -ne 0 ]] && die "${error}"
226 }
227
228 pkg_pretend() {
229 # workaround until bug 365543 is solved
230 if use modules; then
231 linux-info_pkg_setup
232 require_configured_kernel
233 _check_kernel_config
234 fi
235 }
236
237 pkg_setup() {
238 if use modules; then
239 MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
240 BUILD_TARGETS="kmod_build"
241 linux-mod_pkg_setup
242 BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
243 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
244 if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
245 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
246 else
247 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
248 fi
249 fi
250 # Define module dir.
251 MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
252 # get the xorg-server version and set BASE_DIR for that
253 BASE_DIR="${S}/xpic"
254
255 # amd64/x86
256 if use amd64 ; then
257 MY_BASE_DIR="${BASE_DIR}_64a"
258 PKG_LIBDIR=lib64
259 ARCH_DIR="${S}/arch/x86_64"
260 else
261 MY_BASE_DIR="${BASE_DIR}"
262 PKG_LIBDIR=lib
263 ARCH_DIR="${S}/arch/x86"
264 fi
265
266 elog
267 elog "Please note that this driver supports only graphic cards based on"
268 elog "Evergreen chipset and newer."
269 elog "This represent the AMD Radeon HD 5400+ series at this moment."
270 elog
271 elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
272 elog "For migration informations please reffer to:"
273 elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
274 einfo
275 }
276
277 src_unpack() {
278 local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
279 DRIVERS_DISTFILE=${DRIVERS_URI/*\//}
280 XVBA_SDK_DISTFILE=${XVBA_SDK_URI/*\//}
281
282 if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
283 unpack ${DRIVERS_DISTFILE}
284 else
285 #please note, RUN may be insanely assigned at top near SRC_URI
286 if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
287 unpack ${DRIVERS_DISTFILE}
288 [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
289 else
290 RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
291 fi
292 sh ${RUN} --extract "${S}" 2>&1 > /dev/null || die
293 fi
294
295 mkdir xvba_sdk
296 cd xvba_sdk
297 unpack ${XVBA_SDK_DISTFILE}
298 }
299
300 src_prepare() {
301 # All kernel options for prepare are ment to be in here
302 if use modules; then
303 # version patches
304 # epatch "${FILESDIR}"/kernel/${PV}-*.patch
305 if use debug; then
306 sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
307 "${MODULE_DIR}/firegl_public.c" \
308 || die "Failed to enable debug output."
309 fi
310 fi
311
312 # These are the userspace utilities that we also have source for.
313 # We rebuild these later.
314 rm \
315 "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
316 || die "bin rm failed"
317
318 # in this version amdcccle isn't static, thus we depend on qt4
319 use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
320
321 # ACPI fixups
322 sed -i \
323 -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
324 -e "s:/var/lib/gdm/:/var/gdm/:" \
325 "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
326 || die "sed failed."
327
328 # Since "who" is in coreutils, we're using that one instead of "finger".
329 sed -i -e 's:finger:who:' \
330 "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
331 || die "Replacing 'finger' with 'who' failed."
332 # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
333 # add function to detect default state.
334 epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
335
336 # see http://ati.cchtml.com/show_bug.cgi?id=495
337 #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
338 # first hunk applied upstream second (x32 related) was not
339 epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
340
341 # compile fix for linux-3.7
342 # https://bugs.gentoo.org/show_bug.cgi?id=438516
343 epatch "${FILESDIR}/ati-drivers-vm-reserverd.patch"
344
345 # compile fix for AGP-less kernel, bug #435322
346 epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
347
348 # Use ACPI_DEVICE_HANDLE wrapper to make driver build on linux-3.8
349 # see https://bugs.gentoo.org/show_bug.cgi?id=448216
350 epatch "${FILESDIR}/ati-drivers-kernel-3.8-acpihandle.patch"
351
352 cd "${MODULE_DIR}"
353
354 # bugged fglrx build system, this file should be copied by hand
355 cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
356
357 convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
358
359 # When built with ati's make.sh it defines a bunch of macros if
360 # certain .config values are set, falling back to less reliable
361 # detection methods if linux/autoconf.h is not available. We
362 # simply use the linux/autoconf.h settings directly, bypassing the
363 # detection script.
364 sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
365 sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
366 || die "MODVERSIONS sed failed"
367 cd "${S}"
368
369 mkdir extra || die "mkdir failed"
370 cd extra
371 unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
372
373 # Get rid of watermark. Oldest known reference:
374 # http://phoronix.com/forums/showthread.php?19875-Unsupported-Hardware-watermark
375 if use disable-watermark; then
376 ebegin "Disabling watermark"
377 driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
378 for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
379 sed -i "s/${x/x5b/\x5b}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
380 done
381 eend $? || die "Disabling watermark failed"
382 fi
383 }
384
385 src_compile() {
386 use modules && linux-mod_src_compile
387
388 ebegin "Building fgl_glxgears"
389 cd "${S}"/extra/fgl_glxgears
390 # These extra libs/utils either have an Imakefile that does not
391 # work very well without tweaking or a Makefile ignoring CFLAGS
392 # and the like. We bypass those.
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 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 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 'AMD 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 exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
575 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
576 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
577 dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
578 exeinto /usr/$(get_libdir)
579 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
580
581 # OpenCL vendor files
582 insinto /etc/OpenCL/vendors/
583 cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
584 /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
585 EOF
586 doins "${T}"/amdocl${oclsuffix}.icd
587
588 local envname="${T}"/04ati-dri-path
589 if [[ -n ${ABI} ]]; then
590 envname="${envname}-${ABI}"
591 fi
592 echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
593 doenvd "${envname}"
594
595 # Silence the QA notice by creating missing soname symlinks
596 for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
597 do
598 local soname=${so##*/}
599 local soname_one=${soname%.[0-9]}
600 local soname_zero=${soname_one%.[0-9]}
601 dosym ${soname} /usr/$(get_libdir)/${soname_one}
602 dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
603 done
604
605 # See https://bugs.gentoo.org/show_bug.cgi?id=443466
606 dodir /etc/revdep-rebuild/
607 echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
608
609 #remove static libs if not wanted
610 use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
611
612 #install xvba sdk headers
613 doheader xvba_sdk/include/amdxvba.h
614 }
615
616 pkg_postinst() {
617 elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
618 elog "To change your xorg.conf you can use the bundled \"aticonfig\""
619 elog
620 elog "If you experience unexplained segmentation faults and kernel crashes"
621 elog "with this driver and multi-threaded applications such as wine,"
622 elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
623 elog
624 elog "Fully rebooting the system after an ${PN} update is recommended"
625 elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
626 elog "might not work"
627 elog
628 elog "Some cards need acpid running to handle events"
629 elog "Please add it to boot runlevel with rc-update add acpid boot"
630 elog
631
632 use modules && linux-mod_pkg_postinst
633 "${ROOT}"/usr/bin/eselect opengl set --use-old ati
634 "${ROOT}"/usr/bin/eselect opencl set --use-old amd
635
636 if has_version ">=x11-drivers/xf86-video-intel-2.20.3"; then
637 ewarn "It is reported that xf86-video-intel-2.20.3 and later cause the X server"
638 ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
639 ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier."
640 ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
641 fi
642 }
643
644 pkg_preinst() {
645 use modules && linux-mod_pkg_preinst
646 }
647
648 pkg_prerm() {
649 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
650 }
651
652 pkg_postrm() {
653 use modules && linux-mod_pkg_postrm
654 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
655 }

  ViewVC Help
Powered by ViewVC 1.1.20