summaryrefslogtreecommitdiff
blob: 502931bbe3023d96e79c98bdf8a3d85413043ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-xlibs/emul-linux-x86-xlibs-1.2-r7.ebuild,v 1.1 2005/03/09 22:35:39 cryos Exp $

inherit multilib

DESCRIPTION="X11R6 libraries for emulation of 32bit x86 on amd64"
HOMEPAGE="http://www.gentoo.org/"
SRC_URI="http://dev.gentoo.org/~lv/emul-linux-x86-xlibs-${PV}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* ~amd64"
IUSE=""

RDEPEND="virtual/libc
	 >=x11-base/xorg-x11-6.8.0-r4
	 >=app-emulation/emul-linux-x86-baselibs-1.2.2-r2"

S=${WORKDIR}

src_install() {
	mkdir -p ${D}/etc/env.d/
	cp -Rpvf ${WORKDIR}/* ${D}/

	local libdir="lib32"
	if has_multilib_profile; then
		libdir=$(get_abi_LIBDIR x86)
	fi
	dodir /usr/${libdir}/opengl
	dosym /emul/linux/x86/usr/lib/opengl/xorg-x11 /usr/${libdir}/opengl/xorg-x11

	dodir /emul/linux/x86/usr/lib/X11/locale/C
	cp ${FILESDIR}/XI18N_OBJS ${D}/emul/linux/x86/usr/lib/X11/locale/C/
	cp ${FILESDIR}/XLC_LOCALE ${D}/emul/linux/x86/usr/lib/X11/locale/C/

	rm -f ${D}/emul/linux/x86/usr/lib/X11
	mv ${D}/emul/linux/x86/usr/X11R6/lib/* ${D}/emul/linux/x86/usr/lib/

	# Create some extra symlinks, bug 81045.
	cd ${D}/emul/linux/x86/usr/lib
	ln -s libX11.so.6 libX11.so
	ln -s libXext.so.6 libXext.so

	# We don't use this any more
	rm -rf ${D}/usr/X11R6
	rm -rf ${D}/emul/linux/x86/usr/X11R6

	dosed "s:^libdir=.*$:libdir=\'/emul/linux/x86/usr/lib\':" /emul/linux/x86/usr/lib/libGLU.la

	chown -R root:root ${D}
}

pkg_postinst() {
	# Ensure that the proper symlink is set, or a warning generated.
	if [ -h /usr/$(get_libdir)/X11/locale/lib ]; then
		rm -f /usr/$(get_libdir)/X11/locale/lib
	fi
	if [ ! -e /usr/$(get_libdir)/X11/locale/lib ]; then
		ln -s /emul/linux/x86/usr/lib/X11/locale/lib \
			/usr/$(get_libdir)/X11/locale/lib
	else
		ewarn "Error /usr/$(get_libdir)/X11/locale/lib is not a symlink."
		ewarn "This may cause some 32 bit applications to fail."
	fi
}

pkg_postrm() {
	# The symlink should be removed too.
	if [ -L /usr/$(get_libdir)/X11/locale/lib && \
		! -d /emul/linux/x86/usr/lib ]; then
		rm -f /usr/$(get_libdir)/X11/locale/lib
	fi
}