OLD | NEW |
| (Empty) |
1 # Copyright 1999-2010 Gentoo Foundation | |
2 # Distributed under the terms of the GNU General Public License v2 | |
3 | |
4 EAPI="2" | |
5 | |
6 # Must be before x-modular eclass is inherited | |
7 SNAPSHOT="yes" | |
8 | |
9 inherit x-modular multilib versionator | |
10 | |
11 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/xserver" | |
12 | |
13 OPENGL_DIR="xorg-x11" | |
14 | |
15 DESCRIPTION="X.Org X servers" | |
16 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-
fbsd" | |
17 | |
18 IUSE_SERVERS="dmx kdrive xorg" | |
19 IUSE="${IUSE_SERVERS} tslib hal ipv6 minimal nptl sdl" | |
20 RDEPEND="hal? ( sys-apps/hal ) | |
21 tslib? ( >=x11-libs/tslib-1.0 x11-proto/xcalibrateproto ) | |
22 dev-libs/openssl | |
23 >=x11-libs/libXfont-1.3.3 | |
24 >=x11-libs/xtrans-1.2.2 | |
25 >=x11-libs/libXau-1.0.4 | |
26 >=x11-libs/libxkbfile-1.0.4 | |
27 >=x11-libs/libXdmcp-1.0.2 | |
28 >=x11-libs/libpciaccess-0.10.3 | |
29 >=x11-libs/pixman-0.15.20 | |
30 media-libs/freetype | |
31 >=x11-misc/xbitmaps-1.0.1 | |
32 >=x11-misc/xkeyboard-config-1.4 | |
33 x11-apps/xkbcomp | |
34 >=x11-apps/iceauth-1.0.2 | |
35 >=x11-apps/rgb-1.0.3 | |
36 >=x11-apps/xauth-1.0.3 | |
37 >=x11-apps/xinit-1.0.8-r3 | |
38 >=app-admin/eselect-opengl-1.0.8 | |
39 dmx? ( | |
40 x11-libs/libXt | |
41 >=x11-libs/libdmx-1.0.99.1 | |
42 >=x11-libs/libX11-1.1.5 | |
43 >=x11-libs/libXaw-1.0.4 | |
44 >=x11-libs/libXext-1.0.5 | |
45 >=x11-libs/libXfixes-4.0.3 | |
46 >=x11-libs/libXi-1.2.99.1 | |
47 >=x11-libs/libXmu-1.0.3 | |
48 >=x11-libs/libXtst-1.0.3 | |
49 ) | |
50 !minimal? ( | |
51 >=x11-libs/libX11-1.1.5 | |
52 >=x11-libs/libXext-1.0.5 | |
53 >=x11-libs/libXres-1.0.3 | |
54 >=media-libs/mesa-7.8.1[nptl=] | |
55 ) | |
56 >=x11-libs/libxkbui-1.0.2 | |
57 kdrive? ( | |
58 >=x11-libs/libXext-1.0.5 | |
59 sdl? ( media-libs/libsdl ) )" | |
60 # Xres is dmx-dependent | |
61 # Xaw is dmx-dependent | |
62 # Xpm is dmx-dependent, pulls in Xt | |
63 # xkbcomp is launched at startup but not checked by ./configure | |
64 | |
65 ## Deps that don't have a version in configure.ac but do here: | |
66 # x11-proto/resourceproto | |
67 # x11-proto/fontsproto | |
68 # x11-libs/libXau | |
69 # x11-libs/libXfont | |
70 # x11-libs/libXdmcp | |
71 # x11-libs/libXext | |
72 # x11-libs/libX11 | |
73 # x11-libs/libXrender | |
74 # x11-libs/libXmu | |
75 # x11-libs/libXfixes | |
76 # x11-libs/libXtst | |
77 # x11-proto/xineramaproto | |
78 # x11-proto/dmxproto | |
79 ## Deps that are larger here than in configure.ac | |
80 # x11-libs/libpciaccess-0.8.0 | |
81 # | |
82 | |
83 DEPEND="${RDEPEND} | |
84 !!net-dialup/dtrace | |
85 sys-devel/flex | |
86 >=x11-misc/util-macros-1.6.0 | |
87 >=x11-proto/randrproto-1.2.99.3 | |
88 >=x11-proto/renderproto-0.11 | |
89 >=x11-proto/fixesproto-4.1 | |
90 >=x11-proto/damageproto-1.1 | |
91 >=x11-proto/xextproto-7.0.99.3 | |
92 >=x11-proto/xproto-7.0.13 | |
93 >=x11-proto/xf86dgaproto-2.0.99.1 | |
94 >=x11-proto/xf86rushproto-1.1.2 | |
95 >=x11-proto/xf86vidmodeproto-2.2.99.1 | |
96 >=x11-proto/compositeproto-0.4 | |
97 >=x11-proto/recordproto-1.13.99.1 | |
98 >=x11-proto/resourceproto-1.0.2 | |
99 >=x11-proto/videoproto-2.2.2 | |
100 >=x11-proto/scrnsaverproto-1.1 | |
101 >=x11-proto/trapproto-3.4.3 | |
102 >=x11-proto/xineramaproto-1.1.3 | |
103 >=x11-proto/fontsproto-2.0.2 | |
104 >=x11-proto/kbproto-1.0.3 | |
105 >=x11-proto/inputproto-1.9.99.902 | |
106 >=x11-proto/bigreqsproto-1.1.0 | |
107 >=x11-proto/xcmiscproto-1.2.0 | |
108 >=x11-proto/glproto-1.4.10 | |
109 >=media-fonts/font-util-1.1.0 | |
110 dmx? ( >=x11-proto/dmxproto-2.2.99.1 ) | |
111 !minimal? ( | |
112 >=x11-proto/xf86driproto-2.1.0 | |
113 >=x11-proto/dri2proto-2.2 | |
114 >=x11-libs/libdrm-2.3.0 | |
115 )" | |
116 | |
117 PDEPEND="xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )" | |
118 | |
119 EPATCH_FORCE="yes" | |
120 EPATCH_SUFFIX="patch" | |
121 | |
122 # These have been sent upstream | |
123 UPSTREAMED_PATCHES=( | |
124 ) | |
125 | |
126 PATCHES=( | |
127 "${UPSTREAMED_PATCHES[@]}" | |
128 "${FILESDIR}/1.8.1-no-hardcoded-etc.patch" | |
129 "${FILESDIR}/meego-xserver-bg-none-root.patch" | |
130 "${FILESDIR}/05moblin-xorg-x11-nonroot-vesa.patch" | |
131 "${FILESDIR}/meego-xorg-detect-psb.patch" | |
132 "${FILESDIR}/07moblin-use-sloppy-heuristic-first-for-initial-mode.patch" | |
133 "${FILESDIR}/meego-cache-xkbcomp-output-for-fast-start-up.patch" | |
134 # Allow usage of monotonic clock while cross-compiling | |
135 "${FILESDIR}/monotonic-clock-fix.patch" | |
136 ) | |
137 | |
138 pkg_setup() { | |
139 use minimal || ensure_a_server_is_building | |
140 | |
141 # SDL only available in kdrive build | |
142 if use kdrive && use sdl; then | |
143 conf_opts="${conf_opts} --enable-xsdl" | |
144 else | |
145 conf_opts="${conf_opts} --disable-xsdl" | |
146 fi | |
147 | |
148 # Need to make sure aclocal includes target includes | |
149 AT_M4DIR="${AT_M4DIR} -I ${ROOT}usr/share/aclocal" | |
150 | |
151 # localstatedir is used for the log location; we need to override the de
fault | |
152 # from ebuild.sh | |
153 # sysconfdir is used for the xorg.conf location; same applies | |
154 # --enable-install-setuid needed because sparcs default off | |
155 CONFIGURE_OPTIONS=" | |
156 $(use_enable ipv6) | |
157 $(use_enable dmx) | |
158 $(use_enable kdrive) | |
159 $(use_enable tslib) | |
160 $(use_enable tslib xcalibrate) | |
161 $(use_enable !minimal xvfb) | |
162 $(use_enable !minimal xnest) | |
163 $(use_enable !minimal record) | |
164 $(use_enable !minimal xfree86-utils) | |
165 $(use_enable !minimal install-libxf86config) | |
166 $(use_enable !minimal dri) | |
167 $(use_enable !minimal dri2) | |
168 $(use_enable !minimal glx) | |
169 $(use_enable xorg) | |
170 $(use_enable nptl glx-tls) | |
171 $(use_enable hal config-hal) | |
172 --sysconfdir=/etc/X11 | |
173 --localstatedir=/var | |
174 --enable-install-setuid | |
175 --enable-null-root-cursor | |
176 --with-fontdir=/usr/share/fonts | |
177 --with-xkb-output=/var/lib/xkb | |
178 --without-dtrace | |
179 --with-sha1=libcrypto | |
180 ${conf_opts}" | |
181 | |
182 # (#121394) Causes window corruption | |
183 filter-flags -fweb | |
184 | |
185 # Incompatible with GCC 3.x SSP on x86, bug #244352 | |
186 if use x86 ; then | |
187 if [[ $(gcc-major-version) -lt 4 ]]; then | |
188 filter-flags -fstack-protector | |
189 fi | |
190 fi | |
191 | |
192 OLD_IMPLEM="$(eselect opengl show)" | |
193 eselect opengl set ${OPENGL_DIR} | |
194 } | |
195 | |
196 src_install() { | |
197 x-modular_src_install | |
198 | |
199 dynamic_libgl_install | |
200 | |
201 server_based_install | |
202 | |
203 if ! use minimal && use xorg; then | |
204 # Install xorg.conf.example (see bugs #151421 and #151670) | |
205 insinto /etc/X11 | |
206 doins hw/xfree86/xorg.conf.example \ | |
207 || die "couldn't install xorg.conf.example" | |
208 fi | |
209 } | |
210 | |
211 pkg_postinst() { | |
212 switch_opengl_implem | |
213 | |
214 echo | |
215 ewarn "You must rebuild all drivers if upgrading from xorg-server 1.6" | |
216 ewarn "or earlier, because the ABI changed. If you cannot start X becaus
e" | |
217 ewarn "of module version mismatch errors, this is your problem." | |
218 | |
219 echo | |
220 ewarn "You can generate a list of all installed packages in the x11-driv
ers" | |
221 ewarn "category using this command:" | |
222 ewarn "emerge portage-utils; qlist -I -C x11-drivers/" | |
223 | |
224 ebeep 5 | |
225 epause 10 | |
226 } | |
227 | |
228 pkg_postrm() { | |
229 # Get rid of module dir to ensure opengl-update works properly | |
230 if ! has_version x11-base/xorg-server; then | |
231 if [[ -e ${ROOT}/usr/$(get_libdir)/xorg/modules ]]; then | |
232 rm -rf "${ROOT}"/usr/$(get_libdir)/xorg/modules | |
233 fi | |
234 fi | |
235 } | |
236 | |
237 dynamic_libgl_install() { | |
238 # next section is to setup the dynamic libGL stuff | |
239 ebegin "Moving GL files for dynamic switching" | |
240 dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions | |
241 local x="" | |
242 for x in "${D}"/usr/$(get_libdir)/xorg/modules/extensions/lib{gl
x,dri,dri2}*; do | |
243 if [ -f ${x} -o -L ${x} ]; then | |
244 mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPE
NGL_DIR}/extensions | |
245 fi | |
246 done | |
247 eend 0 | |
248 } | |
249 | |
250 server_based_install() { | |
251 if ! use xorg; then | |
252 rm "${D}"/usr/share/man/man1/Xserver.1x \ | |
253 "${D}"/usr/$(get_libdir)/xserver/SecurityPolicy \ | |
254 "${D}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \ | |
255 "${D}"/usr/share/man/man1/Xserver.1x | |
256 fi | |
257 } | |
258 | |
259 switch_opengl_implem() { | |
260 # Switch to the xorg implementation. | |
261 # Use new opengl-update that will not reset user selected | |
262 # OpenGL interface ... | |
263 echo | |
264 eselect opengl set ${OLD_IMPLEM} | |
265 } | |
266 | |
267 ensure_a_server_is_building() { | |
268 for server in ${IUSE_SERVERS}; do | |
269 use ${server} && return; | |
270 done | |
271 eerror "You need to specify at least one server to build." | |
272 eerror "Valid servers are: ${IUSE_SERVERS}." | |
273 die "No servers were specified to build." | |
274 } | |
OLD | NEW |