Gentoo Archives: gentoo-commits

From: "Chi-Thanh Christopher Nguyen (chithanh)" <chithanh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/ati-drivers: ati-drivers-14.6_beta2.ebuild ChangeLog
Date: Mon, 01 Sep 2014 14:57:23
Message-Id: 20140901145718.A96CA470F@oystercatcher.gentoo.org
1 chithanh 14/09/01 14:57:18
2
3 Modified: ChangeLog
4 Added: ati-drivers-14.6_beta2.ebuild
5 Log:
6 New beta, import of Emil Karlson's ebuild from the x11 overlay.
7
8 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x2324E7B566DF2611!)
9
10 Revision Changes Path
11 1.364 x11-drivers/ati-drivers/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.364&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.364&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?r1=1.363&r2=1.364
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v
20 retrieving revision 1.363
21 retrieving revision 1.364
22 diff -u -r1.363 -r1.364
23 --- ChangeLog 18 Jun 2014 20:58:25 -0000 1.363
24 +++ ChangeLog 1 Sep 2014 14:57:18 -0000 1.364
25 @@ -1,6 +1,12 @@
26 # ChangeLog for x11-drivers/ati-drivers
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v 1.363 2014/06/18 20:58:25 mgorny Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v 1.364 2014/09/01 14:57:18 chithanh Exp $
30 +
31 +*ati-drivers-14.6_beta2 (01 Sep 2014)
32 +
33 + 01 Sep 2014; Chí-Thanh Christopher Nguyễn <chithanh@g.o>
34 + +ati-drivers-14.6_beta2.ebuild:
35 + New beta, import of Emil Karlson's ebuild from the x11 overlay.
36
37 18 Jun 2014; Michał Górny <mgorny@g.o> ati-drivers-13.12.ebuild,
38 ati-drivers-13.1_pre897.ebuild, ati-drivers-13.4.ebuild,
39
40
41
42 1.1 x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild?rev=1.1&content-type=text/plain
46
47 Index: ati-drivers-14.6_beta2.ebuild
48 ===================================================================
49 # Copyright 1999-2014 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild,v 1.1 2014/09/01 14:57:18 chithanh Exp $
52
53 EAPI=5
54
55 inherit eutils multilib linux-info linux-mod toolchain-funcs versionator pax-utils
56
57 DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
58 HOMEPAGE="http://www.amd.com"
59 RUN="${WORKDIR}/fglrx-14.20/amd-driver-installer-14.20-x86.x86_64.run"
60 SLOT="1"
61 # Uses javascript for download YESSSS
62 #DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
63 DRIVERS_URI="mirror://gentoo/linux-amd-catalyst-14.6-beta-v1.0-jul11.zip"
64 XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
65 SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
66 FOLDER_PREFIX="common/"
67 IUSE="debug +modules multilib qt4 static-libs pax_kernel"
68
69 LICENSE="AMD GPL-2 QPL-1.0"
70 KEYWORDS="-* ~amd64 ~x86"
71
72 RESTRICT="bindist test"
73
74 RDEPEND="
75 <=x11-base/xorg-server-1.15.49[-minimal]
76 >=app-admin/eselect-opengl-1.0.7
77 app-admin/eselect-opencl
78 sys-power/acpid
79 x11-apps/xauth
80 x11-libs/libX11
81 x11-libs/libXext
82 x11-libs/libXinerama
83 x11-libs/libXrandr
84 x11-libs/libXrender
85 virtual/glu
86 multilib? (
87 || (
88 virtual/glu[abi_x86_32]
89 app-emulation/emul-linux-x86-opengl
90 )
91 || (
92 (
93 x11-libs/libX11[abi_x86_32]
94 x11-libs/libXext[abi_x86_32]
95 x11-libs/libXinerama[abi_x86_32]
96 x11-libs/libXrandr[abi_x86_32]
97 x11-libs/libXrender[abi_x86_32]
98 )
99 app-emulation/emul-linux-x86-xlibs
100 )
101 )
102 qt4? (
103 x11-libs/libICE
104 x11-libs/libSM
105 x11-libs/libXcursor
106 x11-libs/libXfixes
107 x11-libs/libXxf86vm
108 dev-qt/qtcore:4
109 dev-qt/qtgui:4[accessibility]
110 )
111 "
112 if [[ legacy != ${SLOT} ]]; then
113 RDEPEND="${RDEPEND}
114 !x11-drivers/ati-drivers:legacy"
115 else
116 RDEPEND="${RDEPEND}
117 !x11-drivers/ati-drivers:1"
118 fi
119
120 DEPEND="${RDEPEND}
121 x11-proto/inputproto
122 x11-proto/xf86miscproto
123 x11-proto/xf86vidmodeproto
124 x11-proto/xineramaproto
125 x11-libs/libXtst
126 sys-apps/findutils
127 app-misc/pax-utils
128 app-arch/unzip
129 "
130
131 EMULTILIB_PKG="true"
132
133 S="${WORKDIR}"
134
135 # QA Silencing
136 QA_TEXTRELS="
137 usr/lib*/opengl/ati/lib/libGL.so.1.2
138 usr/lib*/libatiadlxx.so
139 usr/lib*/xorg/modules/glesx.so
140 usr/lib*/libaticaldd.so
141 usr/lib*/dri/fglrx_dri.so
142 "
143
144 QA_EXECSTACK="
145 opt/bin/atiode
146 opt/bin/amdcccle
147 usr/lib*/opengl/ati/lib/libGL.so.1.2
148 usr/lib*/dri/fglrx_dri.so
149 "
150
151 QA_WX_LOAD="
152 usr/lib*/opengl/ati/lib/libGL.so.1.2
153 usr/lib*/dri/fglrx_dri.so
154 "
155
156 QA_PRESTRIPPED="
157 usr/lib\(32\|64\)\?/libXvBAW.so.1.0
158 usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
159 usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
160 usr/lib\(32\|64\)\?/xorg/modules/glesx.so
161 usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
162 usr/lib\(32\|64\)\?/libaticaldd.so
163 usr/lib\(32\|64\)\?/dri/fglrx_dri.so
164 usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
165 usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
166 "
167
168 QA_SONAME="
169 usr/lib\(32\|64\)\?/libatiadlxx.so
170 usr/lib\(32\|64\)\?/libaticalcl.so
171 usr/lib\(32\|64\)\?/libaticaldd.so
172 usr/lib\(32\|64\)\?/libaticalrt.so
173 usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
174 "
175
176 QA_DT_HASH="
177 opt/bin/amdcccle
178 opt/bin/aticonfig
179 opt/bin/atiodcli
180 opt/bin/atiode
181 opt/bin/clinfo
182 opt/bin/fglrxinfo
183 opt/sbin/atieventsd
184 opt/sbin/amdnotifyui
185 usr/lib\(32\|64\)\?/libaticalcl.so
186 usr/lib\(32\|64\)\?/libaticalrt.so
187 usr/lib\(32\|64\)\?/libatiuki.so.1.0
188 usr/lib\(32\|64\)\?/libatiadlxx.so
189 usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
190 usr/lib\(32\|64\)\?/libXvBAW.so.1.0
191 usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
192 usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
193 usr/lib\(32\|64\)\?/xorg/modules/glesx.so
194 usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
195 usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
196 usr/lib\(32\|64\)\?/libaticaldd.so
197 usr/lib\(32\|64\)\?/dri/fglrx_dri.so
198 usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
199 usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
200 usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
201 usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
202 usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
203 usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
204 "
205
206 pkg_nofetch() {
207 einfo "The driver packages"
208 einfo ${A}
209 einfo "need to be downloaded manually from"
210 einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
211 einfo "and ${XVBA_SDK_URI}"
212 }
213
214 pkg_pretend() {
215 local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
216 use amd64 && CONFIG_CHECK+=" COMPAT"
217
218 local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
219 local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
220 rendering to work."
221 local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
222 as GPL-only. This prevents ${P} from compiling with an error like this:
223 FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
224 local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
225 kernel to reject loading the fglrx module with
226 \"ERROR: could not insert 'fglrx': Exec format error.\"
227 You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
228 local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
229
230 # workaround until bug 365543 is solved
231 if use modules; then
232 linux-info_pkg_setup
233 require_configured_kernel
234 kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
235 check_extra_config
236 if ! linux_chkconfig_present AGP && \
237 ! linux_chkconfig_present PCIEPORTBUS; then
238 ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
239 ewarn "Direct rendering will not work."
240 fi
241 fi
242
243 if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
244 ewarn "You have disabled xattr pax markings for portage."
245 ewarn "This will likely cause programs using ati-drivers provided"
246 ewarn "libraries to be killed kernel."
247 fi
248 }
249
250 pkg_setup() {
251 if use modules; then
252 MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
253 BUILD_TARGETS="kmod_build"
254 linux-mod_pkg_setup
255 BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
256 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
257 if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
258 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
259 else
260 BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
261 fi
262 fi
263 # Define module dir.
264 MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
265 # get the xorg-server version and set BASE_DIR for that
266 BASE_DIR="${S}/xpic"
267
268 # amd64/x86
269 if use amd64 ; then
270 MY_BASE_DIR="${BASE_DIR}_64a"
271 PKG_LIBDIR=lib64
272 ARCH_DIR="${S}/arch/x86_64"
273 else
274 MY_BASE_DIR="${BASE_DIR}"
275 PKG_LIBDIR=lib
276 ARCH_DIR="${S}/arch/x86"
277 fi
278
279 elog
280 elog "Please note that this driver only supports graphic cards based on"
281 elog "Evergreen chipset and newer."
282 elog "This includes the AMD Radeon HD 5400+ series at this moment."
283 elog
284 elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
285 elog "For migration informations please refer to:"
286 elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
287 einfo
288 }
289
290 src_unpack() {
291 local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
292 DRIVERS_DISTFILE=${DRIVERS_URI##*/}
293 XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
294
295 if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
296 unpack ${DRIVERS_DISTFILE}
297 else
298 #please note, RUN may be insanely assigned at top near SRC_URI
299 if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
300 unpack ${DRIVERS_DISTFILE}
301 [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
302 else
303 RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
304 fi
305 sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
306 fi
307
308 mkdir xvba_sdk
309 cd xvba_sdk
310 unpack ${XVBA_SDK_DISTFILE}
311
312 mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
313 cd "${WORKDIR}/extra"
314 tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
315 }
316
317 src_prepare() {
318 if use modules; then
319 if use debug; then
320 sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
321 "${MODULE_DIR}/firegl_public.c" \
322 || die "Failed to enable debug output."
323 fi
324 fi
325
326 # These are the userspace utilities that we also have source for.
327 # We rebuild these later.
328 rm \
329 "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
330 || die "bin rm failed"
331
332 # in this version amdcccle isn't static, thus we depend on qt4
333 use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
334
335 # ACPI fixups
336 sed -i \
337 -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
338 -e "s:/var/lib/gdm/:/var/gdm/:" \
339 "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
340 || die "ACPI fixups failed."
341
342 # Since "who" is in coreutils, we're using that one instead of "finger".
343 sed -i -e 's:finger:who:' \
344 "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
345 || die "Replacing 'finger' with 'who' failed."
346 # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
347 # add function to detect default state.
348 epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
349
350 # see http://ati.cchtml.com/show_bug.cgi?id=495
351 #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
352 # first hunk applied upstream second (x32 related) was not
353 epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
354
355 # compile fix for AGP-less kernel, bug #435322
356 epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
357
358 # Compile fix for kernel typesafe uid types #469160
359 epatch "${FILESDIR}/typesafe-kuid.diff"
360
361 epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
362
363 # Fix #483400
364 epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
365
366 # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
367 use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
368
369 cd "${MODULE_DIR}"
370
371 # bugged fglrx build system, this file should be copied by hand
372 cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
373
374 convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
375
376 # When built with ati's make.sh it defines a bunch of macros if
377 # certain .config values are set, falling back to less reliable
378 # detection methods if linux/autoconf.h is not available. We
379 # simply use the linux/autoconf.h settings directly, bypassing the
380 # detection script.
381 sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
382 sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
383 || die "MODVERSIONS sed failed"
384 }
385
386 src_compile() {
387 use modules && linux-mod_src_compile
388
389 ebegin "Building fgl_glxgears"
390 cd "${S}"/extra/fgl_glxgears
391 # These extra libs/utils either have an Imakefile that does not
392 # work very well without tweaking or a Makefile ignoring CFLAGS
393 # and the like. We bypass those.
394 # The -DUSE_GLU is needed to compile using nvidia headers
395 # according to a comment in ati-drivers-extra-8.33.6.ebuild.
396 "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
397 -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
398 -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
399 eend $?
400 }
401
402 src_install() {
403 use modules && linux-mod_src_install
404
405 # We can do two things here, and neither of them is very nice.
406
407 # For direct rendering libGL has to be able to load one or more
408 # dri modules (files ending in _dri.so, like fglrx_dri.so).
409 # Gentoo's mesa looks for these files in the location specified by
410 # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
411 # location /usr/$(get_libdir)/dri. Ati's libGL does the same
412 # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
413 # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
414 # 64bit. So we can either put the .so files in that (unusual,
415 # compared to "normal" mesa libGL) location or set
416 # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
417 # 101539.
418
419 # The problem with this approach is that LIBGL_DRIVERS_PATH
420 # *overrides* the default hardcoded location, it does not extend
421 # it. So if ati-drivers is merged but a non-ati libGL is selected
422 # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
423 # (because it changed in a newer mesa or because it was compiled
424 # for a different set of multilib abis than we are) stuff breaks.
425
426 # We create one file per ABI to work with "native" multilib, see
427 # below.
428
429 echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
430 doenvd "${T}/03ati-colon-sep" || die
431
432 # All libraries that we have a 32 bit and 64 bit version of on
433 # amd64 are installed in src_install-libs. Everything else
434 # (including libraries only available in native 64bit on amd64)
435 # goes in here.
436
437 # There used to be some code here that tried to detect running
438 # under a "native multilib" portage ((precursor of)
439 # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
440 # should just work (only doing some duplicate work). --marienz
441 if has_multilib_profile; then
442 local OABI=${ABI}
443 for ABI in $(get_install_abis); do
444 src_install-libs
445 done
446 ABI=${OABI}
447 unset OABI
448 else
449 src_install-libs
450 fi
451
452 # This is sorted by the order the files occur in the source tree.
453
454 # X modules.
455 exeinto /usr/$(get_libdir)/xorg/modules/drivers
456 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
457 exeinto /usr/$(get_libdir)/xorg/modules/linux
458 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
459 exeinto /usr/$(get_libdir)/xorg/modules
460 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
461
462 # Arch-specific files.
463 # (s)bin.
464 into /opt
465 dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
466 use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
467 dobin "${ARCH_DIR}"/usr/bin/clinfo
468 # We cleaned out the compilable stuff in src_unpack
469 dobin "${ARCH_DIR}"/usr/X11R6/bin/*
470
471 # Common files.
472 # etc.
473 insinto /etc/ati
474 exeinto /etc/ati
475 # Everything except for the authatieventsd.sh script.
476 doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
477 doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
478
479 # include.
480 insinto /usr
481 doins -r ${FOLDER_PREFIX}usr/include
482 insinto /usr/include/X11/extensions
483
484 # Just the atigetsysteminfo.sh script.
485 into /usr
486 dosbin ${FOLDER_PREFIX}usr/sbin/*
487
488 # data files for the control panel.
489 if use qt4 ; then
490 insinto /usr/share
491 doins -r ${FOLDER_PREFIX}usr/share/ati
492 insinto /usr/share/pixmaps
493 doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
494 make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
495 ccc_large System
496 fi
497
498 # doc.
499 dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
500
501 doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
502
503 pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
504
505 exeinto /etc/acpi
506 doexe ati-powermode.sh
507 insinto /etc/acpi/events
508 doins events/*
509
510 popd > /dev/null
511
512 # Done with the "source" tree. Install tools we rebuilt:
513 dobin extra/fgl_glxgears/fgl_glxgears
514 newdoc extra/fgl_glxgears/README README.fgl_glxgears
515
516 # Gentoo-specific stuff:
517 newinitd "${FILESDIR}"/atieventsd.init atieventsd
518 echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
519 newconfd "${T}"/atieventsd.conf atieventsd
520
521 # PowerXpress stuff
522 exeinto /usr/$(get_libdir)/fglrx
523 doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
524 cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
525 doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
526 }
527
528 src_install-libs() {
529 if [[ "${ABI}" == "amd64" ]]; then
530 local EX_BASE_DIR="${BASE_DIR}_64a"
531 local pkglibdir=lib64
532 local MY_ARCH_DIR="${S}/arch/x86_64"
533 local oclsuffix=64
534 else
535 local EX_BASE_DIR="${BASE_DIR}"
536 local pkglibdir=lib
537 local MY_ARCH_DIR="${S}/arch/x86"
538 local oclsuffix=32
539 fi
540 einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
541
542 local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
543 # To make sure we do not miss a spot when these change.
544 local libmajor=1 libminor=2
545 local libver=${libmajor}.${libminor}
546
547 # The GLX libraries
548 # (yes, this really is "lib" even on amd64/multilib --marienz)
549 exeinto ${ATI_ROOT}/lib
550 newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
551 libGL.so.${libver}
552 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
553 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
554
555 exeinto ${ATI_ROOT}/extensions
556 doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
557 mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
558
559 # other libs
560 exeinto /usr/$(get_libdir)
561 # Everything except for the libGL.so installed some row above
562 doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
563 -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
564 insinto /usr/$(get_libdir)
565 doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
566 -maxdepth 1 -type f -not -name '*.so*')
567
568 # DRI modules, installed into the path used by recent versions of mesa.
569 exeinto /usr/$(get_libdir)/dri
570 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
571
572 # AMD Cal and OpenCL libraries
573 exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
574 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
575 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
576 dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
577 exeinto /usr/$(get_libdir)
578 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
579
580 # OpenCL vendor files
581 insinto /etc/OpenCL/vendors/
582 cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
583 /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
584 EOF
585 doins "${T}"/amdocl${oclsuffix}.icd
586
587 local envname="${T}"/04ati-dri-path
588 if [[ -n ${ABI} ]]; then
589 envname="${envname}-${ABI}"
590 fi
591 echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
592 doenvd "${envname}"
593
594 # Silence the QA notice by creating missing soname symlinks
595 for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
596 do
597 local soname=${so##*/}
598 local soname_one=${soname%.[0-9]}
599 local soname_zero=${soname_one%.[0-9]}
600 dosym ${soname} /usr/$(get_libdir)/${soname_one}
601 dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
602 done
603
604 # See https://bugs.gentoo.org/show_bug.cgi?id=443466
605 dodir /etc/revdep-rebuild/
606 echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
607
608 #remove static libs if not wanted
609 use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
610
611 #install xvba sdk headers
612 doheader xvba_sdk/include/amdxvba.h
613
614 if use pax_kernel; then
615 pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
616 fi
617 }
618
619 pkg_postinst() {
620 elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
621 elog "To change your xorg.conf you can use the bundled \"aticonfig\""
622 elog
623 elog "If you experience unexplained segmentation faults and kernel crashes"
624 elog "with this driver and multi-threaded applications such as wine,"
625 elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
626 elog
627 elog "Fully rebooting the system after an ${PN} update is recommended"
628 elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
629 elog "might not work"
630 elog
631 elog "Some cards need acpid running to handle events"
632 elog "Please add it to boot runlevel with rc-update add acpid boot"
633 elog
634
635 use modules && linux-mod_pkg_postinst
636 "${ROOT}"/usr/bin/eselect opengl set --use-old ati
637 "${ROOT}"/usr/bin/eselect opencl set --use-old amd
638
639 if has_version "x11-drivers/xf86-video-intel[sna]"; then
640 ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
641 ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
642 ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
643 ewarn "try disabling sna for xf86-video-intel."
644 ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
645 fi
646
647 if use pax_kernel; then
648 ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
649 ewarn "after you have run \"eselect opengl set ati\". Executacle"
650 ewarn "revdep-pax is part of package sys-apps/elfix."
651 fi
652 }
653
654 pkg_preinst() {
655 use modules && linux-mod_pkg_preinst
656 }
657
658 pkg_prerm() {
659 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
660 }
661
662 pkg_postrm() {
663 use modules && linux-mod_pkg_postrm
664 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
665 }