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