Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 204755 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/local/layman/x11/media-libs/mesa/mesa-9999.ebuild (-16 / +116 lines)
Lines 4-10 Link Here
4
4
5
EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
5
EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
6
6
7
inherit autotools multilib flag-o-matic git portability
7
inherit autotools multilib flag-o-matic git portability toolchain-funcs
8
8
9
OPENGL_DIR="xorg-x11"
9
OPENGL_DIR="xorg-x11"
10
10
Lines 23-28 Link Here
23
LICENSE="LGPL-2"
23
LICENSE="LGPL-2"
24
SLOT="0"
24
SLOT="0"
25
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
25
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
26
EMULTILIB_PKG="true"
27
26
IUSE_VIDEO_CARDS="
28
IUSE_VIDEO_CARDS="
27
	video_cards_i810
29
	video_cards_i810
28
	video_cards_mach64
30
	video_cards_mach64
Lines 44-50 Link Here
44
	motif
46
	motif
45
	nptl
47
	nptl
46
	xcb
48
	xcb
47
	kernel_FreeBSD"
49
	kernel_FreeBSD
50
	multilib"
48
51
49
RDEPEND="app-admin/eselect-opengl
52
RDEPEND="app-admin/eselect-opengl
50
	dev-libs/expat
53
	dev-libs/expat
Lines 111-118 Link Here
111
	eautoreconf
114
	eautoreconf
112
}
115
}
113
116
114
src_compile() {
117
mesa_src_compile() {
115
	local myconf
118
	local myconf
119
	local OCFLAGS=""
120
	local OCXXFLAGS=""
121
	local OCHOST=""
122
	CC="$(tc-getCC)"
123
	CXX="$(tc-getCXX)"
124
125
	if has_multilib_profile ; then
126
		OCFLAGS=${CFLAGS}
127
		OCHOST=${CHOST}
128
		if use amd64 || use ppc64 ; then
129
			case ${ABI} in
130
				x86) 	CHOST="i686-${OCHOST#*-}"
131
					CFLAGS="${OCFLAGS} -m32"
132
					CXXFLAGS="${OCXXFLAGS} -m32"
133
					;;
134
				amd64)  CHOST="x86_64-${OCHOST#*-}"
135
					CFLAGS="${OCFLAGS} -m64"
136
					CXXFLAGS="${CXXFLAGS} -m64"
137
					;;
138
				ppc)	CHOST="powerpc-${OCHOST#*-}"
139
					CFLAGS="${OCFLAGS} -m32"
140
					CXXFLAGS="${OCXXFLAGS} -m32"
141
					;;
142
				ppc64)	CHOST="powerpc64-${OCHOST#*-}"
143
					CFLAGS="${OCFLAGS} -m64"
144
					CXXFLAGS="${OCXXFLAGS} -m64"
145
					;;
146
				*)	die "Unknown ABI"
147
					;;
148
			esac
149
		fi
150
	fi
116
151
117
	# This is where we might later change to build xlib/osmesa
152
	# This is where we might later change to build xlib/osmesa
118
	myconf="${myconf} --with-driver=dri"
153
	myconf="${myconf} --with-driver=dri"
Lines 148-184 Link Here
148
183
149
	myconf="${myconf} --without-demos"
184
	myconf="${myconf} --without-demos"
150
185
151
	myconf="${myconf} $(use_enable xcb)"
186
	# xcb is not yet used for the binary 32bit compatibility libs
152
187
	if is_final_abi ; then
188
		myconf="${myconf} $(use_enable xcb)"
189
        fi
190
  	
153
	# Get rid of glut includes
191
	# Get rid of glut includes
154
	rm -f "${S}"/include/GL/glut*h
192
	rm -f "${S}"/include/GL/glut*h
155
193
156
	myconf="${myconf} $(use_enable motif glw)"
194
	myconf="${myconf} $(use_enable motif glw)"
157
195
196
	# Create seperate build dir for each ABI since the Mesa build system
197
	# doesn't handle building both ABIs in the same tree
198
	cp -al ${S} ${WORKDIR}/builddir.${ABI}
199
	cd ${WORKDIR}/builddir.${ABI}
200
	
158
	econf ${myconf} || die
201
	econf ${myconf} || die
202
159
	emake || die
203
	emake || die
204
	if has_multilib_profile; then
205
		CFLAGS="${OCFLAGS}"
206
		CXXFLAGS="${OCXXFLAGS}"
