Gentoo Archives: gentoo-commits

From: Chi-Thanh Christopher Nguyen <chithanh@××××××××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/x11:master commit in: media-libs/mesa/, media-libs/mesa/files/
Date: Thu, 30 Jun 2011 23:49:08
Message-Id: ff7d0a3f799ff452ff51f8ad535c67b8fe862629.chithead@gentoo
1 commit: ff7d0a3f799ff452ff51f8ad535c67b8fe862629
2 Author: Chi-Thanh Christopher Nguyen <chithanh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 30 23:48:31 2011 +0000
4 Commit: Chi-Thanh Christopher Nguyen <chithanh <AT> cs <DOT> tu-berlin <DOT> de>
5 CommitDate: Thu Jun 30 23:48:31 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git;a=commit;h=ff7d0a3f
7
8 media-libs/mesa: adapt ebuild for configure changes, thanks to miknix in bug #372927. make i915g default.
9
10 ---
11 ...elect-mesa.conf.7.11 => eselect-mesa.conf.7.12} | 2 +-
12 media-libs/mesa/mesa-9999.ebuild | 72 +++++++++++---------
13 2 files changed, 41 insertions(+), 33 deletions(-)
14
15 diff --git a/media-libs/mesa/files/eselect-mesa.conf.7.11 b/media-libs/mesa/files/eselect-mesa.conf.7.12
16 similarity index 97%
17 rename from media-libs/mesa/files/eselect-mesa.conf.7.11
18 rename to media-libs/mesa/files/eselect-mesa.conf.7.12
19 index 3a1b196..73b2752 100644
20 --- a/media-libs/mesa/files/eselect-mesa.conf.7.11
21 +++ b/media-libs/mesa/files/eselect-mesa.conf.7.12
22 @@ -16,7 +16,7 @@ declare -A MESA_DRIVERS || die "MESA_DRIVERS already in environment and not asso
23 MESA_DRIVERS[i915,description]="i915 (Intel 915, 945)"
24 MESA_DRIVERS[i915,classicdriver]="i915_dri.so"
25 MESA_DRIVERS[i915,galliumdriver]="i915g_dri.so"
26 -MESA_DRIVERS[i915,default]="classic"
27 +MESA_DRIVERS[i915,default]="gallium"
28
29 MESA_DRIVERS[i965,description]="i965 (Intel 965, G/Q3x, G/Q4x)"
30 MESA_DRIVERS[i965,classicdriver]="i965_dri.so"
31
32 diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild
33 index 670fdc4..fe3f798 100644
34 --- a/media-libs/mesa/mesa-9999.ebuild
35 +++ b/media-libs/mesa/mesa-9999.ebuild
36 @@ -45,7 +45,7 @@ for card in ${VIDEO_CARDS}; do
37 done
38
39 IUSE="${IUSE_VIDEO_CARDS}
40 - bindist +classic d3d debug +egl +gallium gles +llvm motif +nptl openvg pic selinux shared-dricore wayland kernel_FreeBSD"
41 + bindist +classic d3d debug +egl +gallium gles +llvm motif +nptl openvg pic selinux shared-dricore +shared-glapi wayland kernel_FreeBSD"
42
43 LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.24"
44 # not a runtime dependency of this package, but dependency of packages which
45 @@ -209,9 +209,11 @@ src_configure() {
46 $(use_enable gles gles2)
47 $(use_enable egl)
48 $(use_enable openvg)
49 - $(use_enable gallium)
50 "
51 - use egl && myconf+="--with-egl-platforms=$(use wayland && echo "wayland,")drm,x11"
52 + if use egl; then
53 + use shared-glapi || die "egl needs shared-glapi. Please either enable shared-glapi or disable the egl use flag ."
54 + myconf+="--with-egl-platforms=$(use wayland && echo "wayland,")drm,x11"
55 + fi
56
57 if use !gallium && use !classic; then
58 ewarn "You enabled neither classic nor gallium USE flags. No hardware"
59 @@ -221,36 +223,22 @@ src_configure() {
60 myconf+="
61 --with-state-trackers=glx,dri$(use egl && echo ",egl")$(use openvg && echo ",vega")$(use d3d && echo ",d3d1x")
62 $(use_enable llvm gallium-llvm)
63 - $(use_enable video_cards_vmware gallium-svga)
64 - $(use_enable video_cards_nouveau gallium-nouveau)
65 - $(use_enable video_cards_intel gallium-i915)
66 - $(use_enable video_cards_intel gallium-i965)
67 - $(use_enable video_cards_radeon gallium-r300)
68 - $(use_enable video_cards_radeon gallium-r600)
69 "
70 - if use video_cards_i915 || \
71 - use video_cards_intel; then
72 - myconf+=" --enable-gallium-i915"
73 - else
74 - myconf+=" --disable-gallium-i915"
75 - fi
76 - if use video_cards_i965 || \
77 - use video_cards_intel; then
78 - myconf+=" --enable-gallium-i965"
79 - else
80 - myconf+=" --disable-gallium-i965"
81 - fi
82 - if use video_cards_r300 || \
83 - use video_cards_radeon; then
84 - myconf+=" --enable-gallium-r300"
85 - else
86 - myconf+=" --disable-gallium-r300"
87 + gallium_enable swrast
88 + gallium_enable video_cards_vmware svga
89 + gallium_enable video_cards_nouveau nouveau
90 + gallium_enable video_cards_i915 i915
91 + gallium_enable video_cards_i965 i965
92 + if ! use video_cards_i915 && \
93 + ! use video_cards_i965; then
94 + gallium_enable video_cards_intel i915 i965
95 fi
96 - if use video_cards_r600 || \
97 - use video_cards_radeon; then
98 - myconf+=" --enable-gallium-r600"
99 - else
100 - myconf+=" --disable-gallium-r600"
101 +
102 + gallium_enable video_cards_r300 r300
103 + gallium_enable video_cards_r600 r600
104 + if ! use video_cards_r300 && \
105 + ! use video_cards_r600; then
106 + gallium_enable video_cards_radeon r300 r600
107 fi
108 else
109 if use video_cards_nouveau || use video_cards_vmware; then
110 @@ -272,7 +260,9 @@ src_configure() {
111 $(use_enable nptl glx-tls) \
112 $(use_enable !pic asm) \
113 $(use_enable shared-dricore) \
114 + $(use_enable shared-glapi) \
115 --with-dri-drivers=${DRI_DRIVERS} \
116 + --with-gallium-drivers=${GALLIUM_DRIVERS} \
117 ${myconf}
118 }
119
120 @@ -296,7 +286,7 @@ src_install() {
121
122 # Install config file for eselect mesa
123 insinto /usr/share/mesa
124 - newins "${FILESDIR}/eselect-mesa.conf.7.11" eselect-mesa.conf || die
125 + newins "${FILESDIR}/eselect-mesa.conf.7.12" eselect-mesa.conf || die
126
127 # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
128 # because user can eselect desired GL provider.
129 @@ -370,6 +360,7 @@ pkg_postinst() {
130
131 # $1 - VIDEO_CARDS flag
132 # other args - names of DRI drivers to enable
133 +# TODO: avoid code duplication for a more elegant implementation
134 driver_enable() {
135 case $# in
136 # for enabling unconditionally
137 @@ -386,3 +377,20 @@ driver_enable() {
138 ;;
139 esac
140 }
141 +
142 +gallium_enable() {
143 + case $# in
144 + # for enabling unconditionally
145 + 1)
146 + GALLIUM_DRIVERS+=",$1"
147 + ;;
148 + *)
149 + if use $1; then
150 + shift
151 + for i in $@; do
152 + GALLIUM_DRIVERS+=",${i}"
153 + done
154 + fi
155 + ;;
156 + esac
157 +}