| 1 |
# Copyright 1999-2008 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.3.0.0-r3.ebuild,v 1.2 2008/01/17 21:22:09 dberkholz Exp $ |
| 4 |
|
| 5 |
# Must be before x-modular eclass is inherited |
| 6 |
SNAPSHOT="yes" |
| 7 |
|
| 8 |
inherit x-modular multilib |
| 9 |
|
| 10 |
OPENGL_DIR="xorg-x11" |
| 11 |
|
| 12 |
MESA_PN="Mesa" |
| 13 |
MESA_PV="6.5.2" |
| 14 |
MESA_P="${MESA_PN}-${MESA_PV}" |
| 15 |
MESA_SRC_P="${MESA_PN}Lib-${MESA_PV}" |
| 16 |
|
| 17 |
SRC_URI="${SRC_URI} |
| 18 |
mirror://sourceforge/mesa3d/${MESA_SRC_P}.tar.bz2 |
| 19 |
http://xorg.freedesktop.org/releases/individual/xserver/${P}.tar.bz2" |
| 20 |
DESCRIPTION="X.Org X servers" |
| 21 |
KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~x86-fbsd" |
| 22 |
IUSE_INPUT_DEVICES=" |
| 23 |
input_devices_acecad |
| 24 |
input_devices_aiptek |
| 25 |
input_devices_calcomp |
| 26 |
input_devices_citron |
| 27 |
input_devices_digitaledge |
| 28 |
input_devices_dmc |
| 29 |
input_devices_dynapro |
| 30 |
input_devices_elo2300 |
| 31 |
input_devices_elographics |
| 32 |
input_devices_evdev |
| 33 |
input_devices_fpit |
| 34 |
input_devices_hyperpen |
| 35 |
input_devices_jamstudio |
| 36 |
input_devices_joystick |
| 37 |
input_devices_keyboard |
| 38 |
input_devices_magellan |
| 39 |
input_devices_microtouch |
| 40 |
input_devices_mouse |
| 41 |
input_devices_mutouch |
| 42 |
input_devices_palmax |
| 43 |
input_devices_penmount |
| 44 |
input_devices_spaceorb |
| 45 |
input_devices_summa |
| 46 |
input_devices_tek4957 |
| 47 |
input_devices_ur98 |
| 48 |
input_devices_vmmouse |
| 49 |
input_devices_void |
| 50 |
|
| 51 |
input_devices_synaptics |
| 52 |
input_devices_wacom" |
| 53 |
IUSE_VIDEO_CARDS=" |
| 54 |
video_cards_apm |
| 55 |
video_cards_ark |
| 56 |
video_cards_chips |
| 57 |
video_cards_cirrus |
| 58 |
video_cards_cyrix |
| 59 |
video_cards_dummy |
| 60 |
video_cards_epson |
| 61 |
video_cards_fbdev |
| 62 |
video_cards_glint |
| 63 |
video_cards_i128 |
| 64 |
video_cards_i740 |
| 65 |
video_cards_i810 |
| 66 |
video_cards_impact |
| 67 |
video_cards_imstt |
| 68 |
video_cards_mach64 |
| 69 |
video_cards_mga |
| 70 |
video_cards_neomagic |
| 71 |
video_cards_newport |
| 72 |
video_cards_nsc |
| 73 |
video_cards_nv |
| 74 |
video_cards_r128 |
| 75 |
video_cards_radeon |
| 76 |
video_cards_rendition |
| 77 |
video_cards_s3 |
| 78 |
video_cards_s3virge |
| 79 |
video_cards_savage |
| 80 |
video_cards_siliconmotion |
| 81 |
video_cards_sis |
| 82 |
video_cards_sisusb |
| 83 |
video_cards_sunbw2 |
| 84 |
video_cards_suncg14 |
| 85 |
video_cards_suncg3 |
| 86 |
video_cards_suncg6 |
| 87 |
video_cards_sunffb |
| 88 |
video_cards_sunleo |
| 89 |
video_cards_suntcx |
| 90 |
video_cards_tdfx |
| 91 |
video_cards_tga |
| 92 |
video_cards_trident |
| 93 |
video_cards_tseng |
| 94 |
video_cards_v4l |
| 95 |
video_cards_vesa |
| 96 |
video_cards_vga |
| 97 |
video_cards_via |
| 98 |
video_cards_vmware |
| 99 |
video_cards_voodoo |
| 100 |
video_cards_fglrx |
| 101 |
video_cards_nvidia" |
| 102 |
IUSE_SERVERS="dmx kdrive xorg" |
| 103 |
IUSE="${IUSE_VIDEO_CARDS} |
| 104 |
${IUSE_INPUT_DEVICES} |
| 105 |
${IUSE_SERVERS} |
| 106 |
3dfx |
| 107 |
dri ipv6 minimal nptl sdl xprint" |
| 108 |
RDEPEND=">=x11-libs/libXfont-1.2.5 |
| 109 |
x11-libs/xtrans |
| 110 |
x11-libs/libXau |
| 111 |
x11-libs/libXext |
| 112 |
x11-libs/libX11 |
| 113 |
x11-libs/libxkbfile |
| 114 |
x11-libs/libXdmcp |
| 115 |
x11-libs/libXmu |
| 116 |
<x11-libs/libXrender-0.9.3 |
| 117 |
x11-libs/libXi |
| 118 |
media-libs/freetype |
| 119 |
>=media-libs/mesa-6.5.2 |
| 120 |
media-fonts/font-adobe-75dpi |
| 121 |
media-fonts/font-misc-misc |
| 122 |
media-fonts/font-cursor-misc |
| 123 |
x11-misc/xbitmaps |
| 124 |
|| ( x11-misc/xkeyboard-config x11-misc/xkbdata ) |
| 125 |
x11-apps/iceauth |
| 126 |
x11-apps/rgb |
| 127 |
x11-apps/xauth |
| 128 |
x11-apps/xinit |
| 129 |
app-admin/eselect-opengl |
| 130 |
x11-libs/libXaw |
| 131 |
x11-libs/libXpm |
| 132 |
x11-libs/libXxf86misc |
| 133 |
x11-libs/libXxf86vm |
| 134 |
dmx? ( x11-libs/libdmx |
| 135 |
x11-libs/libXfixes ) |
| 136 |
!minimal? ( x11-libs/libXtst |
| 137 |
x11-libs/libXres ) |
| 138 |
>=x11-libs/libxkbui-1.0.2 |
| 139 |
x11-libs/liblbxutil |
| 140 |
kdrive? ( sdl? ( media-libs/libsdl ) )" |
| 141 |
# Xres is dmx-dependent, xkbui is xorgcfg-dependent |
| 142 |
# Xaw is dmx- and xorgcfg-dependent |
| 143 |
# Xpm is dmx- and xorgcfg-dependent, pulls in Xt |
| 144 |
# Xxf86misc and Xxf86vm are xorgcfg-dependent |
| 145 |
# liblbxutil is lbx- dependent |
| 146 |
DEPEND="${RDEPEND} |
| 147 |
>=x11-proto/randrproto-1.2.1 |
| 148 |
<x11-proto/renderproto-0.9.3 |
| 149 |
>=x11-proto/fixesproto-4 |
| 150 |
>=x11-proto/damageproto-1.1 |
| 151 |
x11-proto/xextproto |
| 152 |
x11-proto/xproto |
| 153 |
x11-proto/xf86dgaproto |
| 154 |
x11-proto/xf86miscproto |
| 155 |
x11-proto/xf86rushproto |
| 156 |
x11-proto/xf86vidmodeproto |
| 157 |
x11-proto/xf86bigfontproto |
| 158 |
>=x11-proto/compositeproto-0.3 |
| 159 |
x11-proto/recordproto |
| 160 |
x11-proto/resourceproto |
| 161 |
x11-proto/videoproto |
| 162 |
>=x11-proto/scrnsaverproto-1.1.0 |
| 163 |
x11-proto/evieext |
| 164 |
x11-proto/trapproto |
| 165 |
>=x11-proto/xineramaproto-1.1-r1 |
| 166 |
x11-proto/fontsproto |
| 167 |
>=x11-proto/kbproto-1.0.3 |
| 168 |
x11-proto/inputproto |
| 169 |
x11-proto/bigreqsproto |
| 170 |
x11-proto/xcmiscproto |
| 171 |
>=x11-proto/glproto-1.4.8 |
| 172 |
dmx? ( x11-proto/dmxproto ) |
| 173 |
dri? ( x11-proto/xf86driproto |
| 174 |
>=x11-libs/libdrm-2.3 ) |
| 175 |
xprint? ( x11-proto/printproto |
| 176 |
x11-apps/mkfontdir |
| 177 |
x11-apps/mkfontscale |
| 178 |
x11-apps/xplsprinters )" |
| 179 |
|
| 180 |
# Drivers |
| 181 |
PDEPEND=" |
| 182 |
xorg? ( |
| 183 |
input_devices_acecad? ( >=x11-drivers/xf86-input-acecad-1.1.0 ) |
| 184 |
input_devices_aiptek? ( >=x11-drivers/xf86-input-aiptek-1.0.1 ) |
| 185 |
input_devices_calcomp? ( >=x11-drivers/xf86-input-calcomp-1.1.0 ) |
| 186 |
input_devices_citron? ( >=x11-drivers/xf86-input-citron-2.2.0 ) |
| 187 |
input_devices_digitaledge? ( >=x11-drivers/xf86-input-digitaledge-1.1.0 ) |
| 188 |
input_devices_dmc? ( >=x11-drivers/xf86-input-dmc-1.1.0 ) |
| 189 |
input_devices_dynapro? ( >=x11-drivers/xf86-input-dynapro-1.1.0 ) |
| 190 |
input_devices_elo2300? ( >=x11-drivers/xf86-input-elo2300-1.1.0 ) |
| 191 |
input_devices_elographics? ( >=x11-drivers/xf86-input-elographics-1.1.0 ) |
| 192 |
input_devices_evdev? ( >=x11-drivers/xf86-input-evdev-1.1.1 ) |
| 193 |
input_devices_fpit? ( >=x11-drivers/xf86-input-fpit-1.1.0 ) |
| 194 |
input_devices_hyperpen? ( >=x11-drivers/xf86-input-hyperpen-1.1.0 ) |
| 195 |
input_devices_jamstudio? ( >=x11-drivers/xf86-input-jamstudio-1.1.0 ) |
| 196 |
input_devices_joystick? ( >=x11-drivers/xf86-input-joystick-1.1.0 ) |
| 197 |
input_devices_keyboard? ( =x11-drivers/xf86-input-keyboard-1.1* ) |
| 198 |
input_devices_magellan? ( >=x11-drivers/xf86-input-magellan-1.1.0 ) |
| 199 |
input_devices_microtouch? ( >=x11-drivers/xf86-input-microtouch-1.1.0 ) |
| 200 |
input_devices_mouse? ( >=x11-drivers/xf86-input-mouse-1.1.0 ) |
| 201 |
input_devices_mutouch? ( >=x11-drivers/xf86-input-mutouch-1.1.0 ) |
| 202 |
input_devices_palmax? ( >=x11-drivers/xf86-input-palmax-1.1.0 ) |
| 203 |
input_devices_penmount? ( >=x11-drivers/xf86-input-penmount-1.1.0 ) |
| 204 |
input_devices_spaceorb? ( >=x11-drivers/xf86-input-spaceorb-1.1.0 ) |
| 205 |
input_devices_summa? ( >=x11-drivers/xf86-input-summa-1.1.0 ) |
| 206 |
input_devices_tek4957? ( >=x11-drivers/xf86-input-tek4957-1.1.0 ) |
| 207 |
input_devices_ur98? ( >=x11-drivers/xf86-input-ur98-1.1.0 ) |
| 208 |
input_devices_vmmouse? ( >=x11-drivers/xf86-input-vmmouse-12.4.0 ) |
| 209 |
input_devices_void? ( >=x11-drivers/xf86-input-void-1.1.0 ) |
| 210 |
|
| 211 |
input_devices_synaptics? ( x11-drivers/synaptics ) |
| 212 |
input_devices_wacom? ( x11-drivers/linuxwacom ) |
| 213 |
|
| 214 |
video_cards_apm? ( >=x11-drivers/xf86-video-apm-1.1.1 ) |
| 215 |
video_cards_ark? ( >=x11-drivers/xf86-video-ark-0.6.0 ) |
| 216 |
video_cards_chips? ( >=x11-drivers/xf86-video-chips-1.1.1 ) |
| 217 |
video_cards_cirrus? ( >=x11-drivers/xf86-video-cirrus-1.1.0 ) |
| 218 |
video_cards_cyrix? ( >=x11-drivers/xf86-video-cyrix-1.1.0 ) |
| 219 |
video_cards_dummy? ( >=x11-drivers/xf86-video-dummy-0.2.0 ) |
| 220 |
video_cards_fbdev? ( >=x11-drivers/xf86-video-fbdev-0.2.0 ) |
| 221 |
video_cards_glint? ( >=x11-drivers/xf86-video-glint-1.1.1 ) |
| 222 |
video_cards_i128? ( >=x11-drivers/xf86-video-i128-1.2.0 ) |
| 223 |
video_cards_i740? ( >=x11-drivers/xf86-video-i740-1.1.0 ) |
| 224 |
video_cards_i810? ( >=x11-drivers/xf86-video-i810-1.6.0 ) |
| 225 |
video_cards_impact? ( >=x11-drivers/xf86-video-impact-0.2.0 ) |
| 226 |
video_cards_imstt? ( >=x11-drivers/xf86-video-imstt-1.1.0 ) |
| 227 |
video_cards_mach64? ( >=x11-drivers/xf86-video-ati-6.6.0 ) |
| 228 |
video_cards_mga? ( >=x11-drivers/xf86-video-mga-1.4.1 ) |
| 229 |
video_cards_neomagic? ( >=x11-drivers/xf86-video-neomagic-1.1.1 ) |
| 230 |
video_cards_newport? ( >=x11-drivers/xf86-video-newport-0.2.0 ) |
| 231 |
video_cards_nsc? ( >=x11-drivers/xf86-video-nsc-2.8.1 ) |
| 232 |
video_cards_nv? ( >=x11-drivers/xf86-video-nv-1.1.1 ) |
| 233 |
video_cards_r128? ( >=x11-drivers/xf86-video-ati-6.6.0 ) |
| 234 |
video_cards_radeon? ( >=x11-drivers/xf86-video-ati-6.6.0 ) |
| 235 |
video_cards_rendition? ( >=x11-drivers/xf86-video-rendition-4.1.0 ) |
| 236 |
video_cards_s3? ( >=x11-drivers/xf86-video-s3-0.4.1 ) |
| 237 |
video_cards_s3virge? ( >=x11-drivers/xf86-video-s3virge-1.9.1 ) |
| 238 |
video_cards_savage? ( >=x11-drivers/xf86-video-savage-2.1.1 ) |
| 239 |
video_cards_siliconmotion? ( >=x11-drivers/xf86-video-siliconmotion-1.4.1 ) |
| 240 |
video_cards_sis? ( >=x11-drivers/xf86-video-sis-0.9.1 ) |
| 241 |
video_cards_sisusb? ( >=x11-drivers/xf86-video-sisusb-0.8.1 ) |
| 242 |
video_cards_sunbw2? ( >=x11-drivers/xf86-video-sunbw2-1.1.0 ) |
| 243 |
video_cards_suncg14? ( >=x11-drivers/xf86-video-suncg14-1.1.0 ) |
| 244 |
video_cards_suncg3? ( >=x11-drivers/xf86-video-suncg3-1.1.0 ) |
| 245 |
video_cards_suncg6? ( >=x11-drivers/xf86-video-suncg6-1.1.0 ) |
| 246 |
video_cards_sunffb? ( >=x11-drivers/xf86-video-sunffb-1.1.0 ) |
| 247 |
video_cards_sunleo? ( >=x11-drivers/xf86-video-sunleo-1.1.0 ) |
| 248 |
video_cards_suntcx? ( >=x11-drivers/xf86-video-suntcx-1.1.0 ) |
| 249 |
video_cards_tdfx? ( >=x11-drivers/xf86-video-tdfx-1.2.1 ) |
| 250 |
video_cards_tga? ( >=x11-drivers/xf86-video-tga-1.1.0 ) |
| 251 |
video_cards_trident? ( >=x11-drivers/xf86-video-trident-1.2.1 ) |
| 252 |
video_cards_tseng? ( >=x11-drivers/xf86-video-tseng-1.1.0 ) |
| 253 |
video_cards_v4l? ( >=x11-drivers/xf86-video-v4l-0.1.1 ) |
| 254 |
video_cards_vesa? ( >=x11-drivers/xf86-video-vesa-1.1.0 ) |
| 255 |
video_cards_vga? ( >=x11-drivers/xf86-video-vga-4.1.0 ) |
| 256 |
video_cards_via? ( >=x11-drivers/xf86-video-via-0.2.1 ) |
| 257 |
video_cards_vmware? ( >=x11-drivers/xf86-video-vmware-10.13.0 ) |
| 258 |
video_cards_voodoo? ( >=x11-drivers/xf86-video-voodoo-1.1.0 ) |
| 259 |
video_cards_tdfx? ( 3dfx? ( >=media-libs/glide-v3-3.10 ) ) |
| 260 |
video_cards_nvidia? ( x11-drivers/nvidia-drivers ) |
| 261 |
video_cards_fglrx? ( >=x11-drivers/ati-drivers-8.37.6 ) |
| 262 |
)" |
| 263 |
LICENSE="${LICENSE} MIT" |
| 264 |
|
| 265 |
PATCHES=" |
| 266 |
${FILESDIR}/${PV}-fix-xkb-openoffice-hangs.patch |
| 267 |
${FILESDIR}/${PV}-fix-dual-head-screen-resolutions.patch |
| 268 |
${FILESDIR}/${PV}-fix-randr-resizing.patch |
| 269 |
${FILESDIR}/${PV}-fix-xephyr-amd64-segfault.patch |
| 270 |
${FILESDIR}/${PV}-ramdac.patch |
| 271 |
${FILESDIR}/use-composite-for-unequal-depths.patch |
| 272 |
${FILESDIR}/1.2.0-fix-amd-cpu-detection.patch |
| 273 |
${FILESDIR}/1.2.0-properly-free-device-devprivates-memory-leak-fix.patch |
| 274 |
${FILESDIR}/1.2.0-typo-fix.patch |
| 275 |
${FILESDIR}/1.2.0-zero-out-client-devprivates-on-allocation.patch |
| 276 |
${FILESDIR}/${PV}-use-proc-instead-of-sys.patch |
| 277 |
${FILESDIR}/avoid-crash-on-minimized-xv-window.patch |
| 278 |
${FILESDIR}/xorg-server-sam225bw-quirks.patch |
| 279 |
${FILESDIR}/1.3-alpha-build-fix.patch |
| 280 |
${FILESDIR}/${PV}-xephyr_crash_at_exit.patch |
| 281 |
${FILESDIR}/xorg-x11-server-1.0.1-fpic-libxf86config.patch |
| 282 |
${FILESDIR}/1.4-0001-Fix-for-CVE-2007-5760-XFree86-Misc-extension-out-o.patch |
| 283 |
${FILESDIR}/1.4-0002-Fix-for-CVE-2007-6428-TOG-cup-extension-memory-cor.patch |
| 284 |
${FILESDIR}/1.3-0003-Fix-for-CVE-2007-6427-Xinput-extension-memory-corr.patch |
| 285 |
${FILESDIR}/1.4-0004-Fix-for-CVE-2007-6429-MIT-SHM-and-EVI-extensions-i.patch |
| 286 |
${FILESDIR}/1.4-0005-Fix-for-CVE-2008-0006-PCF-Font-parser-buffer-overf.patch |
| 287 |
${FILESDIR}/1.3-0006-Fix-for-CVE-2007-5958-File-existence-disclosure.patch |
| 288 |
" |
| 289 |
|
| 290 |
pkg_setup() { |
| 291 |
use minimal || ensure_a_server_is_building |
| 292 |
|
| 293 |
# SDL only available in kdrive build |
| 294 |
if use kdrive && use sdl; then |
| 295 |
conf_opts="${conf_opts} --enable-xsdl" |
| 296 |
else |
| 297 |
conf_opts="${conf_opts} --disable-xsdl" |
| 298 |
fi |
| 299 |
|
| 300 |
# Only Xorg and Xgl support this, and we won't build Xgl |
| 301 |
# until it merges to trunk |
| 302 |
if use xorg; then |
| 303 |
conf_opts="${conf_opts} --with-mesa-source=${WORKDIR}/${MESA_P}" |
| 304 |
fi |
| 305 |
|
| 306 |
# localstatedir is used for the log location; we need to override the default |
| 307 |
# from ebuild.sh |
| 308 |
# sysconfdir is used for the xorg.conf location; same applies |
| 309 |
# --enable-install-setuid needed because sparcs default off |
| 310 |
CONFIGURE_OPTIONS=" |
| 311 |
$(use_enable ipv6) |
| 312 |
$(use_enable dmx) |
| 313 |
$(use_enable kdrive) |
| 314 |
$(use_enable !minimal xvfb) |
| 315 |
$(use_enable !minimal xnest) |
| 316 |
$(use_enable !minimal install-libxf86config) |
| 317 |
$(use_enable dri) |
| 318 |
$(use_enable xorg) |
| 319 |
$(use_enable xprint) |
| 320 |
$(use_enable nptl glx-tls) |
| 321 |
$(use_enable !minimal xorgcfg) |
| 322 |
--sysconfdir=/etc/X11 |
| 323 |
--localstatedir=/var |
| 324 |
--enable-install-setuid |
| 325 |
--with-fontdir=/usr/share/fonts |
| 326 |
--with-xkb-output=/var/lib/xkb |
| 327 |
${conf_opts}" |
| 328 |
|
| 329 |
local diemsg="You must build xorg-server and mesa with the same nptl USE setting." |
| 330 |
if built_with_use media-libs/mesa nptl; then |
| 331 |
use nptl || die "${diemsg}" |
| 332 |
else |
| 333 |
use nptl && die "${diemsg}" |
| 334 |
fi |
| 335 |
|
| 336 |
# (#121394) Causes window corruption |
| 337 |
filter-flags -fweb |
| 338 |
|
| 339 |
# Nothing else provides new enough glxtokens.h |
| 340 |
ewarn "Forcing on xorg-x11 for new enough glxtokens.h..." |
| 341 |
OLD_IMPLEM="$(eselect opengl show)" |
| 342 |
eselect opengl set --impl-headers ${OPENGL_DIR} |
| 343 |
} |
| 344 |
|
| 345 |
src_unpack() { |
| 346 |
x-modular_specs_check |
| 347 |
x-modular_dri_check |
| 348 |
x-modular_unpack_source |
| 349 |
x-modular_patch_source |
| 350 |
|
| 351 |
# Set up kdrive servers to build |
| 352 |
if use kdrive; then |
| 353 |
kdrive_setup |
| 354 |
fi |
| 355 |
|
| 356 |
# Make sure eautoreconf gets run if we need the autoconf/make |
| 357 |
# changes. |
| 358 |
if [[ ${SNAPSHOT} != "yes" ]]; then |
| 359 |
if use kdrive; then |
| 360 |
eautoreconf |
| 361 |
fi |
| 362 |
fi |
| 363 |
x-modular_reconf_source |
| 364 |
#do not install xprint's Xsession.d files, we'll do it later |
| 365 |
if use xprint; then |
| 366 |
sed -e "s:install-data-am\: install-dist_xpcDATA:install-data-am\::g" \ |
| 367 |
-i "${S}"/hw/xprint/etc/Xsession.d/Makefile.in \ |
| 368 |
|| die "sed of Xsession.d makefile failed" |
| 369 |
fi |
| 370 |
} |
| 371 |
|
| 372 |
src_install() { |
| 373 |
x-modular_src_install |
| 374 |
|
| 375 |
dynamic_libgl_install |
| 376 |
|
| 377 |
server_based_install |
| 378 |
|
| 379 |
# Install video mode files for system-config-display |
| 380 |
insinto /usr/share/xorg |
| 381 |
doins hw/xfree86/common/{extra,vesa}modes \ |
| 382 |
|| die "couldn't install extra modes" |
| 383 |
|
| 384 |
# Bug #151421 - this file is not built with USE="minimal" |
| 385 |
# Bug #151670 - this file is also not build if USE="-xorg" |
| 386 |
if ! use minimal && use xorg; then |
| 387 |
# Install xorg.conf.example |
| 388 |
insinto /etc/X11 |
| 389 |
doins hw/xfree86/xorg.conf.example \ |
| 390 |
|| die "couldn't install xorg.conf.example" |
| 391 |
fi |
| 392 |
} |
| 393 |
|
| 394 |
pkg_postinst() { |
| 395 |
switch_opengl_implem |
| 396 |
|
| 397 |
# Bug #135544 |
| 398 |
ewarn "Users of reduced blanking now need:" |
| 399 |
ewarn " Option \"ReducedBlanking\"" |
| 400 |
ewarn "In the relevant Monitor section(s)." |
| 401 |
ewarn "Make sure your reduced blanking modelines are safe!" |
| 402 |
} |
| 403 |
|
| 404 |
pkg_postrm() { |
| 405 |
# Get rid of module dir to ensure opengl-update works properly |
| 406 |
if ! has_version x11-base/xorg-server; then |
| 407 |
if [[ -e ${ROOT}/usr/$(get_libdir)/xorg/modules ]]; then |
| 408 |
rm -rf "${ROOT}"/usr/$(get_libdir)/xorg/modules |
| 409 |
fi |
| 410 |
fi |
| 411 |
} |
| 412 |
|
| 413 |
kdrive_setup() { |
| 414 |
local card real_card disable_card kdrive_fbdev kdrive_vesa |
| 415 |
|
| 416 |
einfo "Removing unused kdrive drivers ..." |
| 417 |
|
| 418 |
# Some kdrive servers require fbdev and vesa |
| 419 |
kdrive_fbdev="radeon neomagic sis siliconmotion" |
| 420 |
# Some kdrive servers require just vesa |
| 421 |
kdrive_vesa="chips mach64 mga nv glint r128 via" |
| 422 |
|
| 423 |
for card in ${IUSE_VIDEO_CARDS}; do |
| 424 |
real_card=${card#video_cards_} |
| 425 |
|
| 426 |
# Differences between VIDEO_CARDS name and kdrive server name |
| 427 |
real_card=${real_card/glint/pm2} |
| 428 |
real_card=${real_card/radeon/ati} |
| 429 |
real_card=${real_card/%nv/nvidia} |
| 430 |
real_card=${real_card/siliconmotion/smi} |
| 431 |
real_card=${real_card/%sis/sis300} |
| 432 |
|
| 433 |
disable_card=0 |
| 434 |
|
| 435 |
# Check whether it's a valid kdrive server before we waste time |
| 436 |
# on the rest of this |
| 437 |
if ! grep -q -o "\b${real_card}\b" "${S}"/hw/kdrive/Makefile.am; then |
| 438 |
continue |
| 439 |
fi |
| 440 |
|
| 441 |
if ! use ${card}; then |
| 442 |
if use x86; then |
| 443 |
# Some kdrive servers require fbdev and vesa |
| 444 |
for i in ${kdrive_fbdev}; do |
| 445 |
if use video_cards_${i}; then |
| 446 |
if [[ ${real_card} = fbdev ]] \ |
| 447 |
|| [[ ${real_card} = vesa ]]; then |
| 448 |
continue 2 # Don't disable |
| 449 |
fi |
| 450 |
fi |
| 451 |
done |
| 452 |
|
| 453 |
# Some kdrive servers require just vesa |
| 454 |
for i in ${kdrive_vesa}; do |
| 455 |
if use video_cards_${i}; then |
| 456 |
if [[ ${real_card} = vesa ]]; then |
| 457 |
continue 2 # Don't disable |
| 458 |
fi |
| 459 |
fi |
| 460 |
done |
| 461 |
fi |
| 462 |
disable_card=1 |
| 463 |
# Bug #150052 |
| 464 |
# fbdev is the only VIDEO_CARDS setting that works on non-x86 |
| 465 |
elif ! use x86 \ |
| 466 |
&& [[ ${real_card} != fbdev ]]; then |
| 467 |
ewarn " $real_card does not work on your architecture; disabling." |
| 468 |
disable_card=1 |
| 469 |
fi |
| 470 |
|
| 471 |
if [[ $disable_card = 1 ]]; then |
| 472 |
ebegin " ${real_card}" |
| 473 |
sed -i \ |
| 474 |
-e "s:\b${real_card}\b::g" \ |
| 475 |
"${S}"/hw/kdrive/Makefile.am \ |
| 476 |
|| die "sed of ${real_card} failed" |
| 477 |
eend |
| 478 |
fi |
| 479 |
|
| 480 |
done |
| 481 |
|
| 482 |
# smi and via are the only things on line 2. If line 2 ends up blank, |
| 483 |
# we need to get rid of the backslash at the end of line 1. |
| 484 |
if ! use video_cards_siliconmotion && ! use video_cards_via; then |
| 485 |
sed -i \ |
| 486 |
-e "s:^\(VESA_SUBDIRS.*\)\\\:\1:g" \ |
| 487 |
"${S}"/hw/kdrive/Makefile.am |
| 488 |
fi |
| 489 |
} |
| 490 |
|
| 491 |
dynamic_libgl_install() { |
| 492 |
# next section is to setup the dynamic libGL stuff |
| 493 |
ebegin "Moving GL files for dynamic switching" |
| 494 |
dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions |
| 495 |
local x="" |
| 496 |
for x in "${D}"/usr/$(get_libdir)/xorg/modules/extensions/libglx*; do |
| 497 |
if [ -f ${x} -o -L ${x} ]; then |
| 498 |
mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions |
| 499 |
fi |
| 500 |
done |
| 501 |
eend 0 |
| 502 |
} |
| 503 |
|
| 504 |
server_based_install() { |
| 505 |
use xprint && xprint_src_install |
| 506 |
|
| 507 |
if ! use xorg; then |
| 508 |
rm "${D}"/usr/share/man/man1/Xserver.1x \ |
| 509 |
"${D}"/usr/$(get_libdir)/xserver/SecurityPolicy \ |
| 510 |
"${D}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \ |
| 511 |
"${D}"/usr/share/man/man1/Xserver.1x |
| 512 |
fi |
| 513 |
} |
| 514 |
|
| 515 |
switch_opengl_implem() { |
| 516 |
# Switch to the xorg implementation. |
| 517 |
# Use new opengl-update that will not reset user selected |
| 518 |
# OpenGL interface ... |
| 519 |
echo |
| 520 |
# eselect opengl set --use-old ${OPENGL_DIR} |
| 521 |
eselect opengl set ${OLD_IMPLEM} |
| 522 |
} |
| 523 |
|
| 524 |
xprint_src_install() { |
| 525 |
# RH-style init script, we provide a wrapper |
| 526 |
exeinto /usr/$(get_libdir)/misc |
| 527 |
doexe "${S}"/hw/xprint/etc/init.d/xprint |
| 528 |
# Install the wrapper |
| 529 |
newinitd "${FILESDIR}"/xprint.init xprint |
| 530 |
# Install profile scripts |
| 531 |
insinto /etc/profile.d |
| 532 |
doins "${S}"/hw/xprint/etc/profile.d/xprint* |
| 533 |
insinto /etc/X11/xinit/xinitrc.d |
| 534 |
doins "${S}"/hw/xprint/etc/Xsession.d/92xprint-xpserverlist |
| 535 |
# Patch profile scripts |
| 536 |
sed -e "s:/bin/sh.*get_xpserverlist:/usr/$(get_libdir)/misc/xprint \ |
| 537 |
get_xpserverlist:g" -i "${D}"/etc/profile.d/xprint* \ |
| 538 |
"${D}"/etc/X11/xinit/xinitrc.d/92xprint-xpserverlist |
| 539 |
# Move profile scripts, we can't touch /etc/profile.d/ in Gentoo |
| 540 |
dodoc "${D}"/etc/profile.d/xprint* |
| 541 |
rm -f "${D}"/etc/profile.d/xprint* |
| 542 |
} |
| 543 |
|
| 544 |
ensure_a_server_is_building() { |
| 545 |
for server in ${IUSE_SERVERS}; do |
| 546 |
use ${server} && return; |
| 547 |
done |
| 548 |
eerror "You need to specify at least one server to build." |
| 549 |
eerror "Valid servers are: ${IUSE_SERVERS}." |
| 550 |
die "No servers were specified to build." |
| 551 |
} |