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