| 1 |
# Copyright 1999-2006 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.0.99.901-r1.ebuild,v 1.4 2006/04/24 20:07:53 spyderous Exp $
|
| 4 |
|
| 5 |
# Must be before x-modular eclass is inherited
|
| 6 |
# Hack to make sure autoreconf gets run
|
| 7 |
SNAPSHOT="yes"
|
| 8 |
|
| 9 |
inherit x-modular multilib
|
| 10 |
|
| 11 |
OPENGL_DIR="xorg-x11"
|
| 12 |
|
| 13 |
MESA_PN="Mesa"
|
| 14 |
MESA_PV="6.5"
|
| 15 |
MESA_P="${MESA_PN}-${MESA_PV}"
|
| 16 |
MESA_SRC_P="${MESA_PN}Lib-${MESA_PV}"
|
| 17 |
|
| 18 |
PATCHES="${FILESDIR}/${PN}-1.0.2-xprint-init.patch
|
| 19 |
${FILESDIR}/${PV}-Xprint-xprintdir.patch
|
| 20 |
${FILESDIR}/1.0.2-try-to-fix-xorgcfg.patch
|
| 21 |
${FILESDIR}/1.0.2-fix-xorgconfig-rgbpath-and-mouse.patch
|
| 22 |
${FILESDIR}/${PV}-fix-kdrive-build.patch
|
| 23 |
${FILESDIR}/${PV}-wrap-sdk-headers.patch"
|
| 24 |
|
| 25 |
SRC_URI="${SRC_URI}
|
| 26 |
mirror://sourceforge/mesa3d/${MESA_SRC_P}.tar.bz2
|
| 27 |
http://xorg.freedesktop.org/snapshots/individual/xserver/${P}.tar.bz2"
|
| 28 |
DESCRIPTION="X.Org X servers"
|
| 29 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
|
| 30 |
IUSE_VIDEO_CARDS="
|
| 31 |
video_cards_chips
|
| 32 |
video_cards_epson
|
| 33 |
video_cards_glint
|
| 34 |
video_cards_i810
|
| 35 |
video_cards_mach64
|
| 36 |
video_cards_mga
|
| 37 |
video_cards_neomagic
|
| 38 |
video_cards_nv
|
| 39 |
video_cards_r128
|
| 40 |
video_cards_radeon
|
| 41 |
video_cards_siliconmotion
|
| 42 |
video_cards_via"
|
| 43 |
IUSE="${IUSE_VIDEO_CARDS}
|
| 44 |
dmx dri ipv6 kdrive minimal nptl sdl xorg xprint"
|
| 45 |
RDEPEND="x11-libs/libXfont
|
| 46 |
x11-libs/xtrans
|
| 47 |
x11-libs/libXau
|
| 48 |
x11-libs/libXext
|
| 49 |
x11-libs/libX11
|
| 50 |
x11-libs/libxkbfile
|
| 51 |
x11-libs/libXdmcp
|
| 52 |
x11-libs/libXmu
|
| 53 |
x11-libs/libXrender
|
| 54 |
x11-libs/libXi
|
| 55 |
media-libs/freetype
|
| 56 |
>=media-libs/mesa-6.5-r2
|
| 57 |
media-fonts/font-adobe-75dpi
|
| 58 |
media-fonts/font-misc-misc
|
| 59 |
media-fonts/font-cursor-misc
|
| 60 |
x11-misc/xbitmaps
|
| 61 |
|| ( x11-misc/xkeyboard-config x11-misc/xkbdata )
|
| 62 |
x11-apps/iceauth
|
| 63 |
x11-apps/rgb
|
| 64 |
x11-apps/xauth
|
| 65 |
x11-apps/xinit
|
| 66 |
app-admin/eselect-opengl
|
| 67 |
x11-libs/libXaw
|
| 68 |
x11-libs/libXpm
|
| 69 |
x11-libs/libXxf86misc
|
| 70 |
x11-libs/libXxf86vm
|
| 71 |
!minimal? ( x11-libs/libdmx
|
| 72 |
x11-libs/libXtst
|
| 73 |
x11-libs/libXres )
|
| 74 |
x11-libs/libxkbui
|
| 75 |
x11-libs/liblbxutil
|
| 76 |
kdrive? ( sdl? ( media-libs/libsdl ) )"
|
| 77 |
# Xres is dmx-dependent, xkbui is xorgcfg-dependent
|
| 78 |
# Xaw is dmx- and xorgcfg-dependent
|
| 79 |
# Xpm is dmx- and xorgcfg-dependent, pulls in Xt
|
| 80 |
# Xxf86misc and Xxf86vm are xorgcfg-dependent
|
| 81 |
# liblbxutil is lbx- dependent
|
| 82 |
DEPEND="${RDEPEND}
|
| 83 |
x11-proto/randrproto
|
| 84 |
x11-proto/renderproto
|
| 85 |
>=x11-proto/fixesproto-4
|
| 86 |
x11-proto/damageproto
|
| 87 |
x11-proto/xextproto
|
| 88 |
x11-proto/xproto
|
| 89 |
x11-proto/xf86dgaproto
|
| 90 |
x11-proto/xf86miscproto
|
| 91 |
x11-proto/xf86rushproto
|
| 92 |
x11-proto/xf86vidmodeproto
|
| 93 |
x11-proto/xf86bigfontproto
|
| 94 |
>=x11-proto/compositeproto-0.3
|
| 95 |
x11-proto/recordproto
|
| 96 |
x11-proto/resourceproto
|
| 97 |
x11-proto/videoproto
|
| 98 |
>=x11-proto/scrnsaverproto-1.1.0
|
| 99 |
x11-proto/evieext
|
| 100 |
x11-proto/trapproto
|
| 101 |
>=x11-proto/xineramaproto-1.1-r1
|
| 102 |
x11-proto/fontsproto
|
| 103 |
>=x11-proto/kbproto-1.0-r1
|
| 104 |
x11-proto/inputproto
|
| 105 |
x11-proto/bigreqsproto
|
| 106 |
x11-proto/xcmiscproto
|
| 107 |
>=x11-proto/glproto-1.4.6
|
| 108 |
!minimal? ( x11-proto/dmxproto )
|
| 109 |
dri? ( x11-proto/xf86driproto
|
| 110 |
>=x11-libs/libdrm-2 )
|
| 111 |
xprint? ( x11-proto/printproto
|
| 112 |
x11-apps/mkfontdir
|
| 113 |
x11-apps/mkfontscale )"
|
| 114 |
LICENSE="${LICENSE} MIT"
|
| 115 |
|
| 116 |
pkg_setup() {
|
| 117 |
# localstatedir is used for the log location; we need to override the default
|
| 118 |
# from ebuild.sh
|
| 119 |
# sysconfdir is used for the xorg.conf location; same applies
|
| 120 |
|
| 121 |
# --enable-xorg needed because darwin defaults off
|
| 122 |
# --enable-install-setuid needed because sparcs default off
|
| 123 |
|
| 124 |
# SDL only available in kdrive build
|
| 125 |
if use kdrive && use sdl; then
|
| 126 |
conf_opts="${conf_opts} --enable-xsdl"
|
| 127 |
else
|
| 128 |
conf_opts="${conf_opts} --disable-xsdl"
|
| 129 |
fi
|
| 130 |
|
| 131 |
# Only Xorg and Xgl support this, and we won't build Xgl
|
| 132 |
# until it merges to trunk
|
| 133 |
if use xorg; then
|
| 134 |
conf_opts="${conf_opts} --with-mesa-source=${WORKDIR}/${MESA_P}"
|
| 135 |
fi
|
| 136 |
|
| 137 |
CONFIGURE_OPTIONS="
|
| 138 |
$(use_enable ipv6)
|
| 139 |
$(use_enable dmx)
|
| 140 |
$(use_enable kdrive)
|
| 141 |
$(use_enable !minimal xvfb)
|
| 142 |
$(use_enable !minimal xnest)
|
| 143 |
$(use_enable dri)
|
| 144 |
$(use_enable xorg)
|
| 145 |
$(use_enable xprint)
|
| 146 |
$(use_enable nptl glx-tls)
|
| 147 |
--sysconfdir=/etc/X11
|
| 148 |
--localstatedir=/var
|
| 149 |
--enable-install-setuid
|
| 150 |
--with-default-font-path=/usr/share/fonts/misc,/usr/share/fonts/75dpi,/usr/share/fonts/100dpi,/usr/share/fonts/TTF,/usr/share/fonts/Type1
|
| 151 |
${conf_opts}"
|
| 152 |
|
| 153 |
if built_with_use media-libs/mesa nptl; then
|
| 154 |
local diemsg="You must build xorg-server and mesa with the same nptl USE setting."
|
| 155 |
use nptl || die "${diemsg}"
|
| 156 |
else
|
| 157 |
use nptl && die "${diemsg}"
|
| 158 |
fi
|
| 159 |
|
| 160 |
# (#121394) Causes window corruption
|
| 161 |
filter-flags -fweb
|
| 162 |
|
| 163 |
# Nothing else provides new enough glxtokens.h
|
| 164 |
ewarn "Forcing on xorg-x11 for new enough glxtokens.h..."
|
| 165 |
OLD_IMPLEM="$(eselect opengl show)"
|
| 166 |
eselect opengl set --impl-headers ${OPENGL_DIR}
|
| 167 |
}
|
| 168 |
|
| 169 |
src_unpack() {
|
| 170 |
x-modular_specs_check
|
| 171 |
x-modular_dri_check
|
| 172 |
x-modular_unpack_source
|
| 173 |
x-modular_patch_source
|
| 174 |
|
| 175 |
# Set up kdrive servers to build
|
| 176 |
if use kdrive; then
|
| 177 |
einfo "Removing unused kdrive drivers ..."
|
| 178 |
for card in ${IUSE_VIDEO_CARDS}; do
|
| 179 |
real_card=${card#video_cards_}
|
| 180 |
|
| 181 |
# Differences between VIDEO_CARDS name and kdrive server name
|
| 182 |
real_card=${real_card/glint/pm2}
|
| 183 |
real_card=${real_card/radeon/ati}
|
| 184 |
real_card=${real_card/nv/nvidia}
|
| 185 |
real_card=${real_card/siliconmotion/smi}
|
| 186 |
if ! use ${card}; then
|
| 187 |
ebegin " ${real_card}"
|
| 188 |
sed -i \
|
| 189 |
-e "s:${real_card}::g" \
|
| 190 |
${S}/hw/kdrive/Makefile.am \
|
| 191 |
|| die "sed of ${real_card} failed"
|
| 192 |
eend
|
| 193 |
fi
|
| 194 |
|
| 195 |
done
|
| 196 |
|
| 197 |
# smi and via are the only things on line 2. If line 2 ends up blank,
|
| 198 |
# we need to get rid of the backslash at the end of line 1.
|
| 199 |
if ! use video_cards_siliconmotion && ! use video_cards_via; then
|
| 200 |
sed -i \
|
| 201 |
-e "s:^\(VESA_SUBDIRS.*\)\\\:\1:g" \
|
| 202 |
${S}/hw/kdrive/Makefile.am
|
| 203 |
fi
|
| 204 |
|
| 205 |
# Only need to reconf if we're modifying kdrive's Makefile.am
|
| 206 |
x-modular_reconf_source
|
| 207 |
fi
|
| 208 |
}
|
| 209 |
|
| 210 |
src_install() {
|
| 211 |
x-modular_src_install
|
| 212 |
|
| 213 |
dynamic_libgl_install
|
| 214 |
|
| 215 |
server_based_install
|
| 216 |
}
|
| 217 |
|
| 218 |
pkg_postinst() {
|
| 219 |
switch_opengl_implem
|
| 220 |
}
|
| 221 |
|
| 222 |
pkg_postrm() {
|
| 223 |
# Get rid of module dir to ensure opengl-update works properly
|
| 224 |
if ! has_version x11-base/xorg-server; then
|
| 225 |
if [ -e ${ROOT}/usr/$(get_libdir)/xorg/modules ]; then
|
| 226 |
rm -rf ${ROOT}/usr/$(get_libdir)/xorg/modules
|
| 227 |
fi
|
| 228 |
fi
|
| 229 |
}
|
| 230 |
|
| 231 |
dynamic_libgl_install() {
|
| 232 |
# next section is to setup the dynamic libGL stuff
|
| 233 |
ebegin "Moving GL files for dynamic switching"
|
| 234 |
dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
|
| 235 |
local x=""
|
| 236 |
for x in ${D}/usr/$(get_libdir)/xorg/modules/extensions/libglx*; do
|
| 237 |
if [ -f ${x} -o -L ${x} ]; then
|
| 238 |
mv -f ${x} ${D}/usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
|
| 239 |
fi
|
| 240 |
done
|
| 241 |
eend 0
|
| 242 |
}
|
| 243 |
|
| 244 |
server_based_install() {
|
| 245 |
use xprint && xprint_src_install
|
| 246 |
|
| 247 |
if ! use xorg; then
|
| 248 |
rm ${D}/usr/share/man/man1/Xserver.1x \
|
| 249 |
${D}/usr/$(get_libdir)/xserver/SecurityPolicy \
|
| 250 |
${D}/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
|
| 251 |
${D}/usr/share/man/man1/Xserver.1x
|
| 252 |
fi
|
| 253 |
}
|
| 254 |
|
| 255 |
switch_opengl_implem() {
|
| 256 |
# Switch to the xorg implementation.
|
| 257 |
# Use new opengl-update that will not reset user selected
|
| 258 |
# OpenGL interface ...
|
| 259 |
echo
|
| 260 |
# eselect opengl set --use-old ${OPENGL_DIR}
|
| 261 |
eselect opengl set ${OLD_IMPLEM}
|
| 262 |
}
|
| 263 |
|
| 264 |
xprint_src_install() {
|
| 265 |
# RH-style init script, we provide a wrapper
|
| 266 |
exeinto /usr/$(get_libdir)/misc
|
| 267 |
doexe ${S}/Xprint/etc/init.d/xprint
|
| 268 |
# Patch init script for fonts location
|
| 269 |
sed -e 's:/lib/X11/fonts/:/share/fonts/:g' \
|
| 270 |
-i ${D}/usr/$(get_libdir)/misc/xprint
|
| 271 |
# Install the wrapper
|
| 272 |
newinitd ${FILESDIR}/xprint.init xprint
|
| 273 |
# Install profile scripts
|
| 274 |
insinto /etc/profile.d
|
| 275 |
doins ${S}/Xprint/etc/profile.d/xprint*
|
| 276 |
insinto /etc/X11/xinit/xinitrc.d
|
| 277 |
newins ${S}/Xprint/etc/Xsession.d/cde_xsessiond_xprint.sh \
|
| 278 |
92xprint-xpserverlist.sh
|
| 279 |
# Patch profile scripts
|
| 280 |
sed -e "s:/bin/sh.*get_xpserverlist:/usr/$(get_libdir)/misc/xprint \
|
| 281 |
get_xpserverlist:g" -i ${D}/etc/profile.d/xprint* \
|
| 282 |
${D}/etc/X11/xinit/xinitrc.d/92xprint-xpserverlist.sh
|
| 283 |
# Move profile scripts, we can't touch /etc/profile.d/ in Gentoo
|
| 284 |
dodoc ${D}/etc/profile.d/xprint*
|
| 285 |
rm -f ${D}/etc/profile.d/xprint*
|
| 286 |
}
|