207
		CHOST="${OCHOST}"
208
	fi
160
}
209
}
161
210
162
src_install() {
211
src_compile() {
212
	if [[ -z ${OABI} ]] ; then 
213
		local abilist=""
214
		if has_multilib_profile ; then
215
			abilist=$(get_install_abis)
216
			einfo "Building multilib Mesa for ABIs: ${abilist}"
217
		elif is_crosscompile || tc-is-cross-compiler ; then
218
			abilist=${DEFAULT_ABI}
219
		fi
220
		if [[ -n ${abilist} ]] ; then
221
			OABI=${ABI}
222
			for ABI in ${abilist} ; do
223
				export ABI
224
				src_compile
225
			done
226
			ABI=${OABI}
227
			unset OABI
228
			return 0
229
		fi
230
	fi
231
	mesa_src_compile
232
}
233
234
mesa_src_install() {
235
	einfo "Installing Mesa ${ABI} ..."
236
	cd ${WORKDIR}/builddir.${ABI}
237
163
	dodir /usr
238
	dodir /usr
164
	emake \
239
	emake \
165
		DESTDIR="${D}" \
240
		DESTDIR="${D}" \
166
		install || die "Installation failed"
241
		install || die "Installation failed"
167
242
168
	if ! use motif; then
169
		rm "${D}"/usr/include/GL/GLwMDrawA.h
170
	fi
171
172
	# Don't install private headers
173
	rm -f "${D}"/usr/include/GL/GLw*P.h
174
175
	fix_opengl_symlinks
243
	fix_opengl_symlinks
176
	dynamic_libgl_install
244
	dynamic_libgl_install
177
245
178
	# Install libtool archives
246
	# Install libtool archives
179
	insinto /usr/$(get_libdir)
247
	sed -e "s:\/usr\/lib:/usr/$(get_libdir):g" "${FILESDIR}"/lib/libGLU.la \
180
	# (#67729) Needs to be lib, not $(get_libdir)
248
		> "${D}"/usr/$(get_libdir)/libGLU.la
181
	doins "${FILESDIR}"/lib/libGLU.la
182
	sed -e "s:\${libdir}:$(get_libdir):g" "${FILESDIR}"/lib/libGL.la \
249
	sed -e "s:\${libdir}:$(get_libdir):g" "${FILESDIR}"/lib/libGL.la \
183
		> "${D}"/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.la
250
		> "${D}"/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.la
184
251
Lines 190-202 Link Here
190
		"${D}"/usr/$(get_libdir)/libGLU.la \
257
		"${D}"/usr/$(get_libdir)/libGLU.la \
191
		"${D}"/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.la
258
		"${D}"/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.la
192
259
260
        is_final_abi || return 0
261
193
	# libGLU doesn't get the plain .so symlink either
262
	# libGLU doesn't get the plain .so symlink either
194
	#dosym libGLU.so.1 /usr/$(get_libdir)/libGLU.so
263
	#dosym libGLU.so.1 /usr/$(get_libdir)/libGLU.so
195
264
265
	if ! use motif; then
266
		rm "${D}"/usr/include/GL/GLwMDrawA.h
267
	fi
268
269
	# Don't install private headers
270
	rm -f "${D}"/usr/include/GL/GLw*P.h
271
196
	# Figure out why libGL.so.1.5 is built (directfb), and why it's linked to
272
	# Figure out why libGL.so.1.5 is built (directfb), and why it's linked to
197
	# as the default libGL.so.1
273
	# as the default libGL.so.1
198
}
274
}
199
275
276
src_install() {
277
        if [[ -z ${OABI} ]] ; then
278
                local abilist=""
279
                if has_multilib_profile ; then
280
                        abilist=$(get_install_abis)
281
                        einfo "Installing multilib Mesa for ABIs: ${abilist}"
282
                elif is_crosscompile || tc-is-cross-compiler ; then
283
                        abilist=${DEFAULT_ABI}
284
                fi
285
                if [[ -n ${abilist} ]] ; then
286
                        OABI=${ABI}
287
                        for ABI in ${abilist} ; do
288
                                export ABI 
289
                                src_install
290
                        done
291
                        ABI=${OABI}
292
                        unset OABI 
293
                        return 0
294
                fi
295
        fi
296
297
	mesa_src_install
298
}
299
200
pkg_postinst() {
300
pkg_postinst() {
201
	switch_opengl_implem
301
	switch_opengl_implem
202
302

Return to bug 204755