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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sat Jan 19 02:17:08 2013 UTC (19 months, 3 weeks ago) by zerochaos
Branch: MAIN
Changes since 1.5: +2 -2 lines
readding 12.8, needed as dep for oclhashcat-*-bin

(Portage version: 2.1.11.31/cvs/Linux x86_64, signed Manifest commit with key DD11F94A)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/Attic/ati-drivers-12.8.ebuild,v 1.4 2012/11/27 02:15:54 zerochaos 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 Evergreen (HD5000 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.zip"
15 RUN="${WORKDIR}/amd-driver-installer-8.982-x86.x86_64.run"
16 FOLDER_PREFIX="common/"
17 else
18 #SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
19 SRC_URI="http://www2.ati.com/drivers/hotfix/catalyst_12.6_hotfixes/amd-driver-installer-8.98-x86.x86_64.zip"
20 FOLDER_PREFIX="common/"
21 fi
22 IUSE="debug +modules multilib qt4 static-libs"
23
24 LICENSE="AMD GPL-2 QPL-1.0 as-is"
25 KEYWORDS="-* ~amd64 ~x86"
26 SLOT="1"
27
28 RESTRICT="bindist"
29
30 RDEPEND="
31 <=x11-base/xorg-server-1.12.49[-minimal]
32 >=app-admin/eselect-opengl-1.0.7
33 app-admin/eselect-opencl
34 sys-power/acpid
35 x11-apps/xauth
36 x11-libs/libX11
37 x11-libs/libXext
38 x11-libs/libXinerama
39 x11-libs/libXrandr
40 x11-libs/libXrender
41 multilib? (
42 app-emulation/emul-linux-x86-opengl
43 app-emulation/emul-linux-x86-xlibs
44 )
45 qt4? (
46 x11-libs/libICE
47 x11-libs/libSM
48 x11-libs/libXcursor
49 x11-libs/libXfixes
50 x11-libs/libXxf86vm
51 x11-libs/qt-core:4
52 x11-libs/qt-gui:4
53 )
54 "
55
56 DEPEND="${RDEPEND}
57 x11-proto/inputproto
58 x11-proto/xf86miscproto
59 x11-proto/xf86vidmodeproto
60 x11-proto/xineramaproto
61 x11-libs/libXtst
62 sys-apps/findutils
63 app-misc/pax-utils
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_FLAGS_IGNORED="
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 #if linux_chkconfig_present X86_X32; then
229 # eerror "You've enabled x32 in the kernel."
230 # eerror "Unfortunately, this option is not supported yet and prevents the fglrx"
231 # eerror "kernel module from loading."
232 # error+=" X86_32 enabled;"
233 # failed=1
234 #fi
235
236 [[ ${failed} -ne 0 ]] && die "${error}"
237 }
238
239 pkg_pretend() {
240 # workaround until bug 365543 is solved
241 if use modules; then
242 linux-info_pkg_setup
243 if linux_config_exists; then
244 _check_kernel_config
245 fi
246 fi
247 }
248
249 pkg_setup() {
250 if use modules; then
251 MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
252 BUILD_TARGETS="kmod_build"
253 linux-mod_pkg_setup
254 BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
255 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
256 if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
257 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
258 else
259 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
260 fi
261 fi
262 # Define module dir.
263 MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
264 # get the xorg-server version and set BASE_DIR for that
265 BASE_DIR="${S}/xpic"
266
267 # amd64/x86
268 if use amd64 ; then
269 MY_BASE_DIR="${BASE_DIR}_64a"
270 PKG_LIBDIR=lib64
271 ARCH_DIR="${S}/arch/x86_64"
272 else
273 MY_BASE_DIR="${BASE_DIR}"
274 PKG_LIBDIR=lib
275 ARCH_DIR="${S}/arch/x86"
276 fi
277
278 elog
279 elog "Please note that this driver supports only graphic cards based on"
280 elog "Evergreen chipset and newer."
281 elog "This represent the AMD Radeon HD 5400+ series at this moment."
282 elog
283 elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
284 elog "For migration informations please reffer to:"
285 elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
286 einfo
287 }
288
289 src_unpack() {
290 #please note, RUN may be insanely assigned at top near SRC_URI
291 if [[ ${A} =~ .*\.zip ]]; then
292 unpack ${A}
293 [[ -z "$RUN" ]] && RUN="${S}/${A/%.zip/.run}"
294 else
295 RUN="${DISTDIR}/${A}"
296 fi
297 sh ${RUN} --extract "${S}" 2>&1 > /dev/null || die
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 #fixes bug #420751
337 epatch "${FILESDIR}"/ati-drivers-do_mmap.patch
338
339 # see http://ati.cchtml.com/show_bug.cgi?id=495
340 #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
341 # first hunk applied upstream second (x32 related) was not
342 epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
343
344 cd "${MODULE_DIR}"
345
346 # bugged fglrx build system, this file should be copied by hand
347 cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
348
349 convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
350
351 # When built with ati's make.sh it defines a bunch of macros if
352 # certain .config values are set, falling back to less reliable
353 # detection methods if linux/autoconf.h is not available. We
354 # simply use the linux/autoconf.h settings directly, bypassing the
355 # detection script.
356 sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
357 sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
358 || die "MODVERSIONS sed failed"
359 cd "${S}"
360
361 mkdir extra || die "mkdir failed"
362 cd extra
363 unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
364
365 # Get rid of watermark. Oldest known reference:
366 # http://phoronix.com/forums/showthread.php?19875-Unsupported-Hardware-watermark
367 ebegin "Disabling watermark"
368 driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
369 for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
370 sed -i "s/${x}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
371 done
372 eend $? || die "Disabling watermark failed"
373 }
374
375 src_compile() {
376 use modules && linux-mod_src_compile
377
378 ebegin "Building fgl_glxgears"
379 cd "${S}"/extra/fgl_glxgears
380 # These extra libs/utils either have an Imakefile that does not
381 # work very well without tweaking or a Makefile ignoring CFLAGS
382 # and the like. We bypass those.
383 # The -DUSE_GLU is needed to compile using nvidia headers
384 # according to a comment in ati-drivers-extra-8.33.6.ebuild.
385 "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
386 -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
387 -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
388 eend $?
389 }
390
391 src_test() { :; } # no tests present
392
393 src_install() {
394 use modules && linux-mod_src_install
395
396 # We can do two things here, and neither of them is very nice.
397
398 # For direct rendering libGL has to be able to load one or more
399 # dri modules (files ending in _dri.so, like fglrx_dri.so).
400 # Gentoo's mesa looks for these files in the location specified by
401 # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
402 # location /usr/$(get_libdir)/dri. Ati's libGL does the same
403 # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
404 # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
405 # 64bit. So we can either put the .so files in that (unusual,
406 # compared to "normal" mesa libGL) location or set
407 # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
408 # 101539.
409
410 # The problem with this approach is that LIBGL_DRIVERS_PATH
411 # *overrides* the default hardcoded location, it does not extend
412 # it. So if ati-drivers is merged but a non-ati libGL is selected
413 # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
414 # (because it changed in a newer mesa or because it was compiled
415 # for a different set of multilib abis than we are) stuff breaks.
416
417 # We create one file per ABI to work with "native" multilib, see
418 # below.
419
420 echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
421 doenvd "${T}/03ati-colon-sep" || die
422
423 # All libraries that we have a 32 bit and 64 bit version of on
424 # amd64 are installed in src_install-libs. Everything else
425 # (including libraries only available in native 64bit on amd64)
426 # goes in here.
427
428 # There used to be some code here that tried to detect running
429 # under a "native multilib" portage ((precursor of)
430 # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
431 # should just work (only doing some duplicate work). --marienz
432 if has_multilib_profile; then
433 local OABI=${ABI}
434 for ABI in $(get_install_abis); do
435 src_install-libs
436 done
437 ABI=${OABI}
438 unset OABI
439 else
440 src_install-libs
441 fi
442
443 # This is sorted by the order the files occur in the source tree.
444
445 # X modules.
446 exeinto /usr/$(get_libdir)/xorg/modules/drivers
447 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
448 exeinto /usr/$(get_libdir)/xorg/modules/linux
449 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
450 exeinto /usr/$(get_libdir)/xorg/modules
451 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
452
453 # Arch-specific files.
454 # (s)bin.
455 into /opt
456 dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
457 use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
458 dobin "${ARCH_DIR}"/usr/bin/clinfo
459 # We cleaned out the compilable stuff in src_unpack
460 dobin "${ARCH_DIR}"/usr/X11R6/bin/*
461
462 # Common files.
463 # etc.
464 insinto /etc/ati
465 exeinto /etc/ati
466 # Everything except for the authatieventsd.sh script.
467 doins ${FOLDER_PREFIX}etc/ati/{logo*,control,atiogl.xml,signature,amdpcsdb.default}
468 doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
469
470 # include.
471 insinto /usr
472 doins -r ${FOLDER_PREFIX}usr/include
473 insinto /usr/include/X11/extensions
474
475 # Just the atigetsysteminfo.sh script.
476 into /usr
477 dosbin ${FOLDER_PREFIX}usr/sbin/*
478
479 # data files for the control panel.
480 if use qt4 ; then
481 insinto /usr/share
482 doins -r ${FOLDER_PREFIX}usr/share/ati
483 insinto /usr/share/pixmaps
484 doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
485 make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
486 ccc_large System
487 fi
488
489 # doc.
490 dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
491
492 doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
493
494 pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
495
496 exeinto /etc/acpi
497 doexe ati-powermode.sh
498 insinto /etc/acpi/events
499 doins events/*
500
501 popd > /dev/null
502
503 # Done with the "source" tree. Install tools we rebuilt:
504 dobin extra/fgl_glxgears/fgl_glxgears
505 newdoc extra/fgl_glxgears/README README.fgl_glxgears
506
507 # Gentoo-specific stuff:
508 newinitd "${FILESDIR}"/atieventsd.init atieventsd
509 echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
510 newconfd "${T}"/atieventsd.conf atieventsd
511
512 # PowerXpress stuff
513 exeinto /usr/$(get_libdir)/fglrx
514 doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
515 cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
516 doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
517 }
518
519 src_install-libs() {
520 if [[ "${ABI}" == "amd64" ]]; then
521 local EX_BASE_DIR="${BASE_DIR}_64a"
522 local pkglibdir=lib64
523 local MY_ARCH_DIR="${S}/arch/x86_64"
524 local oclsuffix=64
525 else
526 local EX_BASE_DIR="${BASE_DIR}"
527 local pkglibdir=lib
528 local MY_ARCH_DIR="${S}/arch/x86"
529 local oclsuffix=32
530 fi
531 einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
532
533 local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
534 # To make sure we do not miss a spot when these change.
535 local libmajor=1 libminor=2
536 local libver=${libmajor}.${libminor}
537
538 # The GLX libraries
539 # (yes, this really is "lib" even on amd64/multilib --marienz)
540 exeinto ${ATI_ROOT}/lib
541 newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
542 libGL.so.${libver}
543 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
544 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
545
546 exeinto ${ATI_ROOT}/extensions
547 doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
548 mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
549
550 # other libs
551 exeinto /usr/$(get_libdir)
552 # Everything except for the libGL.so installed some row above
553 doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
554 -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
555 insinto /usr/$(get_libdir)
556 doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
557 -maxdepth 1 -type f -not -name '*.so*')
558
559 # DRI modules, installed into the path used by recent versions of mesa.
560 exeinto /usr/$(get_libdir)/dri
561 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
562
563 # AMD Cal and OpenCL libraries
564 exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
565 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
566 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
567 dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
568 exeinto /usr/$(get_libdir)
569 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
570
571 # OpenCL vendor files
572 insinto /etc/OpenCL/vendors/
573 cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
574 /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
575 EOF
576 doins "${T}"/amdocl${oclsuffix}.icd
577
578 local envname="${T}"/04ati-dri-path
579 if [[ -n ${ABI} ]]; then
580 envname="${envname}-${ABI}"
581 fi
582 echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
583 doenvd "${envname}"
584
585 # Silence the QA notice by creating missing soname symlinks
586 for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
587 do
588 local soname=${so##*/}
589 ## let's keep also this alternative way ;)
590 #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
591 dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
592 done
593
594 # See https://bugs.gentoo.org/show_bug.cgi?id=443466
595 dodir /etc/revdep-rebuild/
596 echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
597
598 #remove static libs if not wanted
599 use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
600 }
601
602 pkg_postinst() {
603 elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
604 elog "To change your xorg.conf you can use the bundled \"aticonfig\""
605 elog
606 elog "If you experience unexplained segmentation faults and kernel crashes"
607 elog "with this driver and multi-threaded applications such as wine,"
608 elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
609 elog
610 elog "Fully rebooting the system after an ${PN} update is recommended"
611 elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
612 elog "might not work"
613 elog
614 elog "Some cards need acpid running to handle events"
615 elog "Please add it to boot runlevel with rc-update add acpid boot"
616 elog
617
618 use modules && linux-mod_pkg_postinst
619 "${ROOT}"/usr/bin/eselect opengl set --use-old ati
620 "${ROOT}"/usr/bin/eselect opencl set --use-old amd
621 }
622
623 pkg_preinst() {
624 use modules && linux-mod_pkg_preinst
625 }
626
627 pkg_prerm() {
628 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
629 }
630
631 pkg_postrm() {
632 use modules && linux-mod_pkg_postrm
633 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
634 }

  ViewVC Help
Powered by ViewVC 1.1.20