Gentoo Archives: gentoo-commits

From: "Jeffrey Gardner (je_fro)" <je_fro@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-drivers/ati-drivers: ChangeLog ati-drivers-8.582.ebuild
Date: Thu, 26 Feb 2009 17:14:51
Message-Id: E1Lcjou-0005bP-4g@stork.gentoo.org
1 je_fro 09/02/26 17:14:48
2
3 Modified: ChangeLog
4 Added: ati-drivers-8.582.ebuild
5 Log:
6 Latest for testing - let the bloodletting begin :)
7 (Portage version: 2.1.6.7/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.144 x11-drivers/ati-drivers/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.144&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?rev=1.144&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ChangeLog?r1=1.143&r2=1.144
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v
19 retrieving revision 1.143
20 retrieving revision 1.144
21 diff -u -r1.143 -r1.144
22 --- ChangeLog 5 Feb 2009 04:26:22 -0000 1.143
23 +++ ChangeLog 26 Feb 2009 17:14:48 -0000 1.144
24 @@ -1,6 +1,18 @@
25 # ChangeLog for x11-drivers/ati-drivers
26 # Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v 1.143 2009/02/05 04:26:22 je_fro Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ChangeLog,v 1.144 2009/02/26 17:14:48 je_fro Exp $
29 +
30 + 26 Feb 2009; Jeff Gardner <je_fro@g.o>
31 + +files/8.582/ati-powermode-opt-path-2.patch,
32 + +files/8.582/ati-drivers-xen-8.552.patch, +ati-drivers-8.582.ebuild:
33 + Add needed files
34 +
35 +*ati-drivers-8.582 (26 Feb 2009)
36 +
37 + 26 Feb 2009; Jeff Gardner <je_fro@g.o>
38 + +files/8.582/ati-powermode-opt-path-2.patch,
39 + +files/8.582/ati-drivers-xen-8.552.patch, +ati-drivers-8.582.ebuild:
40 + Latest for testing
41
42 05 Feb 2009; Jeff Gardner <je_fro@g.o> ChangeLog:
43 Add libstdc++-v3 to RDEPEND, close bug #249192.
44
45
46
47 1.1 x11-drivers/ati-drivers/ati-drivers-8.582.ebuild
48
49 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-8.582.ebuild?rev=1.1&view=markup
50 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-8.582.ebuild?rev=1.1&content-type=text/plain
51
52 Index: ati-drivers-8.582.ebuild
53 ===================================================================
54 # Copyright 1999-2009 Gentoo Foundation
55 # Distributed under the terms of the GNU General Public License v2
56 # $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/ati-drivers-8.582.ebuild,v 1.1 2009/02/26 17:14:48 je_fro Exp $
57
58 IUSE="acpi debug"
59
60 inherit eutils multilib linux-mod toolchain-funcs versionator
61
62 DESCRIPTION="Ati precompiled drivers for recent chipsets"
63 HOMEPAGE="http://www.ati.com"
64 ATI_URL="https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/"
65 SRC_URI="${ATI_URL}/ati-driver-installer-9.2-x86.x86_64.run"
66
67 LICENSE="AMD GPL-2 QPL-1.0 as-is"
68 KEYWORDS="~amd64 ~x86"
69
70 # The portage dep is for COLON_SEPARATED support in env-update.
71 # The eselect dep (>=1.0.9) is for COLON_SEPARATED in eselect env update.
72 RDEPEND=">=x11-base/xorg-server-1.5
73 !x11-apps/ati-drivers-extra
74 >=app-admin/eselect-1.0.9
75 app-admin/eselect-opengl
76 sys-libs/libstdc++-v3
77 amd64? ( app-emulation/emul-linux-x86-xlibs )
78 acpi? (
79 x11-apps/xauth
80 sys-power/acpid
81 )
82 x11-libs/libXrandr
83 >=sys-apps/portage-2.1.1-r1"
84
85 DEPEND="${RDEPEND}
86 x11-proto/xf86miscproto
87 x11-proto/xf86vidmodeproto
88 x11-proto/inputproto
89 !<x11-drivers/ati-drivers-8.552-r1"
90
91 EMULTILIB_PKG="true"
92
93 RESTRICT="binchecks"
94
95 S="${WORKDIR}"
96
97 pkg_setup() {
98
99 # Define module dir.
100 MODULE_DIR="${S}/common/lib/modules/fglrx/build_mod"
101
102 #check kernel and sets up KV_OBJ
103 MODULE_NAMES="fglrx(video:${S}/common/lib/modules/fglrx/build_mod/2.6.x)"
104 BUILD_TARGETS="kmod_build"
105 linux-mod_pkg_setup
106 BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
107
108 if ! kernel_is 2 6; then
109 eerror "Need a 2.6 kernel to compile against!"
110 die "Need a 2.6 kernel to compile against!"
111 fi
112
113 if kernel_is ge 2 6 25 && linux_chkconfig_present PREEMPT_RCU; then
114 die "${P} is not compatible with RCU Preemption (bug #223281), please disable it"
115 fi
116
117 if kernel_is ge 2 6 26 && ! linux_chkconfig_present UNUSED_SYMBOLS; then
118 ewarn "You have to Enable unused/obsolete exported symbols in Kernel hacking section of kernel config for fglrx to load"
119 fi
120
121 if kernel_is ge 2 6 24 && ! linux_chkconfig_present PCI_LEGACY; then
122 eerror "${P} requires support for pci_find_slot."
123 die "${P} requires support for pci_find_slot."
124 fi
125
126 if ! linux_chkconfig_present MTRR; then
127 ewarn "You don't have MTRR support enabled, the direct rendering will not work."
128 fi
129
130 if linux_chkconfig_builtin DRM; then
131 ewarn "You have DRM support enabled builtin, the direct rendering will not work."
132 fi
133
134 if ! linux_chkconfig_present AGP && \
135 ! linux_chkconfig_present PCIEPORTBUS; then
136 ewarn "You need AGP and/or PCI Express support for direct rendering to work."
137 fi
138
139 if linux_chkconfig_present PARAVIRT; then
140 eerror "The current ati-drivers don't compile when having"
141 eerror "paravirtualization active due to GPL symbol export"
142 eerror "restrictions."
143 eerror "Please disable it:"
144 eerror " CONFIG_PARAVIRT=n"
145 eerror "in /usr/src/linux/.config or"
146 eerror " Processor type and features -->"
147 eerror " [ ] Paravirtualization support (EXPERIMENTAL)"
148 eerror "in 'menuconfig'"
149 die "CONFIG_PARAVIRT enabled"
150 fi
151
152 if ! linux_chkconfig_present MAGIC_SYSRQ; then
153 eerror "You need MAGIC_SYSRQ enabled in order to build ati-drivers"
154 die "CONFIG_MAGIC_SYSRQ disabled"
155 fi
156
157 # Only support xorg-server >=1.5
158 BASE_DIR="${S}/x740"
159
160 if ! linux_chkconfig_present PCI_MSI; then
161 eerror "You need PCI_MSI enabled in order to build ati-drivers"
162 die "CONFIG_PCI_MSI disabled"
163 fi
164
165 # This is used like $(get_libdir) for paths in ati's package.
166 if use amd64 ; then
167 MY_BASE_DIR="${BASE_DIR}_64a"
168 PKG_LIBDIR=lib64
169 ARCH_DIR="${S}/arch/x86_64"
170 else
171 MY_BASE_DIR="${BASE_DIR}"
172 PKG_LIBDIR=lib
173 ARCH_DIR="${S}/arch/x86"
174 fi
175 }
176
177 src_unpack() {
178 #Switching to a standard way to extract the files since otherwise no signature file
179 #would be created
180 local src="${DISTDIR}/${A}"
181 sh "${src}" --extract "${S}" 2&>1 /dev/null
182 cd "${S}"
183 epatch "${FILESDIR}"/${PV}/ati-drivers-xen-8.552.patch || die "epatch failed"
184
185 # These are the userspace utilities that we also have source for.
186 # We rebuild these later.
187 rm \
188 "${ARCH_DIR}"/usr/X11R6/bin/{fgl_glxgears,fglrx_xgamma} \
189 "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR}/libfglrx_gamma* \
190 || die "bin rm failed"
191
192 if use debug; then
193 # Enable debug mode in the Source Code.
194 sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
195 "${MODULE_DIR}/firegl_public.c" \
196 || die "Failed to enable debug output."
197 fi
198
199 if use acpi; then
200 sed -i \
201 -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
202 -e "s:/var/lib/gdm/:/var/gdm/:" \
203 "${S}/common/etc/ati/authatieventsd.sh" \
204 || die "sed failed."
205
206 # Since "who" is in coreutils, we're using that one instead of "finger".
207 sed -i -e 's:finger:who:' \
208 "${S}/common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
209 || die "Replacing 'finger' with 'who' failed."
210 # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
211 # add funktion to detect default state.
212 epatch "${FILESDIR}"/${PV}/ati-powermode-opt-path-2.patch
213 fi
214
215 pushd ${MODULE_DIR} >/dev/null
216 ln -s "${ARCH_DIR}"/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC$(gcc-major-version) \
217 || die "symlinking precompiled core failed"
218
219 convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
220
221 # When built with ati's make.sh it defines a bunch of macros if
222 # certain .config values are set, falling back to less reliable
223 # detection methods if linux/autoconf.h is not available. We
224 # simply use the linux/autoconf.h settings directly, bypassing the
225 # detection script.
226 sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
227 sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
228 || die "MODVERSIONS sed failed"
229 popd >/dev/null
230
231 mkdir extra || die "mkdir failed"
232 cd extra
233 unpack ./../common/usr/src/ati/fglrx_sample_source.tgz
234 sed -i -e 's:include/extensions/extutil.h:X11/extensions/extutil.h:' \
235 lib/fglrx_gamma/fglrx_gamma.c || die "include fixup failed"
236 # Add a category.
237 mv programs/fglrx_gamma/fglrx_xgamma.{man,1} || die "man mv failed"
238 cd ..
239 }
240
241 src_compile() {
242 linux-mod_src_compile
243
244 einfo "Building fgl_glxgears"
245 cd "${S}"/extra/fgl_glxgears
246 # These extra libs/utils either have an Imakefile that does not
247 # work very well without tweaking or a Makefile ignoring CFLAGS
248 # and the like. We bypass those.
249
250 # The -DUSE_GLU is needed to compile using nvidia headers
251 # according to a comment in ati-drivers-extra-8.33.6.ebuild.
252 "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
253 -I"${S}"/common/usr/include fgl_glxgears.c \
254 -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
255
256 einfo "Building fglrx_gamma lib"
257 cd "${S}"/extra/lib/fglrx_gamma
258 "$(tc-getCC)" -shared -fpic -o libfglrx_gamma.so.1.0 ${CFLAGS} ${LDFLAGS} \
259 -DXF86MISC -Wl,-soname,libfglrx_gamma.so.1.0 fglrx_gamma.c \
260 -lXext || die "fglrx_gamma lib build failed"
261 ln -s libfglrx_gamma.so.1.0 libfglrx_gamma.so || die "ln failed"
262 ln -s libfglrx_gamma.so.1.0 libfglrx_gamma.so.1 || die "ln failed"
263
264 einfo "Building fglrx_gamma util"
265 cd "${S}"/extra/programs/fglrx_gamma
266 "$(tc-getCC)" -o fglrx_xgamma ${CFLAGS} ${LDFLAGS} \
267 -I../../../common/usr/X11R6/include -L../../lib/fglrx_gamma \
268 fglrx_xgamma.c -lm -lfglrx_gamma -lX11 \
269 || die "fglrx_gamma util build failed"
270
271 }
272
273 src_install() {
274 linux-mod_src_install
275
276 # We can do two things here, and neither of them is very nice.
277
278 # For direct rendering libGL has to be able to load one or more
279 # dri modules (files ending in _dri.so, like fglrx_dri.so).
280 # Gentoo's mesa looks for these files in the location specified by
281 # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
282 # location /usr/$(get_libdir)/dri. Ati's libGL does the same
283 # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
284 # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
285 # 64bit. So we can either put the .so files in that (unusual,
286 # compared to "normal" mesa libGL) location or set
287 # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
288 # 101539.
289
290 # The problem with this approach is that LIBGL_DRIVERS_PATH
291 # *overrides* the default hardcoded location, it does not extend
292 # it. So if ati-drivers is merged but a non-ati libGL is selected
293 # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
294 # (because it changed in a newer mesa or because it was compiled
295 # for a different set of multilib abis than we are) stuff breaks.
296
297 # We create one file per ABI to work with "native" multilib, see
298 # below.
299
300 echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
301 doenvd "${T}/03ati-colon-sep"
302
303 # All libraries that we have a 32 bit and 64 bit version of on
304 # amd64 are installed in src_install-libs. Everything else
305 # (including libraries only available in native 64bit on amd64)
306 # goes in here.
307
308 # There used to be some code here that tried to detect running
309 # under a "native multilib" portage ((precursor of)
310 # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
311 # should just work (only doing some duplicate work). --marienz
312 if has_multilib_profile; then
313 local OABI=${ABI}
314 for ABI in $(get_install_abis); do
315 src_install-libs
316 done
317 ABI=${OABI}
318 unset OABI
319 else
320 src_install-libs
321 fi
322
323 # This is sorted by the order the files occur in the source tree.
324
325 # X modules.
326 exeinto /usr/$(get_libdir)/xorg/modules/drivers
327 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
328 exeinto /usr/$(get_libdir)/xorg/modules/linux
329 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
330 exeinto /usr/$(get_libdir)/xorg/modules
331 doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{esut.a,glesx.so,amdxmm.so}
332
333 # Arch-specific files.
334 # (s)bin.
335 into /opt
336 if use acpi; then
337 dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
338 fi
339 # We cleaned out the compilable stuff in src_unpack
340 dobin "${ARCH_DIR}"/usr/X11R6/bin/*
341
342 # lib.
343 exeinto /usr/$(get_libdir)
344 # Everything except for the libGL.so installed in src_install-libs.
345 doexe $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
346 -maxdepth 1 -type f -name '*.so*' -not -name 'libGL.so*')
347 insinto /usr/$(get_libdir)
348 doins $(find "${ARCH_DIR}"/usr/X11R6/${PKG_LIBDIR} \
349 -maxdepth 1 -type f -not -name '*.so*')
350
351 # Common files.
352 # etc.
353 insinto /etc/ati
354 # Everything except for the authatieventsd.sh script.
355 doins common/etc/ati/{logo*,control,atiogl.xml,signature,amdpcsdb.default}
356 if use acpi; then
357 insopts -m0755
358 doins common/etc/ati/authatieventsd.sh
359 fi
360
361 # include.
362 insinto /usr
363 doins -r common/usr/include
364 insinto /usr/include/X11/extensions
365 doins common/usr/X11R6/include/X11/extensions/fglrx_gamma.h
366
367 # Just the atigetsysteminfo.sh script.
368 into /usr
369 dosbin common/usr/sbin/*
370
371 # data files for the control panel.
372 insinto /usr/share
373 doins -r common/usr/share/ati
374 insinto /usr/share/pixmaps
375 doins common/usr/share/icons/ccc_{large,small}.xpm
376 make_desktop_entry amdcccle 'ATI Catalyst Control Center' \
377 ccc_large System
378
379 # doc.
380 dohtml -r common/usr/share/doc/fglrx
381
382 if use acpi; then
383 doman common/usr/share/man/man8/atieventsd.8
384
385 pushd common/usr/share/doc/fglrx/examples/etc/acpi >/dev/null
386
387 exeinto /etc/acpi
388 doexe ati-powermode.sh
389 insinto /etc/acpi/events
390 doins events/*
391
392 popd >/dev/null
393 fi
394
395 # Done with the "source" tree. Install tools we rebuilt:
396 dobin extra/fgl_glxgears/fgl_glxgears
397 newdoc extra/fgl_glxgears/README README.fgl_glxgears
398
399 dolib extra/lib/fglrx_gamma/*so*
400 newdoc extra/lib/fglrx_gamma/README README.libfglrx_gamma
401
402 dobin extra/programs/fglrx_gamma/fglrx_xgamma
403 doman extra/programs/fglrx_gamma/fglrx_xgamma.1
404 newdoc extra/programs/fglrx_gamma/README README.fglrx_gamma
405
406 # Gentoo-specific stuff:
407 if use acpi; then
408 newinitd "${FILESDIR}"/atieventsd.init atieventsd \
409 || die "Failed to install atieventsd.init.d"
410 echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
411 newconfd "${T}"/atieventsd.conf atieventsd
412 fi
413 }
414
415 src_install-libs() {
416 if [[ "${ABI}" == "amd64" ]]; then
417 local EX_BASE_DIR="${BASE_DIR}_64a"
418 local pkglibdir=lib64
419 local MY_ARCH_DIR="${S}/arch/x86_64"
420 else
421 local EX_BASE_DIR="${BASE_DIR}"
422 local pkglibdir=lib
423 local MY_ARCH_DIR="${S}/arch/x86"
424 fi
425 einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
426
427 local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
428 # To make sure we do not miss a spot when these change.
429 local libmajor=1 libminor=2
430 local libver=${libmajor}.${libminor}
431
432 # The GLX libraries
433 # (yes, this really is "lib" even on amd64/multilib --marienz)
434 exeinto ${ATI_ROOT}/lib
435 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/libGL.so.${libver}
436 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
437 dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
438
439 exeinto ${ATI_ROOT}/extensions
440 doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/*
441
442 # DRI modules, installed into the path used by recent versions of mesa.
443 exeinto /usr/$(get_libdir)/dri
444 doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
445
446 # AMD Cal libraries
447 exeinto /usr/$(get_libdir)
448 doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/*.so
449
450 # Make up a libGL.la. Ati does not provide one, but mesa does. If
451 # a (libtool-based) libfoo is built with libGL.la present a
452 # reference to it is put into libfoo.la, and compiling
453 # (libtool-based) things that link too libfoo.la will complain if
454 # libGL.la disappears. So if we do not make up a libGL.la
455 # switching between mesa and ati becomes painful.
456 local revision=$(printf '%d%02d%02d' $(get_version_components))
457 sed -e "s:\${libmajor}:${libmajor}:g" \
458 -e "s:\${libminor}:${libminor}:g" \
459 -e "s:\${libdir}:$(get_libdir):g" \
460 -e "s:\${revision}:${revision}:g" \
461 "${FILESDIR}"/libGL.la.in > "${D}"/${ATI_ROOT}/lib/libGL.la \
462 || die "sed failed to make libGL.la"
463
464 local envname="${T}"/04ati-dri-path
465 if [[ -n ${ABI} ]]; then
466 envname="${envname}-${ABI}"
467 fi
468 echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
469 doenvd "${envname}"
470 }
471
472 pkg_postinst() {
473 /usr/bin/eselect opengl set --use-old ati
474
475 elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
476 elog "To change your xorg.conf you can use the bundled \"aticonfig\""
477 elog
478 elog "If you experience unexplained segmentation faults and kernel crashes"
479 elog "with this driver and multi-threaded applications such as wine,"
480 elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
481 elog
482 elog "You will have to source /etc/profile (or logout and back in) for dri"
483 elog "to work, unless you previously had ati-drivers installed."
484
485 # Workaroud screen corruption
486 ewarn "If you experience screen corruption with this driver, try putting"
487 ewarn ' Option "XAANoOffscreenPixmaps" "true"'
488 ewarn "in the Device Section of /etc/X11/xorg.conf."
489
490 linux-mod_pkg_postinst
491 }
492
493 pkg_prerm() {
494 /usr/bin/eselect opengl set xorg-x11
495 }