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

Contents of /x11-drivers/ati-drivers/ati-drivers-12.6_beta_pre897.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Sun Dec 30 17:05:35 2012 UTC (20 months, 3 weeks ago) by mr_bones_
Branch: MAIN
Changes since 1.10: +2 -2 lines
whitespace

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

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

  ViewVC Help
Powered by ViewVC 1.1.20