Gentoo Archives: gentoo-commits

From: "Tomas Chvatal (scarabeus)" <scarabeus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/ati-drivers: ChangeLog ati-drivers-8.660.ebuild
Date: Mon, 07 Sep 2009 11:36:43
Message-Id: E1MkcWX-00087W-J7@stork.gentoo.org
1 scarabeus 09/09/07 11:36:41
2
3 Modified: ChangeLog
4 Added: ati-drivers-8.660.ebuild
5 Log:
6 Add ati-drivers-8.660. Which should be 9.10 beta release. First pass, require testing.
7 (Portage version: 2.2_rc38/cvs/Linux i686)
8
9 Revision Changes Path
10 1.184 x11-drivers/ati-drivers/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.184&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.184&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?r1=1.183&r2=1.184
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v
19 retrieving revision 1.183
20 retrieving revision 1.184
21 diff -u -r1.183 -r1.184
22 --- ChangeLog 4 Sep 2009 15:02:00 -0000 1.183
23 +++ ChangeLog 7 Sep 2009 11:36:41 -0000 1.184
24 @@ -1,6 +1,13 @@
25 # ChangeLog for x11-drivers/ati-drivers
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v 1.183 2009/09/04 15:02:00 scarabeus Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v 1.184 2009/09/07 11:36:41 scarabeus Exp $
29 +
30 +*ati-drivers-8.660 (07 Sep 2009)
31 +
32 + 07 Sep 2009; Tomáš Chvátal <scarabeus@g.o>
33 + +ati-drivers-8.660.ebuild:
34 + Add ati-drivers-8.660. Which should be 9.10 beta release. First pass,
35 + require testing.
36
37 04 Sep 2009; Tomáš Chvátal <scarabeus@g.o>
38 ati-drivers-9.8.ebuild:
39
40
41
42 1.1 x11-drivers/ati-drivers/ati-drivers-8.660.ebuild
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-8.660.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-8.660.ebuild?rev=1.1&content-type=text/plain
46
47 Index: ati-drivers-8.660.ebuild
48 ===================================================================
49 # Copyright 1999-2009 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-8.660.ebuild,v 1.1 2009/09/07 11:36:41 scarabeus Exp $
52
53 EAPI="2"
54
55 inherit eutils multilib linux-mod toolchain-funcs versionator
56
57 DESCRIPTION="Ati precompiled drivers for r600 (HD Series) and newer chipsets"
58 HOMEPAGE="http://www.ati.com"
59 # 8.ble will be used for beta releases.
60 if [[ $(get_major_version) > 8 ]]; then
61 ATI_URL="https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/"
62 SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
63 FOLDER_PREFIX="common/"
64 else
65 SRC_URI="https://launchpad.net/ubuntu/karmic/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
66 FOLDER_PREFIX=""
67 fi
68 IUSE="debug +modules multilib"
69
70 LICENSE="AMD GPL-2 QPL-1.0 as-is"
71 KEYWORDS="~amd64 ~x86"
72 SLOT="1"
73
74 RDEPEND="
75 !x11-drivers/ati-drivers:0
76 !x11-apps/ati-drivers-extra
77 >=app-admin/eselect-opengl-1.0.7
78 sys-power/acpid
79 x11-apps/xauth
80 >=x11-base/xorg-server-1.5.3-r7
81 x11-libs/libXinerama
82 x11-libs/libXrandr
83 multilib? ( app-emulation/emul-linux-x86-xlibs )
84 "
85
86 DEPEND="${RDEPEND}
87 x11-proto/inputproto
88 x11-proto/xf86miscproto
89 x11-proto/xf86vidmodeproto
90 x11-proto/xineramaproto
91 "
92
93 EMULTILIB_PKG="true"
94
95 S="${WORKDIR}"
96
97 # QA Silencing
98 QA_TEXTRELS="
99 usr/lib*/opengl/ati/lib/libGL.so.1.2
100 usr/lib*/libatiadlxx.so
101 usr/lib*/xorg/modules/glesx.so
102 usr/lib*/libaticaldd.so
103 usr/lib*/dri/fglrx_dri.so
104 "
105
106 QA_EXECSTACK="
107 opt/bin/atiode
108 opt/bin/amdcccle
109 usr/lib*/opengl/ati/lib/libGL.so.1.2
110 usr/lib*/dri/fglrx_dri.so
111 "
112
113 QA_WX_LOAD="
114 usr/lib*/opengl/ati/lib/libGL.so.1.2
115 usr/lib*/dri/fglrx_dri.so
116 "
117
118 QA_PRESTRIPPED="
119 usr/lib\(32\|64\)\?/libXvBAW.so.1.0
120 usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
121 usr/lib\(32\|64\)\?/xorg/modules/glesx.so
122 usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
123 usr/lib\(32\|64\)\?/libaticaldd.so
124 usr/lib\(32\|64\)\?/dri/fglrx_dri.so
125 "
126
127 QA_SONAME="
128 usr/lib\(32\|64\)\?/libatiadlxx.so
129 usr/lib\(32\|64\)\?/libaticalcl.so
130 usr/lib\(32\|64\)\?/libaticaldd.so
131 usr/lib\(32\|64\)\?/libaticalrt.so
132 "
133
134 _check_kernel_config() {
135 if ! kernel_is 2 6; then
136 eerror "You need a 2.6 linux kernel to compile against!"
137 die "No 2.6 Kernel found"
138 fi
139
140 if kernel_is ge 2 6 25 && linux_chkconfig_present PREEMPT_RCU; then
141 eerror "${P} is incompatible with RCU preemption (bug #223281)."
142 eerror "Please disable it:"
143 eerror " CONFIG_PREEMT_RCU=n"
144 eerror "in /usr/src/linux/.config or"
145 eerror " Processor type and features --->"
146 eerror " [ ] Preemptible RCU"
147 eerror "in the 'menuconfig'"
148 die "CONFIG_PREEMT_RCU enabled"
149 fi
150
151 # kernel hook checking up latest allowed version
152 if kernel_is ge 2 6 31; then
153 eerror "Kernels newer then 2.6.30 are not supported by this driver"
154 die "Downgrade your kernel"
155 fi
156
157 if ! linux_chkconfig_present MTRR; then
158 ewarn "You don't have MTRR support enabled in the kernel."
159 ewarn "Direct rendering will not work."
160 fi
161
162 if linux_chkconfig_builtin DRM; then
163 ewarn "You have DRM support built in to the kernel"
164 ewarn "Direct rendering will not work."
165 fi
166
167 if ! linux_chkconfig_present AGP && \
168 ! linux_chkconfig_present PCIEPORTBUS; then
169 ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
170 ewarn "Direct rendering will not work."
171 fi
172
173 if ! linux_chkconfig_present ACPI; then
174 eerror "${P} requires the ACPI support in the kernel"
175 eerror "Please enable it:"
176 eerror " CONFIG_ACPI=y"
177 eerror "in /usr/src/linux/.config or"
178 eerror " Power management and ACPI options --->"
179 eerror " [*] Power Management support"
180 eerror "in the 'menuconfig'"
181 die "CONFIG_ACPI disabled"
182 fi
183
184 if ! linux_chkconfig_present MAGIC_SYSRQ; then
185 eerror "${P} requires the magic SysRq keys in the kernel."
186 eerror "Please enable it:"
187 eerror " CONFIG_MAGIC_SYSRQ=y"
188 eerror "in /usr/src/linux/.config or"
189 eerror " Kernel hacking --->"
190 eerror " [*] Magic SysRq key"
191 eerror "in the 'menuconfig'"
192 die "CONFIG_MAGIC_SYSRQ disabled"
193 fi
194
195 if ! linux_chkconfig_present PCI_MSI; then
196 eerror "${P} requires MSI in the kernel."
197 eerror "Please enable it:"
198 eerror " CONFIG_PCI_MSI=y"
199 eerror "in /usr/src/linux/.config or"
200 eerror " Bus options (PCI etc.) --->"
201 eerror " [*] Message Signaled Interrupts (MSI and MSI-X)"
202 eerror "in the kernel config."
203 die "CONFIG_PCI_MSI disabled"
204 fi
205
206 if linux_chkconfig_present LOCKDEP; then
207 eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
208 eerror "Unfortunately, this option exports the symbol lock_acquire as GPL-only."
209 eerror "This prevents ${P} from compiling with an error like this:"
210 eerror "FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
211 eerror "Please make sure the following options have been unset:"
212 eerror " Kernel hacking --->"
213 eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
214 eerror " [ ] Lock debugging: prove locking correctness"
215 eerror " [ ] Lock usage statistics"
216 eerror "in 'menuconfig'"
217 die "LOCKDEP enabled"
218 fi
219 }
220
221 pkg_setup() {
222 # Define module dir.
223 MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
224 # xorg folder
225 BASE_DIR="${S}/x740"
226
227 # amd64/x86
228 if use amd64 ; then
229 MY_BASE_DIR="${BASE_DIR}_64a"
230 PKG_LIBDIR=lib64
231 ARCH_DIR="${S}/arch/x86_64"
232 else
233 MY_BASE_DIR="${BASE_DIR}"
234 PKG_LIBDIR=lib
235 ARCH_DIR="${S}/arch/x86"
236 fi
237
238 if use modules; then
239 MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
240 BUILD_TARGETS="kmod_build"
241 linux-mod_pkg_setup
242 BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
243 _check_kernel_config
244 fi
245
246 elog
247 elog "Please note that this driver supports only graphic cards based on"
248 elog "r600 chipset and newer."
249 elog "This represent the ATI Radeon HD series at this moment."
250 elog
251 elog "If your card is older then usage of ${CATEGORY}/xf86-video-ati"
252 elog "as replacement is highly recommended. Rather than staying with"
253 elog "old versions of this driver."
254 elog "For migration informations please reffer to:"
255 elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
256 einfo
257 }
258
259 src_unpack() {
260 if [[ $(get_major_version) > 8 ]]; then
261 # Switching to a standard way to extract the files since otherwise no signature file
262 # would be created
263 local src="${DISTDIR}/${A}"
264 sh "${src}" --extract "${S}" 2&>1 /dev/null
265 else
266 unpack ${A}
267 fi
268 }
269
270 src_prepare() {
271 epatch "${FILESDIR}"/ati-drivers-xen.patch
272
273 # All kernel options for prepare are ment to be in here
274 if use modules; then
275 # version patches
276 # epatch "${FILESDIR}"/kernel/${PV}-*.patch
277 if use debug; then
278 sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
279 "${MODULE_DIR}/firegl_public.c" \
280 || die "Failed to enable debug output."
281 fi
282 fi
283
284 # These are the userspace utilities that we also have source for.
285 # We rebuild these later.
286 rm \
287 "${ARCH_DIR}"/usr/X11R6/bin/{fgl_glxgears,fglrx_xgamma} \
288 "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR}/libfglrx_gamma* \
289 || die "bin rm failed"
290
291 # ACPI fixups
292 sed -i \
293 -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
294 -e "s:/var/lib/gdm/:/var/gdm/:" \
295 "${S}/${FOLDER_PREFIX}/etc/ati/authatieventsd.sh" \
296 || die "sed failed."
297
298 # Since "who" is in coreutils, we're using that one instead of "finger".
299 sed -i -e 's:finger:who:' \
300 "${S}/${FOLDER_PREFIX}/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
301 || die "Replacing 'finger' with 'who' failed."
302 # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
303 # add function to detect default state.
304 epatch "${FILESDIR}"/ati-powermode-opt-path-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
305
306 cd "${MODULE_DIR}"
307 ln -s "${ARCH_DIR}"/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC$(gcc-major-version) \
308 || die "symlinking precompiled core failed"
309
310 convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
311
312 # When built with ati's make.sh it defines a bunch of macros if
313 # certain .config values are set, falling back to less reliable
314 # detection methods if linux/autoconf.h is not available. We
315 # simply use the linux/autoconf.h settings directly, bypassing the
316 # detection script.
317 sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
318 sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
319 || die "MODVERSIONS sed failed"
320 cd "${S}"
321
322 mkdir extra || die "mkdir failed"
323 cd extra
324 unpack ./../${FOLDER_PREFIX}/usr/src/ati/fglrx_sample_source.tgz
325 sed -i -e 's:include/extensions/extutil.h:X11/extensions/extutil.h:' \
326 lib/fglrx_gamma/fglrx_gamma.c || die "include fixup failed"
327 # Add a category.
328 mv programs/fglrx_gamma/fglrx_xgamma.{man,1} || die "man mv failed"
329 }
330
331 src_compile() {
332 use modules && linux-mod_src_compile
333
334 ebegin "Building fgl_glxgears"
335 cd "${S}"/extra/fgl_glxgears
336 # These extra libs/utils either have an Imakefile that does not
337 # work very well without tweaking or a Makefile ignoring CFLAGS
338 # and the like. We bypass those.
339
340 # The -DUSE_GLU is needed to compile using nvidia headers
341 # according to a comment in ati-drivers-extra-8.33.6.ebuild.
342 "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
343 -I"${S}"/${FOLDER_PREFIX}/usr/include fgl_glxgears.c \
344 -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
345 eend $?
346
347 ebegin "Building fglrx_gamma lib"
348 cd "${S}"/extra/lib/fglrx_gamma
349 "$(tc-getCC)" -shared -fpic -o libfglrx_gamma.so.1.0 ${CFLAGS} ${LDFLAGS} \
350 -DXF86MISC -Wl,-soname,libfglrx_gamma.so.1.0 fglrx_gamma.c \
351 -lXext || die "fglrx_gamma lib build failed"
352 ln -s libfglrx_gamma.so.1.0 libfglrx_gamma.so || die "ln failed"
353 ln -s libfglrx_gamma.so.1.0 libfglrx_gamma.so.1 || die "ln failed"
354 eend $?
355
356 ebegin "Building fglrx_gamma util"
357 cd "${S}"/extra/programs/fglrx_gamma
358 "$(tc-getCC)" -o fglrx_xgamma ${CFLAGS} ${LDFLAGS} \
359 -I../../../${FOLDER_PREFIX}/usr/X11R6/include -L../../lib/fglrx_gamma \
360 fglrx_xgamma.c -lm -lfglrx_gamma -lX11 \
361 || die "fglrx_gamma util build failed"
362 eend $?
363
364 }
365
366 src_install() {
367 use modules && linux-mod_src_install
368
369 # We can do two things here, and neither of them is very nice.
370
371 # For direct rendering libGL has to be able to load one or more
372 # dri modules (files ending in _dri.so, like fglrx_dri.so).
373 # Gentoo's mesa looks for these files in the location specified by
374 # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
375 # location /usr/$(get_libdir)/dri. Ati's libGL does the same
376 # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
377 # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
378 # 64bit. So we can either put the .so files in that (unusual,
379 # compared to "normal" mesa libGL) location or set
380 # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
381 # 101539.
382
383 # The problem with this approach is that LIBGL_DRIVERS_PATH
384 # *overrides* the default hardcoded location, it does not extend
385 # it. So if ati-drivers is merged but a non-ati libGL is selected
386 # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
387 # (because it changed in a newer mesa or because it was compiled
388 # for a different set of multilib abis than we are) stuff breaks.
389
390 # We create one file per ABI to work with "native" multilib, see
391 # below.
392
393 echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
394 doenvd "${T}/03ati-colon-sep" || die
395
396 # All libraries that we have a 32 bit and 64 bit version of on
397 # amd64 are installed in src_install-libs. Everything else
398 # (including libraries only available in native 64bit on amd64)
399 # goes in here.
400
401 # There used to be some code here that tried to detect running
402 # under a "native multilib" portage ((precursor of)
403 # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
404 # should just work (only doing some duplicate work). --marienz
405 if has_multilib_profile; then
406 local OABI=${ABI}
407 for ABI in $(get_install_abis); do
408 src_install-libs
409 done
410 ABI=${OABI}
411 unset OABI
412 else
413 src_install-libs
414 fi
415
416 # This is sorted by the order the files occur in the source tree.
417
418 # X modules.
419 exeinto /usr/$(get_libdir)/xorg/modules/drivers
420 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so || die
421 exeinto /usr/$(get_libdir)/xorg/modules/linux
422 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so || die
423 exeinto /usr/$(get_libdir)/xorg/modules
424 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{esut.a,glesx.so,amdxmm.so} || die
425
426 # Arch-specific files.
427 # (s)bin.
428 into /opt
429 dosbin "${ARCH_DIR}"/usr/sbin/atieventsd || die
430 # We cleaned out the compilable stuff in src_unpack
431 dobin "${ARCH_DIR}"/usr/X11R6/bin/* || die
432
433 # lib.
434 exeinto /usr/$(get_libdir)
435 # Everything except for the libGL.so installed in src_install-libs.
436 doexe $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
437 -maxdepth 1 -type f -name '*.so*' -not -name 'libGL.so*')
438 insinto /usr/$(get_libdir)
439 doins $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
440 -maxdepth 1 -type f -not -name '*.so*')
441
442 # Common files.
443 # etc.
444 insinto /etc/ati
445 # Everything except for the authatieventsd.sh script.
446 doins ${FOLDER_PREFIX}/etc/ati/{logo*,control,atiogl.xml,signature,amdpcsdb.default}
447 insopts -m0755
448 doins ${FOLDER_PREFIX}/etc/ati/authatieventsd.sh || die
449
450 # include.
451 insinto /usr
452 doins -r ${FOLDER_PREFIX}/usr/include || die
453 insinto /usr/include/X11/extensions
454 doins ${FOLDER_PREFIX}/usr/X11R6/include/X11/extensions/fglrx_gamma.h || die
455
456 # Just the atigetsysteminfo.sh script.
457 into /usr
458 dosbin ${FOLDER_PREFIX}/usr/sbin/* || die
459
460 # data files for the control panel.
461 insinto /usr/share
462 doins -r ${FOLDER_PREFIX}/usr/share/ati || die
463 insinto /usr/share/pixmaps
464 doins ${FOLDER_PREFIX}/usr/share/icons/ccc_{large,small}.xpm || die
465 make_desktop_entry amdcccle 'ATI Catalyst Control Center' \
466 ccc_large System
467
468 # doc.
469 dohtml -r ${FOLDER_PREFIX}/usr/share/doc/fglrx || die
470
471 doman ${FOLDER_PREFIX}/usr/share/man/man8/atieventsd.8 || die
472
473 pushd ${FOLDER_PREFIX}/usr/share/doc/fglrx/examples/etc/acpi > /dev/null
474
475 exeinto /etc/acpi
476 doexe ati-powermode.sh || die
477 insinto /etc/acpi/events
478 doins events/* || die
479
480 popd > /dev/null
481
482 # Done with the "source" tree. Install tools we rebuilt:
483 dobin extra/fgl_glxgears/fgl_glxgears || die
484 newdoc extra/fgl_glxgears/README README.fgl_glxgears || die
485
486 dolib extra/lib/fglrx_gamma/*so* || die
487 newdoc extra/lib/fglrx_gamma/README README.libfglrx_gamma || die
488
489 dobin extra/programs/fglrx_gamma/fglrx_xgamma || die
490 doman extra/programs/fglrx_gamma/fglrx_xgamma.1 || die
491 newdoc extra/programs/fglrx_gamma/README README.fglrx_gamma || die
492
493 # Gentoo-specific stuff:
494 newinitd "${FILESDIR}"/atieventsd.init atieventsd \
495 || die "Failed to install atieventsd.init.d"
496 echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
497 newconfd "${T}"/atieventsd.conf atieventsd || die
498 }
499
500 src_install-libs() {
501 if [[ "${ABI}" == "amd64" ]]; then
502 local EX_BASE_DIR="${BASE_DIR}_64a"
503 local pkglibdir=lib64
504 local MY_ARCH_DIR="${S}/arch/x86_64"
505 else
506 local EX_BASE_DIR="${BASE_DIR}"
507 local pkglibdir=lib
508 local MY_ARCH_DIR="${S}/arch/x86"
509 fi
510 einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
511
512 local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
513 # To make sure we do not miss a spot when these change.
514 local libmajor=1 libminor=2
515 local libver=${libmajor}.${libminor}
516
517 # The GLX libraries
518 # (yes, this really is "lib" even on amd64/multilib --marienz)
519 exeinto ${ATI_ROOT}/lib
520 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/libGL.so.${libver} || die
521 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor} || die
522 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so || die
523
524 exeinto ${ATI_ROOT}/extensions
525 doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/* || die
526
527 # DRI modules, installed into the path used by recent versions of mesa.
528 exeinto /usr/$(get_libdir)/dri
529 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so || die
530
531 # AMD Cal libraries
532 exeinto /usr/$(get_libdir)
533 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/*.so || die
534
535 # warn about removal of .la file
536 # WILL BE NEEDED IN FUTURE
537 #if [[ -e ${ATI_ROOT}/lib/libGL.la ]]; then
538 # ewarn "Since this version the libGL.la is not installed"
539 # ewarn "For fixing this issues please take look on:"
540 # ewarn " dev-util/lafilefixer"
541 # ewarn "This step is needed because the libGL.la is going"
542 # ewarn "to be removed by newer versions of the media-libs/mesa"
543 #fi
544 # Make up a libGL.la. Ati does not provide one, but mesa does. If
545 # a (libtool-based) libfoo is built with libGL.la present a
546 # reference to it is put into libfoo.la, and compiling
547 # (libtool-based) things that link too libfoo.la will complain if
548 # libGL.la disappears. So if we do not make up a libGL.la
549 # switching between mesa and ati becomes painful.
550 local revision=$(printf '%d%02d%02d' $(get_version_components))
551 sed -e "s:\${libmajor}:${libmajor}:g" \
552 -e "s:\${libminor}:${libminor}:g" \
553 -e "s:\${libdir}:$(get_libdir):g" \
554 -e "s:\${revision}:${revision}:g" \
555 "${FILESDIR}"/libGL.la.in > "${D}"/${ATI_ROOT}/lib/libGL.la \
556 || die "sed failed to make libGL.la"
557
558 local envname="${T}"/04ati-dri-path
559 if [[ -n ${ABI} ]]; then
560 envname="${envname}-${ABI}"
561 fi
562 echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
563 doenvd "${envname}" || die
564 }
565
566 pkg_postinst() {
567 elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
568 elog "To change your xorg.conf you can use the bundled \"aticonfig\""
569 elog
570 elog "If you experience unexplained segmentation faults and kernel crashes"
571 elog "with this driver and multi-threaded applications such as wine,"
572 elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
573 elog
574 elog "You will have to source /etc/profile (or logout and back in) for dri"
575 elog "to work, unless you previously had ati-drivers installed."
576
577 # Workaroud screen corruption
578 ewarn "If you experience screen corruption with this driver, try putting"
579 ewarn ' Option "XAANoOffscreenPixmaps" "true"'
580 ewarn "in the Device Section of /etc/X11/xorg.conf."
581
582 use modules && linux-mod_pkg_postinst
583 "${ROOT}"/usr/bin/eselect opengl set --use-old ati
584 }
585
586 pkg_preinst() {
587 use modules && linux-mod_pkg_preinst
588 }
589
590 pkg_prerm() {
591 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
592 }
593
594 pkg_postrm() {
595 use modules && linux-mod_pkg_postrm
596 "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
597 }