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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Jun 5 14:27:47 2012 UTC (2 years, 6 months ago) by chithanh
Branch: MAIN
Bump to prerelease.

(Portage version: 2.2.0_alpha109/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20