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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Tue Nov 27 02:15:54 2012 UTC (2 years, 8 months ago) by zerochaos
Branch: MAIN
Changes since 1.8: +5 -1 lines
masking clinfo for revdep-rebuild, see bug #443466

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

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

  ViewVC Help
Powered by ViewVC 1.1.20