summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-emulation/wine/wine-scm.ebuild305
-rw-r--r--eclass/bash-completion-r1.eclass136
-rw-r--r--eclass/gnome2-live.eclass145
-rw-r--r--eclass/gnome2-python.eclass54
-rw-r--r--eclass/gnome2-utils.eclass502
-rw-r--r--eclass/gnome2.eclass301
-rw-r--r--eclass/scm-git.eclass186
-rw-r--r--eclass/scm.eclass374
-rw-r--r--eclass/vala.eclass149
-rw-r--r--profiles/eapi2
-rw-r--r--x11-base/xorg-drivers/xorg-drivers-9999.ebuild170
-rw-r--r--x11-base/xorg-server/files/xdm-setup.initd-114
-rw-r--r--x11-base/xorg-server/files/xdm.confd-410
-rw-r--r--x11-base/xorg-server/files/xdm.initd-11231
-rw-r--r--x11-base/xorg-server/files/xdm.initd-9216
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-cve-2013-1940.patch34
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch75
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-cve-2015-3418.patch29
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch11
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch60
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch53
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-0.patch102
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-1.patch138
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-1.patch33
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-2.patch246
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-3.patch34
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17-ia64-fix_inx_outx.patch59
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17-support-multiple-Files-sections.patch65
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.17.2-uninit-clientsWritable.patch65
-rw-r--r--x11-base/xorg-server/files/xorg-server-1.18-support-multiple-Files-sections.patch53
-rw-r--r--x11-base/xorg-server/files/xorg-server-disable-acpi.patch31
-rw-r--r--x11-base/xorg-server/files/xorg-sets.conf6
-rw-r--r--x11-base/xorg-server/xorg-server-9999.ebuild242
33 files changed, 2197 insertions, 1934 deletions
diff --git a/app-emulation/wine/wine-scm.ebuild b/app-emulation/wine/wine-scm.ebuild
index 679924f..73681c8 100644
--- a/app-emulation/wine/wine-scm.ebuild
+++ b/app-emulation/wine/wine-scm.ebuild
@@ -2,13 +2,12 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
-EAPI="5"
+EAPI=6
-AUTOTOOLS_AUTORECONF=1
PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
PLOCALE_BACKUP="en"
-inherit autotools-utils eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
+inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
EGIT_BRANCH="master"
@@ -16,53 +15,56 @@ inherit git-r3
SRC_URI=""
#KEYWORDS=""
-GV="2.44"
-MV="4.6.0"
+VANILLA_GV="2.47"
+VANILLA_MV="4.6.3"
+STAGING_GV="2.47"
+STAGING_MV="4.6.3"
+[[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
STAGING_P="wine-staging-${PV}"
-STAGING_DIR="${WORKDIR}/${STAGING_P}"
-WINE_NINE_DIR="${WORKDIR}/wine-nine"
+STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
+D3D9_P="wine-d3d9-${PV}"
+D3D9_DIR="${WORKDIR}/wine-d3d9-patches-${D3D9_P}"
WINE_GENTOO="wine-gentoo-2015.03.07"
DESCRIPTION="Free implementation of Windows(tm) on Unix"
HOMEPAGE="http://www.winehq.org/"
SRC_URI="${SRC_URI}
- gecko? (
- abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
- abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+ !staging? (
+ gecko? (
+ abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${VANILLA_GV}/wine_gecko-${VANILLA_GV}-x86.msi )
+ abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${VANILLA_GV}/wine_gecko-${VANILLA_GV}-x86_64.msi )
+ )
+ mono? ( https://dl.winehq.org/wine/wine-mono/${VANILLA_MV}/wine-mono-${VANILLA_MV}.msi )
+ )
+ staging? (
+ gecko? (
+ abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+ abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+ )
+ mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
)
- mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
-
-WINE_NINE_EGIT_REPO_URI="https://github.com/NP-Hardass/wine-d3d9-patches.git"
+D3D9_EGIT_REPO_URI="git://github.com/sarnex/wine-d3d9-patches.git"
LICENSE="LGPL-2.1"
SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls nine odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png pulseaudio +realtime run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test themes +threads +truetype udev +udisks v4l vaapi +X +xcomposite xinerama +xml"
REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
- test? ( abi_x86_32 )
+ X? ( truetype )
elibc_glibc? ( threads )
+ osmesa? ( opengl )
pipelight? ( staging )
s3tc? ( staging )
- vaapi? ( staging )
- osmesa? ( opengl )" #286560
+ test? ( abi_x86_32 )
+ themes? ( staging )
+ vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
# FIXME: the test suite is unsuitable for us; many tests require net access
# or fail due to Xvfb's opengl limitations.
RESTRICT="test"
COMMON_DEPEND="
- truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
- capi? ( net-dialup/capi4k-utils )
- ncurses? ( >=sys-libs/ncurses-5.2:=[${MULTILIB_USEDEP}] )
- udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
- fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
- gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
- openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
- gstreamer? (
- media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
- media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
- )
X? (
x11-libs/libXcursor[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -70,36 +72,59 @@ COMMON_DEPEND="
x11-libs/libXi[${MULTILIB_USEDEP}]
x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
)
- xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+ capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
- opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
- opengl? (
- virtual/glu[${MULTILIB_USEDEP}]
- virtual/opengl[${MULTILIB_USEDEP}]
+ d3d9? (
+ media-libs/mesa[d3d9,egl,${MULTILIB_USEDEP}]
+ x11-libs/libX11[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libxcb[${MULTILIB_USEDEP}]
)
+ fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+ gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+ gstreamer? (
+ media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+ media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+ )
jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
- ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+ ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+ openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+ opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+ opengl? (
+ virtual/glu[${MULTILIB_USEDEP}]
+ virtual/opengl[${MULTILIB_USEDEP}]
+ )
osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+ png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
- staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
- xml? (
- dev-libs/libxml2[${MULTILIB_USEDEP}]
- dev-libs/libxslt[${MULTILIB_USEDEP}]
- )
scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
- png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+ staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+ themes? (
+ dev-libs/glib:2[${MULTILIB_USEDEP}]
+ x11-libs/cairo[${MULTILIB_USEDEP}]
+ x11-libs/gtk+:3[${MULTILIB_USEDEP}]
+ )
+ truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+ udev? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
+ udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+ xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+ xml? (
+ dev-libs/libxml2[${MULTILIB_USEDEP}]
+ dev-libs/libxslt[${MULTILIB_USEDEP}]
+ )
abi_x86_32? (
!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
!<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -118,29 +143,36 @@ COMMON_DEPEND="
)"
RDEPEND="${COMMON_DEPEND}
- dos? ( games-emulation/dosbox )
- perl? ( dev-lang/perl dev-perl/XML-Simple )
+ dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+ perl? (
+ dev-lang/perl
+ dev-perl/XML-Simple
+ )
+ pulseaudio? (
+ realtime? ( sys-auth/rtkit )
+ )
s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
- samba? ( >=net-fs/samba-3.0.25 )
+ samba? ( >=net-fs/samba-3.0.25[winbind] )
selinux? ( sec-policy/selinux-wine )
- udisks? ( sys-fs/udisks:2 )
- pulseaudio? ( realtime? ( sys-auth/rtkit ) )
- nine? ( media-libs/mesa[d3d9] )
- "
+ udisks? ( sys-fs/udisks:2 )"
# tools/make_requests requires perl
DEPEND="${COMMON_DEPEND}
- staging? ( dev-lang/perl dev-perl/XML-Simple )
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6
+ virtual/pkgconfig
+ virtual/yacc
X? (
x11-proto/inputproto
x11-proto/xextproto
x11-proto/xf86vidmodeproto
)
- xinerama? ( x11-proto/xineramaproto )
- >=sys-kernel/linux-headers-2.6
- virtual/pkgconfig
- virtual/yacc
- sys-devel/flex"
+ prelink? ( sys-devel/prelink )
+ staging? (
+ dev-lang/perl
+ dev-perl/XML-Simple
+ )
+ xinerama? ( x11-proto/xineramaproto )"
# These use a non-standard "Wine" category, which is provided by
# /etc/xdg/applications-merged/wine.menu
@@ -149,59 +181,138 @@ usr/share/applications/wine-notepad.desktop
usr/share/applications/wine-uninstaller.desktop
usr/share/applications/wine-winecfg.desktop"
-wine_build_environment_check() {
+wine_compiler_check() {
[[ ${MERGE_TYPE} = "binary" ]] && return 0
+ # GCC-specific bugs
+ if tc-is-gcc; then
+ # bug #549768
+ if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+ ebegin "Checking for gcc-5 ms_abi compiler bug"
+ $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+ # Run in subshell to prevent "Aborted" message
+ ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+ if ! eend $?; then
+ eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+ eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+ eerror "or use gcc-config to select a different compiler version."
+ eerror "See https://bugs.gentoo.org/549768"
+ eerror
+ return 1
+ fi
+ fi
+ # bug #574044
+ if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+ ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+ # Compile in subshell to prevent "Aborted" message
+ ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 ) >/dev/null 2>&1
+ if ! eend $?; then
+ eerror "Wine cannot be built with this version of gcc-5.3"
+ eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+ eerror "or use gcc-config to select a different compiler version."
+ eerror "See https://bugs.gentoo.org/574044"
+ eerror
+ return 1
+ fi
+ fi
+ fi
+
+ # Ensure compiler support
+# if use abi_x86_64; then
+# ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+# # Compile in subshell to prevent "Aborted" message
+# ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+# if ! eend $?; then
+# eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
+# eerror
+# eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
+# eerror
+# return 1
+# fi
+# fi
+}
+
+wine_build_environment_check() {
+ [[ ${MERGE_TYPE} = "binary" ]] && return 0
- if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
- eerror "You need gcc-4.4+ to build 64-bit wine"
+ if use abi_x86_32 && use opencl && [[ "$(eselect opencl show 2> /dev/null)" == "intel" ]]; then
+ eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+ eerror "See https://bugs.gentoo.org/487864 for more details."
eerror
return 1
fi
+}
- if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
- eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
- eerror "See https://bugs.gentoo.org/487864 for more details."
+wine_env_vcs_vars() {
+ local pn_live_var="${PN//[-+]/_}_LIVE_COMMIT"
+ local pn_live_val="${pn_live_var}"
+ eval pn_live_val='$'${pn_live_val}
+ if [[ ! -z ${pn_live_val} ]]; then
+ if use staging || use d3d9; then
+ eerror "Because of the multi-repo nature of ${PN}, ${pn_live_var}"
+ eerror "cannot be used to set the commit. Instead, you may use the"
+ eerror "environmental variables WINE_COMMIT, STAGING_COMMIT, and D3D9_COMMIT."
+ eerror
+ return 1
+ fi
+ fi
+ if [[ ! -z ${EGIT_COMMIT} ]]; then
+ eerror "Commits must now be specified using the environmental variables"
+ eerror "WINE_COMMIT, STAGING_COMMIT, and D3D9_COMMIT"
eerror
return 1
fi
}
pkg_pretend() {
+ wine_compiler_check || die
wine_build_environment_check || die
+
+ # Verify OSS support
+ if use oss && ! use kernel_FreeBSD; then
+ if ! has_version ">=media-sound/oss-4"; then
+ eerror "You cannot build wine with USE=oss without having support from a"
+ eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+ eerror
+ die
+ fi
+ fi
}
pkg_setup() {
wine_build_environment_check || die
+ wine_env_vcs_vars || die
+ if ! use staging; then
+ GV=${VANILLA_GV}
+ MV=${VANILLA_MV}
+ else
+ GV=${STAGING_GV}
+ MV=${STAGING_MV}
+ fi
}
src_unpack() {
- git-r3_src_unpack
+ EGIT_COMMIT="${WINE_COMMIT}" git-r3_src_unpack
if use staging; then
- local WINE_COMMIT=${EGIT_VERSION}
-
- EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
- unset ${PN}_LIVE_REPO;
- unset EGIT_COMMIT;
+ local CURRENT_WINE_COMMIT=${EGIT_VERSION}
- EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+ git-r3_fetch "${STAGING_EGIT_REPO_URI}" "${STAGING_COMMIT}"
+ git-r3_checkout "${STAGING_EGIT_REPO_URI}" "${STAGING_DIR}"
- local STAGING_COMMIT=$("${STAGING_DIR}/patches/patchinstall.sh" --upstream-commit) || die
+ local COMPAT_WINE_COMMIT=$("${STAGING_DIR}/patches/patchinstall.sh" --upstream-commit) || die
- if [[ "${WINE_COMMIT}" != "${STAGING_COMMIT}" ]]; then
+ if [[ "${CURRENT_WINE_COMMIT}" != "${COMPAT_WINE_COMMIT}" ]]; then
einfo "The current Staging patchset is not guaranteed to apply on this WINE commit."
- einfo "If src_prepare fails, try emerging with the env var EGIT_COMMIT."
- einfo "Example: EGIT_COMMIT=${STAGING_COMMIT} emerge -1 wine"
+ einfo "If src_prepare fails, try emerging with the env var WINE_COMMIT."
+ einfo "Example: WINE_COMMIT=${COMPAT_WINE_COMMIT} emerge -1 wine"
fi
fi
-
- if use nine; then
- EGIT_REPO_URI=${WINE_NINE_EGIT_REPO_URI}
- unset ${PN}_LIVE_REPO;
- EGIT_CHECKOUT_DIR=${WINE_NINE_DIR} git-r3_src_unpack
- fi
+ if use d3d9; then
+ git-r3_fetch "${D3D9_EGIT_REPO_URI}" "${D3D9_COMMIT}"
+ git-r3_checkout "${D3D9_EGIT_REPO_URI}" "${D3D9_DIR}"
+ fi
- unpack "${WINE_GENTOO}.tar.bz2"
+ default
l10n_find_plocales_changes "${S}/po" "" ".po"
}
@@ -210,7 +321,7 @@ src_prepare() {
local md5="$(md5sum server/protocol.def)"
local PATCHES=(
"${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
- "${FILESDIR}"/${PN}-1.9.5-multilib-portage.patch #395615
+# "${FILESDIR}"/${PN}-1.9.5-multilib-portage.patch #395615
"${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
"${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
)
@@ -221,19 +332,31 @@ src_prepare() {
local STAGING_EXCLUDE=""
use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
-# #577198 1.9.5 only
-# STAGING_EXCLUDE="${STAGING_EXCLUDE} -W makefiles-Disabled_Rules"
-
- # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+ # Launch wine-staging patcher in a subshell, using eapply as a backend, and gitapply.sh as a backend for binary patches
ebegin "Running Wine-Staging patch installer"
(
- set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+ set -- DESTDIR="${S}" --backend=eapply --no-autoconf --all ${STAGING_EXCLUDE}
cd "${STAGING_DIR}/patches"
source "${STAGING_DIR}/patches/patchinstall.sh"
)
- eend $?
+ eend $? || die "Failed to apply Wine-Staging patches"
+
+ # To differentiate unofficial staging releases
+ if [[ ! -z ${SUFFIX} ]]; then
+ sed -i "s/(Staging)/(Staging [Unofficial])/" libs/wine/Makefile.in || die
+ fi
fi
- autotools-utils_src_prepare
+ if use d3d9; then
+ if use staging; then
+ PATCHES+=( "${D3D9_DIR}/staging-helper.patch" )
+ else
+ PATCHES+=( "${D3D9_DIR}/d3d9-helper.patch" )
+ fi
+ PATCHES+=( "${D3D9_DIR}/wine-d3d9.patch" )
+ fi
+
+ default
+ eautoreconf
# Modification of the server protocol requires regenerating the server requests
if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
@@ -248,7 +371,7 @@ src_prepare() {
# hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
- l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+ l10n_get_locales > po/LINGUAS || die # otherwise wine doesn't respect LINGUAS
}
src_configure() {
@@ -292,6 +415,7 @@ multilib_src_configure() {
$(use_with scanner sane)
$(use_enable test tests)
$(use_with truetype freetype)
+ $(use_with udev)
$(use_with v4l)
$(use_with X x)
$(use_with xcomposite)
@@ -302,8 +426,10 @@ multilib_src_configure() {
use staging && myconf+=(
--with-xattr
+ $(use_with themes gtk3)
$(use_with vaapi va)
)
+ use d3d9 && myconf+=( $(use_with d3d9 d3d9-nine) )
local PKG_CONFIG AR RANLIB
# Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
@@ -366,6 +492,13 @@ multilib_src_install_all() {
rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
fi
+ # Remove wineconsole if neither backend is installed #551124
+ if ! use X && ! use ncurses; then
+ rm "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+ use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+ use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+ fi
+
use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
diff --git a/eclass/bash-completion-r1.eclass b/eclass/bash-completion-r1.eclass
deleted file mode 100644
index 4afeb86..0000000
--- a/eclass/bash-completion-r1.eclass
+++ /dev/null
@@ -1,136 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-# @ECLASS: bash-completion-r1.eclass
-# @MAINTAINER:
-# mgorny@gentoo.org
-# @BLURB: A few quick functions to install bash-completion files
-# @EXAMPLE:
-#
-# @CODE
-# EAPI=5
-#
-# src_configure() {
-# econf \
-# --with-bash-completion-dir="$(get_bashcompdir)"
-# }
-#
-# src_install() {
-# default
-#
-# newbashcomp contrib/${PN}.bash-completion ${PN}
-# }
-# @CODE
-
-inherit toolchain-funcs
-
-case ${EAPI:-0} in
- 0|1|2|3|4|5|6|paludis-1) ;;
- *) die "EAPI ${EAPI} unsupported (yet)."
-esac
-
-# @FUNCTION: _bash-completion-r1_get_bashdir
-# @INTERNAL
-# @DESCRIPTION:
-# First argument is name of the string in bash-completion.pc
-# Second argument is the fallback directory if the string is not found
-# @EXAMPLE:
-# _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion
-_bash-completion-r1_get_bashdir() {
- debug-print-function ${FUNCNAME} "${@}"
-
- if $(tc-getPKG_CONFIG) --exists bash-completion &>/dev/null; then
- local path
- path=$($(tc-getPKG_CONFIG) --variable="${1}" bash-completion) || die
- # we need to return unprefixed, so strip from what pkg-config returns
- # to us, bug #477692
- echo "${path#${EPREFIX}}"
- else
- echo "${2}"
- fi
-}
-
-# @FUNCTION: _bash-completion-r1_get_bashcompdir
-# @INTERNAL
-# @DESCRIPTION:
-# Get unprefixed bash-completion completions directory.
-_bash-completion-r1_get_bashcompdir() {
- debug-print-function ${FUNCNAME} "${@}"
-
- _bash-completion-r1_get_bashdir completionsdir /usr/share/bash-completion/completions
-}
-
-# @FUNCTION: _bash-completion-r1_get_helpersdir
-# @INTERNAL
-# @DESCRIPTION:
-# Get unprefixed bash-completion helpers directory.
-_bash-completion-r1_get_bashhelpersdir() {
- debug-print-function ${FUNCNAME} "${@}"
-
- _bash-completion-r1_get_bashdir helpersdir /usr/share/bash-completion/helpers
-}
-
-# @FUNCTION: get_bashcompdir
-# @DESCRIPTION:
-# Get the bash-completion completions directory.
-get_bashcompdir() {
- debug-print-function ${FUNCNAME} "${@}"
-
- echo "${EPREFIX}$(_bash-completion-r1_get_bashcompdir)"
-}
-
-# @FUNCTION: get_bashhelpersdir
-# @INTERNAL
-# @DESCRIPTION:
-# Get the bash-completion helpers directory.
-get_bashhelpersdir() {
- debug-print-function ${FUNCNAME} "${@}"
-
- echo "${EPREFIX}$(_bash-completion-r1_get_bashhelpersdir)"
-}
-
-# @FUNCTION: dobashcomp
-# @USAGE: file [...]
-# @DESCRIPTION:
-# Install bash-completion files passed as args. Has EAPI-dependant failure
-# behavior (like doins).
-dobashcomp() {
- debug-print-function ${FUNCNAME} "${@}"
-
- (
- insinto "$(_bash-completion-r1_get_bashcompdir)"
- doins "${@}"
- )
-}
-
-# @FUNCTION: newbashcomp
-# @USAGE: file newname
-# @DESCRIPTION:
-# Install bash-completion file under a new name. Has EAPI-dependant failure
-# behavior (like newins).
-newbashcomp() {
- debug-print-function ${FUNCNAME} "${@}"
-
- (
- insinto "$(_bash-completion-r1_get_bashcompdir)"
- newins "${@}"
- )
-}
-
-# @FUNCTION: bashcomp_alias
-# @USAGE: <basename> <alias>...
-# @DESCRIPTION:
-# Alias <basename> completion to one or more commands (<alias>es).
-bashcomp_alias() {
- debug-print-function ${FUNCNAME} "${@}"
-
- [[ ${#} -lt 2 ]] && die "Usage: ${FUNCNAME} <basename> <alias>..."
- local base=${1} f
- shift
-
- for f; do
- dosym "${base}" "$(_bash-completion-r1_get_bashcompdir)/${f}" \
- || return
- done
-}
diff --git a/eclass/gnome2-live.eclass b/eclass/gnome2-live.eclass
deleted file mode 100644
index f01dea0..0000000
--- a/eclass/gnome2-live.eclass
+++ /dev/null
@@ -1,145 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-#
-# @ECLASS: gnome2-live.eclass
-# @MAINTAINER:
-# gnome@gentoo.org
-# @AUTHOR:
-# Nirbheek Chauhan <nirbheek@gentoo.org>
-# @BLURB: Live ebuild phases for GNOME packages
-# @DESCRIPTION:
-# Exports additional functions used by live ebuilds written for GNOME packages
-# Always to be imported *AFTER* gnome2.eclass
-#
-
-inherit autotools eutils gnome2 gnome2-utils libtool git-r3
-
-# Stolen from git.eclass
-EXPORTED_FUNCTIONS="src_unpack pkg_postinst"
-case "${EAPI:-0}" in
- 2|3|4|5) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare" ;;
- 0|1) ;;
- *) die "Unknown EAPI, Bug eclass maintainers." ;;
-esac
-EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
-
-# DEPEND on
-# app-text/gnome-doc-utils for gnome-doc-*
-# dev-util/gtk-doc for gtkdocize
-# dev-util/intltool for intltoolize
-# gnome-base/gnome-common for GNOME_COMMON_INIT
-DEPEND="${DEPEND}
- app-text/gnome-doc-utils
- app-text/yelp-tools
- dev-util/gtk-doc
- dev-util/intltool
- gnome-base/gnome-common
- sys-devel/gettext"
-
-# Extra options passed to elibtoolize
-ELTCONF=${ELTCONF:-}
-
-# @ECLASS-VARIABLE: GNOME_LIVE_MODULE
-# @DESCRIPTION:
-# Default git module name is assumed to be the same as the gnome.org module name
-# used on ftp.gnome.org. We have GNOME_ORG_MODULE because we inherit gnome.org
-: ${GNOME_LIVE_MODULE:="${GNOME_ORG_MODULE}"}
-
-# @ECLASS-VARIABLE: EGIT_REPO_URI
-# @DESCRIPTION:
-# git URI for the project, uses GNOME_LIVE_MODULE by default
-: "${EGIT_REPO_URI:="git://git.gnome.org/${GNOME_LIVE_MODULE}"}"
-
-# @ECLASS-VARIABLE: PATCHES
-# @DESCRIPTION:
-# Whitespace-separated list of patches to apply after cloning
-: ${PATCHES:=""}
-
-# Unset SRC_URI auto-set by gnome2.eclass
-SRC_URI=""
-
-# @FUNCTION: gnome2-live_get_var
-# @DESCRIPTION:
-# Get macro variable values from configure.ac, etc
-gnome2-live_get_var() {
- local var f
- var="$1"
- f="$2"
- echo $(sed -ne "s/${var}(\(.*\))/\1/p" "${f}" | tr -d '[]')
-}
-
-# @FUNCTION: gnome2-live_get_var
-# @DESCRIPTION:
-# Calls git-2_src_unpack, and unpacks ${A} if required.
-# Also calls gnome2-live_src_prepare for older EAPI.
-gnome2-live_src_unpack() {
- if test -n "${A}"; then
- unpack ${A}
- fi
- git-r3_src_unpack
- has src_prepare ${EXPORTED_FUNCTIONS} || gnome2-live_src_prepare
-}
-
-# @FUNCTION: gnome2-live_src_prepare
-# @DESCRIPTION:
-# Lots of magic to workaround autogen.sh quirks in various packages
-# Creates blank ChangeLog and necessary macro dirs. Runs various autotools
-# programs if required, and finally runs eautoreconf.
-gnome2-live_src_prepare() {
- for i in ${PATCHES}; do
- epatch "${i}"
- done
-
- epatch_user
-
- # If ChangeLog doesn't exist, maybe it's autogenerated
- # Avoid a `dodoc` failure by adding an empty ChangeLog
- if ! test -e ChangeLog; then
- echo > ChangeLog
- fi
-
- # eautoreconf is smart enough to run all necessary commands
- eautoreconf
-
- ### Keep this in-sync with gnome2.eclass!
-
- # Don't use the session bus address inherited via the environment
- # causes test and introspection-building failures
- unset DBUS_SESSION_BUS_ADDRESS
-
- # Prevent assorted access violations and test failures
- gnome2_environment_reset
-
- # Prevent scrollkeeper access violations
- gnome2_omf_fix
-
- # Libtool patching
- elibtoolize ${ELTCONF}
-}
-
-# @FUNCTION: gnome2_src_unpack
-# @DESCRIPTION:
-# Defined so that it replaces gnome2_src_unpack in ebuilds that call it
-gnome2_src_unpack() {
- gnome2-live_src_unpack
-}
-
-# @FUNCTION: gnome2_src_prepare
-# @DESCRIPTION:
-# Defined so that it replaces gnome2_src_prepare in ebuilds that call it
-gnome2_src_prepare() {
- gnome2-live_src_prepare
-}
-
-# @FUNCTION: gnome2-live_pkg_postinst
-# @DESCRIPTION:
-# Must be run manually for ebuilds that have a custom pkg_postinst
-gnome2-live_pkg_postinst() {
- gnome2_pkg_postinst
-
- ewarn "This is a live ebuild, upstream trunks will mostly be UNstable"
- ewarn "Do NOT report bugs about this package to Gentoo"
- ewarn "Report upstream bugs (with patches if possible) instead."
-}
diff --git a/eclass/gnome2-python.eclass b/eclass/gnome2-python.eclass
deleted file mode 100644
index 7330f39..0000000
--- a/eclass/gnome2-python.eclass
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-# @ECLASS: gnome2-python.eclass
-# @MAINTAINER:
-# Gentoo GNOME Project <gnome@gentoo.org>
-# Gentoo Python Project <python@gentoo.org>
-# @BLURB: Eclass for GNOME Python packages supporting installation for multiple Python ABIs
-# @DESCRIPTION:
-# The gnome2-python eclass defines phase functions for GNOME Python packages supporting
-# installation for multiple Python ABIs.
-
-inherit gnome2 python
-
-# Stolen from git.eclass
-EXPORTED_FUNCTIONS="pkg_setup src_compile src_test src_install"
-case "${EAPI:-0}" in
- 2|3|4) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" ;;
- 0|1) ;;
- *) die "Unknown EAPI, bug eclass maintainers." ;;
-esac
-
-EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
-
-gnome2-python_pkg_setup() {
- python_pkg_setup
-}
-
-gnome2-python_src_prepare() {
- gnome2_src_prepare
- python_clean_py-compile_files
- python_copy_sources
-}
-
-gnome2-python_src_configure() {
- configure() {
- gnome2_src_configure PYTHON=$(PYTHON -a) "$@"
- }
- python_execute_function -s configure
-}
-
-gnome2-python_src_compile() {
- python_execute_function -s gnome2_src_compile "$@"
-}
-
-gnome2-python_src_test() {
- python_execute_function -s -d
-}
-
-gnome2-python_src_install() {
- python_execute_function -s gnome2_src_install
- python_clean_installation_image
-}
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
deleted file mode 100644
index 4c7d0c8..0000000
--- a/eclass/gnome2-utils.eclass
+++ /dev/null
@@ -1,502 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-# @ECLASS: gnome2-utils.eclass
-# @MAINTAINER:
-# gnome@gentoo.org
-# @BLURB: Auxiliary functions commonly used by Gnome packages.
-# @DESCRIPTION:
-# This eclass provides a set of auxiliary functions needed by most Gnome
-# packages. It may be used by non-Gnome packages as needed for handling various
-# Gnome stack related functions such as:
-# * Gtk+ icon cache management
-# * GSettings schemas management
-# * GConf schemas management
-# * scrollkeeper (old Gnome help system) management
-
-inherit multilib
-
-case "${EAPI:-0}" in
- 0|1|2|3|4|5) ;;
- *) die "EAPI=${EAPI} is not supported" ;;
-esac
-
-# @ECLASS-VARIABLE: GCONFTOOL_BIN
-# @INTERNAL
-# @DESCRIPTION:
-# Path to gconftool-2
-: ${GCONFTOOL_BIN:="/usr/bin/gconftool-2"}
-
-# @ECLASS-VARIABLE: SCROLLKEEPER_DIR
-# @INTERNAL
-# @DESCRIPTION:
-# Directory where scrollkeeper-update should do its work
-: ${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}
-
-# @ECLASS-VARIABLE: SCROLLKEEPER_UPDATE_BIN
-# @INTERNAL
-# @DESCRIPTION:
-# Path to scrollkeeper-update
-: ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
-
-# @ECLASS-VARIABLE: GTK_UPDATE_ICON_CACHE
-# @INTERNAL
-# @DESCRIPTION:
-# Path to gtk-update-icon-cache
-: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
-
-# @ECLASS-VARIABLE: GLIB_COMPILE_SCHEMAS
-# @INTERNAL
-# @DESCRIPTION:
-# Path to glib-compile-schemas
-: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
-
-# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS
-# @INTERNAL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# List of GConf schemas provided by the package
-
-# @ECLASS-VARIABLE: GNOME2_ECLASS_ICONS
-# @INTERNAL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# List of icons provided by the package
-
-# @ECLASS-VARIABLE: GNOME2_ECLASS_SCROLLS
-# @INTERNAL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# List of scrolls (documentation files) provided by the package
-
-# @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS
-# @INTERNAL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# List of GSettings schemas provided by the package
-
-# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
-# @INTERNAL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# List of gdk-pixbuf loaders provided by the package
-
-DEPEND=">=sys-apps/sed-4"
-
-
-# @FUNCTION: gnome2_environment_reset
-# @DESCRIPTION:
-# Reset various variables inherited from root's evironment to a reasonable
-# default for ebuilds to help avoid access violations and test failures.
-gnome2_environment_reset() {
- # Respected by >=glib-2.30.1-r1
- export G_HOME="${T}"
-
- # GST_REGISTRY is to work around gst utilities trying to read/write /root
- export GST_REGISTRY="${T}/registry.xml"
-
- # XXX: code for resetting XDG_* directories should probably be moved into
- # a separate function in a non-gnome eclass
- export XDG_DATA_HOME="${T}/.local/share"
- export XDG_CONFIG_HOME="${T}/.config"
- export XDG_CACHE_HOME="${T}/.cache"
- export XDG_RUNTIME_DIR="${T}/run"
- mkdir -p "${XDG_DATA_HOME}" "${XDG_CONFIG_HOME}" "${XDG_CACHE_HOME}" \
- "${XDG_RUNTIME_DIR}"
- # This directory needs to be owned by the user, and chmod 0700
- # http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
- chmod 0700 "${XDG_RUNTIME_DIR}"
-}
-
-# @FUNCTION: gnome2_gconf_savelist
-# @DESCRIPTION:
-# Find the GConf schemas that are about to be installed and save their location
-# in the GNOME2_ECLASS_SCHEMAS environment variable.
-# This function should be called from pkg_preinst.
-gnome2_gconf_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" &> /dev/null
- export GNOME2_ECLASS_SCHEMAS=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null)
- popd &> /dev/null
-}
-
-# @FUNCTION: gnome2_gconf_install
-# @DESCRIPTION:
-# Applies any schema files installed by the current ebuild to Gconf's database
-# using gconftool-2.
-# This function should be called from pkg_postinst.
-gnome2_gconf_install() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GCONFTOOL_BIN}"
-
- if [[ ! -x "${updater}" ]]; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
- debug-print "No GNOME 2 GConf schemas found"
- return
- fi
-
- # We are ready to install the GCONF Scheme now
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
- export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")"
-
- einfo "Installing GNOME 2 GConf schemas"
-
- local F
- for F in ${GNOME2_ECLASS_SCHEMAS}; do
- if [[ -e "${EROOT}${F}" ]]; then
- debug-print "Installing schema: ${F}"
- "${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
- fi
- done
-
- # have gconf reload the new schemas
- pids=$(pgrep -x gconfd-2)
- if [[ $? == 0 ]] ; then
- ebegin "Reloading GConf schemas"
- kill -HUP ${pids}
- eend $?
- fi
-}
-
-# @FUNCTION: gnome2_gconf_uninstall
-# @DESCRIPTION:
-# Removes schema files previously installed by the current ebuild from Gconf's
-# database.
-gnome2_gconf_uninstall() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GCONFTOOL_BIN}"
-
- if [[ ! -x "${updater}" ]]; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
- debug-print "No GNOME 2 GConf schemas found"
- return
- fi
-
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
- export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")"
-
- einfo "Uninstalling GNOME 2 GConf schemas"
-
- local F
- for F in ${GNOME2_ECLASS_SCHEMAS}; do
- if [[ -e "${EROOT}${F}" ]]; then
- debug-print "Uninstalling gconf schema: ${F}"
- "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
- fi
- done
-
- # have gconf reload the new schemas
- pids=$(pgrep -x gconfd-2)
- if [[ $? == 0 ]] ; then
- ebegin "Reloading GConf schemas"
- kill -HUP ${pids}
- eend $?
- fi
-}
-
-# @FUNCTION: gnome2_icon_savelist
-# @DESCRIPTION:
-# Find the icons that are about to be installed and save their location
-# in the GNOME2_ECLASS_ICONS environment variable.
-# This function should be called from pkg_preinst.
-gnome2_icon_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" &> /dev/null
- export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
- popd &> /dev/null
-}
-
-# @FUNCTION: gnome2_icon_cache_update
-# @DESCRIPTION:
-# Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild
-# have installed anything under that location.
-# This function should be called from pkg_postinst and pkg_postrm.
-gnome2_icon_cache_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
-
- if [[ ! -x "${updater}" ]] ; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then
- debug-print "No icon cache to update"
- return
- fi
-
- ebegin "Updating icons cache"
-
- local retval=0
- local fails=( )
-
- for dir in ${GNOME2_ECLASS_ICONS}
- do
- if [[ -f "${EROOT}${dir}/index.theme" ]] ; then
- local rv=0
-
- "${updater}" -qf "${EROOT}${dir}"
- rv=$?
-
- if [[ ! $rv -eq 0 ]] ; then
- debug-print "Updating cache failed on ${EROOT}${dir}"
-
- # Add to the list of failures
- fails[$(( ${#fails[@]} + 1 ))]="${EROOT}${dir}"
-
- retval=2
- fi
- elif [[ $(ls "${EROOT}${dir}") = "icon-theme.cache" ]]; then
- # Clear stale cache files after theme uninstallation
- rm "${EROOT}${dir}/icon-theme.cache"
- fi
-
- if [[ -z $(ls "${EROOT}${dir}") ]]; then
- # Clear empty theme directories after theme uninstallation
- rmdir "${EROOT}${dir}"
- fi
- done
-
- eend ${retval}
-
- for f in "${fails[@]}" ; do
- eerror "Failed to update cache with icon $f"
- done
-}
-
-# @FUNCTION: gnome2_omf_fix
-# @DESCRIPTION:
-# Workaround applied to Makefile rules in order to remove redundant
-# calls to scrollkeeper-update and sandbox violations.
-# This function should be called from src_prepare.
-gnome2_omf_fix() {
- local omf_makefiles filename
-
- omf_makefiles="$@"
-
- if [[ -f ${S}/omf.make ]] ; then
- omf_makefiles="${omf_makefiles} ${S}/omf.make"
- fi
-
- if [[ -f ${S}/gnome-doc-utils.make ]] ; then
- omf_makefiles="${omf_makefiles} ${S}/gnome-doc-utils.make"
- fi
-
- # testing fixing of all makefiles found
- # The sort is important to ensure .am is listed before the respective .in for
- # maintainer mode regeneration not kicking in due to .am being newer than .in
- for filename in $(find "${S}" -name "Makefile.in" -o -name "Makefile.am" |sort) ; do
- omf_makefiles="${omf_makefiles} ${filename}"
- done
-
- ebegin "Fixing OMF Makefiles"
-
- local retval=0
- local fails=( )
-
- for omf in ${omf_makefiles} ; do
- sed -i -e 's:scrollkeeper-update:true:' "${omf}"
- retval=$?
-
- if [[ $retval -ne 0 ]] ; then
- debug-print "updating of ${omf} failed"
-
- # Add to the list of failures
- fails[$(( ${#fails[@]} + 1 ))]=$omf
-
- retval=2
- fi
- done
-
- eend $retval
-
- for f in "${fails[@]}" ; do
- eerror "Failed to update OMF Makefile $f"
- done
-}
-
-# @FUNCTION: gnome2_scrollkeeper_savelist
-# @DESCRIPTION:
-# Find the scrolls that are about to be installed and save their location
-# in the GNOME2_ECLASS_SCROLLS environment variable.
-# This function should be called from pkg_preinst.
-gnome2_scrollkeeper_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" &> /dev/null
- export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name "*.omf" 2> /dev/null)
- popd &> /dev/null
-}
-
-# @FUNCTION: gnome2_scrollkeeper_update
-# @DESCRIPTION:
-# Updates the global scrollkeeper database.
-# This function should be called from pkg_postinst and pkg_postrm.
-gnome2_scrollkeeper_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
-
- if [[ ! -x "${updater}" ]] ; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
- debug-print "No scroll cache to update"
- return
- fi
-
- ebegin "Updating scrollkeeper database ..."
- "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
- eend $?
-}
-
-# @FUNCTION: gnome2_schemas_savelist
-# @DESCRIPTION:
-# Find if there is any GSettings schema to install and save the list in
-# GNOME2_ECLASS_GLIB_SCHEMAS variable.
-# This function should be called from pkg_preinst.
-gnome2_schemas_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" &>/dev/null
- export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null)
- popd &>/dev/null
-}
-
-# @FUNCTION: gnome2_schemas_update
-# @USAGE: gnome2_schemas_update
-# @DESCRIPTION:
-# Updates GSettings schemas if GNOME2_ECLASS_GLIB_SCHEMAS has some.
-# This function should be called from pkg_postinst and pkg_postrm.
-gnome2_schemas_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
-
- if [[ ! -x ${updater} ]]; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
- debug-print "No GSettings schemas to update"
- return
- fi
-
- ebegin "Updating GSettings schemas"
- ${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
- eend $?
-}
-
-# @FUNCTION: gnome2_gdk_pixbuf_savelist
-# @DESCRIPTION:
-# Find if there is any gdk-pixbuf loader to install and save the list in
-# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
-# This function should be called from pkg_preinst.
-gnome2_gdk_pixbuf_savelist() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- pushd "${ED}" 1>/dev/null
- export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find usr/lib*/gdk-pixbuf-2.0 -type f 2>/dev/null)
- popd 1>/dev/null
-}
-
-# @FUNCTION: gnome2_gdk_pixbuf_update
-# @USAGE: gnome2_gdk_pixbuf_update
-# @DESCRIPTION:
-# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
-# This function should be called from pkg_postinst and pkg_postrm.
-gnome2_gdk_pixbuf_update() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
-
- if [[ ! -x ${updater} ]]; then
- updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
- fi
-
- if [[ ! -x ${updater} ]]; then
- debug-print "${updater} is not executable"
- return
- fi
-
- if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
- debug-print "gdk-pixbuf loader cache does not need an update"
- return
- fi
-
- ebegin "Updating gdk-pixbuf loader cache"
- local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf)
- ${updater} 1> "${tmp_file}" &&
- chmod 0644 "${tmp_file}" &&
- cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
- rm "${tmp_file}" # don't replace this with mv, required for SELinux support
- eend $?
-}
-
-# @FUNCTION: gnome2_query_immodules_gtk2
-# @USAGE: gnome2_query_immodules_gtk2
-# @DESCRIPTION:
-# Updates gtk2 immodules/gdk-pixbuf loaders listing.
-gnome2_query_immodules_gtk2() {
- local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-2.0
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
-
- "${updater}" --update-cache
-}
-
-# @FUNCTION: gnome2_query_immodules_gtk3
-# @USAGE: gnome2_query_immodules_gtk3
-# @DESCRIPTION:
-# Updates gtk3 immodules/gdk-pixbuf loaders listing.
-gnome2_query_immodules_gtk3() {
- local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-3.0
- [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
-
- "${updater}" --update-cache
-}
-
-# @FUNCTION: gnome2_disable_deprecation_warning
-# @DESCRIPTION:
-# Disable deprecation warnings commonly found in glib based packages.
-# Should be called from src_prepare.
-gnome2_disable_deprecation_warning() {
- local retval=0
- local fails=( )
- local makefile
-
- ebegin "Disabling deprecation warnings"
- # The sort is important to ensure .am is listed before the respective .in for
- # maintainer mode regeneration not kicking in due to .am being newer than .in
- while read makefile ; do
- if ! grep -qE "(DISABLE_DEPRECATED|GSEAL_ENABLE)" "${makefile}"; then
- continue
- fi
-
- LC_ALL=C sed -r -i \
- -e 's:-D[A-Z_]+_DISABLE_DEPRECATED:$(NULL):g' \
- -e 's:-DGSEAL_ENABLE+[A-Z_]:$(NULL):g' \
- -i "${makefile}"
-
- if [[ $? -ne 0 ]]; then
- # Add to the list of failures
- fails+=( "${makefile}" )
- retval=2
- fi
- done < <(find "${S}" -name "Makefile.in" \
- -o -name "Makefile.am" -o -name "Makefile.decl" \
- | sort; echo configure)
-# TODO: sedding configure.ac can trigger maintainer mode; bug #439602
-# -o -name "configure.ac" -o -name "configure.in" \
-# | sort; echo configure)
- eend ${retval}
-
- for makefile in "${fails[@]}" ; do
- ewarn "Failed to disable deprecation warnings in ${makefile}"
- done
-}
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
deleted file mode 100644
index f77dace..0000000
--- a/eclass/gnome2.eclass
+++ /dev/null
@@ -1,301 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-# @ECLASS: gnome2.eclass
-# @MAINTAINER:
-# gnome@gentoo.org
-# @BLURB: Provides phases for Gnome/Gtk+ based packages.
-# @DESCRIPTION:
-# Exports portage base functions used by ebuilds written for packages using the
-# GNOME framework. For additional functions, see gnome2-utils.eclass.
-
-inherit eutils fdo-mime libtool gnome.org gnome2-utils
-
-case "${EAPI:-0}" in
- 0|1)
- eqawarn
- eqawarn "${CATEGORY}/${PF}: EAPI 0/1 support is now deprecated."
- eqawarn "If you are the package maintainer, please"
- eqawarn "update this package to a newer EAPI."
- eqawarn "Support for EAPIs 0 and 1 for gnome2.eclass will be dropped"
- eqawarn "in a month (around 23rd December)."
- eqawarn
- EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm
- ;;
- 2|3|4|5)
- EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install pkg_preinst pkg_postinst pkg_postrm
- ;;
- *) die "EAPI=${EAPI} is not supported" ;;
-esac
-
-# @ECLASS-VARIABLE: G2CONF
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Extra configure opts passed to econf
-G2CONF=${G2CONF:-""}
-
-# @ECLASS-VARIABLE: GNOME2_LA_PUNT
-# @DESCRIPTION:
-# Should we delete ALL the .la files?
-# NOT to be used without due consideration.
-if has ${EAPI:-0} 0 1 2 3 4; then
- GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-"no"}
-else
- GNOME2_LA_PUNT=${GNOME2_LA_PUNT:-""}
-fi
-
-# @ECLASS-VARIABLE: ELTCONF
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Extra options passed to elibtoolize
-ELTCONF=${ELTCONF:-""}
-
-# @ECLASS-VARIABLE: USE_EINSTALL
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Should we use EINSTALL instead of DESTDIR. DEPRECATED
-USE_EINSTALL=${USE_EINSTALL:-""}
-
-# @ECLASS-VARIABLE: DOCS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# String containing documents passed to dodoc command.
-
-# @ECLASS-VARIABLE: GCONF_DEBUG
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Whether to handle debug or not.
-# Some gnome applications support various levels of debugging (yes, no, minimum,
-# etc), but using --disable-debug also removes g_assert which makes debugging
-# harder. This variable should be set to yes for such packages for the eclass
-# to handle it properly. It will enable minimal debug with USE=-debug.
-# Note that this is most commonly found in configure.ac as GNOME_DEBUG_CHECK.
-
-
-if [[ ${GCONF_DEBUG} != "no" ]]; then
- IUSE="debug"
-fi
-
-
-# @FUNCTION: gnome2_src_unpack
-# @DESCRIPTION:
-# Stub function for old EAPI.
-gnome2_src_unpack() {
- unpack ${A}
- cd "${S}"
- has ${EAPI:-0} 0 1 && gnome2_src_prepare
-}
-
-# @FUNCTION: gnome2_src_prepare
-# @DESCRIPTION:
-# Prepare environment for build, fix build of scrollkeeper documentation,
-# run elibtoolize.
-gnome2_src_prepare() {
- # Prevent assorted access violations and test failures
- gnome2_environment_reset
-
- # Prevent scrollkeeper access violations
- gnome2_omf_fix
-
- # Disable all deprecation warnings
- gnome2_disable_deprecation_warning
-
- # Run libtoolize
- if has ${EAPI:-0} 0 1 2 3; then
- elibtoolize ${ELTCONF}
- else
- # Everything is fatal EAPI 4 onwards
- nonfatal elibtoolize ${ELTCONF}
- fi
-
-}
-
-# @FUNCTION: gnome2_src_configure
-# @DESCRIPTION:
-# Gnome specific configure handling
-gnome2_src_configure() {
- # Update the GNOME configuration options
- if [[ ${GCONF_DEBUG} != 'no' ]] ; then
- if use debug ; then
- G2CONF="--enable-debug=yes ${G2CONF}"
- fi
- fi
-
- # Starting with EAPI=5, we consider packages installing gtk-doc to be
- # handled by adding DEPEND="dev-util/gtk-doc-am" which provides tools to
- # relink URLs in documentation to already installed documentation.
- # This decision also greatly helps with constantly broken doc generation.
- # Remember to drop 'doc' USE flag from your package if it was only used to
- # rebuild docs.
- # Preserve old behavior for older EAPI.
- if grep -q "enable-gtk-doc" "${ECONF_SOURCE:-.}"/configure ; then
- if has ${EAPI:-0} 0 1 2 3 4 && in_iuse doc ; then
- G2CONF="$(use_enable doc gtk-doc) ${G2CONF}"
- else
- G2CONF="--disable-gtk-doc ${G2CONF}"
- fi
- fi
-
- # Pass --disable-maintainer-mode when needed
- if grep -q "^[[:space:]]*AM_MAINTAINER_MODE(\[enable\])" \
- "${ECONF_SOURCE:-.}"/configure.*; then
- G2CONF="--disable-maintainer-mode ${G2CONF}"
- fi
-
- # Pass --disable-scrollkeeper when possible
- if grep -q "disable-scrollkeeper" "${ECONF_SOURCE:-.}"/configure; then
- G2CONF="--disable-scrollkeeper ${G2CONF}"
- fi
-
- # Pass --disable-silent-rules when possible (not needed for eapi5), bug #429308
- if has ${EAPI:-0} 0 1 2 3 4; then
- if grep -q "disable-silent-rules" "${ECONF_SOURCE:-.}"/configure; then
- G2CONF="--disable-silent-rules ${G2CONF}"
- fi
- fi
-
- # Pass --disable-schemas-install when possible
- if grep -q "disable-schemas-install" "${ECONF_SOURCE:-.}"/configure; then
- G2CONF="--disable-schemas-install ${G2CONF}"
- fi
-
- # Pass --disable-schemas-compile when possible
- if grep -q "disable-schemas-compile" "${ECONF_SOURCE:-.}"/configure; then
- G2CONF="--disable-schemas-compile ${G2CONF}"
- fi
-
- # Pass --enable-compile-warnings=minimum as we don't want -Werror* flags, bug #471336
- if grep -q "enable-compile-warnings" "${ECONF_SOURCE:-.}"/configure; then
- G2CONF="--enable-compile-warnings=minimum ${G2CONF}"
- fi
-
- # Pass --docdir with proper directory, bug #482646
- if grep -q "^ *--docdir=" "${ECONF_SOURCE:-.}"/configure; then
- G2CONF="--docdir="${EPREFIX}"/usr/share/doc/${PF} ${G2CONF}"
- fi
-
- # Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
- addwrite "$(unset HOME; echo ~)/.gnome2"
-
- econf ${G2CONF} "$@"
-}
-
-# @FUNCTION: gnome2_src_compile
-# @DESCRIPTION:
-# Stub function for old EAPI.
-gnome2_src_compile() {
- has ${EAPI:-0} 0 1 && gnome2_src_configure "$@"
- emake || die "compile failure"
-}
-
-# @FUNCTION: gnome2_src_install
-# @DESCRIPTION:
-# Gnome specific install. Handles typical GConf and scrollkeeper setup
-# in packages and removal of .la files if requested
-gnome2_src_install() {
- has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
- # if this is not present, scrollkeeper-update may segfault and
- # create bogus directories in /var/lib/
- local sk_tmp_dir="/var/lib/scrollkeeper"
- dodir "${sk_tmp_dir}" || die "dodir failed"
-
- # we must delay gconf schema installation due to sandbox
- export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL="1"
-
- if [[ -z "${USE_EINSTALL}" || "${USE_EINSTALL}" = "0" ]]; then
- debug-print "Installing with 'make install'"
- emake DESTDIR="${D}" "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" install || die "install failed"
- else
- debug-print "Installing with 'einstall'"
- einstall "scrollkeeper_localstate_dir=${ED}${sk_tmp_dir} " "$@" || die "einstall failed"
- fi
-
- unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
-
- # Handle documentation as 'default' for eapi5 and newer, bug #373131
- if has ${EAPI:-0} 0 1 2 3 4; then
- # Manual document installation
- if [[ -n "${DOCS}" ]]; then
- dodoc ${DOCS} || die "dodoc failed"
- fi
- else
- einstalldocs
- fi
-
- # Do not keep /var/lib/scrollkeeper because:
- # 1. The scrollkeeper database is regenerated at pkg_postinst()
- # 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
- # thus it makes no sense if pkg_postinst ISN'T run for some reason.
- rm -rf "${ED}${sk_tmp_dir}"
- rmdir "${ED}/var/lib" 2>/dev/null
- rmdir "${ED}/var" 2>/dev/null
-
- # Make sure this one doesn't get in the portage db
- rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
-
- # Delete all .la files
- if has ${EAPI:-0} 0 1 2 3 4; then
- if [[ "${GNOME2_LA_PUNT}" != "no" ]]; then
- ebegin "Removing .la files"
- if ! use_if_iuse static-libs ; then
- find "${D}" -name '*.la' -exec rm -f {} + || die "la file removal failed"
- fi
- eend
- fi
- else
- case "${GNOME2_LA_PUNT}" in
- yes) prune_libtool_files --modules;;
- no) ;;
- *) prune_libtool_files;;
- esac
- fi
-}
-
-# @FUNCTION: gnome2_pkg_preinst
-# @DESCRIPTION:
-# Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
-gnome2_pkg_preinst() {
- gnome2_gconf_savelist
- gnome2_icon_savelist
- gnome2_schemas_savelist
- gnome2_scrollkeeper_savelist
- gnome2_gdk_pixbuf_savelist
-}
-
-# @FUNCTION: gnome2_pkg_postinst
-# @DESCRIPTION:
-# Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
-# database updates.
-gnome2_pkg_postinst() {
- gnome2_gconf_install
- fdo-mime_desktop_database_update
- fdo-mime_mime_database_update
- gnome2_icon_cache_update
- gnome2_schemas_update
- gnome2_scrollkeeper_update
- gnome2_gdk_pixbuf_update
-
- # This should only be in the overlay
- ewarn "**************************************************************"
- ewarn "This is the *experimental* Gentoo GNOME Overlay"
- ewarn "Please report bugs at #gentoo-desktop @ FreeNode"
- ewarn "Do NOT go to upstream with bugs without checking with us first"
- ewarn "**************************************************************"
-}
-
-# # FIXME Handle GConf schemas removal
-#gnome2_pkg_prerm() {
-# gnome2_gconf_uninstall
-#}
-
-# @FUNCTION: gnome2_pkg_postrm
-# @DESCRIPTION:
-# Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
-gnome2_pkg_postrm() {
- fdo-mime_desktop_database_update
- fdo-mime_mime_database_update
- gnome2_icon_cache_update
- gnome2_schemas_update
- gnome2_scrollkeeper_update
-}
diff --git a/eclass/scm-git.eclass b/eclass/scm-git.eclass
deleted file mode 100644
index c027085..0000000
--- a/eclass/scm-git.eclass
+++ /dev/null
@@ -1,186 +0,0 @@
-# Copyright 2008 David Leverton <dleverton@exherbo.org>
-# Distributed under the terms of the GNU General Public License v2
-# Based in part upon git.exlib, which is:
-# Copyright 2008 Fernando J. Pereda
-# Based upon 'git.eclass' which is:
-# Copyright 1999-2007 Gentoo Foundation
-
-if [[ -z ${SCM_TYPE} ]]; then
- SCM_TYPE=git
- inherit scm
-fi
-
-scm-git_do_dependencies() {
- local git='>=dev-vcs/git-1.6.0'
- if [[ $(scm_get_var REPOSITORY) == https://* ]]; then
- echo "${git}$(scm_usedeps curl) net-misc/curl$(scm_usedeps ssl)"
- elif [[ $(scm_get_var REPOSITORY) == http://* || $(scm_get_var REPOSITORY) == ftp://* ]]; then
- echo "${git}$(scm_usedeps curl)"
- elif [[ $(scm_get_var REPOSITORY) == rsync://* ]]; then
- echo "${git} net-misc/rsync"
- elif [[ $(scm_get_var REPOSITORY) == ssh://* ]] ||
- [[ $(scm_get_var REPOSITORY) != *://* && $(scm_get_var REPOSITORY) == *:* ]]; then
- echo "${git} net-misc/openssh"
- else
- echo "${git}"
- fi
-
- if [[ -n $(scm_get_var TAG) ]]; then
- local keys
- scm_get_array GIT_TAG_SIGNING_KEYS keys
- [[ ${#keys[@]} -gt 0 ]] && echo app-crypt/gnupg
- fi
-}
-
-scm-git_do_check_vars() {
- [[ -n $(scm_get_var TAG) && -n $(scm_get_var REVISION) ]] \
- && die "for git, $(scm_var_name TAG) must not be set at the same time as $(scm_var_name REVISION)"
- [[ -z $(scm_get_var BRANCH) && -z $(scm_get_var REVISION) &&
- -z $(scm_get_var TAG) ]] && scm_set_var BRANCH master
- local rev=$(scm_get_var REVISION)
- [[ -n ${rev} ]] && [[ ${rev} == *[^0123456789abcdef]* || ${#rev} -ne 40 ]] \
- && die "for git, $(scm_var_name REVISION) must be a 40-character lowercase hexadecimal SHA-1 sum"
- [[ -n $(scm_get_var SUBPATH) ]] && die "for git, $(scm_var_name SUBPATH) must not be set"
-
- scm_modify_var REPOSITORY scm_trim_slashes -scheme -trailing
-}
-
-scm-git_git() {
- local echo=echo
- if [[ ${1} == -q ]]; then
- shift
- echo=:
- fi
-
- local need_git_dir=yes global=( )
- while [[ ${#} -gt 0 && ${1} == -* ]]; do
- global+=( "${1}" )
- [[ ${1} == --git-dir=* ]] && need_git_dir=
- shift
- done
- [[ ${1} != clone && -n ${need_git_dir} ]] && global+=( --git-dir="$(scm_get_var CHECKOUT_TO)" )
-
- ${echo} git "${global[@]}" "${@}"
- GIT_PAGER=cat git "${global[@]}" "${@}" || scm_die_unless_nonfatal "git ${1} failed"
-}
-
-scm-git_do_appraise() {
- local dir=$(scm_get_var CHECKOUT_TO)
-
- if ! scm_nonfatal scm-git_git -q rev-parse 2>/dev/null; then
- echo "${dir} is not a git checkout"
- return 3
- fi
-
- if [[ -n $(scm_get_var REVISION) ]]; then
- if [[ -z $(scm_nonfatal scm-git_git -q cat-file -t $(scm_get_var REVISION) 2>/dev/null) ]]; then
- echo "$(scm_get_var REVISION) is not present in ${dir}"
- return 1
- elif [[ $(scm-git_git -q cat-file -t $(scm_get_var REVISION)) == commit ]]; then
- if [[ -n $(scm_get_var BRANCH) ]] && ! scm-git_git -q rev-list "refs/heads/$(scm_get_var BRANCH)" \
- | grep -Fx $(scm_get_var REVISION) >/dev/null; then
- echo "revision $(scm_get_var REVISION) is not part of branch $(scm_get_var BRANCH) of ${dir}"
- return 1
- fi
- return 2
- else
- die "$(scm_get_var REVISION) is not a commit in ${dir}"
- fi
- fi
-
- local origin=$(scm-git_git -q config remote.origin.url)
- [[ -n ${origin} ]] || die "could not determine origin URL for ${dir}"
- if [[ ${origin} != $(scm_get_var REPOSITORY) ]]; then
- echo "${dir} is a clone of ${origin}, but wanted $(scm_get_var REPOSITORY)"
- return 1
- fi
-
- if [[ -n $(scm_get_var TAG) ]]; then
- if [[ -n $(scm-git_git -q for-each-ref "refs/tags/$(scm_get_var TAG)") ]]; then
- if [[ -n $(scm_get_var BRANCH) ]] && ! scm-git_git -q rev-list "refs/heads/$(scm_get_var BRANCH)" \
- | grep -Fx $(scm-git_git -q rev-parse "refs/tags/$(scm_get_var TAG)") >/dev/null; then
- echo "tag $(scm_get_var TAG) is not part of branch $(scm_get_var BRANCH) of ${dir}"
- return 1
- fi
-
- local keys
- scm_get_array GIT_TAG_SIGNING_KEYS keys
- if [[ ${#keys[@]} -gt 0 ]]; then
- local gpghome=$(mktemp -d -p "${T}" gpg-XXXXXX)
- [[ -n ${gpghome} ]] || die "mktemp failed"
-
- cat >"${gpghome}/gpg" <<-EOF
- #! /usr/bin/env bash
- $(HOME=${gpghome} declare -p HOME)
- $(gpg=$(type -P gpg); declare -p gpg)
- errors=\$("\${gpg}" --keyserver-options no-auto-key-retrieve "\${@}" 2>&1 >/dev/null) && exit
- status=\${?}
- echo "\${errors}" >&2
- exit \${status}
- EOF
- [[ ${?} -eq 0 ]] || die "create gpg wrapper failed"
- chmod +x "${gpghome}/gpg" || die "chmod +x gpg wrapper failed"
-
- PATH=${gpghome}:${PATH} gpg --import "${keys[@]}" || die "gpg --import ${keys[*]} failed"
- PATH=${gpghome}:${PATH} scm-git_git -q verify-tag "$(scm_get_var TAG)" >/dev/null
- fi
-
- return 2
- else
- echo "${dir} does not contain the tag $(scm_get_var TAG)"
- return 1
- fi
- fi
-
- if [[ -n $(scm_get_var BRANCH) && -z $(scm-git_git -q for-each-ref "refs/heads/$(scm_get_var BRANCH)") ]]; then
- echo "${dir} does not contain the branch $(scm_get_var BRANCH)"
- return 1
- fi
-
- return 0
-}
-
-scm-git_do_checkout() {
- scm-git_git clone --bare "$(scm_get_var REPOSITORY)" "$(scm_get_var CHECKOUT_TO)"
- scm-git_git config remote.origin.url "$(scm_get_var REPOSITORY)"
- scm-git_git gc --auto
-}
-
-scm-git_do_update() {
- local old_origin=$(scm-git_git -q config remote.origin.url)
- [[ -n ${old_origin} ]] || die "could not determine origin URL for $(scm_get_var CHECKOUT_TO)"
- if [[ ${old_origin} != $(scm_get_var REPOSITORY) ]]; then
- scm-git_git config remote.origin.url "$(scm_get_var REPOSITORY)"
- eval "$(scm-git_git -q for-each-ref --shell --format "scm-git_git update-ref -d %(refname)" refs/{heads,tags}/\*)"
- fi
-
- local branch=$(scm_get_var BRANCH)
- scm-git_git fetch -f -u origin "refs/heads/${branch:-*}:refs/heads/${branch:-*}"
- scm-git_git gc --auto
- [[ -n ${branch} ]] && scm_set_array FETCHED_BRANCHES "${branch}"
-}
-
-scm-git_do_revision() {
- scm-git_git -q rev-parse $(
- if [[ -n $(scm_get_var TAG) ]]; then
- echo refs/tags/$(scm_get_var TAG)
- elif [[ -n $(scm_get_var REVISION) ]]; then
- scm_get_var REVISION
- else
- echo refs/heads/$(scm_get_var BRANCH)
- fi)
-}
-
-scm-git_do_unpack() {
- scm-git_git clone -s -n "$(scm_get_var CHECKOUT_TO)" "$(scm_get_var UNPACK_TO)"
- scm-git_git --git-dir="$(scm_get_var UNPACK_TO)"/.git --work-tree="$(scm_get_var UNPACK_TO)" checkout -f $(
- if [[ -n $(scm_get_var TAG) ]]; then
- echo refs/tags/$(scm_get_var TAG)
- elif [[ -n $(scm_get_var REVISION) ]]; then
- scm_get_var REVISION
- else
- [[ -n $(scm-git_git -q --git-dir="$(scm_get_var UNPACK_TO)"/.git for-each-ref "refs/heads/$(scm_get_var BRANCH)") ]] \
- || echo -b $(scm_get_var BRANCH) refs/remotes/origin/$(scm_get_var BRANCH)
- fi) --
-}
-
diff --git a/eclass/scm.eclass b/eclass/scm.eclass
deleted file mode 100644
index a509d40..0000000
--- a/eclass/scm.eclass
+++ /dev/null
@@ -1,374 +0,0 @@
-# Copyright 2008 David Leverton <dleverton@exherbo.org>
-# Distributed under the terms of the GNU General Public License v2
-# Based in part upon subversion.eclass, which is:
-# Copyright 1999-2008 Gentoo Foundation
-
-scm_need_extglob() {
- [[ ${#} -eq 1 ]] || die "scm_need_extglob needs exactly one argument"
- [[ -n $(declare -F ${1}) ]] || die "${1} is not a function"
- eval "_scm_need_extglob_$(declare -f ${1})"
- eval "${1}() {
- local oldextglob=\$(shopt -p extglob)
- shopt -s extglob
- _scm_need_extglob_${1} \"\${@}\"
- local status=\${?}
- \${oldextglob}
- return \${status}
- }"
-}
-
-scm_usedeps() {
- [[ ${#} -ge 1 ]] || die "scm_usedeps needs at least one argument"
- local myeapi=$(echo ${EAPI/prefix})
- has ${myeapi:-0} 0 1 && return
- local IFS=,
- local deps="[${*}]"
- [[ ${myeapi:-0} == kdebuild-* ]] && deps=${deps//,/][}
- echo "${deps}"
-}
-
-scm_nonfatal() {
- SCM_NONFATAL=1 "${@}"
-}
-
-scm_die_unless_nonfatal() {
- [[ -z ${SCM_NONFATAL} ]] && die "${@}"
-}
-
-scm_for_each() {
- [[ ${#} -ge 1 ]] || die "scm_for_each needs at least one argument"
-
- [[ -z ${SCM_NO_PRIMARY_REPOSITORY} ]] && SCM_THIS= "${@}"
-
- local t active=true
- local -i level=0
- for t in ${SCM_SECONDARY_REPOSITORIES}; do
- if [[ ${t} == *\? ]]; then
- ${active} && ! use ${t%\?} && active=false
- elif [[ ${t} == \( ]]; then
- ${active} || (( level++ ))
- elif [[ ${t} == \) ]]; then
- if ! ${active}; then
- (( level-- ))
- [[ ${level} -eq 0 ]] && active=true
- fi
- else
- ${active} && SCM_THIS=${t} "${@}"
- fi
- done
-}
-
-scm_var_name() {
- [[ ${#} -eq 1 ]] || die "scm_var_name needs exactly one argument"
- echo SCM${SCM_THIS:+_${SCM_THIS}}_${1}
-}
-
-scm_get_var() {
- [[ ${#} -eq 1 ]] || die "scm_get_var needs exactly one argument"
- local var=$(scm_var_name ${1})
- echo "${!var}"
-}
-
-scm_set_var() {
- [[ ${#} -eq 2 ]] || die "scm_set_var needs exactly two arguments"
- printf -v $(scm_var_name ${1}) %s "${2}"
-}
-
-scm_modify_var() {
- [[ ${#} -ge 2 ]] || die "scm_modify_var needs at least two arguments"
- local var=${1}
- shift
- scm_set_var ${var} "$("${@}" "$(scm_get_var ${var})")"
-}
-
-scm_get_array() {
- [[ ${#} -eq 2 ]] || die "scm_get_array needs exactly two arguments"
- eval "${2}=( \"\${$(scm_var_name ${1})[@]}\" )"
-}
-
-scm_set_array() {
- [[ ${#} -ge 1 ]] || die "scm_set_array needs at least one argument"
- local name=${1}
- shift
- eval "$(scm_var_name ${name})=( \"\${@}\" )"
-}
-
-scm_call() {
- [[ ${#} -ge 1 ]] || die "scm_call needs at least one argument"
- local func=${1} type=$(scm_get_var TYPE)
- shift
- if [[ -n $(declare -F scm-${type}_do_${func}) ]]; then
- scm-${type}_do_${func} "${@}"
- elif [[ -n $(declare -F scm_do_${func}) ]]; then
- scm_do_${func} "${@}"
- else
- die "bug in scm-${type}.eclass: scm-${type}_do_${func} not defined"
- fi
-}
-
-scm_access_checkout() {
- [[ ${#} -ge 1 ]] || die "scm_access_checkout needs at least one argument"
- local dir=$(scm_get_var CHECKOUT_TO)
- local lock=${dir%/*}/.lock-${dir##*/}
-
- local dir_base=${dir%/*}
- if [[ ! -d ${dir_base} ]]; then
- local dir_addwrite=${dir_base}
- local dir_search=${dir_addwrite%/*}
- while [[ ! -d ${dir_search} ]]; do
- dir_addwrite=${dir_search}
- dir_search=${dir_search%/*}
- done
- (
- addwrite "${dir_addwrite}"
- mkdir -p "${dir_base}"
- ) || die "mkdir failed"
- fi
-
- local SANDBOX_WRITE=${SANDBOX_WRITE}
- addwrite "${dir}"
- addwrite "${lock}"
-
- local fd
- for fd in {3..9}; do
- [[ -e /dev/fd/${fd} ]] || break
- done
- [[ -e /dev/fd/${fd} ]] && die "can't find free file descriptor"
-
- eval "
- {
- flock -x \${fd} || die \"flock failed\"
- \"\${@}\"
- local status=\${?}
- :
- } ${fd}>\"\${lock}\" || die \"opening lock file failed\"
- "
-
- return ${status}
-}
-
-scm_do_resolve_externals() {
- :
-}
-
-scm_check_timestamp() {
- [[ -e ${1}/${2} && -n $(find "${1}" -maxdepth 1 -name "${2}" \
- -mmin -$((${SCM_MIN_UPDATE_DELAY} * 60)) -print) ]]
-}
-
-scm_perform_fetch() {
- local dir=$(scm_get_var CHECKOUT_TO)
-
- local whynot status
- if [[ -d ${dir} ]]; then
- whynot=$(scm_call appraise)
- status=${?}
- if [[ ${status} -eq 2 ]]; then
- einfo "Not fetching ${SCM_THIS:-primary repository} because the existing checkout is perfect"
- return
- fi
- else
- whynot="${dir} does not exist"
- status=1
- fi
-
- if [[ -n ${SCM_OFFLINE} ]]; then
- [[ ${status} -ne 0 ]] && die "can't use SCM_OFFLINE for ${SCM_THIS:-primary repository} because ${whynot}"
- einfo "Not fetching ${SCM_THIS:-primary repository} because SCM_OFFLINE is set"
- return
- fi
-
- if [[ -n ${SCM_MIN_UPDATE_DELAY} ]]; then
- [[ ${SCM_MIN_UPDATE_DELAY} == *[^0123456789]* || ${SCM_MIN_UPDATE_DELAY} -eq 0 ]] \
- && die "SCM_MIN_UPDATE_DELAY must be a positive integer"
- local branch=$(scm_get_var BRANCH)
- if scm_check_timestamp "${dir}" .scm.eclass.timestamp ||
- { [[ -n ${branch} ]] && scm_check_timestamp "${dir}" .scm.eclass.timestamp."${branch//\//--}"; }; then
- if [[ ${status} -eq 0 ]]; then
- einfo "Not fetching ${SCM_THIS:-primary repository} because SCM_MIN_UPDATE_DELAY (${SCM_MIN_UPDATE_DELAY}) hours have not passed"
- return
- else
- einfo "Ignoring SCM_MIN_UPDATE_DELAY for ${SCM_THIS:-primary repository} because ${whynot}"
- fi
- fi
- fi
-
- if [[ ${status} -eq 3 ]]; then
- echo rm -rf "${dir}"
- rm -rf "${dir}"
- [[ -d ${dir} ]] && die "rm failed"
- fi
-
- if [[ -d ${dir} ]]; then
- scm_call update
- else
- scm_call checkout
- fi
-
- if [[ -d ${dir} ]]; then
- whynot=$(scm_call appraise)
- [[ ${?} -eq 1 || ${?} -eq 3 ]] && die "${whynot}"
- else
- die "${dir} does not exist"
- fi
-
- local fetched
- scm_get_array FETCHED_BRANCHES fetched
- if [[ ${#fetched[@]} -gt 0 ]]; then
- fetched=( "${fetched[@]//\//--}" )
- touch "${fetched[@]/#/${dir}/.scm.eclass.timestamp.}" || die "touch failed"
- else
- touch "${dir}/.scm.eclass.timestamp" || die "touch failed"
- fi
-}
-
-scm_fetch_one() {
- scm_perform_fetch
- scm_call resolve_externals
-}
-
-scm_src_fetch_extra() {
- scm_{for_each,access_checkout,fetch_one}
-}
-
-scm_scmrevision_one() {
- local rev=$(scm_call revision)
- [[ -n ${rev} ]] || die "could not determine revision for ${SCM_THIS:-primary repository}"
- SCM_PKG_SCM_REVISION_RESULT+=,${SCM_THIS}=${rev}
-}
-
-scm_pkg_scm_revision() {
- local SCM_PKG_SCM_REVISION_RESULT=
- scm_{for_each,access_checkout,scmrevision_one}
- echo ${SCM_PKG_SCM_REVISION_RESULT#,=}
-}
-
-scm_do_unpack() {
- echo cp -pPR "$(scm_get_var CHECKOUT_TO)" "$(scm_get_var UNPACK_TO)"
- cp -pPR "$(scm_get_var CHECKOUT_TO)" "$(scm_get_var UNPACK_TO)" || die "cp failed"
-}
-
-scm_do_set_actual_vars() {
- local rev=$(scm_call revision)
- [[ -n ${rev} ]] || die "could not determine revision for ${SCM_THIS:-primary repository}"
- scm_set_var ACTUAL_REVISION "${rev}"
-}
-
-scm_unpack_one() {
- scm_call resolve_externals
-
- local whynot
- if [[ -d $(scm_get_var CHECKOUT_TO) ]]; then
- whynot=$(scm_call appraise)
- [[ ${?} -eq 1 || ${?} -eq 3 ]] && die "${whynot}"
- else
- die "$(scm_get_var CHECKOUT_TO) does not exist"
- fi
-
- local dir=$(scm_get_var UNPACK_TO)
- if [[ -d ${dir} ]]; then
- rmdir "${dir}" || die "rmdir failed"
- else
- mkdir -p "${dir%/*}" || die mkdir "failed"
- fi
-
- scm_call unpack
- rm -f "${dir}/.scm.eclass.timestamp"{,.*}
- scm_call set_actual_vars
-}
-
-scm_src_unpack() {
- scm_src_fetch_extra
-
- scm_{for_each,access_checkout,unpack_one}
- SCM_IS_BUILT=1
-}
-
-scm_do_info() {
- :
-}
-
-scm_pkg_info() {
- [[ -n ${SCM_IS_BUILT} ]] && scm_{for_each,call} info
-}
-
-scm_trim_slashes() {
- local scheme= leading= trailing=
- while [[ ${#} -gt 0 && ${1} == -* ]]; do
- case ${1} in
- -scheme) scheme=1 ;;
- -leading) leading=1 ;;
- -trailing) trailing=1 ;;
- *) die "scm_trim_slashes: unrecognised switch ${1}"
- esac
- shift
- done
-
- [[ ${#} -eq 1 ]] || die "scm_trim_slashes needs exactly one argument besides switches"
- local value=${1}
-
- local myscheme=
- if [[ -n ${scheme} && ${value} == *://* ]]; then
- myscheme=${value%%://*}://
- value=${value#*://}
- fi
-
- value=${value//+(\/)/\/}
- [[ -n ${leading} ]] && value=${value#/}
- [[ -n ${trailing} ]] && value=${value%/}
-
- echo "${myscheme}${value}"
-}
-scm_need_extglob scm_trim_slashes
-
-scm_do_check_vars() {
- :
-}
-
-scm_global_stuff() {
- if [[ -z $(scm_get_var TYPE) ]]; then
- if [[ -n ${SCM_THIS} ]]; then
- scm_set_var TYPE ${SCM_TYPE}
- else
- die "$(scm_var_name TYPE) must be set"
- fi
- fi
- inherit scm-$(scm_get_var TYPE)
-
- [[ -z $(scm_get_var REPOSITORY) ]] \
- && die "$(scm_var_name REPOSITORY) must be set"
-
- local checkout_to=$(scm_get_var CHECKOUT_TO)
- [[ -z ${checkout_to} ]] && checkout_to=${SCM_THIS:-${PN}}
- [[ ${checkout_to} == /* ]] || checkout_to=${SCM_HOME}/${checkout_to}
- scm_set_var CHECKOUT_TO "$(scm_trim_slashes -trailing "${checkout_to}")"
-
- local unpack_to=$(scm_get_var UNPACK_TO)
- [[ -z ${unpack_to} ]] && unpack_to=${WORKDIR}/${SCM_THIS:-${P}}
- scm_set_var UNPACK_TO "$(scm_trim_slashes -trailing "${unpack_to}")"
-
- scm_call check_vars
-
- DEPEND+=" $(scm_call dependencies)"
-}
-
-SCM_HOME=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/scm
-scm_finalise() {
- DEPEND+=" >=sys-apps/util-linux-2.13_pre2"
-
- [[ -z ${SCM_NO_PRIMARY_REPOSITORY} ]] && SCM_THIS= scm_global_stuff
-
- local t
- for t in ${SCM_SECONDARY_REPOSITORIES}; do
- if [[ ${t} == *\? || ${t} == \( || ${t} == \) ]]; then
- DEPEND+=" ${t}"
- else
- SCM_THIS=${t} scm_global_stuff
- fi
- done
-}
-[[ -z ${SCM_NO_AUTOMATIC_FINALISE} ]] && scm_finalise
-
-#EXPORT_FUNCTIONS src_fetch_extra pkg_scm_revision src_unpack pkg_info
-EXPORT_FUNCTIONS src_unpack pkg_info
-
diff --git a/eclass/vala.eclass b/eclass/vala.eclass
deleted file mode 100644
index 49c9e36..0000000
--- a/eclass/vala.eclass
+++ /dev/null
@@ -1,149 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-# @ECLASS: vala.eclass
-# @MAINTAINER:
-# gnome@gentoo.org
-# @AUTHOR:
-# Alexandre Rostovtsev <tetromino@gentoo.org>
-# @BLURB: Sets up the environment for using a specific version of vala.
-# @DESCRIPTION:
-# This eclass sets up commonly used environment variables for using a specific
-# version of dev-lang/vala to configure and build a package. It is needed for
-# packages whose build systems assume the existence of certain unversioned vala
-# executables, pkgconfig files, etc., which Gentoo does not provide.
-#
-# This eclass provides one phase function: src_prepare.
-
-inherit eutils multilib
-
-case "${EAPI:-0}" in
- 0) die "EAPI=0 is not supported" ;;
- 1) ;;
- *) EXPORT_FUNCTIONS src_prepare ;;
-esac
-
-# @ECLASS-VARIABLE: VALA_MIN_API_VERSION
-# @DESCRIPTION:
-# Minimum vala API version (e.g. 0.20).
-VALA_MIN_API_VERSION=${VALA_MIN_API_VERSION:-0.20}
-
-# @ECLASS-VARIABLE: VALA_MAX_API_VERSION
-# @DESCRIPTION:
-# Maximum vala API version (e.g. 0.26).
-VALA_MAX_API_VERSION=${VALA_MAX_API_VERSION:-0.26}
-
-# @ECLASS-VARIABLE: VALA_USE_DEPEND
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# USE dependencies that vala must be built with (e.g. vapigen).
-
-# @FUNCTION: vala_api_versions
-# @DESCRIPTION:
-# Outputs a list of vala API versions from VALA_MAX_API_VERSION down to
-# VALA_MIN_API_VERSION.
-vala_api_versions() {
- [[ ${VALA_MIN_API_VERSION} =~ ^0\.[[:digit:]]+$ ]] || die "Invalid syntax of VALA_MIN_API_VERSION"
- [[ ${VALA_MAX_API_VERSION} =~ ^0\.[[:digit:]]+$ ]] || die "Invalid syntax of VALA_MAX_API_VERSION"
-
- local minimal_supported_minor_version minor_version
-
- # Dependency atoms are not generated for Vala versions older than 0.${minimal_supported_minor_version}.
- minimal_supported_minor_version="20"
-
- for ((minor_version = ${VALA_MAX_API_VERSION#*.}; minor_version >= ${VALA_MIN_API_VERSION#*.}; minor_version = minor_version - 2)); do
- if ((minor_version >= minimal_supported_minor_version)); then
- echo "0.${minor_version}"
- fi
- done
-}
-
-# @FUNCTION: vala_depend
-# @DESCRIPTION:
-# Outputs a ||-dependency string on vala from VALA_MAX_API_VERSION down to
-# VALA_MIN_API_VERSION
-vala_depend() {
- local u v versions=$(vala_api_versions)
- [[ ${VALA_USE_DEPEND} ]] && u="[${VALA_USE_DEPEND}(+)]"
-
- echo -n "|| ("
- for v in ${versions}; do
- echo -n " dev-lang/vala:${v}${u}"
- done
- echo " )"
-}
-
-# @FUNCTION: vala_best_api_version
-# @DESCRIPTION:
-# Returns the highest installed vala API version satisfying
-# VALA_MAX_API_VERSION, VALA_MIN_API_VERSION, and VALA_USE_DEPEND.
-vala_best_api_version() {
- local u v
- [[ ${VALA_USE_DEPEND} ]] && u="[${VALA_USE_DEPEND}(+)]"
- for v in $(vala_api_versions); do
- has_version "dev-lang/vala:${v}${u}" && echo "${v}" && return
- done
-}
-
-# @FUNCTION: vala_src_prepare
-# @USAGE: [--ignore-use] [--vala-api-version api_version]
-# @DESCRIPTION:
-# Sets up the environment variables and pkgconfig files for the
-# specified API version, or, if no version is specified, for the
-# highest installed vala API version satisfying
-# VALA_MAX_API_VERSION, VALA_MIN_API_VERSION, and VALA_USE_DEPEND.
-# Is a no-op if called without --ignore-use when USE=-vala.
-# Dies if the USE check is passed (or ignored) and a suitable vala
-# version is not available.
-vala_src_prepare() {
- local p d valafoo version ignore_use
-
- while [[ $1 ]]; do
- case $1 in
- "--ignore-use" )
- ignore_use=1 ;;
- "--vala-api-version" )
- shift
- version=$1
- [[ ${version} ]] || die "'--vala-api-version' option requires API version parameter."
- esac
- shift
- done
-
- if [[ -z ${ignore_use} ]]; then
- in_iuse vala && ! use vala && return 0
- fi
-
- if [[ ${version} ]]; then
- has_version "dev-lang/vala:${version}" || die "No installed vala:${version}"
- else
- version=$(vala_best_api_version)
- [[ ${version} ]] || die "No installed vala in $(vala_depend)"
- fi
-
- export VALAC=$(type -P valac-${version})
-
- valafoo=$(type -P vala-gen-introspect-${version})
- [[ ${valafoo} ]] && export VALA_GEN_INTROSPECT="${valafoo}"
-
- valafoo=$(type -P vapigen-${version})
- [[ ${valafoo} ]] && export VAPIGEN="${valafoo}"
-
- valafoo="${EPREFIX}/usr/share/vala/Makefile.vapigen"
- [[ -e ${valafoo} ]] && export VAPIGEN_MAKEFILE="${valafoo}"
-
- export VAPIGEN_VAPIDIR="${EPREFIX}/usr/share/vala/vapi"
-
- mkdir -p "${T}/pkgconfig" || die "mkdir failed"
- for p in libvala vapigen; do
- for d in "${EPREFIX}/usr/$(get_libdir)/pkgconfig" "${EPREFIX}/usr/share/pkgconfig"; do
- if [[ -e ${d}/${p}-${version}.pc ]]; then
- ln -s "${d}/${p}-${version}.pc" "${T}/pkgconfig/${p}.pc" || die "ln failed"
- break
- fi
- done
- done
- : ${PKG_CONFIG_PATH:="${EPREFIX}/usr/$(get_libdir)/pkgconfig:${EPREFIX}/usr/share/pkgconfig"}
- export PKG_CONFIG_PATH="${T}/pkgconfig:${PKG_CONFIG_PATH}"
-}
diff --git a/profiles/eapi b/profiles/eapi
index 7ed6ff8..1e8b314 100644
--- a/profiles/eapi
+++ b/profiles/eapi
@@ -1 +1 @@
-5
+6
diff --git a/x11-base/xorg-drivers/xorg-drivers-9999.ebuild b/x11-base/xorg-drivers/xorg-drivers-9999.ebuild
new file mode 100644
index 0000000..61d4881
--- /dev/null
+++ b/x11-base/xorg-drivers/xorg-drivers-9999.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Meta package containing deps on all xorg drivers"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS=""
+
+IUSE_INPUT_DEVICES="
+ input_devices_acecad
+ input_devices_aiptek
+ input_devices_elographics
+ input_devices_evdev
+ input_devices_fpit
+ input_devices_hyperpen
+ input_devices_joystick
+ input_devices_keyboard
+ input_devices_libinput
+ input_devices_mouse
+ input_devices_mutouch
+ input_devices_penmount
+ input_devices_tslib
+ input_devices_vmmouse
+ input_devices_void
+ input_devices_synaptics
+ input_devices_wacom
+"
+IUSE_VIDEO_CARDS="
+ video_cards_amdgpu
+ video_cards_apm
+ video_cards_ast
+ video_cards_chips
+ video_cards_cirrus
+ video_cards_dummy
+ video_cards_epson
+ video_cards_fbdev
+ video_cards_freedreno
+ video_cards_geode
+ video_cards_glint
+ video_cards_i128
+ video_cards_i740
+ video_cards_intel
+ video_cards_mach64
+ video_cards_mga
+ video_cards_neomagic
+ video_cards_nouveau
+ video_cards_nv
+ video_cards_omap
+ video_cards_omapfb
+ video_cards_qxl
+ video_cards_r128
+ video_cards_radeon
+ video_cards_radeonsi
+ video_cards_rendition
+ video_cards_s3
+ video_cards_s3virge
+ video_cards_savage
+ video_cards_siliconmotion
+ video_cards_sisusb
+ video_cards_sunbw2
+ video_cards_suncg14
+ video_cards_suncg3
+ video_cards_suncg6
+ video_cards_sunffb
+ video_cards_sunleo
+ video_cards_suntcx
+ video_cards_tdfx
+ video_cards_tegra
+ video_cards_tga
+ video_cards_trident
+ video_cards_tseng
+ video_cards_vesa
+ video_cards_via
+ video_cards_virtualbox
+ video_cards_vmware
+ video_cards_voodoo
+ video_cards_fglrx
+ video_cards_nvidia
+"
+
+IUSE="${IUSE_VIDEO_CARDS} ${IUSE_INPUT_DEVICES}"
+
+PDEPEND="
+ input_devices_acecad? ( x11-drivers/xf86-input-acecad )
+ input_devices_aiptek? ( x11-drivers/xf86-input-aiptek )
+ input_devices_elographics? ( x11-drivers/xf86-input-elographics )
+ input_devices_evdev? ( x11-drivers/xf86-input-evdev )
+ input_devices_fpit? ( x11-drivers/xf86-input-fpit )
+ input_devices_hyperpen? ( x11-drivers/xf86-input-hyperpen )
+ input_devices_joystick? ( x11-drivers/xf86-input-joystick )
+ input_devices_keyboard? ( x11-drivers/xf86-input-keyboard )
+ input_devices_libinput? ( x11-drivers/xf86-input-libinput )
+ input_devices_mouse? ( x11-drivers/xf86-input-mouse )
+ input_devices_mutouch? ( x11-drivers/xf86-input-mutouch )
+ input_devices_penmount? ( x11-drivers/xf86-input-penmount )
+ input_devices_tslib? ( x11-drivers/xf86-input-tslib )
+ input_devices_vmmouse? ( x11-drivers/xf86-input-vmmouse )
+ input_devices_void? ( x11-drivers/xf86-input-void )
+ input_devices_synaptics? ( x11-drivers/xf86-input-synaptics )
+ input_devices_wacom? ( x11-drivers/xf86-input-wacom )
+
+ video_cards_amdgpu? ( x11-drivers/xf86-video-amdgpu )
+ video_cards_apm? ( x11-drivers/xf86-video-apm )
+ video_cards_ast? ( x11-drivers/xf86-video-ast )
+ video_cards_chips? ( x11-drivers/xf86-video-chips )
+ video_cards_cirrus? ( x11-drivers/xf86-video-cirrus )
+ video_cards_dummy? ( x11-drivers/xf86-video-dummy )
+ video_cards_fbdev? ( x11-drivers/xf86-video-fbdev )
+ video_cards_freedreno? ( x11-drivers/xf86-video-freedreno )
+ video_cards_geode? ( x11-drivers/xf86-video-geode )
+ video_cards_glint? ( x11-drivers/xf86-video-glint )
+ video_cards_i128? ( x11-drivers/xf86-video-i128 )
+ video_cards_i740? ( x11-drivers/xf86-video-i740 )
+ video_cards_intel? ( x11-drivers/xf86-video-intel )
+ video_cards_mach64? ( x11-drivers/xf86-video-mach64 )
+ video_cards_mga? ( x11-drivers/xf86-video-mga )
+ video_cards_neomagic? ( x11-drivers/xf86-video-neomagic )
+ video_cards_nouveau? ( x11-drivers/xf86-video-nouveau )
+ video_cards_nv? ( x11-drivers/xf86-video-nv )
+ video_cards_omap? ( x11-drivers/xf86-video-omap )
+ video_cards_omapfb? ( x11-drivers/xf86-video-omapfb )
+ video_cards_qxl? ( x11-drivers/xf86-video-qxl )
+ video_cards_nvidia? ( x11-drivers/nvidia-drivers )
+ video_cards_fglrx? ( x11-drivers/ati-drivers )
+ video_cards_r128? ( x11-drivers/xf86-video-r128 )
+ video_cards_radeon? ( x11-drivers/xf86-video-ati )
+ video_cards_radeonsi? ( x11-drivers/xf86-video-ati[glamor] )
+ video_cards_rendition? ( x11-drivers/xf86-video-rendition )
+ video_cards_s3? ( x11-drivers/xf86-video-s3 )
+ video_cards_s3virge? ( x11-drivers/xf86-video-s3virge )
+ video_cards_savage? ( x11-drivers/xf86-video-savage )
+ video_cards_siliconmotion? ( x11-drivers/xf86-video-siliconmotion )
+ video_cards_sisusb? ( x11-drivers/xf86-video-sisusb )
+ video_cards_suncg14? ( x11-drivers/xf86-video-suncg14 )
+ video_cards_suncg3? ( x11-drivers/xf86-video-suncg3 )
+ video_cards_suncg6? ( x11-drivers/xf86-video-suncg6 )
+ video_cards_sunffb? ( x11-drivers/xf86-video-sunffb )
+ video_cards_sunleo? ( x11-drivers/xf86-video-sunleo )
+ video_cards_suntcx? ( x11-drivers/xf86-video-suntcx )
+ video_cards_tdfx? ( x11-drivers/xf86-video-tdfx )
+ video_cards_tegra? ( x11-drivers/xf86-video-opentegra )
+ video_cards_tga? ( x11-drivers/xf86-video-tga )
+ video_cards_trident? ( x11-drivers/xf86-video-trident )
+ video_cards_tseng? ( x11-drivers/xf86-video-tseng )
+ video_cards_vesa? ( x11-drivers/xf86-video-vesa )
+ video_cards_via? ( x11-drivers/xf86-video-openchrome )
+ video_cards_virtualbox? ( x11-drivers/xf86-video-virtualbox )
+ video_cards_vmware? ( x11-drivers/xf86-video-vmware )
+ video_cards_voodoo? ( x11-drivers/xf86-video-voodoo )
+
+ !x11-drivers/xf86-input-citron
+ !x11-drivers/xf86-video-cyrix
+ !x11-drivers/xf86-video-impact
+ !x11-drivers/xf86-video-nsc
+ !x11-drivers/xf86-video-sunbw2
+ !<=x11-drivers/xf86-video-ark-0.7.5
+ !<=x11-drivers/xf86-video-newport-0.2.4
+ !<=x11-drivers/xf86-video-sis-0.10.7
+ !<=x11-drivers/xf86-video-v4l-0.2.0
+ !<x11-drivers/xf86-input-evdev-2.10.0
+ !<x11-drivers/xf86-video-ati-7.6.1
+ !<x11-drivers/xf86-video-intel-2.99.917_p20160122
+ !<x11-drivers/xf86-video-nouveau-1.0.12
+"
diff --git a/x11-base/xorg-server/files/xdm-setup.initd-1 b/x11-base/xorg-server/files/xdm-setup.initd-1
new file mode 100644
index 0000000..917cd12
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm-setup.initd-1
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need localmount
+}
+
+start() {
+ if get_bootparam "nox" ; then
+ touch /etc/.noxdm
+ fi
+}
diff --git a/x11-base/xorg-server/files/xdm.confd-4 b/x11-base/xorg-server/files/xdm.confd-4
new file mode 100644
index 0000000..c82fece
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.confd-4
@@ -0,0 +1,10 @@
+# We always try and start X on a static VT. The various DMs normally default
+# to using VT7. If you wish to use the xdm init script, then you should ensure
+# that the VT checked is the same VT your DM wants to use. We do this check to
+# ensure that you haven't accidentally configured something to run on the VT
+# in your /etc/inittab file so that you don't get a dead keyboard.
+CHECKVT=7
+
+# What display manager do you use ? [ xdm | gdm | kdm | gpe | entrance ]
+# NOTE: If this is set in /etc/rc.conf, that setting will override this one.
+DISPLAYMANAGER="xdm"
diff --git a/x11-base/xorg-server/files/xdm.initd-11 b/x11-base/xorg-server/files/xdm.initd-11
new file mode 100644
index 0000000..70b81c0
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.initd-11
@@ -0,0 +1,231 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Id$
+
+# 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
+ # (#390609) gdm-3 will fail when dbus is not running
+ # (#366753) starting keymaps after X causes problems
+ after bootmisc consolefont modules netmount
+ after readahead-list ypbind autofs openvpn gpm lircmd
+ after quota keymaps
+ before alsasound
+
+ # Start before X
+ use consolekit dbus 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=/usr/bin/kdm
+ PIDFILE=/run/kdm.pid
+ ;;
+ entrance*)
+ EXE=/usr/sbin/entrance
+ PIDFILE=/run/entrance.pid
+ ;;
+ gdm|gnome)
+ # gdm-3 and above has different paths
+ if [ -f /usr/sbin/gdm ]; then
+ EXE=/usr/sbin/gdm
+ PIDFILE=/run/gdm/gdm.pid
+ START_STOP_ARGS="--background"
+ AUTOCLEAN_CGROUP="yes"
+ else
+ EXE=/usr/bin/gdm
+ PIDFILE=/run/gdm.pid
+ fi
+ [ "${RC_UNAME}" != "Linux" ] && NAME=gdm-binary
+ ;;
+ wdm)
+ EXE=/usr/bin/wdm
+ PIDFILE=
+ ;;
+ gpe)
+ EXE=/usr/bin/gpe-dm
+ PIDFILE=/run/gpe-dm.pid
+ ;;
+ lxdm)
+ EXE=/usr/sbin/lxdm-binary
+ PIDFILE=/run/lxdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ lightdm)
+ EXE=/usr/sbin/lightdm
+ PIDFILE=/run/lightdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ sddm)
+ EXE="/usr/bin/sddm"
+ START_STOP_ARGS="-m --background"
+ PIDFILE=/run/sddm.pid
+ ;;
+ *)
+ # first find out if there is such executable
+ EXE="$(command -v ${MY_XDM} 2>/dev/null)"
+ PIDFILE="/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=/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 AUTOCLEAN_CGROUP
+ 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}"
+ save_options "start_stop_args" "${START_STOP_ARGS}"
+ save_options "autoclean_cgroup" "${AUTOCLEAN_CGROUP:-no}"
+
+ 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##*/}
+ yesno "${rc_cgroup_cleanup:-no}" || rc_cgroup_cleanup=$(get_options "autoclean_cgroup")
+
+ [ -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/xdm.initd-9 b/x11-base/xorg-server/files/xdm.initd-9
new file mode 100644
index 0000000..11b4f19
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.initd-9
@@ -0,0 +1,216 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Id$
+
+# 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
+ # (#390609) gdm-3 will fail when dbus is not running
+ # (#366753) starting keymaps after X causes problems
+ after bootmisc consolefont modules netmount
+ after readahead-list ypbind autofs openvpn gpm lircmd
+ after quota keymaps
+ before alsasound
+
+ # Start before X
+ use consolekit dbus 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=/usr/bin/kdm
+ PIDFILE=/var/run/kdm.pid
+ ;;
+ entrance*)
+ EXE=/usr/sbin/entrance
+ PIDFILE=/var/run/entrance.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
+ ;;
+ lxdm)
+ EXE=/usr/sbin/lxdm-binary
+ PIDFILE=/var/run/lxdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ lightdm)
+ EXE=/usr/sbin/lightdm
+ PIDFILE=/var/run/lightdm.pid
+ START_STOP_ARGS="--background"
+ ;;
+ *)
+ # first find out if there is such executable
+ EXE="$(command -v ${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}"
+ save_options "start_stop_args" "${START_STOP_ARGS}"
+
+ 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.12-cve-2013-1940.patch b/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-1940.patch
new file mode 100644
index 0000000..d85494f
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-1940.patch
@@ -0,0 +1,34 @@
+From 6ca03b9161d33b1d2b55a3a1a913cf88deb2343f Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@gmail.com>
+Date: Wed, 10 Apr 2013 06:09:01 +0000
+Subject: xf86: fix flush input to work with Linux evdev devices.
+
+So when we VT switch back and attempt to flush the input devices,
+we don't succeed because evdev won't return part of an event,
+since we were only asking for 4 bytes, we'd only get -EINVAL back.
+
+This could later cause events to be flushed that we shouldn't have
+gotten.
+
+This is a fix for CVE-2013-1940.
+
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
+index ab3757a..4d08c1e 100644
+--- a/hw/xfree86/os-support/shared/posix_tty.c
++++ b/hw/xfree86/os-support/shared/posix_tty.c
+@@ -421,7 +421,8 @@ xf86FlushInput(int fd)
+ {
+ fd_set fds;
+ struct timeval timeout;
+- char c[4];
++ /* this needs to be big enough to flush an evdev event. */
++ char c[256];
+
+ DebugF("FlushingSerial\n");
+ if (tcflush(fd, TCIFLUSH) == 0)
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch b/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch
new file mode 100644
index 0000000..4b6727e
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-cve-2013-4396.patch
@@ -0,0 +1,75 @@
+From 7bddc2ba16a2a15773c2ea8947059afa27727764 Mon Sep 17 00:00:00 2001
+From: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Mon, 16 Sep 2013 21:47:16 -0700
+Subject: [PATCH] Avoid use-after-free in dix/dixfonts.c: doImageText()
+ [CVE-2013-4396]
+
+Save a pointer to the passed in closure structure before copying it
+and overwriting the *c pointer to point to our copy instead of the
+original. If we hit an error, once we free(c), reset c to point to
+the original structure before jumping to the cleanup code that
+references *c.
+
+Since one of the errors being checked for is whether the server was
+able to malloc(c->nChars * itemSize), the client can potentially pass
+a number of characters chosen to cause the malloc to fail and the
+error path to be taken, resulting in the read from freed memory.
+
+Since the memory is accessed almost immediately afterwards, and the
+X server is mostly single threaded, the odds of the free memory having
+invalid contents are low with most malloc implementations when not using
+memory debugging features, but some allocators will definitely overwrite
+the memory there, leading to a likely crash.
+
+Reported-by: Pedro Ribeiro <pedrib@gmail.com>
+Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Reviewed-by: Julien Cristau <jcristau@debian.org>
+---
+ dix/dixfonts.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/dix/dixfonts.c b/dix/dixfonts.c
+index feb765d..2e34d37 100644
+--- a/dix/dixfonts.c
++++ b/dix/dixfonts.c
+@@ -1425,6 +1425,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ GC *pGC;
+ unsigned char *data;
+ ITclosurePtr new_closure;
++ ITclosurePtr old_closure;
+
+ /* We're putting the client to sleep. We need to
+ save some state. Similar problem to that handled
+@@ -1436,12 +1437,14 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ err = BadAlloc;
+ goto bail;
+ }
++ old_closure = c;
+ *new_closure = *c;
+ c = new_closure;
+
+ data = malloc(c->nChars * itemSize);
+ if (!data) {
+ free(c);
++ c = old_closure;
+ err = BadAlloc;
+ goto bail;
+ }
+@@ -1452,6 +1455,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ if (!pGC) {
+ free(c->data);
+ free(c);
++ c = old_closure;
+ err = BadAlloc;
+ goto bail;
+ }
+@@ -1464,6 +1468,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
+ FreeScratchGC(pGC);
+ free(c->data);
+ free(c);
++ c = old_closure;
+ err = BadAlloc;
+ goto bail;
+ }
+--
+1.7.9.2
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-cve-2015-3418.patch b/x11-base/xorg-server/files/xorg-server-1.12-cve-2015-3418.patch
new file mode 100644
index 0000000..4b6a6ae
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-cve-2015-3418.patch
@@ -0,0 +1,29 @@
+From dc777c346d5d452a53b13b917c45f6a1bad2f20b Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp@keithp.com>
+Date: Sat, 3 Jan 2015 08:46:45 -0800
+Subject: dix: Allow zero-height PutImage requests
+
+The length checking code validates PutImage height and byte width by
+making sure that byte-width >= INT32_MAX / height. If height is zero,
+this generates a divide by zero exception. Allow zero height requests
+explicitly, bypassing the INT32_MAX check.
+
+Signed-off-by: Keith Packard <keithp@keithp.com>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+diff --git a/dix/dispatch.c b/dix/dispatch.c
+index 55b978d..9044ac7 100644
+--- a/dix/dispatch.c
++++ b/dix/dispatch.c
+@@ -2000,7 +2000,7 @@ ProcPutImage(ClientPtr client)
+ tmpImage = (char *) &stuff[1];
+ lengthProto = length;
+
+- if (lengthProto >= (INT32_MAX / stuff->height))
++ if (stuff->height != 0 && lengthProto >= (INT32_MAX / stuff->height))
+ return BadLength;
+
+ if ((bytes_to_int32(lengthProto * stuff->height) +
+--
+cgit v0.10.2
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch b/x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch
new file mode 100644
index 0000000..df43dbd
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-disable-acpi.patch
@@ -0,0 +1,11 @@
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac 2011-10-31 19:40:02.000000000 +0100
++++ b/configure.ac 2011-10-31 19:41:02.372745481 +0100
+@@ -1624,7 +1624,6 @@
+ linux_alpha=yes
+ ;;
+ i*86|amd64*|x86_64*|ia64*)
+- linux_acpi="yes"
+ ;;
+ *)
+ ;;
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch b/x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch
new file mode 100644
index 0000000..24a5a02
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-ia64-fix_inx_outx.patch
@@ -0,0 +1,60 @@
+diff -r --context xorg-server-1.12.3/hw/xfree86/common/compiler.h xorg-server-1.12.3-fix/hw/xfree86/common/compiler.h
+*** xorg-server-1.12.3/hw/xfree86/common/compiler.h 2012-07-06 07:17:19.000000000 +0200
+--- xorg-server-1.12.3-fix/hw/xfree86/common/compiler.h 2012-08-29 00:14:39.000000000 +0200
+***************
+*** 421,426 ****
+--- 421,474 ----
+ #include <machine/pio.h>
+ #endif /* __NetBSD__ */
+
++ #elif defined(linux) && defined(__ia64__)
++ /* for Linux on ia64, we use the LIBC _inx/_outx routines */
++ /* note that the appropriate setup via "ioperm" needs to be done */
++ /* *before* any inx/outx is done. */
++
++ extern _X_EXPORT void _outb(unsigned char val, unsigned long port);
++ extern _X_EXPORT void _outw(unsigned short val, unsigned long port);
++ extern _X_EXPORT void _outl(unsigned int val, unsigned long port);
++ extern _X_EXPORT unsigned int _inb(unsigned long port);
++ extern _X_EXPORT unsigned int _inw(unsigned long port);
++ extern _X_EXPORT unsigned int _inl(unsigned long port);
++
++ static __inline__ void
++ outb(unsigned long port, unsigned char val)
++ {
++ _outb(val, port);
++ }
++
++ static __inline__ void
++ outw(unsigned long port, unsigned short val)
++ {
++ _outw(val, port);
++ }
++
++ static __inline__ void
++ outl(unsigned long port, unsigned int val)
++ {
++ _outl(val, port);
++ }
++
++ static __inline__ unsigned int
++ inb(unsigned long port)
++ {
++ return _inb(port);
++ }
++
++ static __inline__ unsigned int
++ inw(unsigned long port)
++ {
++ return _inw(port);
++ }
++
++ static __inline__ unsigned int
++ inl(unsigned long port)
++ {
++ return _inl(port);
++ }
++
+ #elif (defined(linux) || defined(__FreeBSD__)) && defined(__amd64__)
+
+ #include <inttypes.h>
diff --git a/x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch b/x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch
new file mode 100644
index 0000000..57c7349
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.12-unloadsubmodule.patch
@@ -0,0 +1,53 @@
+diff -u13 -r xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c xorg-server-1.12.3/hw/xfree86/loader/loadmod.c
+--- xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c 2012-09-05 18:26:42.000000000 +0200
++++ xorg-server-1.12.3/hw/xfree86/loader/loadmod.c 2012-09-05 18:28:54.000000000 +0200
+@@ -1109,39 +1109,38 @@
+ static void
+ RemoveChild(ModuleDescPtr child)
+ {
+ ModuleDescPtr mdp;
+ ModuleDescPtr prevsib;
+ ModuleDescPtr parent;
+
+ if (!child->parent)
+ return;
+
+ parent = child->parent;
+ if (parent->child == child) {
+ parent->child = child->sib;
+- return;
+- }
+-
+- prevsib = parent->child;
+- mdp = prevsib->sib;
+- while (mdp && mdp != child) {
+- prevsib = mdp;
+- mdp = mdp->sib;
++ }
++ else {
++ prevsib = parent->child;
++ mdp = prevsib->sib;
++ while (mdp && mdp != child) {
++ prevsib = mdp;
++ mdp = mdp->sib;
++ }
++ if (mdp == child)
++ prevsib->sib = child->sib;
+ }
+- if (mdp == child)
+- prevsib->sib = child->sib;
+ child->sib = NULL;
+- return;
+ }
+
+ void
+ LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
+ {
+ const char *msg;
+ MessageType type = X_ERROR;
+
+ switch (errmaj) {
+ case LDR_NOERROR:
+ msg = "no error";
+ break;
+ case LDR_NOMEM:
diff --git a/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-0.patch b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-0.patch
new file mode 100644
index 0000000..9540e31
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-0.patch
@@ -0,0 +1,102 @@
+From 81c90dc8f0aae3b65730409b1b615b5fa7280ebd Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri, 16 Jan 2015 20:08:59 +0100
+Subject: xkb: Don't swap XkbSetGeometry data in the input buffer
+
+The XkbSetGeometry request embeds data which needs to be swapped when the
+server and the client have different endianess.
+
+_XkbSetGeometry() invokes functions that swap these data directly in the
+input buffer.
+
+However, ProcXkbSetGeometry() may call _XkbSetGeometry() more than once
+(if there is more than one keyboard), thus causing on swapped clients the
+same data to be swapped twice in memory, further causing a server crash
+because the strings lengths on the second time are way off bounds.
+
+To allow _XkbSetGeometry() to run reliably more than once with swapped
+clients, do not swap the data in the buffer, use variables instead.
+
+Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+diff --git a/xkb/xkb.c b/xkb/xkb.c
+index 15c7f34..b9a3ac4 100644
+--- a/xkb/xkb.c
++++ b/xkb/xkb.c
+@@ -4961,14 +4961,13 @@ static char *
+ _GetCountedString(char **wire_inout, Bool swap)
+ {
+ char *wire, *str;
+- CARD16 len, *plen;
++ CARD16 len;
+
+ wire = *wire_inout;
+- plen = (CARD16 *) wire;
++ len = *(CARD16 *) wire;
+ if (swap) {
+- swaps(plen);
++ swaps(&len);
+ }
+- len = *plen;
+ str = malloc(len + 1);
+ if (str) {
+ memcpy(str, &wire[2], len);
+@@ -4985,25 +4984,28 @@ _CheckSetDoodad(char **wire_inout,
+ {
+ char *wire;
+ xkbDoodadWireDesc *dWire;
++ xkbAnyDoodadWireDesc any;
++ xkbTextDoodadWireDesc text;
+ XkbDoodadPtr doodad;
+
+ dWire = (xkbDoodadWireDesc *) (*wire_inout);
++ any = dWire->any;
+ wire = (char *) &dWire[1];
+ if (client->swapped) {
+- swapl(&dWire->any.name);
+- swaps(&dWire->any.top);
+- swaps(&dWire->any.left);
+- swaps(&dWire->any.angle);
++ swapl(&any.name);
++ swaps(&any.top);
++ swaps(&any.left);
++ swaps(&any.angle);
+ }
+ CHK_ATOM_ONLY(dWire->any.name);
+- doodad = XkbAddGeomDoodad(geom, section, dWire->any.name);
++ doodad = XkbAddGeomDoodad(geom, section, any.name);
+ if (!doodad)
+ return BadAlloc;
+ doodad->any.type = dWire->any.type;
+ doodad->any.priority = dWire->any.priority;
+- doodad->any.top = dWire->any.top;
+- doodad->any.left = dWire->any.left;
+- doodad->any.angle = dWire->any.angle;
++ doodad->any.top = any.top;
++ doodad->any.left = any.left;
++ doodad->any.angle = any.angle;
+ switch (doodad->any.type) {
+ case XkbOutlineDoodad:
+ case XkbSolidDoodad:
+@@ -5026,12 +5028,13 @@ _CheckSetDoodad(char **wire_inout,
+ dWire->text.colorNdx);
+ return BadMatch;
+ }
++ text = dWire->text;
+ if (client->swapped) {
+- swaps(&dWire->text.width);
+- swaps(&dWire->text.height);
++ swaps(&text.width);
++ swaps(&text.height);
+ }
+- doodad->text.width = dWire->text.width;
+- doodad->text.height = dWire->text.height;
++ doodad->text.width = text.width;
++ doodad->text.height = text.height;
+ doodad->text.color_ndx = dWire->text.colorNdx;
+ doodad->text.text = _GetCountedString(&wire, client->swapped);
+ doodad->text.font = _GetCountedString(&wire, client->swapped);
+--
+cgit v0.10.2
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-1.patch b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-1.patch
new file mode 100644
index 0000000..be131c2
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-0255-1.patch
@@ -0,0 +1,138 @@
+From 20079c36cf7d377938ca5478447d8b9045cb7d43 Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Fri, 16 Jan 2015 08:44:45 +0100
+Subject: xkb: Check strings length against request size
+
+Ensure that the given strings length in an XkbSetGeometry request remain
+within the limits of the size of the request.
+
+Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+diff --git a/xkb/xkb.c b/xkb/xkb.c
+index b9a3ac4..f3988f9 100644
+--- a/xkb/xkb.c
++++ b/xkb/xkb.c
+@@ -4957,25 +4957,29 @@ ProcXkbGetGeometry(ClientPtr client)
+
+ /***====================================================================***/
+
+-static char *
+-_GetCountedString(char **wire_inout, Bool swap)
++static Status
++_GetCountedString(char **wire_inout, ClientPtr client, char **str)
+ {
+- char *wire, *str;
++ char *wire, *next;
+ CARD16 len;
+
+ wire = *wire_inout;
+ len = *(CARD16 *) wire;
+- if (swap) {
++ if (client->swapped) {
+ swaps(&len);
+ }
+- str = malloc(len + 1);
+- if (str) {
+- memcpy(str, &wire[2], len);
+- str[len] = '\0';
+- }
+- wire += XkbPaddedSize(len + 2);
+- *wire_inout = wire;
+- return str;
++ next = wire + XkbPaddedSize(len + 2);
++ /* Check we're still within the size of the request */
++ if (client->req_len <
++ bytes_to_int32(next - (char *) client->requestBuffer))
++ return BadValue;
++ *str = malloc(len + 1);
++ if (!*str)
++ return BadAlloc;
++ memcpy(*str, &wire[2], len);
++ *(*str + len) = '\0';
++ *wire_inout = next;
++ return Success;
+ }
+
+ static Status
+@@ -4987,6 +4991,7 @@ _CheckSetDoodad(char **wire_inout,
+ xkbAnyDoodadWireDesc any;
+ xkbTextDoodadWireDesc text;
+ XkbDoodadPtr doodad;
++ Status status;
+
+ dWire = (xkbDoodadWireDesc *) (*wire_inout);
+ any = dWire->any;
+@@ -5036,8 +5041,14 @@ _CheckSetDoodad(char **wire_inout,
+ doodad->text.width = text.width;
+ doodad->text.height = text.height;
+ doodad->text.color_ndx = dWire->text.colorNdx;
+- doodad->text.text = _GetCountedString(&wire, client->swapped);
+- doodad->text.font = _GetCountedString(&wire, client->swapped);
++ status = _GetCountedString(&wire, client, &doodad->text.text);
++ if (status != Success)
++ return status;
++ status = _GetCountedString(&wire, client, &doodad->text.font);
++ if (status != Success) {
++ free (doodad->text.text);
++ return status;
++ }
+ break;
+ case XkbIndicatorDoodad:
+ if (dWire->indicator.onColorNdx >= geom->num_colors) {
+@@ -5072,7 +5083,9 @@ _CheckSetDoodad(char **wire_inout,
+ }
+ doodad->logo.color_ndx = dWire->logo.colorNdx;
+ doodad->logo.shape_ndx = dWire->logo.shapeNdx;
+- doodad->logo.logo_name = _GetCountedString(&wire, client->swapped);
++ status = _GetCountedString(&wire, client, &doodad->logo.logo_name);
++ if (status != Success)
++ return status;
+ break;
+ default:
+ client->errorValue = _XkbErrCode2(0x4F, dWire->any.type);
+@@ -5304,18 +5317,20 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
+ char *wire;
+
+ wire = (char *) &req[1];
+- geom->label_font = _GetCountedString(&wire, client->swapped);
++ status = _GetCountedString(&wire, client, &geom->label_font);
++ if (status != Success)
++ return status;
+
+ for (i = 0; i < req->nProperties; i++) {
+ char *name, *val;
+
+- name = _GetCountedString(&wire, client->swapped);
+- if (!name)
+- return BadAlloc;
+- val = _GetCountedString(&wire, client->swapped);
+- if (!val) {
++ status = _GetCountedString(&wire, client, &name);
++ if (status != Success)
++ return status;
++ status = _GetCountedString(&wire, client, &val);
++ if (status != Success) {
+ free(name);
+- return BadAlloc;
++ return status;
+ }
+ if (XkbAddGeomProperty(geom, name, val) == NULL) {
+ free(name);
+@@ -5349,9 +5364,9 @@ _CheckSetGeom(XkbGeometryPtr geom, xkbSetGeometryReq * req, ClientPtr client)
+ for (i = 0; i < req->nColors; i++) {
+ char *name;
+
+- name = _GetCountedString(&wire, client->swapped);
+- if (!name)
+- return BadAlloc;
++ status = _GetCountedString(&wire, client, &name);
++ if (status != Success)
++ return status;
+ if (!XkbAddGeomColor(geom, name, geom->num_colors)) {
+ free(name);
+ return BadAlloc;
+--
+cgit v0.10.2
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-1.patch b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-1.patch
new file mode 100644
index 0000000..a9f8030
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-1.patch
@@ -0,0 +1,33 @@
+From c4534a38b68aa07fb82318040dc8154fb48a9588 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Tue, 5 May 2015 16:43:42 -0400
+Subject: xwayland: Enable access control on open sockets [CVE-2015-3164 1/3]
+
+Xwayland currently allows wide-open access to the X sockets
+it listens on, ignoring Xauth access control.
+
+This commit makes sure to enable access control on the sockets,
+so one user can't snoop on another user's X-over-wayland
+applications.
+
+Signed-off-by: Ray Strode <rstrode@redhat.com>
+Reviewed-by: Daniel Stone <daniels@collabora.com>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+
+diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
+index 7e8d667..c5bee77 100644
+--- a/hw/xwayland/xwayland.c
++++ b/hw/xwayland/xwayland.c
+@@ -483,7 +483,7 @@ listen_on_fds(struct xwl_screen *xwl_screen)
+ int i;
+
+ for (i = 0; i < xwl_screen->listen_fd_count; i++)
+- ListenOnOpenFD(xwl_screen->listen_fds[i], TRUE);
++ ListenOnOpenFD(xwl_screen->listen_fds[i], FALSE);
+ }
+
+ static void
+--
+cgit v0.10.2
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-2.patch b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-2.patch
new file mode 100644
index 0000000..47b323f
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-2.patch
@@ -0,0 +1,246 @@
+From 4b4b9086d02b80549981d205fb1f495edc373538 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Tue, 5 May 2015 16:43:43 -0400
+Subject: os: support new implicit local user access mode [CVE-2015-3164 2/3]
+
+If the X server is started without a '-auth' argument, then
+it gets started wide open to all local users on the system.
+
+This isn't a great default access model, but changing it in
+Xorg at this point would break backward compatibility.
+
+Xwayland, on the other hand is new, and much more targeted
+in scope. It could, in theory, be changed to allow the much
+more secure default of a "user who started X server can connect
+clients to that server."
+
+This commit paves the way for that change, by adding a mechanism
+for DDXs to opt-in to that behavior. They merely need to call
+
+LocalAccessScopeUser()
+
+in their init functions.
+
+A subsequent commit will add that call for Xwayland.
+
+Signed-off-by: Ray Strode <rstrode@redhat.com>
+Reviewed-by: Daniel Stone <daniels@collabora.com>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+
+diff --git a/include/os.h b/include/os.h
+index 6638c84..b2b96c8 100644
+--- a/include/os.h
++++ b/include/os.h
+@@ -431,11 +431,28 @@ extern _X_EXPORT void
+ ResetHosts(const char *display);
+
+ extern _X_EXPORT void
++EnableLocalAccess(void);
++
++extern _X_EXPORT void
++DisableLocalAccess(void);
++
++extern _X_EXPORT void
+ EnableLocalHost(void);
+
+ extern _X_EXPORT void
+ DisableLocalHost(void);
+
++#ifndef NO_LOCAL_CLIENT_CRED
++extern _X_EXPORT void
++EnableLocalUser(void);
++
++extern _X_EXPORT void
++DisableLocalUser(void);
++
++extern _X_EXPORT void
++LocalAccessScopeUser(void);
++#endif
++
+ extern _X_EXPORT void
+ AccessUsingXdmcp(void);
+
+diff --git a/os/access.c b/os/access.c
+index 8fa028e..75e7a69 100644
+--- a/os/access.c
++++ b/os/access.c
+@@ -102,6 +102,10 @@ SOFTWARE.
+ #include <sys/ioctl.h>
+ #include <ctype.h>
+
++#ifndef NO_LOCAL_CLIENT_CRED
++#include <pwd.h>
++#endif
++
+ #if defined(TCPCONN) || defined(STREAMSCONN)
+ #include <netinet/in.h>
+ #endif /* TCPCONN || STREAMSCONN */
+@@ -225,6 +229,13 @@ static int LocalHostEnabled = FALSE;
+ static int LocalHostRequested = FALSE;
+ static int UsingXdmcp = FALSE;
+
++static enum {
++ LOCAL_ACCESS_SCOPE_HOST = 0,
++#ifndef NO_LOCAL_CLIENT_CRED
++ LOCAL_ACCESS_SCOPE_USER,
++#endif
++} LocalAccessScope;
++
+ /* FamilyServerInterpreted implementation */
+ static Bool siAddrMatch(int family, void *addr, int len, HOST * host,
+ ClientPtr client);
+@@ -237,6 +248,21 @@ static void siTypesInitialize(void);
+ */
+
+ void
++EnableLocalAccess(void)
++{
++ switch (LocalAccessScope) {
++ case LOCAL_ACCESS_SCOPE_HOST:
++ EnableLocalHost();
++ break;
++#ifndef NO_LOCAL_CLIENT_CRED
++ case LOCAL_ACCESS_SCOPE_USER:
++ EnableLocalUser();
++ break;
++#endif
++ }
++}
++
++void
+ EnableLocalHost(void)
+ {
+ if (!UsingXdmcp) {
+@@ -249,6 +275,21 @@ EnableLocalHost(void)
+ * called when authorization is enabled to keep us secure
+ */
+ void
++DisableLocalAccess(void)
++{
++ switch (LocalAccessScope) {
++ case LOCAL_ACCESS_SCOPE_HOST:
++ DisableLocalHost();
++ break;
++#ifndef NO_LOCAL_CLIENT_CRED
++ case LOCAL_ACCESS_SCOPE_USER:
++ DisableLocalUser();
++ break;
++#endif
++ }
++}
++
++void
+ DisableLocalHost(void)
+ {
+ HOST *self;
+@@ -262,6 +303,74 @@ DisableLocalHost(void)
+ }
+ }
+
++#ifndef NO_LOCAL_CLIENT_CRED
++static int GetLocalUserAddr(char **addr)
++{
++ static const char *type = "localuser";
++ static const char delimiter = '\0';
++ static const char *value;
++ struct passwd *pw;
++ int length = -1;
++
++ pw = getpwuid(getuid());
++
++ if (pw == NULL || pw->pw_name == NULL)
++ goto out;
++
++ value = pw->pw_name;
++
++ length = asprintf(addr, "%s%c%s", type, delimiter, value);
++
++ if (length == -1) {
++ goto out;
++ }
++
++ /* Trailing NUL */
++ length++;
++
++out:
++ return length;
++}
++
++void
++EnableLocalUser(void)
++{
++ char *addr = NULL;
++ int length = -1;
++
++ length = GetLocalUserAddr(&addr);
++
++ if (length == -1)
++ return;
++
++ NewHost(FamilyServerInterpreted, addr, length, TRUE);
++
++ free(addr);
++}
++
++void
++DisableLocalUser(void)
++{
++ char *addr = NULL;
++ int length = -1;
++
++ length = GetLocalUserAddr(&addr);
++
++ if (length == -1)
++ return;
++
++ RemoveHost(NULL, FamilyServerInterpreted, length, addr);
++
++ free(addr);
++}
++
++void
++LocalAccessScopeUser(void)
++{
++ LocalAccessScope = LOCAL_ACCESS_SCOPE_USER;
++}
++#endif
++
+ /*
+ * called at init time when XDMCP will be used; xdmcp always
+ * adds local hosts manually when needed
+diff --git a/os/auth.c b/os/auth.c
+index 5fcb538..7da6fc6 100644
+--- a/os/auth.c
++++ b/os/auth.c
+@@ -181,11 +181,11 @@ CheckAuthorization(unsigned int name_length,
+
+ /*
+ * If the authorization file has at least one entry for this server,
+- * disable local host access. (loadauth > 0)
++ * disable local access. (loadauth > 0)
+ *
+ * If there are zero entries (either initially or when the
+ * authorization file is later reloaded), or if a valid
+- * authorization file was never loaded, enable local host access.
++ * authorization file was never loaded, enable local access.
+ * (loadauth == 0 || !loaded)
+ *
+ * If the authorization file was loaded initially (with valid
+@@ -194,11 +194,11 @@ CheckAuthorization(unsigned int name_length,
+ */
+
+ if (loadauth > 0) {
+- DisableLocalHost(); /* got at least one */
++ DisableLocalAccess(); /* got at least one */
+ loaded = TRUE;
+ }
+ else if (loadauth == 0 || !loaded)
+- EnableLocalHost();
++ EnableLocalAccess();
+ }
+ if (name_length) {
+ for (i = 0; i < NUM_AUTHORIZATION; i++) {
+--
+cgit v0.10.2
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-3.patch b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-3.patch
new file mode 100644
index 0000000..7e8f173
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17-cve-2015-3164-3.patch
@@ -0,0 +1,34 @@
+From 76636ac12f2d1dbdf7be08222f80e7505d53c451 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Tue, 5 May 2015 16:43:44 -0400
+Subject: xwayland: default to local user if no xauth file given.
+ [CVE-2015-3164 3/3]
+
+Right now if "-auth" isn't passed on the command line, we let
+any user on the system connect to the Xwayland server.
+
+That's clearly suboptimal, given Xwayland is generally designed
+to be used by one user at a time.
+
+This commit changes the behavior, so only the user who started the
+X server can connect clients to it.
+
+Signed-off-by: Ray Strode <rstrode@redhat.com>
+Reviewed-by: Daniel Stone <daniels@collabora.com>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+
+diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
+index c5bee77..bc92beb 100644
+--- a/hw/xwayland/xwayland.c
++++ b/hw/xwayland/xwayland.c
+@@ -702,4 +702,6 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv)
+ if (AddScreen(xwl_screen_init, argc, argv) == -1) {
+ FatalError("Couldn't add screen\n");
+ }
++
++ LocalAccessScopeUser();
+ }
+--
+cgit v0.10.2
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.17-ia64-fix_inx_outx.patch b/x11-base/xorg-server/files/xorg-server-1.17-ia64-fix_inx_outx.patch
new file mode 100644
index 0000000..84485c9
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17-ia64-fix_inx_outx.patch
@@ -0,0 +1,59 @@
+diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
+index 1653574..fe881ee 100644
+--- a/hw/xfree86/common/compiler.h
++++ b/hw/xfree86/common/compiler.h
+@@ -286,6 +286,54 @@ extern _X_EXPORT unsigned int inl(unsigned int port);
+ #include <machine/pio.h>
+ #endif /* __NetBSD__ */
+
++#elif defined(linux) && defined(__ia64__)
++/* for Linux on ia64, we use the LIBC _inx/_outx routines */
++/* note that the appropriate setup via "ioperm" needs to be done */
++/* *before* any inx/outx is done. */
++
++extern _X_EXPORT void _outb(unsigned char val, unsigned long port);
++extern _X_EXPORT void _outw(unsigned short val, unsigned long port);
++extern _X_EXPORT void _outl(unsigned int val, unsigned long port);
++extern _X_EXPORT unsigned int _inb(unsigned long port);
++extern _X_EXPORT unsigned int _inw(unsigned long port);
++extern _X_EXPORT unsigned int _inl(unsigned long port);
++
++static __inline__ void
++outb(unsigned long port, unsigned char val)
++{
++ _outb(val, port);
++}
++
++static __inline__ void
++outw(unsigned long port, unsigned short val)
++{
++ _outw(val, port);
++}
++
++static __inline__ void
++outl(unsigned long port, unsigned int val)
++{
++ _outl(val, port);
++}
++
++static __inline__ unsigned int
++inb(unsigned long port)
++{
++ return _inb(port);
++}
++
++static __inline__ unsigned int
++inw(unsigned long port)
++{
++ return _inw(port);
++}
++
++static __inline__ unsigned int
++inl(unsigned long port)
++{
++ return _inl(port);
++}
++
+ #elif defined(__amd64__)
+
+ #include <inttypes.h>
diff --git a/x11-base/xorg-server/files/xorg-server-1.17-support-multiple-Files-sections.patch b/x11-base/xorg-server/files/xorg-server-1.17-support-multiple-Files-sections.patch
new file mode 100644
index 0000000..789a118
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17-support-multiple-Files-sections.patch
@@ -0,0 +1,65 @@
+From a140d7ce3f37f30b4fed27c5a70ebcc4ed13c612 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Tue, 24 Feb 2015 12:57:24 +0100
+Subject: [PATCH] config: Support multiple 'Files' sections
+
+---
+ hw/xfree86/parser/Files.c | 8 ++++++--
+ hw/xfree86/parser/configProcs.h | 2 +-
+ hw/xfree86/parser/read.c | 2 +-
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
+index 849bf92..5cc3ec7 100644
+--- a/hw/xfree86/parser/Files.c
++++ b/hw/xfree86/parser/Files.c
+@@ -76,14 +76,18 @@ static xf86ConfigSymTabRec FilesTab[] = {
+ #define CLEANUP xf86freeFiles
+
+ XF86ConfFilesPtr
+-xf86parseFilesSection(void)
++xf86parseFilesSection(XF86ConfFilesPtr ptr)
+ {
+ int i, j;
+ int k, l;
+ char *str;
+ int token;
+
+- parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec)
++ if (!ptr) {
++ if( (ptr=calloc(1,sizeof(XF86ConfFilesRec))) == NULL ) {
++ return NULL;
++ }
++ }
+
+ while ((token = xf86getToken(FilesTab)) != ENDSECTION) {
+ switch (token) {
+diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
+index 774e2a2..b9fdebb 100644
+--- a/hw/xfree86/parser/configProcs.h
++++ b/hw/xfree86/parser/configProcs.h
+@@ -37,7 +37,7 @@ void xf86freeDeviceList(XF86ConfDevicePtr ptr);
+ int xf86validateDevice(XF86ConfigPtr p);
+
+ /* Files.c */
+-XF86ConfFilesPtr xf86parseFilesSection(void);
++XF86ConfFilesPtr xf86parseFilesSection(XF86ConfFilesPtr ptr);
+ void xf86printFileSection(FILE * cf, XF86ConfFilesPtr ptr);
+ void xf86freeFiles(XF86ConfFilesPtr p);
+
+diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
+index 327c02a..e0d6139 100644
+--- a/hw/xfree86/parser/read.c
++++ b/hw/xfree86/parser/read.c
+@@ -110,7 +110,7 @@ xf86readConfigFile(void)
+ if (xf86nameCompare(xf86_lex_val.str, "files") == 0) {
+ free(xf86_lex_val.str);
+ xf86_lex_val.str = NULL;
+- HANDLE_RETURN(conf_files, xf86parseFilesSection());
++ HANDLE_RETURN(conf_files, xf86parseFilesSection(ptr->conf_files));
+ }
+ else if (xf86nameCompare(xf86_lex_val.str, "serverflags") == 0) {
+ free(xf86_lex_val.str);
+--
+2.3.0
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.17.2-uninit-clientsWritable.patch b/x11-base/xorg-server/files/xorg-server-1.17.2-uninit-clientsWritable.patch
new file mode 100644
index 0000000..6818196
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.17.2-uninit-clientsWritable.patch
@@ -0,0 +1,65 @@
+https://bugs.gentoo.org/show_bug.cgi?id=555776
+
+From 7cc7ffd25d5e50b54cb942d07d4cb160f20ff9c5 Mon Sep 17 00:00:00 2001
+From: Martin Peres <martin.peres@linux.intel.com>
+Date: Fri, 17 Jul 2015 17:21:26 +0300
+Subject: [PATCH] os: make sure the clientsWritable fd_set is initialized
+ before use
+
+In WaitForSomething(), the fd_set clientsWritable may be used unitialized when
+the boolean AnyClientsWriteBlocked is set in the WakeupHandler(). This leads to
+a crash in FlushAllOutput() after x11proto's commit
+2c94cdb453bc641246cc8b9a876da9799bee1ce7.
+
+The problem did not manifest before because both the XFD_SIZE and the maximum
+number of clients were set to 256. As the connectionTranslation table was
+initalized for the 256 clients to 0, the test on the index not being 0 was
+aborting before dereferencing the client #0.
+
+As of commit 2c94cdb453bc641246cc8b9a876da9799bee1ce7 in x11proto, the XFD_SIZE
+got bumped to 512. This lead the OutputPending fd_set to have any fd above 256
+to be uninitialized which in turns lead to reading an index after the end of
+the ConnectionTranslation table. This index would then be used to find the
+client corresponding to the fd marked as pending writes and would also result
+to an out-of-bound access which would usually be the fatal one.
+
+Fix this by zeroing the clientsWritable fd_set at the beginning of
+WaitForSomething(). In this case, the bottom part of the loop, which would
+indirectly call FlushAllOutput, will not do any work but the next call to
+select will result in the execution of the right codepath. This is exactly what
+we want because we need to know the writable clients before handling them. In
+the end, it also makes sure that the fds above MaxClient are initialized,
+preventing the crash in FlushAllOutput().
+
+Thanks to everyone involved in tracking this one down!
+
+Reported-by: Karol Herbst <freedesktop@karolherbst.de>
+Reported-by: Tobias Klausmann <tobias.klausmann@mni.thm.de>
+Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
+Tested-by: Martin Peres <martin.peres@linux.intel.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91316
+Cc: Ilia Mirkin <imirkin@alum.mit.edu>
+Cc: Martin Peres <martin.peres@linux.intel.com>
+Cc: Olivier Fourdan <ofourdan@redhat.com
+Cc: Adam Jackson <ajax@redhat.com>
+Cc: Alan Coopersmith <alan.coopersmith@oracle.com
+Cc: Chris Wilson <chris@chris-wilson.co.uk>
+---
+ os/WaitFor.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/os/WaitFor.c b/os/WaitFor.c
+index 431f1a6..993c14e 100644
+--- a/os/WaitFor.c
++++ b/os/WaitFor.c
+@@ -158,6 +158,7 @@ WaitForSomething(int *pClientsReady)
+ Bool someReady = FALSE;
+
+ FD_ZERO(&clientsReadable);
++ FD_ZERO(&clientsWritable);
+
+ if (nready)
+ SmartScheduleStopTimer();
+--
+2.4.5
+
diff --git a/x11-base/xorg-server/files/xorg-server-1.18-support-multiple-Files-sections.patch b/x11-base/xorg-server/files/xorg-server-1.18-support-multiple-Files-sections.patch
new file mode 100644
index 0000000..0a61145
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-1.18-support-multiple-Files-sections.patch
@@ -0,0 +1,53 @@
+See http://lists.x.org/archives/xorg-devel/2015-February/045755.html
+
+diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
+index 849bf92..5cc3ec7 100644
+--- a/hw/xfree86/parser/Files.c
++++ b/hw/xfree86/parser/Files.c
+@@ -76,14 +76,18 @@ static xf86ConfigSymTabRec FilesTab[] = {
+ #define CLEANUP xf86freeFiles
+
+ XF86ConfFilesPtr
+-xf86parseFilesSection(void)
++xf86parseFilesSection(XF86ConfFilesPtr ptr)
+ {
+ int i, j;
+ int k, l;
+ char *str;
+ int token;
+
+- parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec)
++ if (!ptr) {
++ if( (ptr=calloc(1,sizeof(XF86ConfFilesRec))) == NULL ) {
++ return NULL;
++ }
++ }
+
+ while ((token = xf86getToken(FilesTab)) != ENDSECTION) {
+ switch (token) {
+diff --git a/hw/xfree86/parser/configProcs.h b/hw/xfree86/parser/configProcs.h
+index 171f8e8..e8199fe 100644
+--- a/hw/xfree86/parser/configProcs.h
++++ b/hw/xfree86/parser/configProcs.h
+@@ -36,7 +36,7 @@ void xf86freeDeviceList(XF86ConfDevicePtr ptr);
+ int xf86validateDevice(XF86ConfigPtr p);
+
+ /* Files.c */
+-XF86ConfFilesPtr xf86parseFilesSection(void);
++XF86ConfFilesPtr xf86parseFilesSection(XF86ConfFilesPtr ptr);
+ void xf86printFileSection(FILE * cf, XF86ConfFilesPtr ptr);
+ void xf86freeFiles(XF86ConfFilesPtr p);
+
+diff --git a/hw/xfree86/parser/read.c b/hw/xfree86/parser/read.c
+index 327c02a..e0d6139 100644
+--- a/hw/xfree86/parser/read.c
++++ b/hw/xfree86/parser/read.c
+@@ -110,7 +110,7 @@ xf86readConfigFile(void)
+ if (xf86nameCompare(xf86_lex_val.str, "files") == 0) {
+ free(xf86_lex_val.str);
+ xf86_lex_val.str = NULL;
+- HANDLE_RETURN(conf_files, xf86parseFilesSection());
++ HANDLE_RETURN(conf_files, xf86parseFilesSection(ptr->conf_files));
+ }
+ else if (xf86nameCompare(xf86_lex_val.str, "serverflags") == 0) {
+ free(xf86_lex_val.str);
diff --git a/x11-base/xorg-server/files/xorg-server-disable-acpi.patch b/x11-base/xorg-server/files/xorg-server-disable-acpi.patch
new file mode 100644
index 0000000..cc80e6c
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-server-disable-acpi.patch
@@ -0,0 +1,31 @@
+From a8079882f1884edc62a9de28af915bd8b65dfbbe Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Wed, 11 Mar 2009 14:02:11 -0400
+Subject: [PATCH] Don't build the ACPI code.
+
+No good can come of this.
+---
+ configure.ac | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 72ae67e..04716f8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1269,13 +1269,11 @@ if test "x$XORG" = xyes; then
+ case $host_cpu in
+ ia64*)
+ linux_ia64=yes
+- linux_acpi="yes"
+ ;;
+ alpha*)
+ linux_alpha=yes
+ ;;
+ i*86|amd64*|x86_64*)
+- linux_acpi="yes"
+ ;;
+ *)
+ ;;
+--
+1.6.1.3
+
diff --git a/x11-base/xorg-server/files/xorg-sets.conf b/x11-base/xorg-server/files/xorg-sets.conf
new file mode 100644
index 0000000..5cd8112
--- /dev/null
+++ b/x11-base/xorg-server/files/xorg-sets.conf
@@ -0,0 +1,6 @@
+# Rebuild all X11 modules (mostly useful after xorg-server ABI change).
+[x11-module-rebuild]
+class = portage.sets.dbapi.VariableSet
+world-candidate = false
+variable = CATEGORY
+includes = x11-drivers
diff --git a/x11-base/xorg-server/xorg-server-9999.ebuild b/x11-base/xorg-server/xorg-server-9999.ebuild
new file mode 100644
index 0000000..446117c
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-9999.ebuild
@@ -0,0 +1,242 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DOC=doc
+inherit xorg-2 multilib versionator flag-o-matic
+EGIT_REPO_URI="git://anongit.freedesktop.org/xorg/xserver"
+
+DESCRIPTION="X.Org X servers"
+SLOT="0/${PV}"
+KEYWORDS="alpha amd64 ~arm ~arm64 hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+
+IUSE_SERVERS="dmx kdrive xephyr xnest xorg xvfb"
+IUSE="${IUSE_SERVERS} glamor ipv6 libressl minimal selinux +suid systemd tslib +udev unwind wayland"
+
+CDEPEND=">=app-eselect/eselect-opengl-1.3.0
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl )
+ 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/libdrm-2.4.46
+ >=x11-libs/libpciaccess-0.12.901
+ >=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/libxshmfence-1.1
+ >=x11-libs/pixman-0.27.2
+ >=x11-libs/xtrans-1.3.5
+ >=x11-misc/xbitmaps-1.0.1
+ >=x11-misc/xkeyboard-config-2.4.1-r3
+ 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.99.4
+ >=x11-libs/libXfixes-5.0
+ >=x11-libs/libXi-1.2.99.1
+ >=x11-libs/libXmu-1.0.3
+ x11-libs/libXrender
+ >=x11-libs/libXres-1.0.3
+ >=x11-libs/libXtst-1.0.99.2
+ )
+ glamor? (
+ media-libs/libepoxy
+ >=media-libs/mesa-10.3.4-r1[egl,gbm]
+ !x11-libs/glamor
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ xephyr? (
+ x11-libs/libxcb
+ x11-libs/xcb-util
+ x11-libs/xcb-util-image
+ x11-libs/xcb-util-keysyms
+ x11-libs/xcb-util-renderutil
+ x11-libs/xcb-util-wm
+ )
+ !minimal? (
+ >=x11-libs/libX11-1.1.5
+ >=x11-libs/libXext-1.0.5
+ >=media-libs/mesa-10.3.4-r1
+ )
+ tslib? ( >=x11-libs/tslib-1.0 )
+ udev? ( >=virtual/udev-150 )
+ unwind? ( sys-libs/libunwind )
+ wayland? (
+ >=dev-libs/wayland-1.3.0
+ media-libs/libepoxy
+ )
+ >=x11-apps/xinit-1.3.3-r1
+ systemd? (
+ sys-apps/dbus
+ sys-apps/systemd
+ )"
+
+DEPEND="${CDEPEND}
+ sys-devel/flex
+ >=x11-proto/bigreqsproto-1.1.0
+ >=x11-proto/compositeproto-0.4
+ >=x11-proto/damageproto-1.1
+ >=x11-proto/fixesproto-5.0
+ >=x11-proto/fontsproto-2.1.3
+ >=x11-proto/glproto-1.4.17-r1
+ >=x11-proto/inputproto-2.3
+ >=x11-proto/kbproto-1.0.3
+ >=x11-proto/randrproto-1.5.0
+ >=x11-proto/recordproto-1.13.99.1
+ >=x11-proto/renderproto-0.11
+ >=x11-proto/resourceproto-1.2.0
+ >=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.2.99.901
+ >=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.28
+ >=x11-proto/presentproto-1.0
+ >=x11-proto/dri3proto-1.0
+ dmx? (
+ >=x11-proto/dmxproto-2.2.99.1
+ doc? (
+ || (
+ www-client/links
+ www-client/lynx
+ www-client/w3m
+ )
+ )
+ )
+ !minimal? (
+ >=x11-proto/xf86driproto-2.1.0
+ >=x11-proto/dri2proto-2.8
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-xserver )
+ !x11-drivers/xf86-video-modesetting
+"
+
+PDEPEND="
+ xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
+
+REQUIRED_USE="!minimal? (
+ || ( ${IUSE_SERVERS} )
+ )
+ xephyr? ( kdrive )"
+
+#UPSTREAMED_PATCHES=(
+# "${WORKDIR}/patches/"
+#)
+
+PATCHES=(
+ "${UPSTREAMED_PATCHES[@]}"
+ "${FILESDIR}"/${PN}-1.12-unloadsubmodule.patch
+ # needed for new eselect-opengl, bug #541232
+ "${FILESDIR}"/${PN}-1.18-support-multiple-Files-sections.patch
+)
+
+pkg_pretend() {
+ # older gcc is not supported
+ [[ "${MERGE_TYPE}" != "binary" && $(gcc-major-version) -lt 4 ]] && \
+ die "Sorry, but gcc earlier than 4.0 will not work for xorg-server."
+}
+
+src_configure() {
+ # 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
+ # NOTE: fop is used for doc generating; and I have no idea if Gentoo
+ # package it somewhere
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ipv6)
+ $(use_enable dmx)
+ $(use_enable glamor)
+ $(use_enable kdrive)
+ $(use_enable kdrive kdrive-kbd)
+ $(use_enable kdrive kdrive-mouse)
+ $(use_enable kdrive kdrive-evdev)
+ $(use_enable suid install-setuid)
+ $(use_enable tslib)
+ $(use_enable unwind libunwind)
+ $(use_enable wayland xwayland)
+ $(use_enable !minimal record)
+ $(use_enable !minimal xfree86-utils)
+ $(use_enable !minimal dri)
+ $(use_enable !minimal dri2)
+ $(use_enable !minimal glx)
+ $(use_enable xephyr)
+ $(use_enable xnest)
+ $(use_enable xorg)
+ $(use_enable xvfb)
+ $(use_enable udev config-udev)
+ $(use_with doc doxygen)
+ $(use_with doc xmlto)
+ $(use_with systemd systemd-daemon)
+ $(use_enable systemd systemd-logind)
+ --enable-libdrm
+ --sysconfdir="${EPREFIX}"/etc/X11
+ --localstatedir="${EPREFIX}"/var
+ --with-fontrootdir="${EPREFIX}"/usr/share/fonts
+ --with-xkb-output="${EPREFIX}"/var/lib/xkb
+ --disable-config-hal
+ --disable-linux-acpi
+ --without-dtrace
+ --without-fop
+ --with-os-vendor=Gentoo
+ --with-sha1=libcrypto
+ )
+
+ xorg-2_src_configure
+}
+
+src_install() {
+ xorg-2_src_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc "${AUTOTOOLS_BUILD_DIR}"/hw/xfree86/xorg.conf.example
+ fi
+
+ newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup
+ newinitd "${FILESDIR}"/xdm.initd-11 xdm
+ newconfd "${FILESDIR}"/xdm.confd-4 xdm
+
+ # install the @x11-module-rebuild set for Portage
+ insinto /usr/share/portage/config/sets
+ newins "${FILESDIR}"/xorg-sets.conf xorg.conf
+}
+
+pkg_postinst() {
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ eselect opengl set xorg-x11 --use-old
+}
+
+pkg_postrm() {
+ # Get rid of module dir to ensure opengl-update works properly
+ if [[ -z ${REPLACED_BY_VERSION} && -e ${EROOT}/usr/$(get_libdir)/xorg/modules ]]; then
+ rm -rf "${EROOT}"/usr/$(get_libdir)/xorg/modules
+ fi
+}
+
+server_based_install() {
+ if ! use xorg; then
+ rm "${ED}"/usr/share/man/man1/Xserver.1x \
+ "${ED}"/usr/$(get_libdir)/xserver/SecurityPolicy \
+ "${ED}"/usr/$(get_libdir)/pkgconfig/xorg-server.pc \
+ "${ED}"/usr/share/man/man1/Xserver.1x
+ fi
+}