summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2010-12-20 21:13:25 +0800
committerZhang Le <r0bertz@gentoo.org>2010-12-20 21:13:25 +0800
commit0b139a92ae2ea51793901c302e1d262e8b712636 (patch)
tree9717902776eb5714a5ea9fc151bc536a5745241c /x11-base
parentfixed binutils's mo confliction with gdb (diff)
downloadloongson-0b139a92ae2ea51793901c302e1d262e8b712636.tar.gz
loongson-0b139a92ae2ea51793901c302e1d262e8b712636.tar.bz2
loongson-0b139a92ae2ea51793901c302e1d262e8b712636.zip
added xulrunner-1.9.2.13, firefox-3.6.13 and xorg-server-1.9.2.902
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Diffstat (limited to 'x11-base')
-rw-r--r--x11-base/xorg-server/Manifest4
-rw-r--r--x11-base/xorg-server/files/xdm.initd-3207
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.9.2.902-loongson.patch53
-rw-r--r--x11-base/xorg-server/xorg-server-1.9.2.902.ebuild274
4 files changed, 538 insertions, 0 deletions
diff --git a/x11-base/xorg-server/Manifest b/x11-base/xorg-server/Manifest
index 4f17aa2..46133b8 100644
--- a/x11-base/xorg-server/Manifest
+++ b/x11-base/xorg-server/Manifest
@@ -44,6 +44,7 @@ AUX xdm-setup.initd-1 346 RMD160 e68512e71adbf15743f789bb6b5587b07a9812a3 SHA1 f
AUX xdm.confd-3 853 RMD160 363cd18f760650923e16579bf55f661e93dad63b SHA1 0027b98f2aeb5c43219fa4f9b7d81a05101bec6f SHA256 00af0d957ff1b4f31c1aa4701d93a54080408548792deafac5414cbfa13b89ec
AUX xdm.initd 5392 RMD160 eec0b0ccefeee366e891afc73d195240b447421f SHA1 d3ce725e86fa3889f77403354b7f69d8184181ae SHA256 0c087c42d46563fd9d63da655753128aab2a0815efb83f906db3f54ba5c886ce
AUX xdm.initd-2 5428 RMD160 85c40a4874e1f3358077056294947f4b5f7f7a3a SHA1 11ee3c7a7000ae4ac9ab7d33667c44f98193266f SHA256 8582cc4265da2f93f498252b88e0dc055f78152b1daa9fbd7ecc0852f463730c
+AUX xdm.initd-3 5396 RMD160 eb1741ec3a80f83948150610a595115ff96d4833 SHA1 788097c7b72ae7c3df2348b2b503405b50046156 SHA256 10181710766bac1dc33093ee2775d63f58a43d2d9ffcc709d0b9181749912b70
AUX xorg-server-1.3.0.0-loongson.patch 1931 RMD160 cc84def06fdfa7099342411baa037529166f56c0 SHA1 3596b2abaab7f58e78722988f9e4f1ca97bd7cd3 SHA256 e77dad77f9c36053ddc52f2aa6af7fc6c65b24a9d8456ac346382ca2a18b6d90
AUX xorg-server-1.4-loongson.patch 2039 RMD160 9ae834b71e29de0fd9698843833dcf967a4385f6 SHA1 828246c5fdd34f6018c3fab8654ce9e095142608 SHA256 c875ede2906969d0c6cb2f9b5548f9002a93f25f174d82e013c8310697265cf5
AUX xorg-server-1.5.2-loongson.patch 2039 RMD160 9ae834b71e29de0fd9698843833dcf967a4385f6 SHA1 828246c5fdd34f6018c3fab8654ce9e095142608 SHA256 c875ede2906969d0c6cb2f9b5548f9002a93f25f174d82e013c8310697265cf5
@@ -59,6 +60,7 @@ AUX xorg-server-1.8-nouveau-default.patch 963 RMD160 cb8e530815c21a6015052594204
AUX xorg-server-1.8.2-loongson.patch 1899 RMD160 5705d24c037697d7c8f4eed53e6fd0c6b0962040 SHA1 27b6440970ffcceec5bb45c09de16a8ee8a6ef1e SHA256 fa2b1769ff6d5b1879053d64328bd1a08f9ead1b676ceda06a897d1f7c509552
AUX xorg-server-1.9-nouveau-default.patch 916 RMD160 0ebdf0fb76364b7fd0c520c3a2f7cc2cc1a83446 SHA1 daddde0f4f4276e12b87354d2e6825ed5c74c6eb SHA256 a7ff421dd928e3025194279f9afb7cc033a896b3417abe339741e9c6ed4b54ea
AUX xorg-server-1.9.0-loongson.patch 1899 RMD160 5705d24c037697d7c8f4eed53e6fd0c6b0962040 SHA1 27b6440970ffcceec5bb45c09de16a8ee8a6ef1e SHA256 fa2b1769ff6d5b1879053d64328bd1a08f9ead1b676ceda06a897d1f7c509552
+AUX xorg-server-1.9.2.902-loongson.patch 1899 RMD160 5705d24c037697d7c8f4eed53e6fd0c6b0962040 SHA1 27b6440970ffcceec5bb45c09de16a8ee8a6ef1e SHA256 fa2b1769ff6d5b1879053d64328bd1a08f9ead1b676ceda06a897d1f7c509552
AUX xorg-server-9999-loongson.patch 4107 RMD160 19aed186ec0163a4a1a81574040592ab8d8e1a06 SHA1 a39df02932f9d24693e79bbcbb80e7e6a5c74fa0 SHA256 a19a28c5f4930348e7e4ed471d3d0e53f9d936e7a4c756281ada480b63ecc039
AUX xorg-server-disable-acpi.patch 663 RMD160 7074ca5276369b746ea7606a0795232aafe07c90 SHA1 d300a37dd2e0a8aa3965948c13f6995e6767841d SHA256 5b3cc7c8bea18fe3ba81851d2846d19ffd8fab9cdf5d8f3a274846847e734200
AUX xorg-server-loongson-fix-smi-16bpp.patch 478 RMD160 bc4383c3ce55e051e255cd972d496542ac9a5eb5 SHA1 e020301ec281e8fdd4bf9d05f8d62448ae4ac20a SHA256 39d65416a4a8f8db3c73165109c265c92c7977b4b54f9092cf2551a855e392ca
@@ -74,12 +76,14 @@ DIST xorg-server-1.6.5.tar.bz2 4678406 RMD160 702970358a5643dbc9205f42e39c5b8ed2
DIST xorg-server-1.7.5.tar.bz2 4926990 RMD160 900863aeb73967e33265e0445ddaa61feeecc452 SHA1 c385293b66a6b0bc6bad648588f611d844c26ee7 SHA256 91e5f3d05c3e7270f4122235b6ab071210cc79579dcb842ffd4e71199b6bb7aa
DIST xorg-server-1.8.2.tar.bz2 5226285 RMD160 dee713fe677fdcccc0fec29a02b0af4ef48819f2 SHA1 825d11757b729444800e0a3afd4e98d19d286b1a SHA256 52157e12295cfb6f1553d3ce64af2b27ee5b512958d4c66d21065d2376aeace2
DIST xorg-server-1.9.0.tar.bz2 5345092 RMD160 9d0152458e4d82681422705d9ab0c7808a0aa372 SHA1 a18d2212df80446b597b71b8948d133f52c399cc SHA256 1064f04c648285af9960e9c8e9cd5b8efabd58113c229e3af2408da39e829ad3
+DIST xorg-server-1.9.2.902.tar.bz2 5287890 RMD160 c02f539db2b85b0c97bfd90c15aff534196f2a11 SHA1 80f8276a8f547d67ce67c787aa4728a3c457b5f3 SHA256 b89064cc9473f48aa2a6a81c330d6107b95a6ea08fda9a62404f834b353e2af9
EBUILD xorg-server-1.4.0.90-r3.ebuild 19571 RMD160 2a18b5ff8b87141e0a6f06e3589d71e0a1f934dd SHA1 6fd1e7f78a2faefbc13f1ad5c3a8f77d121a458b SHA256 4f3375321e37883fa765105cbb7056f90e6d2d6e74d4ab06072a31d635618781
EBUILD xorg-server-1.5.3.ebuild 16703 RMD160 97d1d64120e5c7a6c40236894880bcce0e27e6dd SHA1 0abc2d7b74dc01ccfdd765dd6d73e73d2258a887 SHA256 3c7aa222bb7aa967f6c0cd2e8f03b542dfb619599c5f3c36a07ea8b37392a257
EBUILD xorg-server-1.6.5.ebuild 6897 RMD160 70aa46bdd55ff4517d10517f2d26b2fb9495d59c SHA1 4835b5c31a380fb573404123a7045abd5a902713 SHA256 f503bf6f5d693c0533af3e1cb88472a3b1132d28072287b8309e7f3d9021cabd
EBUILD xorg-server-1.7.5.ebuild 7170 RMD160 826bc1ab53d6703b79798b9c79664ba641574278 SHA1 e6c410063e2862c3a81af6e0cf2207c7341257d4 SHA256 a9958384cc851512a108af346a8169771df4940d94d0f45f07f401262676d853
EBUILD xorg-server-1.8.2.ebuild 8241 RMD160 2fa4126a8c52b3f8be9ae45b0d087cfe669e4d1d SHA1 8fea1dede1e3bcd9c5a0729920e3a6750043251a SHA256 52f9a3925448037b9e68aa538c238401c07b0ce19850371dd925a46e905da37a
EBUILD xorg-server-1.9.0.ebuild 7853 RMD160 a5e96a4414e17fecde10ab9b16e8d726d909c140 SHA1 00c4a70acc477aa1cf95ae9eef9af7930efeed9a SHA256 9c4b389edecbd3baeef6c46bd525ae3434a02ad2d816c47f27f70165ec40d76f
+EBUILD xorg-server-1.9.2.902.ebuild 8067 RMD160 f835be6b42d62dc44050145ffedf8c0ce7eac99e SHA1 ca35dedcba423f17be3be2dd15af65834c262c6f SHA256 ba801538aca09efd026508a8ffcaf18e9208530b303dc91cbd46cbcf5c19fa82
EBUILD xorg-server-9999.ebuild 13974 RMD160 5df9e7a97e2becf05a56756b21e2945416ec04ba SHA1 4ae167f622911208539bb80330d287ffdce259a6 SHA256 bd73081e164fe8aae6b2d589b04d345d999ec098a7be4eec09b296b0140ed26b
MISC ChangeLog 46548 RMD160 fd66dad1dc5b8181e294f00b2d867e273f375fed SHA1 c1c264afd91f7d13bd8c4cd5d8d03cc9327e1e14 SHA256 ae56c39d52f287b2e1e0c5be5bffe5207fbc60e0cbf906a15f50f7f849bd69d7
MISC metadata.xml 156 RMD160 c1274bdccf57603d580de0075ba07a35b7509560 SHA1 6f78f604e3d079d39189b40aaaa1ddb06182ad91 SHA256 5101ab0d4cc8c7125eea733c44e86962769bd77acaf53b69223b9cadcdd29055
diff --git a/x11-base/xorg-server/files/xdm.initd-3 b/x11-base/xorg-server/files/xdm.initd-3
new file mode 100644
index 0000000..ae5f59e
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.initd-3
@@ -0,0 +1,207 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/files/xdm.initd-3,v 1.1 2010/09/28 12:43:19 scarabeus Exp $
+
+# This is here to serve as a note to myself, and future developers.
+#
+# Any Display manager (gdm,kdm,xdm) has the following problem: if
+# it is started before any getty, and no vt is specified, it will
+# usually run on vt2. When the getty on vt2 then starts, and the
+# DM is already started, the getty will take control of the keyboard,
+# leaving us with a "dead" keyboard.
+#
+# Resolution: add the following line to /etc/inittab
+#
+# x:a:once:/etc/X11/startDM.sh
+#
+# and have /etc/X11/startDM.sh start the DM in daemon mode if
+# a lock is present (with the info of what DM should be started),
+# else just fall through.
+#
+# How this basically works, is the "a" runlevel is a additional
+# runlevel that you can use to fork processes with init, but the
+# runlevel never gets changed to this runlevel. Along with the "a"
+# runlevel, the "once" key word means that startDM.sh will only be
+# run when we specify it to run, thus eliminating respawning
+# startDM.sh when "xdm" is not added to the default runlevel, as was
+# done previously.
+#
+# This script then just calls "telinit a", and init will run
+# /etc/X11/startDM.sh after the current runlevel completes (this
+# script should only be added to the actual runlevel the user is
+# using).
+#
+# Martin Schlemmer
+# aka Azarah
+# 04 March 2002
+
+depend() {
+ need localmount xdm-setup
+
+ # this should start as early as possible
+ # we can't do 'before *' as that breaks it
+ # (#139824) Start after ypbind and autofs for network authentication
+ # (#145219 #180163) Could use lirc mouse as input device
+ # (#70689 comment #92) Start after consolefont to avoid display corruption
+ # (#291269) Start after quota, since some dm need readable home
+ after bootmisc consolefont modules netmount
+ after readahead-list ypbind autofs openvpn gpm lircmd
+ after quota
+ before alsasound
+
+ # Start before X
+ use consolekit xfs
+}
+
+setup_dm() {
+ local MY_XDM
+
+ MY_XDM=$(echo "${DISPLAYMANAGER}" | tr '[:upper:]' '[:lower:]')
+
+ # Load our root path from profile.env
+ # Needed for kdm
+ PATH=${PATH}:$(. /etc/profile.env; echo "${ROOTPATH}")
+
+ NAME=
+ case "${MY_XDM}" in
+ kdm|kde)
+ EXE="$(which kdm)"
+ PIDFILE=/var/run/kdm.pid
+ ;;
+ kdm-*)
+ EXE="/usr/kde/${MY_XDM#kdm-}/bin/kdm"
+ PIDFILE=/var/run/kdm.pid
+ ;;
+ entrance*)
+ EXE=/usr/sbin/entranced
+ PIDFILE=/var/lib/entranced.pid
+ ;;
+ gdm|gnome)
+ EXE=/usr/bin/gdm
+ [ "${RC_UNAME}" != "Linux" ] && NAME=gdm-binary
+ PIDFILE=/var/run/gdm.pid
+ ;;
+ wdm)
+ EXE=/usr/bin/wdm
+ PIDFILE=
+ ;;
+ gpe)
+ EXE=/usr/bin/gpe-dm
+ PIDFILE=/var/run/gpe-dm.pid
+ ;;
+ *)
+ # first find out if there is such executable
+ EXE="$(which ${MY_XDM} 2>/dev/null)"
+ PIDFILE="/var/run/${MY_XDM}.pid"
+
+ # warn user that he is doing sick things if the exe was not found
+ if [ -z "${EXE}" ]; then
+ echo "ERROR: Your XDM value is invalid."
+ echo " No ${MY_XDM} executable could be found on your system."
+ fi
+ ;;
+ esac
+
+ if ! [ -x "${EXE}" ]; then
+ EXE=/usr/bin/xdm
+ PIDFILE=/var/run/xdm.pid
+ if ! [ -x "/usr/bin/xdm" ]; then
+ echo "ERROR: Please set your DISPLAYMANAGER variable in /etc/conf.d/xdm,"
+ echo " or install x11-apps/xdm package"
+ eend 255
+ fi
+ fi
+}
+
+# Check to see if something is defined on our VT
+vtstatic() {
+ if [ -e /etc/inittab ] ; then
+ grep -Eq "^[^#]+.*\<tty$1\>" /etc/inittab
+ elif [ -e /etc/ttys ] ; then
+ grep -q "^ttyv$(($1 - 1))" /etc/ttys
+ else
+ return 1
+ fi
+}
+
+start() {
+ local EXE NAME PIDFILE
+ setup_dm
+
+ if [ -f /etc/.noxdm ]; then
+ einfo "Skipping ${EXE##*/}, /etc/.noxdm found or \"nox\" bootparam passed."
+ rm /etc/.noxdm
+ return 0
+ fi
+
+ ebegin "Setting up ${EXE##*/}"
+
+ # save the prefered DM
+ save_options "service" "${EXE}"
+ save_options "name" "${NAME}"
+ save_options "pidfile" "${PIDFILE}"
+
+ if [ -n "${CHECKVT-y}" ] ; then
+ if vtstatic "${CHECKVT:-7}" ; then
+ if [ -x /sbin/telinit ] && [ "${SOFTLEVEL}" != "BOOT" ] && [ "${RC_SOFTLEVEL}" != "BOOT" ]; then
+ ewarn "Something is already defined on VT ${CHECKVT:-7}, will start X later"
+ telinit a >/dev/null 2>&1
+ return 0
+ else
+ eerror "Something is already defined on VT ${CHECKVT:-7}, not starting"
+ return 1
+ fi
+ fi
+ fi
+
+ /etc/X11/startDM.sh
+ eend 0
+}
+
+stop() {
+ local curvt retval
+
+ retval=0
+ if [ -t 0 ]; then
+ if type fgconsole >/dev/null 2>&1; then
+ curvt=$(fgconsole 2>/dev/null)
+ else
+ curvt=$(tty)
+ case "${curvt}" in
+ /dev/ttyv[0-9]*) curvt=${curvt#/dev/ttyv} ;;
+ *) curvt= ;;
+ esac
+ fi
+ fi
+ local myexe myname mypidfile myservice
+ myexe=$(get_options "service")
+ myname=$(get_options "name")
+ mypidfile=$(get_options "pidfile")
+ myservice=${myexe##*/}
+
+ [ -z "${myexe}" ] && return 0
+
+ ebegin "Stopping ${myservice}"
+
+ if start-stop-daemon --quiet --test --stop --exec "${myexe}"; then
+ start-stop-daemon --stop --exec "${myexe}" --retry TERM/5/TERM/5 \
+ ${mypidfile:+--pidfile} ${mypidfile} \
+ ${myname:+--name} ${myname}
+ retval=${?}
+ fi
+
+ # switch back to original vt
+ if [ -n "${curvt}" ]; then
+ if type chvt >/dev/null 2>&1; then
+ chvt "${curvt}"
+ else
+ vidcontrol -s "$((curvt + 1))"
+ fi
+ fi
+
+ eend ${retval} "Error stopping ${myservice}"
+ return ${retval}
+}
+
+# vim: set ts=4 :
diff --git a/x11-base/xorg-server/files/xorg-server-1.9.2.902-loongson.patch b/x11-base/xorg-server/files/xorg-server-1.9.2.902-loongson.patch
new file mode 100644
index 0000000..4351f28
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.9.2.902-loongson.patch
@@ -0,0 +1,53 @@
+diff --git a/hw/xfree86/dri/sarea.h b/hw/xfree86/dri/sarea.h
+index 1528cc1..6be12b9 100644
+--- a/hw/xfree86/dri/sarea.h
++++ b/hw/xfree86/dri/sarea.h
+@@ -42,6 +42,8 @@
+ /* SAREA area needs to be at least a page */
+ #if defined(__alpha__)
+ #define SAREA_MAX 0x2000
++#elif defined(__mips__)
++#define SAREA_MAX 0x4000
+ #elif defined(__ia64__)
+ #define SAREA_MAX 0x10000 /* 64kB */
+ #else
+diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
+index 688106a..1552860 100644
+--- a/hw/xfree86/os-support/linux/lnx_video.c
++++ b/hw/xfree86/os-support/linux/lnx_video.c
+@@ -505,9 +505,10 @@ _X_EXPORT volatile unsigned char *ioBase = NULL;
+ _X_EXPORT Bool
+ xf86EnableIO(void)
+ {
+-#if defined(__powerpc__)
++#if defined(__powerpc__) || defined(__mips__)
+ int fd;
+ unsigned int ioBase_phys;
++ extern unsigned int IOPortBase;
+ #endif
+
+ if (ExtendedEnabled)
+@@ -532,7 +533,22 @@ xf86EnableIO(void)
+ #endif
+ }
+ close(fd);
+-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__)
++#elif defined(__mips__)
++ fd = open("/dev/mem", O_RDWR);
++ IOPortBase = (volatile unsigned char *)mmap(0, 0x20000,
++ PROT_READ | PROT_WRITE, MAP_SHARED, fd,
++ 0x1fd00000);
++ if (IOPortBase == MAP_FAILED) {
++ xf86Msg(X_WARNING,
++ "xf86EnableIOPorts: Failed to map iobase (%s)\n",
++ strerror(errno));
++ return FALSE;
++ }
++ close(fd);
++ xf86Msg(X_WARNING,
++ "xf86EnableIOPorts: map iobase (%x)\n",
++ IOPortBase);
++#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__)
+ if (ioperm(0, 1024, 1) || iopl(3)) {
+ if (errno == ENODEV)
+ ErrorF("xf86EnableIOPorts: no I/O ports found\n");
diff --git a/x11-base/xorg-server/xorg-server-1.9.2.902.ebuild b/x11-base/xorg-server/xorg-server-1.9.2.902.ebuild
new file mode 100644
index 0000000..26eabe2
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.9.2.902.ebuild
@@ -0,0 +1,274 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/xorg-server/xorg-server-1.9.2.902.ebuild,v 1.1 2010/12/05 11:32:35 scarabeus Exp $
+
+EAPI=3
+# They generate the configure.ac with wrong version of util-macros
+# see bug #339988
+XORG_EAUTORECONF="yes"
+inherit xorg-2 multilib versionator
+
+EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/xserver"
+
+OPENGL_DIR="xorg-x11"
+
+DESCRIPTION="X.Org X servers"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+
+IUSE_SERVERS="dmx kdrive xorg"
+IUSE="${IUSE_SERVERS} doc ipv6 minimal nptl tslib +udev"
+RDEPEND=">=app-admin/eselect-opengl-1.0.8
+ dev-libs/openssl
+ media-libs/freetype
+ >=x11-apps/iceauth-1.0.2
+ >=x11-apps/rgb-1.0.3
+ >=x11-apps/xauth-1.0.3
+ x11-apps/xkbcomp
+ >=x11-libs/libpciaccess-0.10.3
+ >=x11-libs/libXau-1.0.4
+ >=x11-libs/libXdmcp-1.0.2
+ >=x11-libs/libXfont-1.4.2
+ >=x11-libs/libxkbfile-1.0.4
+ >=x11-libs/pixman-0.15.20
+ >=x11-libs/xtrans-1.2.2
+ >=x11-misc/xbitmaps-1.0.1
+ >=x11-misc/xkeyboard-config-1.4
+ dmx? (
+ x11-libs/libXt
+ >=x11-libs/libdmx-1.0.99.1
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXaw-1.0.4
+ >=x11-libs/libXext-1.0.5
+ >=x11-libs/libXfixes-4.0.3
+ >=x11-libs/libXi-1.2.99.1
+ >=x11-libs/libXmu-1.0.3
+ >=x11-libs/libXres-1.0.3
+ >=x11-libs/libXtst-1.0.3
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ !minimal? (
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXext-1.0.5
+ >=media-libs/mesa-7.8_rc[nptl=]
+ )
+ tslib? ( >=x11-libs/tslib-1.0 x11-proto/xcalibrateproto )
+ udev? ( >=sys-fs/udev-150 )"
+
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ >=x11-proto/bigreqsproto-1.1.0
+ >=x11-proto/compositeproto-0.4
+ >=x11-proto/damageproto-1.1
+ >=x11-proto/fixesproto-4.1
+ >=x11-proto/fontsproto-2.0.2
+ >=x11-proto/glproto-1.4.11
+ >=x11-proto/inputproto-1.9.99.902
+ >=x11-proto/kbproto-1.0.3
+ >=x11-proto/randrproto-1.2.99.3
+ >=x11-proto/recordproto-1.13.99.1
+ >=x11-proto/renderproto-0.11
+ >=x11-proto/resourceproto-1.0.2
+ >=x11-proto/scrnsaverproto-1.1
+ >=x11-proto/trapproto-3.4.3
+ >=x11-proto/videoproto-2.2.2
+ >=x11-proto/xcmiscproto-1.2.0
+ >=x11-proto/xextproto-7.0.99.3
+ >=x11-proto/xf86dgaproto-2.0.99.1
+ >=x11-proto/xf86rushproto-1.1.2
+ >=x11-proto/xf86vidmodeproto-2.2.99.1
+ >=x11-proto/xineramaproto-1.1.3
+ >=x11-proto/xproto-7.0.17
+ dmx? ( >=x11-proto/dmxproto-2.2.99.1 )
+ doc? (
+ >=app-doc/doxygen-1.6.1
+ app-text/xmlto
+ )
+ !minimal? (
+ >=x11-proto/xf86driproto-2.1.0
+ >=x11-proto/dri2proto-2.3
+ >=x11-libs/libdrm-2.4.20
+ )"
+
+PDEPEND="
+ >=x11-apps/xinit-1.2.1-r1
+ xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
+
+EPATCH_FORCE="yes"
+EPATCH_SUFFIX="patch"
+
+# These have been sent upstream
+UPSTREAMED_PATCHES=(
+# "${WORKDIR}/patches/"
+ )
+
+PATCHES=(
+ "${UPSTREAMED_PATCHES[@]}"
+ # A workaround for http://bugs.freedesktop.org/show_bug.cgi?id=21622
+ "${FILESDIR}/xorg-server-loongson-fix-smi-16bpp.patch"
+ "${FILESDIR}/${P}-loongson.patch"
+ "${FILESDIR}"/${PN}-disable-acpi.patch
+ "${FILESDIR}"/${PN}-1.9-nouveau-default.patch
+ )
+
+pkg_setup() {
+ xorg-2_pkg_setup
+
+ use minimal || ensure_a_server_is_building
+
+ # localstatedir is used for the log location; we need to override the default
+ # from ebuild.sh
+ # sysconfdir is used for the xorg.conf location; same applies
+ # --enable-install-setuid needed because sparcs default off
+ # NOTE: fop is used for doc generating ; and i have no idea if gentoo
+ # package it somewhere
+ CONFIGURE_OPTIONS="
+ $(use_enable ipv6)
+ $(use_enable dmx)
+ $(use_enable kdrive)
+ $(use_enable kdrive kdrive-kbd)
+ $(use_enable kdrive kdrive-mouse)
+ $(use_enable kdrive kdrive-evdev)
+ $(use_enable tslib)
+ $(use_enable tslib xcalibrate)
+ $(use_enable !minimal xvfb)
+ $(use_enable !minimal xnest)
+ $(use_enable !minimal record)
+ $(use_enable !minimal xfree86-utils)
+ $(use_enable !minimal install-libxf86config)
+ $(use_enable !minimal dri)
+ $(use_enable !minimal dri2)
+ $(use_enable !minimal glx)
+ $(use_enable xorg)
+ $(use_enable nptl glx-tls)
+ $(use_enable udev config-udev)
+ $(use_with doc doxygen)
+ $(use_with doc xmlto)
+ --sysconfdir=/etc/X11
+ --localstatedir=/var
+ --enable-install-setuid
+ --with-fontrootdir=/usr/share/fonts
+ --with-xkb-output=/var/lib/xkb
+ --disable-config-hal
+ --without-dtrace
+ --without-fop
+ --with-os-vendor=Gentoo
+ ${conf_opts}"
+
+ # Xorg-server requires includes from OS mesa which are not visible for
+ # users of binary drivers.
+ # Due to the limitations of CONFIGURE_OPTIONS, we have to export this
+ mkdir -p "${T}/mesa-symlinks/GL"
+ for i in gl glx glxmd glxproto glxtokens; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/xorg-x11/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ for i in glext glxext; do
+ ln -s "${EROOT}usr/$(get_libdir)/opengl/global/include/$i.h" "${T}/mesa-symlinks/GL/$i.h" || die
+ done
+ append-cppflags "-I${T}/mesa-symlinks"
+
+ # (#121394) Causes window corruption
+ filter-flags -fweb
+
+ # Incompatible with GCC 3.x SSP on x86, bug #244352
+ if use x86 ; then
+ if [[ $(gcc-major-version) -lt 4 ]]; then
+ filter-flags -fstack-protector
+ fi
+ fi
+
+ # Incompatible with GCC 3.x CPP, bug #314615
+ if [[ $(gcc-major-version) -lt 4 ]]; then
+ ewarn "GCC 3.x C preprocessor may cause build failures. Use GCC 4.x"
+ ewarn "or set CPP=cpp-4.3.4 (replace with the actual installed version)"
+ fi
+
+ # detect if we should inform user about ebuild breakage
+ if ! has_version "x11-base/xorg-server" ||
+ has_version "<x11-base/xorg-server-$(get_version_component_range 1-2)"; then
+ INFO="yes"
+ fi
+}
+
+src_install() {
+ xorg-2_src_install
+
+ dynamic_libgl_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc hw/xfree86/xorg.conf.example \
+ || die "couldn't install xorg.conf.example"
+ fi
+
+ newinitd "${FILESDIR}"/xdm.initd-3 xdm || die "initd file install failed"
+ newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup || die
+ newconfd "${FILESDIR}"/xdm.confd-3 xdm || die
+
+ # install the @x11-module-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/xorg-sets.conf xorg.conf || die
+}
+
+pkg_postinst() {
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ eselect opengl set --use-old xorg-x11
+
+ if [[ ${INFO} = yes ]]; then
+ elog "You should consider reading upgrade guide for this release:"
+ elog " http://www.gentoo.org/proj/en/desktop/x/x11/xorg-server-$(get_version_component_range 1-2)-upgrade-guide.xml"
+ echo
+ ewarn "You must rebuild all drivers if upgrading from <xorg-server-$(get_version_component_range 1-2)"
+ ewarn "because the ABI changed. If you cannot start X because"
+ ewarn "of module version mismatch errors, this is your problem."
+
+ echo
+ ewarn "You can generate a list of all installed packages in the x11-drivers"
+ ewarn "category using this command:"
+ ewarn " emerge portage-utils; qlist -I -C x11-drivers/"
+ fi
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if ! has_version x11-base/xorg-server; then
+ if [[ -e ${ROOT}/usr/$(get_libdir)/xorg/modules ]]; then
+ rm -rf "${ROOT}"/usr/$(get_libdir)/xorg/modules
+ fi
+ fi
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ ebegin "Moving GL files for dynamic switching"
+ dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
+ local x=""
+ for x in "${D}"/usr/$(get_libdir)/xorg/modules/extensions/lib{glx,dri,dri2}*; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/extensions
+ fi
+ done
+ eend 0
+}
+
+server_based_install() {
+ if ! use xorg; then
+ rm "${D}"/usr/share/man/man1/Xserver.1x \
+ "${D}"/usr/$(get_libdir)/xserver/SecurityPolicy \
+ "${D}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
+ "${D}"/usr/share/man/man1/Xserver.1x
+ fi
+}
+
+ensure_a_server_is_building() {
+ for server in ${IUSE_SERVERS}; do
+ use ${server} && return;
+ done
+ eerror "You need to specify at least one server to build."
+ eerror "Valid servers are: ${IUSE_SERVERS}."
+ die "No servers were specified to build."
+}