summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-arch/unar/Manifest2
-rw-r--r--app-arch/unar/metadata.xml7
-rw-r--r--app-arch/unar/unar-1.10.7-r1.ebuild57
-rw-r--r--dev-python/fonttools/Manifest1
-rw-r--r--dev-python/fonttools/fonttools-4.12.1.ebuild50
-rw-r--r--dev-python/fonttools/metadata.xml8
-rw-r--r--media-sound/qjackctl/Manifest1
-rw-r--r--media-sound/qjackctl/metadata.xml7
-rw-r--r--media-sound/qjackctl/qjackctl-0.6.2.ebuild60
-rw-r--r--media-sound/qjackctl/qjackctl-9999.ebuild65
-rw-r--r--virtual/notification-daemon/metadata.xml4
-rw-r--r--virtual/notification-daemon/notification-daemon-1.ebuild30
-rw-r--r--virtual/rust/metadata.xml4
-rw-r--r--virtual/rust/rust-1.41.1.ebuild15
-rw-r--r--virtual/rust/rust-1.42.0.ebuild15
-rw-r--r--virtual/rust/rust-1.43.1.ebuild15
-rw-r--r--virtual/rust/rust-1.44.0.ebuild15
-rw-r--r--virtual/rust/rust-1.44.1.ebuild15
-rw-r--r--virtual/rust/rust-1.45.0.ebuild15
-rw-r--r--x11-apps/mesa-progs/Manifest1
-rw-r--r--x11-apps/mesa-progs/files/mesa-progs-8.4.0-improve-printing.patch289
-rw-r--r--x11-apps/mesa-progs/mesa-progs-8.4.0-r1.ebuild68
-rw-r--r--x11-apps/mesa-progs/mesa-progs-9999.ebuild64
-rw-r--r--x11-apps/mesa-progs/metadata.xml15
-rw-r--r--x11-base/xorg-server/Manifest1
-rw-r--r--x11-base/xorg-server/files/xdm-setup.initd-113
-rw-r--r--x11-base/xorg-server/files/xdm.confd-410
-rw-r--r--x11-base/xorg-server/files/xdm.initd-11230
-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.18-support-multiple-Files-sections.patch53
-rw-r--r--x11-base/xorg-server/files/xorg-sets.conf6
-rw-r--r--x11-base/xorg-server/metadata.xml19
-rw-r--r--x11-base/xorg-server/xorg-server-1.20.8-r2.ebuild237
-rw-r--r--x11-base/xorg-server/xorg-server-9999.ebuild237
-rw-r--r--x11-libs/cairo/Manifest1
-rw-r--r--x11-libs/cairo/cairo-1.16.0-r5.ebuild136
-rw-r--r--x11-libs/cairo/cairo-9999.ebuild133
-rw-r--r--x11-libs/cairo/files/cairo-1.12.18-disable-test-suite.patch15
-rw-r--r--x11-libs/cairo/files/cairo-1.16.0-binutils-2.34.patch20
-rw-r--r--x11-libs/cairo/files/cairo-1.16.0-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch30
-rw-r--r--x11-libs/cairo/files/cairo-1.16.0-pdf-add-missing-flush.patch29
-rw-r--r--x11-libs/cairo/files/cairo-1.16.0-strings.patch19
-rw-r--r--x11-libs/cairo/files/cairo-respect-fontconfig.patch13
-rw-r--r--x11-libs/cairo/metadata.xml14
-rw-r--r--x11-misc/redshift/Manifest1
-rw-r--r--x11-misc/redshift/files/redshift-wlroots-gamma.patch920
-rw-r--r--x11-misc/redshift/metadata.xml10
-rw-r--r--x11-misc/redshift/redshift-1.12-r4.ebuild91
48 files changed, 3114 insertions, 0 deletions
diff --git a/app-arch/unar/Manifest b/app-arch/unar/Manifest
new file mode 100644
index 0000000..270ff06
--- /dev/null
+++ b/app-arch/unar/Manifest
@@ -0,0 +1,2 @@
+DIST XADMaster-1.10.7.tar.gz 2064770 BLAKE2B f6119dfb46f3d617fafb5847f41d6c0f3e5e87c8cd0763cd8e5986fae1d5b1c6e6761e9e7e4fa84125003979151b2b34d35ff47dc9be3271107cf53f1be22644 SHA512 3447b6d8f3f4fa5eea93c6628a1633017da6ff09c580d5ce4fd422027b3b79acbf38d6e41a059806d1e60eb25a9d66889938b32599168dc2c0ca648e1c1976b1
+DIST universal-detector-1.1.tar.gz 196274 BLAKE2B d84dc1f850031213d88c288341edcbb588197f23ae0d10632ed129e73e4cc2b7670c8c862bba2165fcc7421c265e4dc3e791ea188e3d2b647bd1ab9b428bb866 SHA512 e514670b3d37b2472ed3e9cb0fdc3298a8479772264b7573411f104be554222bec2e01f73e1f35db95620fe785bee2dcf9ddc9c2b1f4ff6b522fa64d14d020f5
diff --git a/app-arch/unar/metadata.xml b/app-arch/unar/metadata.xml
new file mode 100644
index 0000000..b6ae255
--- /dev/null
+++ b/app-arch/unar/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <remote-id type="github">MacPaw/XADMaster</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-arch/unar/unar-1.10.7-r1.ebuild b/app-arch/unar/unar-1.10.7-r1.ebuild
new file mode 100644
index 0000000..f076cb7
--- /dev/null
+++ b/app-arch/unar/unar-1.10.7-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 toolchain-funcs
+
+DESCRIPTION="Unpacker for various archiving formats, e.g. rar v3"
+HOMEPAGE="https://unarchiver.c3.cx/"
+SRC_URI="
+ https://github.com/MacPaw/XADMaster/archive/v${PV}/XADMaster-${PV}.tar.gz
+ https://github.com/MacPaw/universal-detector/archive/1.1/universal-detector-1.1.tar.gz
+"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64"
+
+RDEPEND="
+ app-arch/bzip2:=
+ dev-libs/icu:=
+ gnustep-base/gnustep-base:=
+ media-sound/wavpack
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}
+ ${BDEPEND}
+ gnustep-base/gnustep-make[native-exceptions]
+"
+
+S="${WORKDIR}/XADMaster-${PV}"
+
+src_prepare() {
+ default
+ # avoid jobserver warning "make[1]: warning: jobserver unavailable: using -j1"
+ sed -i -e 's:make:$(MAKE):g' Makefile.linux || die
+ mv "${WORKDIR}/universal-detector-1.1" "${WORKDIR}/UniversalDetector" || die
+}
+
+src_compile() {
+ emake -f Makefile.linux \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ OBJCC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ OBJCFLAGS="${CFLAGS}" \
+ LD="$(tc-getCXX)" \
+ LDFLAGS="-Wl,--whole-archive -fexceptions -fgnu-runtime ${LDFLAGS}"
+}
+
+src_install() {
+ dobin {ls,un}ar
+ doman Extra/{ls,un}ar.1
+ dobashcomp Extra/{ls,un}ar.bash_completion
+}
diff --git a/dev-python/fonttools/Manifest b/dev-python/fonttools/Manifest
new file mode 100644
index 0000000..bd14b66
--- /dev/null
+++ b/dev-python/fonttools/Manifest
@@ -0,0 +1 @@
+DIST fonttools-4.12.1.tar.gz 2449008 BLAKE2B 11c08ee391c7306694538f602e68b95bc8c05aa6a227a1efa79e0f88cbe78a7d68eed6eaf371b36ebc84e691e360a16d2ba176a67b40b27dcf8ca0a33beb0a96 SHA512 4200214236dc2e8c0997223a95c1271b3d4c088b9c086e5f6481a311a80fdeb39d56f5aebd278434f84d3fb1c626c32bc5a3ebd7e05ebf5b1d338dcd42e8a92a
diff --git a/dev-python/fonttools/fonttools-4.12.1.ebuild b/dev-python/fonttools/fonttools-4.12.1.ebuild
new file mode 100644
index 0000000..f15fbef
--- /dev/null
+++ b/dev-python/fonttools/fonttools-4.12.1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{3_6,3_7,3_8} )
+PYTHON_REQ_USE="xml(+)"
+
+inherit distutils-r1 virtualx
+
+DESCRIPTION="Library for manipulating TrueType, OpenType, AFM and Type1 fonts"
+HOMEPAGE="https://github.com/fonttools/fonttools/"
+SRC_URI="https://github.com/fonttools/fonttools/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 sparc x86"
+RESTRICT="!test? ( test )"
+IUSE="test"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ test? (
+ >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
+
+ >=dev-python/fs-2.4.9[${PYTHON_USEDEP}]
+ app-arch/brotli[python,${PYTHON_USEDEP}]
+ app-arch/zopfli
+ )"
+
+python_prepare_all() {
+ # When dev-python/pytest-shutil is installed, we get weird import errors.
+ # This is due to incomplete nesting in the Tests/ tree:
+ #
+ # Tests/feaLib/__init__.py
+ # Tests/ufoLib/__init__.py
+ # Tests/svgLib/path/__init__.py
+ # Tests/otlLib/__init__.py
+ # Tests/varLib/__init__.py
+ #
+ # This tree requires an __init__.py in Tests/svgLib/ too, bug #701148.
+ touch Tests/svgLib/__init__.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ # virtualx used when matplotlib is installed causing plot module tests to run
+ virtx pytest -vv Tests fontTools
+}
diff --git a/dev-python/fonttools/metadata.xml b/dev-python/fonttools/metadata.xml
new file mode 100644
index 0000000..1073d2b
--- /dev/null
+++ b/dev-python/fonttools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <stabilize-allarches/>
+ <upstream>
+ <remote-id type="github">fonttools/fonttools</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-sound/qjackctl/Manifest b/media-sound/qjackctl/Manifest
new file mode 100644
index 0000000..4d1b9e5
--- /dev/null
+++ b/media-sound/qjackctl/Manifest
@@ -0,0 +1 @@
+DIST qjackctl-0.6.2.tar.gz 1027742 BLAKE2B d2db9e0496223844e3cb289aa8c4ae136011ad36578f3526fd54b44344606e14885d7272bd8e333035b2c908216e60ce2bfe7698c4c8395fd3b017da6b64f03f SHA512 a05f514d749b4f2344c7f0d57a2a0dd1ac6a97f35d0227827e78d3bd7abfbddc3201e2fc7e23f878cd318e408f169a4006a150dc0e43101086e9ba32004e5520
diff --git a/media-sound/qjackctl/metadata.xml b/media-sound/qjackctl/metadata.xml
new file mode 100644
index 0000000..af4a04a
--- /dev/null
+++ b/media-sound/qjackctl/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <remote-id type="sourceforge">qjackctl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-sound/qjackctl/qjackctl-0.6.2.ebuild b/media-sound/qjackctl/qjackctl-0.6.2.ebuild
new file mode 100644
index 0000000..8fef3fa
--- /dev/null
+++ b/media-sound/qjackctl/qjackctl-0.6.2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic qmake-utils xdg-utils
+
+DESCRIPTION="Qt GUI to control the JACK Audio Connection Kit and ALSA sequencer connections"
+HOMEPAGE="https://qjackctl.sourceforge.io/"
+SRC_URI="mirror://sourceforge/qjackctl/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="alsa dbus debug portaudio"
+
+BDEPEND="dev-qt/linguist-tools:5"
+RDEPEND="
+ app-arch/gzip
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qtxml:5
+ virtual/jack
+ alsa? ( media-libs/alsa-lib )
+ dbus? ( dev-qt/qtdbus:5 )
+ portaudio? ( media-libs/portaudio )"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ append-cxxflags -std=c++11
+ local myeconfargs=(
+ $(use_enable alsa alsa-seq)
+ $(use_enable dbus)
+ $(use_enable debug)
+ $(use_enable portaudio)
+ --enable-jack-version
+ )
+ econf "${myeconfargs[@]}"
+ eqmake5 ${PN}.pro -o ${PN}.mak
+}
+
+src_compile() {
+ emake -f ${PN}.mak
+}
+
+src_install() {
+ default
+
+ gunzip "${D}/usr/share/man/man1/qjackctl.fr.1.gz" || die
+ gunzip "${D}/usr/share/man/man1/qjackctl.1.gz" || die
+}
+
+pkg_postinst() {
+ xdg_icon_cache_update
+}
+
+pkg_postrm() {
+ xdg_icon_cache_update
+}
diff --git a/media-sound/qjackctl/qjackctl-9999.ebuild b/media-sound/qjackctl/qjackctl-9999.ebuild
new file mode 100644
index 0000000..3131466
--- /dev/null
+++ b/media-sound/qjackctl/qjackctl-9999.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic qmake-utils autotools git-r3 xdg-utils
+
+DESCRIPTION="Qt GUI to control the JACK Audio Connection Kit and ALSA sequencer connections"
+HOMEPAGE="https://qjackctl.sourceforge.io/"
+EGIT_REPO_URI="https://git.code.sf.net/p/qjackctl/code"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="alsa dbus debug portaudio"
+
+BDEPEND="dev-qt/linguist-tools:5"
+RDEPEND="
+ app-arch/gzip
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ dev-qt/qtxml:5
+ virtual/jack
+ alsa? ( media-libs/alsa-lib )
+ dbus? ( dev-qt/qtdbus:5 )
+ portaudio? ( media-libs/portaudio )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ append-cxxflags -std=c++11
+ local myeconfargs=(
+ $(use_enable alsa alsa-seq)
+ $(use_enable dbus)
+ $(use_enable debug)
+ $(use_enable portaudio)
+ --enable-jack-version
+ )
+ econf "${myeconfargs[@]}"
+ eqmake5 ${PN}.pro -o ${PN}.mak
+}
+
+src_compile() {
+ emake -f ${PN}.mak
+}
+
+src_install() {
+ default
+
+ gunzip "${D}/usr/share/man/man1/qjackctl.fr.1.gz" || die
+ gunzip "${D}/usr/share/man/man1/qjackctl.1.gz" || die
+}
+
+pkg_postinst() {
+ xdg_icon_cache_update
+}
+
+pkg_postrm() {
+ xdg_icon_cache_update
+}
diff --git a/virtual/notification-daemon/metadata.xml b/virtual/notification-daemon/metadata.xml
new file mode 100644
index 0000000..097975e
--- /dev/null
+++ b/virtual/notification-daemon/metadata.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+</pkgmetadata>
diff --git a/virtual/notification-daemon/notification-daemon-1.ebuild b/virtual/notification-daemon/notification-daemon-1.ebuild
new file mode 100644
index 0000000..6e0d476
--- /dev/null
+++ b/virtual/notification-daemon/notification-daemon-1.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Virtual for notification daemon dbus service"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ia64 ~mips ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-solaris"
+IUSE="gnome kde wayland"
+
+RDEPEND="
+ gnome? ( || ( x11-misc/notification-daemon
+ gnome-base/gnome-shell ) )
+ kde? ( kde-plasma/plasma-workspace )
+ !gnome? ( !kde? ( || (
+ wayland? (
+ gui-apps/mako
+ )
+ x11-misc/notification-daemon
+ gnome-extra/cinnamon
+ xfce-extra/xfce4-notifyd
+ x11-misc/notify-osd
+ x11-misc/dunst
+ >=x11-wm/awesome-3.4.4
+ x11-wm/enlightenment[enlightenment_modules_notification]
+ x11-wm/enlightenment[e_modules_notification]
+ x11-misc/mate-notification-daemon
+ lxqt-base/lxqt-notificationd
+ net-misc/eventd[notification]
+ ) ) )"
diff --git a/virtual/rust/metadata.xml b/virtual/rust/metadata.xml
new file mode 100644
index 0000000..097975e
--- /dev/null
+++ b/virtual/rust/metadata.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+</pkgmetadata>
diff --git a/virtual/rust/rust-1.41.1.ebuild b/virtual/rust/rust-1.41.1.ebuild
new file mode 100644
index 0000000..315e172
--- /dev/null
+++ b/virtual/rust/rust-1.41.1.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-build
+
+DESCRIPTION="Virtual for Rust language compiler"
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="amd64 ~arm arm64 ppc64 x86"
+
+BDEPEND=""
+RDEPEND="|| ( =dev-lang/rust-bin-${PV}* =dev-lang/rust-${PV}*[${MULTILIB_USEDEP}] )"
diff --git a/virtual/rust/rust-1.42.0.ebuild b/virtual/rust/rust-1.42.0.ebuild
new file mode 100644
index 0000000..3d180e1
--- /dev/null
+++ b/virtual/rust/rust-1.42.0.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-build
+
+DESCRIPTION="Virtual for Rust language compiler"
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+BDEPEND=""
+RDEPEND="|| ( =dev-lang/rust-bin-${PV}* =dev-lang/rust-${PV}*[${MULTILIB_USEDEP}] )"
diff --git a/virtual/rust/rust-1.43.1.ebuild b/virtual/rust/rust-1.43.1.ebuild
new file mode 100644
index 0000000..047d17e
--- /dev/null
+++ b/virtual/rust/rust-1.43.1.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-build
+
+DESCRIPTION="Virtual for Rust language compiler"
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ppc64 x86"
+
+BDEPEND=""
+RDEPEND="|| ( =dev-lang/rust-bin-${PV}*[${MULTILIB_USEDEP}] =dev-lang/rust-${PV}*[${MULTILIB_USEDEP}] )"
diff --git a/virtual/rust/rust-1.44.0.ebuild b/virtual/rust/rust-1.44.0.ebuild
new file mode 100644
index 0000000..3d33a14
--- /dev/null
+++ b/virtual/rust/rust-1.44.0.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-build
+
+DESCRIPTION="Virtual for Rust language compiler"
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+BDEPEND=""
+RDEPEND="|| ( =dev-lang/rust-bin-${PV}*[${MULTILIB_USEDEP}] =dev-lang/rust-${PV}*[${MULTILIB_USEDEP}] )"
diff --git a/virtual/rust/rust-1.44.1.ebuild b/virtual/rust/rust-1.44.1.ebuild
new file mode 100644
index 0000000..0e6e6e7
--- /dev/null
+++ b/virtual/rust/rust-1.44.1.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-build
+
+DESCRIPTION="Virtual for Rust language compiler"
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ppc64 x86"
+
+BDEPEND=""
+RDEPEND="|| ( ~dev-lang/rust-bin-${PV}[${MULTILIB_USEDEP}] ~dev-lang/rust-${PV}[${MULTILIB_USEDEP}] )"
diff --git a/virtual/rust/rust-1.45.0.ebuild b/virtual/rust/rust-1.45.0.ebuild
new file mode 100644
index 0000000..61df384
--- /dev/null
+++ b/virtual/rust/rust-1.45.0.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-build
+
+DESCRIPTION="Virtual for Rust language compiler"
+
+LICENSE=""
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+BDEPEND=""
+RDEPEND="|| ( ~dev-lang/rust-bin-${PV}[${MULTILIB_USEDEP}] ~dev-lang/rust-${PV}[${MULTILIB_USEDEP}] )"
diff --git a/x11-apps/mesa-progs/Manifest b/x11-apps/mesa-progs/Manifest
new file mode 100644
index 0000000..3f7b33b
--- /dev/null
+++ b/x11-apps/mesa-progs/Manifest
@@ -0,0 +1 @@
+DIST mesa-demos-8.4.0.tar.bz2 10073259 BLAKE2B d251e705c6e3d2fe959161d736401fd06ba267a9c389341098373670b6f44ca7cdb451d96e94e3b22f006b696a9b19e38096423f6438544539f46beda91c03f4 SHA512 b72d03cad36e0535ff18dcfb222ec4200064b9264f6da51a6e5f03b0dd912abe188bc1d600b6698de3ce6f63b28d2ce01565886ca8e7079edc4967fbf2fb0957
diff --git a/x11-apps/mesa-progs/files/mesa-progs-8.4.0-improve-printing.patch b/x11-apps/mesa-progs/files/mesa-progs-8.4.0-improve-printing.patch
new file mode 100644
index 0000000..ffc4d3f
--- /dev/null
+++ b/x11-apps/mesa-progs/files/mesa-progs-8.4.0-improve-printing.patch
@@ -0,0 +1,289 @@
+From aa9e66f2d1e96937c56e4141bf8c966a8a59983f Mon Sep 17 00:00:00 2001
+From: Brian Paul <brianp@vmware.com>
+Date: Wed, 28 Feb 2018 11:14:34 -0700
+Subject: [PATCH 1/4] glxinfo/wglinfo: remove print_shader_limits() code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+And add queries of GL 2.0 limits. All the VS, FS, GS limits which were
+reported with print_shader_limits() are also covered by the GL 2.0 and
+3.2 queries.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105285
+Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
+Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+---
+ src/xdemos/glinfo_common.c | 89 +++++---------------------------------
+ 1 file changed, 11 insertions(+), 78 deletions(-)
+
+diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
+index 3668026b..7ffbeac5 100644
+--- a/src/xdemos/glinfo_common.c
++++ b/src/xdemos/glinfo_common.c
+@@ -378,74 +378,6 @@ struct token_name
+ };
+
+
+-static void
+-print_shader_limit_list(const struct token_name *lim)
+-{
+- GLint max[1];
+- unsigned i;
+-
+- for (i = 0; lim[i].token; i++) {
+- glGetIntegerv(lim[i].token, max);
+- if (glGetError() == GL_NO_ERROR) {
+- printf(" %s = %d\n", lim[i].name, max[0]);
+- }
+- }
+-}
+-
+-
+-/**
+- * Print interesting limits for vertex/fragment shaders.
+- */
+-static void
+-print_shader_limits(GLenum target)
+-{
+- static const struct token_name vertex_limits[] = {
+- { GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB" },
+- { GL_MAX_VARYING_FLOATS_ARB, "GL_MAX_VARYING_FLOATS_ARB" },
+- { GL_MAX_VERTEX_ATTRIBS_ARB, "GL_MAX_VERTEX_ATTRIBS_ARB" },
+- { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
+- { GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" },
+- { GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" },
+- { GL_MAX_TEXTURE_COORDS_ARB, "GL_MAX_TEXTURE_COORDS_ARB" },
+- { GL_MAX_VERTEX_OUTPUT_COMPONENTS , "GL_MAX_VERTEX_OUTPUT_COMPONENTS " },
+- { (GLenum) 0, NULL }
+- };
+- static const struct token_name fragment_limits[] = {
+- { GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" },
+- { GL_MAX_TEXTURE_COORDS_ARB, "GL_MAX_TEXTURE_COORDS_ARB" },
+- { GL_MAX_TEXTURE_IMAGE_UNITS_ARB, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
+- { GL_MAX_FRAGMENT_INPUT_COMPONENTS , "GL_MAX_FRAGMENT_INPUT_COMPONENTS " },
+- { (GLenum) 0, NULL }
+- };
+- static const struct token_name geometry_limits[] = {
+- { GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS" },
+- { GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS" },
+- { GL_MAX_GEOMETRY_OUTPUT_VERTICES , "GL_MAX_GEOMETRY_OUTPUT_VERTICES " },
+- { GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS" },
+- { GL_MAX_GEOMETRY_INPUT_COMPONENTS , "GL_MAX_GEOMETRY_INPUT_COMPONENTS " },
+- { GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, "GL_MAX_GEOMETRY_OUTPUT_COMPONENTS" },
+- { (GLenum) 0, NULL }
+- };
+-
+- switch (target) {
+- case GL_VERTEX_SHADER:
+- printf(" GL_VERTEX_SHADER_ARB:\n");
+- print_shader_limit_list(vertex_limits);
+- break;
+-
+- case GL_FRAGMENT_SHADER:
+- printf(" GL_FRAGMENT_SHADER_ARB:\n");
+- print_shader_limit_list(fragment_limits);
+- break;
+-
+- case GL_GEOMETRY_SHADER:
+- printf(" GL_GEOMETRY_SHADER:\n");
+- print_shader_limit_list(geometry_limits);
+- break;
+- }
+-}
+-
+-
+ /**
+ * Print interesting limits for vertex/fragment programs.
+ */
+@@ -627,7 +559,17 @@ print_limits(const char *extensions, const char *oglstring, int version,
+ { 1, GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS, "GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS", "GL_ARB_tessellation_shader" },
+ { 1, GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS, "GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS", "GL_ARB_tessellation_shader" },
+ #endif
+-
++#if defined(GL_VERSION_2_0)
++ { 1, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS", "2.0" },
++ { 1, GL_MAX_DRAW_BUFFERS, "GL_MAX_DRAW_BUFFERS", "2.0" },
++ { 1, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS", "2.0" },
++ { 1, GL_MAX_TEXTURE_COORDS, "GL_MAX_TEXTURE_COORDS", "2.0" },
++ { 1, GL_MAX_TEXTURE_IMAGE_UNITS, "GL_MAX_TEXTURE_IMAGE_UNITS", "2.0" },
++ { 1, GL_MAX_VARYING_FLOATS, "GL_MAX_VARYING_FLOATS", "2.0" },
++ { 1, GL_MAX_VERTEX_ATTRIBS, "GL_MAX_VERTEX_ATTRIBS", "2.0" },
++ { 1, GL_MAX_VERTEX_UNIFORM_COMPONENTS, "GL_MAX_VERTEX_UNIFORM_COMPONENTS", "2.0" },
++ { 1, GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS", "2.0" },
++#endif
+ #if defined(GL_VERSION_3_0)
+ { 1, GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", "3.0" },
+ { 1, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", "3.0" },
+@@ -819,15 +761,6 @@ print_limits(const char *extensions, const char *oglstring, int version,
+ print_program_limits(GL_FRAGMENT_PROGRAM_ARB, extfuncs);
+ }
+ #endif
+- if (extension_supported("GL_ARB_vertex_shader", extensions)) {
+- print_shader_limits(GL_VERTEX_SHADER_ARB);
+- }
+- if (extension_supported("GL_ARB_fragment_shader", extensions)) {
+- print_shader_limits(GL_FRAGMENT_SHADER_ARB);
+- }
+- if (version >= 32) {
+- print_shader_limits(GL_GEOMETRY_SHADER);
+- }
+ }
+
+
+--
+2.19.2
+
+From 9804a083feb676cf810905a6826f708f54a15be2 Mon Sep 17 00:00:00 2001
+From: Brian Paul <brianp@vmware.com>
+Date: Wed, 28 Feb 2018 11:19:43 -0700
+Subject: [PATCH 2/4] glxinfo/wglinfo: fix VP/FP strings, indentation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Print extensions string instead of program target.
+Use less indentation to match other sections.
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105285
+Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
+Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+---
+ src/xdemos/glinfo_common.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
+index 7ffbeac5..57dccc82 100644
+--- a/src/xdemos/glinfo_common.c
++++ b/src/xdemos/glinfo_common.c
+@@ -419,10 +419,10 @@ print_program_limits(GLenum target,
+ int i;
+
+ if (target == GL_VERTEX_PROGRAM_ARB) {
+- printf(" GL_VERTEX_PROGRAM_ARB:\n");
++ printf(" GL_ARB_vertex_program:\n");
+ }
+ else if (target == GL_FRAGMENT_PROGRAM_ARB) {
+- printf(" GL_FRAGMENT_PROGRAM_ARB:\n");
++ printf(" GL_ARB_fragment_program:\n");
+ }
+ else {
+ return; /* something's wrong */
+@@ -431,14 +431,14 @@ print_program_limits(GLenum target,
+ for (i = 0; common_limits[i].token; i++) {
+ extfuncs->GetProgramivARB(target, common_limits[i].token, max);
+ if (glGetError() == GL_NO_ERROR) {
+- printf(" %s = %d\n", common_limits[i].name, max[0]);
++ printf(" %s = %d\n", common_limits[i].name, max[0]);
+ }
+ }
+ if (target == GL_FRAGMENT_PROGRAM_ARB) {
+ for (i = 0; fragment_limits[i].token; i++) {
+ extfuncs->GetProgramivARB(target, fragment_limits[i].token, max);
+ if (glGetError() == GL_NO_ERROR) {
+- printf(" %s = %d\n", fragment_limits[i].name, max[0]);
++ printf(" %s = %d\n", fragment_limits[i].name, max[0]);
+ }
+ }
+ }
+--
+2.19.2
+
+From 6a7cee63b714699b98a31b3e57039d26506465ae Mon Sep 17 00:00:00 2001
+From: Brian Paul <brianp@vmware.com>
+Date: Mon, 5 Mar 2018 09:37:17 -0700
+Subject: [PATCH 3/4] glxinfo/wglinfo: print (110) instead of empty line
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The GL_SHADING_LANGUAGE_VERSION query returns an empty string for
+GLSL 1.10. Instead of printing an empty line, print (110).
+
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105285
+Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
+Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+---
+ src/xdemos/glinfo_common.c | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
+index 57dccc82..a8ec12e7 100644
+--- a/src/xdemos/glinfo_common.c
++++ b/src/xdemos/glinfo_common.c
+@@ -745,8 +745,17 @@ print_limits(const char *extensions, const char *oglstring, int version,
+ glGetIntegerv(GL_NUM_SHADING_LANGUAGE_VERSIONS, &n);
+ printf(" GL_NUM_SHADING_LANGUAGE_VERSIONS = %d\n", n);
+ for (i = 0; i < n; i++) {
+- printf(" %s\n", (const char *)
+- extfuncs->GetStringi(GL_SHADING_LANGUAGE_VERSION, i));
++ const char *lang = (const char *)
++ extfuncs->GetStringi(GL_SHADING_LANGUAGE_VERSION, i);
++ if (lang[0] == 0) {
++ /* The empty string is really GLSL 1.10. Instead of
++ * printing an empty line, print (110). For more info,
++ * see the GL 4.3 compatibility profile specification,
++ * page 628.
++ */
++ lang = "(110)";
++ }
++ printf(" %s\n", lang);
+ }
+ }
+ #endif
+--
+2.19.2
+
+From 27a0e5af804b3d28c51bd05ad38d25a2c8b4112d Mon Sep 17 00:00:00 2001
+From: Brian Paul <brianp@vmware.com>
+Date: Mon, 5 Mar 2018 09:44:41 -0700
+Subject: [PATCH 4/4] glxinfo/wglinfo: improve GL_ARB_imaging query code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Print GL_MAX_CONVOLUTION_WIDTH, HEIGHT on separate lines.
+Print GL_MAX_COLOR_MATRIX_STACK_DEPTH in same section.
+
+Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
+Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
+---
+ src/xdemos/glinfo_common.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/xdemos/glinfo_common.c b/src/xdemos/glinfo_common.c
+index a8ec12e7..92467d67 100644
+--- a/src/xdemos/glinfo_common.c
++++ b/src/xdemos/glinfo_common.c
+@@ -464,7 +464,6 @@ print_limits(const char *extensions, const char *oglstring, int version,
+ { 1, GL_MAX_ATTRIB_STACK_DEPTH, "GL_MAX_ATTRIB_STACK_DEPTH", NULL },
+ { 1, GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", NULL },
+ { 1, GL_MAX_CLIP_PLANES, "GL_MAX_CLIP_PLANES", NULL },
+- { 1, GL_MAX_COLOR_MATRIX_STACK_DEPTH, "GL_MAX_COLOR_MATRIX_STACK_DEPTH", "GL_ARB_imaging" },
+ { 1, GL_MAX_ELEMENTS_VERTICES, "GL_MAX_ELEMENTS_VERTICES", NULL },
+ { 1, GL_MAX_ELEMENTS_INDICES, "GL_MAX_ELEMENTS_INDICES", NULL },
+ { 1, GL_MAX_EVAL_ORDER, "GL_MAX_EVAL_ORDER", NULL },
+@@ -716,12 +715,16 @@ print_limits(const char *extensions, const char *oglstring, int version,
+
+ /* these don't fit into the above mechanism, unfortunately */
+ if (extension_supported("GL_ARB_imaging", extensions)) {
++ GLint d;
++ printf(" GL_ARB_imaging:\n");
+ extfuncs->GetConvolutionParameteriv(GL_CONVOLUTION_2D,
+- GL_MAX_CONVOLUTION_WIDTH, max);
++ GL_MAX_CONVOLUTION_WIDTH, &d);
++ printf(" GL_MAX_CONVOLUTION_WIDTH = %d\n", d);
+ extfuncs->GetConvolutionParameteriv(GL_CONVOLUTION_2D,
+- GL_MAX_CONVOLUTION_HEIGHT, max+1);
+- printf(" GL_ARB_imaging:\n");
+- printf(" GL_MAX_CONVOLUTION_WIDTH/HEIGHT = %d, %d\n", max[0], max[1]);
++ GL_MAX_CONVOLUTION_HEIGHT, &d);
++ printf(" GL_MAX_CONVOLUTION_HEIGHT = %d\n", d);
++ glGetIntegerv(GL_MAX_COLOR_MATRIX_STACK_DEPTH, &d);
++ printf(" GL_MAX_COLOR_MATRIX_STACK_DEPTH = %d\n", d);
+ }
+
+ if (extension_supported("GL_ARB_texture_compression", extensions)) {
+--
+2.19.2
+
diff --git a/x11-apps/mesa-progs/mesa-progs-8.4.0-r1.ebuild b/x11-apps/mesa-progs/mesa-progs-8.4.0-r1.ebuild
new file mode 100644
index 0000000..295d0d1
--- /dev/null
+++ b/x11-apps/mesa-progs/mesa-progs-8.4.0-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+MY_PN="${PN/progs/demos}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Mesa's OpenGL utility and demo programs (glxgears and glxinfo)"
+HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/ https://gitlab.freedesktop.org/mesa/demos"
+if [[ ${PV} = 9999* ]]; then
+ inherit autotools git-r3
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/demos.git"
+ EGIT_CHECKOUT_DIR="${S}"
+ EXPERIMENTAL="true"
+else
+ SRC_URI="https://mesa.freedesktop.org/archive/demos/${MY_P}.tar.bz2
+ https://mesa.freedesktop.org/archive/demos/${PV}/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="egl gles2"
+
+RDEPEND="
+ media-libs/mesa[egl?,gles2?]
+ media-libs/glew
+ virtual/opengl
+ x11-libs/libX11"
+DEPEND="${RDEPEND}
+ virtual/glu
+ x11-base/xorg-proto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-improve-printing.patch
+)
+
+src_prepare() {
+ default
+ [[ $PV = 9999* ]] && eautoreconf
+}
+
+src_compile() {
+ emake -C src/xdemos glxgears glxinfo
+
+ if use egl; then
+ emake LDLIBS="-lEGL" -C src/egl/opengl/ eglinfo
+ emake -C src/egl/eglut/ libeglut_x11.la
+ emake LDLIBS="-lGL -lEGL -lX11 -lm" -C src/egl/opengl/ eglgears_x11
+
+ if use gles2; then
+ emake LDLIBS="-lGLESv2 -lEGL -lX11" -C src/egl/opengles2/ es2_info
+ emake LDLIBS="-lGLESv2 -lEGL -lX11 -lm" -C src/egl/opengles2/ es2gears_x11
+ fi
+ fi
+}
+
+src_install() {
+ dobin src/xdemos/{glxgears,glxinfo}
+ if use egl; then
+ dobin src/egl/opengl/egl{info,gears_x11}
+
+ use gles2 && dobin src/egl/opengles2/es2{_info,gears_x11}
+ fi
+}
diff --git a/x11-apps/mesa-progs/mesa-progs-9999.ebuild b/x11-apps/mesa-progs/mesa-progs-9999.ebuild
new file mode 100644
index 0000000..96677b7
--- /dev/null
+++ b/x11-apps/mesa-progs/mesa-progs-9999.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+MY_PN="${PN/progs/demos}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Mesa's OpenGL utility and demo programs (glxgears and glxinfo)"
+HOMEPAGE="https://www.mesa3d.org/ https://mesa.freedesktop.org/ https://gitlab.freedesktop.org/mesa/demos"
+if [[ ${PV} = 9999* ]]; then
+ inherit autotools git-r3
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/demos.git"
+ EGIT_CHECKOUT_DIR="${S}"
+ EXPERIMENTAL="true"
+else
+ SRC_URI="https://mesa.freedesktop.org/archive/demos/${MY_P}.tar.bz2
+ https://mesa.freedesktop.org/archive/demos/${PV}/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+LICENSE="LGPL-2"
+SLOT="0"
+IUSE="egl gles2"
+
+RDEPEND="
+ media-libs/glew
+ media-libs/mesa[egl?,gles2?]
+ virtual/opengl
+ x11-libs/libX11"
+DEPEND="${RDEPEND}
+ virtual/glu
+ x11-base/xorg-proto"
+
+src_prepare() {
+ default
+ [[ $PV = 9999* ]] && eautoreconf
+}
+
+src_compile() {
+ emake -C src/xdemos glxgears glxinfo
+
+ if use egl; then
+ emake LDLIBS="-lEGL" -C src/egl/opengl/ eglinfo
+ emake -C src/egl/eglut/ libeglut_x11.la
+ emake LDLIBS="-lGL -lEGL -lX11 -lm" -C src/egl/opengl/ eglgears_x11
+
+ if use gles2; then
+ emake LDLIBS="-lGLESv2 -lEGL -lX11" -C src/egl/opengles2/ es2_info
+ emake LDLIBS="-lGLESv2 -lEGL -lX11 -lm" -C src/egl/opengles2/ es2gears_x11
+ fi
+ fi
+}
+
+src_install() {
+ dobin src/xdemos/{glxgears,glxinfo}
+ if use egl; then
+ dobin src/egl/opengl/egl{info,gears_x11}
+
+ use gles2 && dobin src/egl/opengles2/es2{_info,gears_x11}
+ fi
+}
diff --git a/x11-apps/mesa-progs/metadata.xml b/x11-apps/mesa-progs/metadata.xml
new file mode 100644
index 0000000..733cce5
--- /dev/null
+++ b/x11-apps/mesa-progs/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>x11@gentoo.org</email>
+ <name>X11</name>
+ </maintainer>
+ <use>
+ <flag name="egl">Build EGL utilities</flag>
+ <flag name="gles2">Build OpenGL ES 2 utilities</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">mesa3d</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/x11-base/xorg-server/Manifest b/x11-base/xorg-server/Manifest
new file mode 100644
index 0000000..0b04317
--- /dev/null
+++ b/x11-base/xorg-server/Manifest
@@ -0,0 +1 @@
+DIST xorg-server-1.20.8.tar.bz2 6309640 BLAKE2B 0dadd3a7afdb768bcd79f99f3670f7efcb919c43ea88870c93df598b080fbbec48f88cfa996fb7bff2363cffe70d42d9b154855691a64ddb26156f1b378512a0 SHA512 ab0ec0fcbf490c61558b9297f61b58fd2dedb676c78bef6431dc9166054743b43a0091b88a8b3f4e81d1f539909440ee7e188a298cefabe13ea89159639cd805
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..8f2ed27
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm-setup.initd-1
@@ -0,0 +1,13 @@
+#!/sbin/openrc-run
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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..880d463
--- /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 | sddm | gpe | lightdm | 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..7b2f992
--- /dev/null
+++ b/x11-base/xorg-server/files/xdm.initd-11
@@ -0,0 +1,230 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+
+# 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}" 2>/dev/null; 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-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.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-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/metadata.xml b/x11-base/xorg-server/metadata.xml
new file mode 100644
index 0000000..fbd7f37
--- /dev/null
+++ b/x11-base/xorg-server/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<use>
+ <flag name="dmx">Build the Distributed Multiheaded X server</flag>
+ <flag name="elogind">Use elogind to get control over framebuffer when running as regular user</flag>
+ <flag name="kdrive">Build the kdrive X servers</flag>
+ <flag name="libglvnd">Use libglvnd for dispatch.</flag>
+ <flag name="unwind">Enable libunwind usage for backtraces</flag>
+ <flag name="xcsecurity">Build Security extension</flag>
+ <flag name="xephyr">Build the Xephyr server</flag>
+ <flag name="xnest">Build the Xnest server</flag>
+ <flag name="xorg">Build the Xorg X server (HIGHLY RECOMMENDED)</flag>
+ <flag name="xvfb">Build the Xvfb server</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:x.org:xorg-server</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/x11-base/xorg-server/xorg-server-1.20.8-r2.ebuild b/x11-base/xorg-server/xorg-server-1.20.8-r2.ebuild
new file mode 100644
index 0000000..7c23839
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-1.20.8-r2.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+XORG_DOC=doc
+inherit xorg-3 multilib flag-o-matic toolchain-funcs
+EGIT_REPO_URI="https://gitlab.freedesktop.org/xorg/xserver.git"
+
+DESCRIPTION="X.Org X servers"
+SLOT="0/${PV}"
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux"
+fi
+
+IUSE_SERVERS="dmx kdrive wayland xephyr xnest xorg xvfb"
+IUSE="${IUSE_SERVERS} debug +elogind ipv6 libressl +libglvnd minimal selinux suid systemd +udev unwind xcsecurity"
+
+CDEPEND="libglvnd? (
+ media-libs/libglvnd[X]
+ !app-eselect/eselect-opengl
+ !!x11-drivers/nvidia-drivers[-libglvnd(-)]
+ )
+ !libglvnd? ( >=app-eselect/eselect-opengl-1.3.0 )
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ >=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.89
+ >=x11-libs/libpciaccess-0.12.901
+ >=x11-libs/libXau-1.0.4
+ >=x11-libs/libXdmcp-1.0.2
+ >=x11-libs/libXfont2-2.0.1
+ >=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
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ xephyr? (
+ x11-libs/libxcb[xkb]
+ 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-18[X(+),egl,gbm]
+ >=media-libs/libepoxy-1.5.4[X,egl(+)]
+ )
+ udev? ( virtual/libudev:= )
+ unwind? ( sys-libs/libunwind )
+ wayland? (
+ >=dev-libs/wayland-1.3.0
+ >=media-libs/libepoxy-1.5.4[egl(+)]
+ >=dev-libs/wayland-protocols-1.18
+ )
+ systemd? (
+ sys-apps/dbus
+ sys-apps/systemd
+ )
+ elogind? (
+ sys-apps/dbus
+ sys-auth/elogind[pam]
+ sys-auth/pambase[elogind]
+ )
+ "
+
+DEPEND="${CDEPEND}
+ sys-devel/flex
+ >=x11-base/xorg-proto-2018.4
+ dmx? (
+ doc? (
+ || (
+ www-client/links
+ www-client/lynx
+ www-client/w3m
+ )
+ )
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-xserver )
+"
+
+PDEPEND="
+ xorg? ( >=x11-base/xorg-drivers-$(ver_cut 1-2) )"
+
+REQUIRED_USE="!minimal? (
+ || ( ${IUSE_SERVERS} )
+ )
+ elogind? ( udev )
+ ?? ( elogind systemd )
+ minimal? ( !wayland )
+ xephyr? ( kdrive )"
+
+UPSTREAMED_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_setup() {
+ if use wayland && use minimal; then
+ ewarn "glamor is necessary for acceleration under Xwayland."
+ ewarn "Performance may be unacceptable without it."
+ ewarn "Build with USE=-minimal to enable glamor."
+ fi
+
+ # 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 debug)
+ $(use_enable dmx)
+ $(use_enable kdrive)
+ $(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 dri3)
+ $(use_enable !minimal glamor)
+ $(use_enable !minimal glx)
+ $(use_enable xcsecurity)
+ $(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)
+ --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
+ CPP="$(tc-getPROG CPP cpp)"
+ )
+
+ if use systemd || use elogind; then
+ XORG_CONFIGURE_OPTIONS+=(
+ "--enable-systemd-logind"
+ "--disable-install-setuid"
+ "$(use_enable suid suid-wrapper)"
+ )
+ else
+ XORG_CONFIGURE_OPTIONS+=(
+ "--disable-systemd-logind"
+ "--disable-suid-wrapper"
+ "$(use_enable suid install-setuid)"
+ )
+ fi
+}
+
+src_install() {
+ xorg-3_src_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc "${S}"/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
+
+ find "${ED}"/var -type d -empty -delete || die
+}
+
+pkg_postinst() {
+ if ! use minimal; then
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ if ! use libglvnd; then
+ eselect opengl set xorg-x11 --use-old
+ fi
+ fi
+}
+
+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
+}
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..5e12f1c
--- /dev/null
+++ b/x11-base/xorg-server/xorg-server-9999.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+XORG_DOC=doc
+XORG_EAUTORECONF="yes"
+inherit xorg-3 multilib flag-o-matic toolchain-funcs
+EGIT_REPO_URI="https://gitlab.freedesktop.org/xorg/xserver.git"
+
+DESCRIPTION="X.Org X servers"
+SLOT="0/${PV}"
+if [[ ${PV} != 9999* ]]; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+IUSE_SERVERS="dmx kdrive wayland xephyr xnest xorg xvfb"
+IUSE="${IUSE_SERVERS} debug +elogind ipv6 libressl +libglvnd minimal selinux suid systemd +udev unwind xcsecurity"
+
+CDEPEND="libglvnd? (
+ media-libs/libglvnd[X]
+ !app-eselect/eselect-opengl
+ !!x11-drivers/nvidia-drivers[-libglvnd(-)]
+ )
+ !libglvnd? ( >=app-eselect/eselect-opengl-1.3.0 )
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ >=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.89
+ >=x11-libs/libpciaccess-0.12.901
+ >=x11-libs/libXau-1.0.4
+ >=x11-libs/libXdmcp-1.0.2
+ >=x11-libs/libXfont2-2.0.1
+ >=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
+ )
+ kdrive? (
+ >=x11-libs/libXext-1.0.5
+ x11-libs/libXv
+ )
+ xephyr? (
+ x11-libs/libxcb[xkb]
+ 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-18[X(+),egl,gbm]
+ >=media-libs/libepoxy-1.5.4[X,egl(+)]
+ )
+ udev? ( virtual/libudev:= )
+ unwind? ( sys-libs/libunwind )
+ wayland? (
+ >=dev-libs/wayland-1.3.0
+ >=media-libs/libepoxy-1.5.4[egl(+)]
+ >=dev-libs/wayland-protocols-1.18
+ )
+ systemd? (
+ sys-apps/dbus
+ sys-apps/systemd
+ )
+ elogind? (
+ sys-apps/dbus
+ sys-auth/elogind[pam]
+ sys-auth/pambase[elogind]
+ )
+ "
+
+DEPEND="${CDEPEND}
+ sys-devel/flex
+ >=x11-base/xorg-proto-2018.4
+ dmx? (
+ doc? (
+ || (
+ www-client/links
+ www-client/lynx
+ www-client/w3m
+ )
+ )
+ )"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-xserver )
+"
+
+PDEPEND="
+ xorg? ( >=x11-base/xorg-drivers-$(ver_cut 1-2) )"
+
+REQUIRED_USE="!minimal? (
+ || ( ${IUSE_SERVERS} )
+ )
+ elogind? ( udev )
+ ?? ( elogind systemd )
+ minimal? ( !wayland )
+ xephyr? ( kdrive )"
+
+UPSTREAMED_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_setup() {
+ if use wayland && use minimal; then
+ ewarn "glamor is necessary for acceleration under Xwayland."
+ ewarn "Performance may be unacceptable without it."
+ ewarn "Build with USE=-minimal to enable glamor."
+ fi
+
+ # 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 debug)
+ $(use_enable dmx)
+ $(use_enable kdrive)
+ $(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 dri3)
+ $(use_enable !minimal glamor)
+ $(use_enable !minimal glx)
+ $(use_enable xcsecurity)
+ $(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)
+ --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-sha1=libcrypto
+ CPP="$(tc-getPROG CPP cpp)"
+ )
+
+ if use systemd || use elogind; then
+ XORG_CONFIGURE_OPTIONS+=(
+ "--enable-systemd-logind"
+ "--disable-install-setuid"
+ "$(use_enable suid suid-wrapper)"
+ )
+ else
+ XORG_CONFIGURE_OPTIONS+=(
+ "--disable-systemd-logind"
+ "--disable-suid-wrapper"
+ "$(use_enable suid install-setuid)"
+ )
+ fi
+}
+
+src_install() {
+ xorg-3_src_install
+
+ server_based_install
+
+ if ! use minimal && use xorg; then
+ # Install xorg.conf.example into docs
+ dodoc "${S}"/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
+
+ find "${ED}"/var -type d -empty -delete || die
+}
+
+pkg_postinst() {
+ if ! use minimal; then
+ # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
+ if ! use libglvnd; then
+ eselect opengl set xorg-x11 --use-old
+ fi
+ fi
+}
+
+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
+}
diff --git a/x11-libs/cairo/Manifest b/x11-libs/cairo/Manifest
new file mode 100644
index 0000000..a9d5249
--- /dev/null
+++ b/x11-libs/cairo/Manifest
@@ -0,0 +1 @@
+DIST cairo-1.16.0.tar.xz 41997432 BLAKE2B aa37edf7fdf0c952484fd0adc9281724227db93958d6e4919216b30e9017fab670bc2340e3b975737080f1f67dec24025fe0e4680e275ab7703cfb9235eb1fe0 SHA512 9eb27c4cf01c0b8b56f2e15e651f6d4e52c99d0005875546405b64f1132aed12fbf84727273f493d84056a13105e065009d89e94a8bfaf2be2649e232b82377f
diff --git a/x11-libs/cairo/cairo-1.16.0-r5.ebuild b/x11-libs/cairo/cairo-1.16.0-r5.ebuild
new file mode 100644
index 0000000..b951785
--- /dev/null
+++ b/x11-libs/cairo/cairo-1.16.0-r5.ebuild
@@ -0,0 +1,136 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic autotools multilib-minimal
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/cairo/cairo.git"
+ SRC_URI=""
+else
+ SRC_URI="https://www.cairographics.org/releases/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+DESCRIPTION="A vector graphics library with cross-device output support"
+HOMEPAGE="https://www.cairographics.org/ https://gitlab.freedesktop.org/cairo/cairo"
+LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
+SLOT="0"
+IUSE="X aqua debug gles2-only +glib lzo opengl static-libs +svg utils valgrind"
+# gtk-doc regeneration doesn't seem to work with out-of-source builds
+#[[ ${PV} == *9999* ]] && IUSE="${IUSE} doc" # API docs are provided in tarball, no need to regenerate
+
+# Test causes a circular depend on gtk+... since gtk+ needs cairo but test needs gtk+ so we need to block it
+RESTRICT="test"
+
+BDEPEND="
+ virtual/pkgconfig
+ >=sys-devel/libtool-2"
+RDEPEND="
+ >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}]
+ >=media-libs/freetype-2.5.0.1:2[${MULTILIB_USEDEP}]
+ >=media-libs/libpng-1.6.10:0=[${MULTILIB_USEDEP}]
+ sys-libs/binutils-libs:0=[${MULTILIB_USEDEP}]
+ >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+ >=x11-libs/pixman-0.32.4[${MULTILIB_USEDEP}]
+ gles2-only? ( >=media-libs/mesa-9.1.6[gles2,${MULTILIB_USEDEP}] )
+ glib? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ lzo? ( >=dev-libs/lzo-2.06-r1[${MULTILIB_USEDEP}] )
+ opengl? ( >=media-libs/mesa-9.1.6[egl,X(+),${MULTILIB_USEDEP}] )
+ X? (
+ >=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libxcb-1.9.1[${MULTILIB_USEDEP}]
+ )"
+DEPEND="${RDEPEND}
+ X? ( x11-base/xorg-proto )"
+#[[ ${PV} == *9999* ]] && DEPEND="${DEPEND}
+# doc? (
+# >=dev-util/gtk-doc-1.6
+# ~app-text/docbook-xml-dtd-4.2
+# )"
+
+REQUIRED_USE="
+ gles2-only? ( !opengl )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.12.18-disable-test-suite.patch
+ "${FILESDIR}"/${PN}-respect-fontconfig.patch
+ "${FILESDIR}"/${P}-pdf-add-missing-flush.patch
+ "${FILESDIR}"/${P}-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch
+ "${FILESDIR}"/${P}-strings.patch
+)
+
+src_prepare() {
+ default
+
+ if has_version ">=sys-libs/binutils-libs-2.34"; then
+ eapply "${FILESDIR}"/${PN}-1.16.0-binutils-2.34.patch
+ fi
+
+ # tests and perf tools require X, bug #483574
+ if ! use X; then
+ sed -e '/^SUBDIRS/ s#boilerplate test perf# #' -i Makefile.am || die
+ fi
+
+ # Slightly messed build system YAY
+ if [[ ${PV} == *9999* ]]; then
+ touch boilerplate/Makefile.am.features
+ touch src/Makefile.am.features
+ touch ChangeLog
+ fi
+
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local myopts
+
+ [[ ${CHOST} == *-interix* ]] && append-flags -D_REENTRANT
+
+ use elibc_FreeBSD && myopts+=" --disable-symbol-lookup"
+
+ # [[ ${PV} == *9999* ]] && myopts+=" $(use_enable doc gtk-doc)"
+
+ ECONF_SOURCE="${S}" \
+ ac_cv_lib_lzo2_lzo2a_decompress=$(usex lzo) \
+ econf \
+ $(use_with X x) \
+ $(use_enable X tee) \
+ $(use_enable X xlib) \
+ $(use_enable X xlib-xrender) \
+ $(use_enable X xcb) \
+ $(use_enable X xcb-shm) \
+ $(use_enable aqua quartz) \
+ $(use_enable aqua quartz-image) \
+ $(use_enable debug test-surfaces) \
+ $(use_enable gles2-only glesv2) \
+ $(use_enable glib gobject) \
+ $(use_enable opengl gl) \
+ $(use_enable static-libs static) \
+ $(use_enable svg) \
+ $(use_enable utils trace) \
+ $(use_enable valgrind) \
+ --enable-ft \
+ --enable-interpreter \
+ --enable-pdf \
+ --enable-png \
+ --enable-ps \
+ --enable-script \
+ --disable-drm \
+ --disable-directfb \
+ --disable-gallium \
+ --disable-qt \
+ --disable-vg \
+ --disable-xlib-xcb \
+ ${myopts}
+}
+
+multilib_src_install_all() {
+ find "${D}" -name '*.la' -delete || die
+ einstalldocs
+}
diff --git a/x11-libs/cairo/cairo-9999.ebuild b/x11-libs/cairo/cairo-9999.ebuild
new file mode 100644
index 0000000..6a8c6b7
--- /dev/null
+++ b/x11-libs/cairo/cairo-9999.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic autotools multilib-minimal
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://gitlab.freedesktop.org/cairo/cairo.git"
+ SRC_URI=""
+else
+ SRC_URI="https://www.cairographics.org/releases/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+DESCRIPTION="A vector graphics library with cross-device output support"
+HOMEPAGE="https://www.cairographics.org/ https://gitlab.freedesktop.org/cairo/cairo"
+LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
+SLOT="0"
+IUSE="X aqua debug gles2-only +glib lzo opengl static-libs +svg utils valgrind"
+# gtk-doc regeneration doesn't seem to work with out-of-source builds
+#[[ ${PV} == *9999* ]] && IUSE="${IUSE} doc" # API docs are provided in tarball, no need to regenerate
+
+# Test causes a circular depend on gtk+... since gtk+ needs cairo but test needs gtk+ so we need to block it
+RESTRICT="test"
+
+BDEPEND="
+ virtual/pkgconfig
+ >=sys-devel/libtool-2"
+RDEPEND="
+ >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}]
+ >=media-libs/freetype-2.5.0.1:2[${MULTILIB_USEDEP}]
+ >=media-libs/libpng-1.6.10:0=[${MULTILIB_USEDEP}]
+ sys-libs/binutils-libs:0=[${MULTILIB_USEDEP}]
+ >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
+ >=x11-libs/pixman-0.32.4[${MULTILIB_USEDEP}]
+ gles2-only? ( >=media-libs/mesa-9.1.6[gles2,${MULTILIB_USEDEP}] )
+ glib? ( >=dev-libs/glib-2.34.3:2[${MULTILIB_USEDEP}] )
+ lzo? ( >=dev-libs/lzo-2.06-r1[${MULTILIB_USEDEP}] )
+ opengl? ( >=media-libs/mesa-9.1.6[egl,X(+),${MULTILIB_USEDEP}] )
+ X? (
+ >=x11-libs/libXrender-0.9.8[${MULTILIB_USEDEP}]
+ >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
+ >=x11-libs/libxcb-1.9.1[${MULTILIB_USEDEP}]
+ )"
+DEPEND="${RDEPEND}
+ X? ( x11-base/xorg-proto )"
+#[[ ${PV} == *9999* ]] && DEPEND="${DEPEND}
+# doc? (
+# >=dev-util/gtk-doc-1.6
+# ~app-text/docbook-xml-dtd-4.2
+# )"
+
+REQUIRED_USE="
+ gles2-only? ( !opengl )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.12.18-disable-test-suite.patch
+ "${FILESDIR}"/${PN}-respect-fontconfig.patch
+)
+
+src_prepare() {
+ default
+
+ if has_version ">=sys-libs/binutils-libs-2.34"; then
+ eapply "${FILESDIR}"/${PN}-1.16.0-binutils-2.34.patch
+ fi
+
+ # tests and perf tools require X, bug #483574
+ if ! use X; then
+ sed -e '/^SUBDIRS/ s#boilerplate test perf# #' -i Makefile.am || die
+ fi
+
+ # Slightly messed build system YAY
+ if [[ ${PV} == *9999* ]]; then
+ touch boilerplate/Makefile.am.features
+ touch src/Makefile.am.features
+ touch ChangeLog
+ fi
+
+ eautoreconf
+}
+
+multilib_src_configure() {
+ local myopts
+
+ [[ ${CHOST} == *-interix* ]] && append-flags -D_REENTRANT
+
+ use elibc_FreeBSD && myopts+=" --disable-symbol-lookup"
+
+ # [[ ${PV} == *9999* ]] && myopts+=" $(use_enable doc gtk-doc)"
+
+ ECONF_SOURCE="${S}" \
+ ac_cv_lib_lzo2_lzo2a_decompress=$(usex lzo) \
+ econf \
+ $(use_with X x) \
+ $(use_enable X tee) \
+ $(use_enable X xlib) \
+ $(use_enable X xlib-xrender) \
+ $(use_enable X xcb) \
+ $(use_enable X xcb-shm) \
+ $(use_enable aqua quartz) \
+ $(use_enable aqua quartz-image) \
+ $(use_enable debug test-surfaces) \
+ $(use_enable gles2-only glesv2) \
+ $(use_enable glib gobject) \
+ $(use_enable opengl gl) \
+ $(use_enable static-libs static) \
+ $(use_enable svg) \
+ $(use_enable utils trace) \
+ $(use_enable valgrind) \
+ --enable-ft \
+ --enable-interpreter \
+ --enable-pdf \
+ --enable-png \
+ --enable-ps \
+ --enable-script \
+ --disable-drm \
+ --disable-directfb \
+ --disable-gallium \
+ --disable-qt \
+ --disable-vg \
+ --disable-xlib-xcb \
+ ${myopts}
+}
+
+multilib_src_install_all() {
+ find "${D}" -name '*.la' -delete || die
+ einstalldocs
+}
diff --git a/x11-libs/cairo/files/cairo-1.12.18-disable-test-suite.patch b/x11-libs/cairo/files/cairo-1.12.18-disable-test-suite.patch
new file mode 100644
index 0000000..6822121
--- /dev/null
+++ b/x11-libs/cairo/files/cairo-1.12.18-disable-test-suite.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile.am b/Makefile.am
+index 03fa352..7e11d24 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -18,10 +18,6 @@ ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS}
+
+ DIST_SUBDIRS = src doc util boilerplate test perf
+ SUBDIRS = src doc util
+-# libpng is required for our test programs
+-if CAIRO_HAS_PNG_FUNCTIONS
+-SUBDIRS += boilerplate test perf
+-endif
+
+ configure: cairo-version.h
+
diff --git a/x11-libs/cairo/files/cairo-1.16.0-binutils-2.34.patch b/x11-libs/cairo/files/cairo-1.16.0-binutils-2.34.patch
new file mode 100644
index 0000000..03daac0
--- /dev/null
+++ b/x11-libs/cairo/files/cairo-1.16.0-binutils-2.34.patch
@@ -0,0 +1,20 @@
+--- a/util/cairo-trace/lookup-symbol.c
++++ b/util/cairo-trace/lookup-symbol.c
+@@ -145,14 +145,14 @@ find_address_in_section (bfd *abfd,
+ if (symbol->found)
+ return;
+
+- if ((bfd_get_section_flags (symtab->bfd, section) & SEC_ALLOC) == 0)
++ if ((bfd_section_flags (section) & SEC_ALLOC) == 0)
+ return;
+
+- vma = bfd_get_section_vma (symtab->bfd, section);
++ vma = bfd_section_vma (section);
+ if (symbol->pc < vma)
+ return;
+
+- size = bfd_section_size (symtab->bfd, section);
++ size = bfd_section_size (section);
+ if (symbol->pc >= vma + size)
+ return;
+
diff --git a/x11-libs/cairo/files/cairo-1.16.0-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch b/x11-libs/cairo/files/cairo-1.16.0-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch
new file mode 100644
index 0000000..3709c5a
--- /dev/null
+++ b/x11-libs/cairo/files/cairo-1.16.0-ft-Use-FT_Done_MM_Var-instead-of-free-when-available.patch
@@ -0,0 +1,30 @@
+From 90e85c2493fdfa3551f202ff10282463f1e36645 Mon Sep 17 00:00:00 2001
+From: Carlos Garcia Campos <cgarcia@igalia.com>
+Date: Mon, 19 Nov 2018 12:33:07 +0100
+Subject: [PATCH] ft: Use FT_Done_MM_Var instead of free when available in
+ cairo_ft_apply_variations
+
+Fixes a crash when using freetype >= 2.9
+---
+ src/cairo-ft-font.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
+index 325dd61b4..981973f78 100644
+--- a/src/cairo-ft-font.c
++++ b/src/cairo-ft-font.c
+@@ -2393,7 +2393,11 @@ skip:
+ done:
+ free (coords);
+ free (current_coords);
++#if HAVE_FT_DONE_MM_VAR
++ FT_Done_MM_Var (face->glyph->library, ft_mm_var);
++#else
+ free (ft_mm_var);
++#endif
+ }
+ }
+
+--
+2.19.2
+
diff --git a/x11-libs/cairo/files/cairo-1.16.0-pdf-add-missing-flush.patch b/x11-libs/cairo/files/cairo-1.16.0-pdf-add-missing-flush.patch
new file mode 100644
index 0000000..19345f1
--- /dev/null
+++ b/x11-libs/cairo/files/cairo-1.16.0-pdf-add-missing-flush.patch
@@ -0,0 +1,29 @@
+From 4c8813f0eaacc32c27126ad2296951a626300b89 Mon Sep 17 00:00:00 2001
+From: Adrian Johnson <ajohnson@redneon.com>
+Date: Thu, 25 Oct 2018 18:46:17 +1030
+Subject: [PATCH] pdf: add missing flush
+
+Issue #342
+---
+ src/cairo-pdf-surface.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
+index 7eb61aa1e..939b2d2d7 100644
+--- a/src/cairo-pdf-surface.c
++++ b/src/cairo-pdf-surface.c
+@@ -7711,6 +7711,11 @@ _cairo_pdf_surface_mask (void *abstract_surface,
+ * and most common, case to handle. */
+ if (_cairo_pattern_is_constant_alpha (mask, &extents.bounded, &alpha) &&
+ _can_paint_pattern (source)) {
++
++ status = _cairo_pdf_operators_flush (&surface->pdf_operators);
++ if (unlikely (status))
++ goto cleanup;
++
+ _cairo_output_stream_printf (surface->output, "q\n");
+ status = _cairo_pdf_surface_paint_pattern (surface,
+ op,
+--
+2.19.2
+
diff --git a/x11-libs/cairo/files/cairo-1.16.0-strings.patch b/x11-libs/cairo/files/cairo-1.16.0-strings.patch
new file mode 100644
index 0000000..ee72f9d
--- /dev/null
+++ b/x11-libs/cairo/files/cairo-1.16.0-strings.patch
@@ -0,0 +1,19 @@
+https://bugs.gentoo.org/726200
+--- a/build/aclocal.float.m4
++++ b/build/aclocal.float.m4
+@@ -31,10 +31,13 @@ int main() { return 0; }
+
+ ]])], [
+
+-if strings -a conftest$ac_exeext | grep noonsees >/dev/null ; then
++# allow users to override default 'strings' with 'llvm-strings'
++# or ${CHOST}-strings.
++AC_CHECK_TOOL(STRINGS, strings)
++if $STRINGS -a conftest$ac_exeext | grep noonsees >/dev/null ; then
+ ax_cv_c_float_words_bigendian=yes
+ fi
+-if strings -a conftest$ac_exeext | grep seesnoon >/dev/null ; then
++if $STRINGS -a conftest$ac_exeext | grep seesnoon >/dev/null ; then
+ if test "$ax_cv_c_float_words_bigendian" = unknown; then
+ ax_cv_c_float_words_bigendian=no
+ else
diff --git a/x11-libs/cairo/files/cairo-respect-fontconfig.patch b/x11-libs/cairo/files/cairo-respect-fontconfig.patch
new file mode 100644
index 0000000..b0a1b29
--- /dev/null
+++ b/x11-libs/cairo/files/cairo-respect-fontconfig.patch
@@ -0,0 +1,13 @@
+--- cairo-1.7.6-orig/src/cairo-ft-font.c 2008-09-29 21:43:13.000000000 +0100
++++ cairo-1.7.6/src/cairo-ft-font.c 2008-09-29 21:52:19.000000000 +0100
+@@ -1705,7 +1705,9 @@
+ options->base.subpixel_order = other->base.subpixel_order;
+ }
+
+- if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT)
++ options->base.hint_style = CAIRO_HINT_STYLE_DEFAULT;
++
++ if (other->base.hint_style != CAIRO_HINT_STYLE_DEFAULT)
+ options->base.hint_style = other->base.hint_style;
+
+ if (other->base.hint_style == CAIRO_HINT_STYLE_NONE)
diff --git a/x11-libs/cairo/metadata.xml b/x11-libs/cairo/metadata.xml
new file mode 100644
index 0000000..0ac435d
--- /dev/null
+++ b/x11-libs/cairo/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="opengl" restrict="&gt;=x11-libs/cairo-1.10.0">Build the OpenGL backend</flag>
+ <flag name="gles2-only">Build the OpenGL ES 2 backend</flag>
+ <flag name="glib">Compile with GLib Object System support</flag>
+ <flag name="utils">Build support for Cairo script and trace utilities</flag>
+ <flag name="valgrind">Built-in support to mark memory regions</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:cairographics:cairo</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/x11-misc/redshift/Manifest b/x11-misc/redshift/Manifest
new file mode 100644
index 0000000..e439764
--- /dev/null
+++ b/x11-misc/redshift/Manifest
@@ -0,0 +1 @@
+DIST redshift-1.12.tar.gz 659019 BLAKE2B 09339a57fee192e3428ba4387cbea498f2f9f97eb75a418588cdda3289cfa7b7fada4cb299e983e9e6d2ffe3822c8235082e67bdfa542716b6dee9fc853a8dc1 SHA512 6763f6964b577fc146191af1c67a283a60df5bbdd3a74bfc94f66d5f9f3bef8835a479c6ec8a648b650b83a0e245928884a0f628606ace8c3f58d8319d35036f
diff --git a/x11-misc/redshift/files/redshift-wlroots-gamma.patch b/x11-misc/redshift/files/redshift-wlroots-gamma.patch
new file mode 100644
index 0000000..b1239c3
--- /dev/null
+++ b/x11-misc/redshift/files/redshift-wlroots-gamma.patch
@@ -0,0 +1,920 @@
+diff --git a/configure.ac b/configure.ac
+index b4116262..8347dcc4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -68,6 +68,10 @@ PKG_CHECK_MODULES([XCB], [xcb], [have_xcb=yes], [have_xcb=no])
+ PKG_CHECK_MODULES([XCB_RANDR], [xcb-randr],
+ [have_xcb_randr=yes], [have_xcb_randr=no])
+
++PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-scanner >= 1.15.0],
++ [have_wayland=yes], [have_wayland=no])
++PKG_CHECK_VAR(WAYLAND_SCANNER, wayland-scanner, wayland_scanner)
++
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 gobject-2.0], [have_glib=yes], [have_glib=no])
+ PKG_CHECK_MODULES([GEOCLUE2], [glib-2.0 gio-2.0 >= 2.26], [have_geoclue2=yes], [have_geoclue2=no])
+
+@@ -124,6 +128,30 @@ AS_IF([test "x$enable_drm" != xno], [
+ ])
+ AM_CONDITIONAL([ENABLE_DRM], [test "x$enable_drm" = xyes])
+
++# Check Wayland method
++AC_MSG_CHECKING([whether to enable Wayland method])
++AC_ARG_ENABLE([wayland], [AC_HELP_STRING([--enable-wayland],
++ [enable Wayland method])],
++ [enable_wayland=$enableval],[enable_wayland=maybe])
++AS_IF([test "x$enable_wayland" != xno], [
++ AS_IF([test $have_wayland = yes], [
++ AC_DEFINE([ENABLE_WAYLAND], 1,
++ [Define to 1 to enable Wayland method])
++ AC_MSG_RESULT([yes])
++ enable_wayland=yes
++ ], [
++ AC_MSG_RESULT([missing dependencies])
++ AS_IF([test "x$enable_wayland" = xyes], [
++ AC_MSG_ERROR([missing dependencies for Wayland method])
++ ])
++ enable_wayland=no
++ ])
++], [
++ AC_MSG_RESULT([no])
++ enable_wayland=no
++])
++AM_CONDITIONAL([ENABLE_WAYLAND], [test "x$enable_wayland" = xyes])
++
+ # Check RANDR method
+ AC_MSG_CHECKING([whether to enable RANDR method])
+ AC_ARG_ENABLE([randr], [AC_HELP_STRING([--enable-randr],
+@@ -376,6 +404,7 @@ echo "
+
+ Adjustment methods:
+ DRM: ${enable_drm}
++ Wayland: ${enable_wayland}
+ RANDR: ${enable_randr}
+ VidMode: ${enable_vidmode}
+ Quartz (macOS): ${enable_quartz}
+diff --git a/po/POTFILES.in b/po/POTFILES.in
+index 5ef8dacc..1d255600 100644
+--- a/po/POTFILES.in
++++ b/po/POTFILES.in
+@@ -9,6 +9,7 @@ src/options.c
+ src/config-ini.c
+
+ src/gamma-drm.c
++src/gamma-wl.c
+ src/gamma-randr.c
+ src/gamma-vidmode.c
+ src/gamma-quartz.c
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8aa96ead..4f1acf4f 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -23,6 +23,7 @@ redshift_SOURCES = \
+
+ EXTRA_redshift_SOURCES = \
+ gamma-drm.c gamma-drm.h \
++ gamma-wl.c gamma-wl.h \
+ gamma-randr.c gamma-randr.h \
+ gamma-vidmode.c gamma-vidmode.h \
+ gamma-quartz.c gamma-quartz.h \
+@@ -43,6 +44,27 @@ redshift_LDADD += \
+ $(DRM_LIBS) $(DRM_CFLAGS)
+ endif
+
++if ENABLE_WAYLAND
++redshift_SOURCES += gamma-wl.c gamma-wl.h os-compatibility.c os-compatibility.h
++
++AM_CFLAGS += $(WAYLAND_CFLAGS)
++
++redshift_LDADD += \
++ $(WAYLAND_LIBS) $(WAYLAND_CFLAGS)
++
++nodist_redshift_SOURCES = \
++ gamma-control-client-protocol.h \
++ gamma-control-protocol.c \
++ orbital-authorizer-protocol.c \
++ orbital-authorizer-client-protocol.h
++
++BUILT_SOURCES = \
++ gamma-control-protocol.c \
++ gamma-control-client-protocol.h \
++ orbital-authorizer-protocol.c \
++ orbital-authorizer-client-protocol.h
++endif
++
+ if ENABLE_RANDR
+ redshift_SOURCES += gamma-randr.c gamma-randr.h
+ AM_CFLAGS += $(XCB_CFLAGS) $(XCB_RANDR_CFLAGS)
+@@ -103,3 +125,11 @@ endif
+
+ .rc.o:
+ $(AM_V_GEN)$(WINDRES) -I$(top_builddir) -i $< -o $@
++
++%-protocol.c : $(srcdir)/%.xml
++ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(WAYLAND_SCANNER) private-code < $< > $@
++
++%-client-protocol.h : $(srcdir)/%.xml
++ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(WAYLAND_SCANNER) client-header < $< > $@
++
++CLEANFILES = *-protocol.c *-client-protocol.h
+diff --git a/src/gamma-control.xml b/src/gamma-control.xml
+new file mode 100644
+index 00000000..ad71a15c
+--- /dev/null
++++ b/src/gamma-control.xml
+@@ -0,0 +1,126 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<protocol name="wlr_gamma_control_unstable_v1">
++ <copyright>
++ Copyright © 2015 Giulio camuffo
++ Copyright © 2018 Simon Ser
++
++ Permission to use, copy, modify, distribute, and sell this
++ software and its documentation for any purpose is hereby granted
++ without fee, provided that the above copyright notice appear in
++ all copies and that both that copyright notice and this permission
++ notice appear in supporting documentation, and that the name of
++ the copyright holders not be used in advertising or publicity
++ pertaining to distribution of the software without specific,
++ written prior permission. The copyright holders make no
++ representations about the suitability of this software for any
++ purpose. It is provided "as is" without express or implied
++ warranty.
++
++ THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
++ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
++ FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
++ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
++ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
++ THIS SOFTWARE.
++ </copyright>
++
++ <description summary="manage gamma tables of outputs">
++ This protocol allows a privileged client to set the gamma tables for
++ outputs.
++
++ Warning! The protocol described in this file is experimental and
++ backward incompatible changes may be made. Backward compatible changes
++ may be added together with the corresponding interface version bump.
++ Backward incompatible changes are done by bumping the version number in
++ the protocol and interface names and resetting the interface version.
++ Once the protocol is to be declared stable, the 'z' prefix and the
++ version number in the protocol and interface names are removed and the
++ interface version number is reset.
++ </description>
++
++ <interface name="zwlr_gamma_control_manager_v1" version="1">
++ <description summary="manager to create per-output gamma controls">
++ This interface is a manager that allows creating per-output gamma
++ controls.
++ </description>
++
++ <request name="get_gamma_control">
++ <description summary="get a gamma control for an output">
++ Create a gamma control that can be used to adjust gamma tables for the
++ provided output.
++ </description>
++ <arg name="id" type="new_id" interface="zwlr_gamma_control_v1"/>
++ <arg name="output" type="object" interface="wl_output"/>
++ </request>
++
++ <request name="destroy" type="destructor">
++ <description summary="destroy the manager">
++ All objects created by the manager will still remain valid, until their
++ appropriate destroy request has been called.
++ </description>
++ </request>
++ </interface>
++
++ <interface name="zwlr_gamma_control_v1" version="1">
++ <description summary="adjust gamma tables for an output">
++ This interface allows a client to adjust gamma tables for a particular
++ output.
++
++ The client will receive the gamma size, and will then be able to set gamma
++ tables. At any time the compositor can send a failed event indicating that
++ this object is no longer valid.
++
++ There must always be at most one gamma control object per output, which
++ has exclusive access to this particular output. When the gamma control
++ object is destroyed, the gamma table is restored to its original value.
++ </description>
++
++ <event name="gamma_size">
++ <description summary="size of gamma ramps">
++ Advertise the size of each gamma ramp.
++
++ This event is sent immediately when the gamma control object is created.
++ </description>
++ <arg name="size" type="uint"/>
++ </event>
++
++ <enum name="error">
++ <entry name="invalid_gamma" value="1" summary="invalid gamma tables"/>
++ </enum>
++
++ <request name="set_gamma">
++ <description summary="set the gamma table">
++ Set the gamma table. The file descriptor can be memory-mapped to provide
++ the raw gamma table, which contains successive gamma ramps for the red,
++ green and blue channels. Each gamma ramp is an array of 16-byte unsigned
++ integers which has the same length as the gamma size.
++
++ The file descriptor data must have the same length as three times the
++ gamma size.
++ </description>
++ <arg name="fd" type="fd" summary="gamma table file descriptor"/>
++ </request>
++
++ <event name="failed">
++ <description summary="object no longer valid">
++ This event indicates that the gamma control is no longer valid. This
++ can happen for a number of reasons, including:
++ - The output doesn't support gamma tables
++ - Setting the gamma tables failed
++ - Another client already has exclusive gamma control for this output
++ - The compositor has transfered gamma control to another client
++
++ Upon receiving this event, the client should destroy this object.
++ </description>
++ </event>
++
++ <request name="destroy" type="destructor">
++ <description summary="destroy this control">
++ Destroys the gamma control object. If the object is still valid, this
++ restores the original gamma tables.
++ </description>
++ </request>
++ </interface>
++</protocol>
+diff --git a/src/gamma-wl.c b/src/gamma-wl.c
+new file mode 100644
+index 00000000..8efa1c2e
+--- /dev/null
++++ b/src/gamma-wl.c
+@@ -0,0 +1,365 @@
++/* gamma-wl.c -- Wayland gamma adjustment header
++ This file is part of Redshift.
++
++ Redshift is free software: you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation, either version 3 of the License, or
++ (at your option) any later version.
++
++ Redshift is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with Redshift. If not, see <http://www.gnu.org/licenses/>.
++
++ Copyright (c) 2015 Giulio Camuffo <giuliocamuffo@gmail.com>
++*/
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <stdint.h>
++#include <string.h>
++#include <sys/mman.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include <unistd.h>
++
++#ifdef ENABLE_NLS
++# include <libintl.h>
++# define _(s) gettext(s)
++#else
++# define _(s) s
++#endif
++
++#include "gamma-wl.h"
++#include "os-compatibility.h"
++#include "colorramp.h"
++
++#include "gamma-control-client-protocol.h"
++#include "orbital-authorizer-client-protocol.h"
++
++typedef struct {
++ struct wl_display *display;
++ struct wl_registry *registry;
++ struct wl_callback *callback;
++ uint32_t gamma_control_manager_id;
++ struct zwlr_gamma_control_manager_v1 *gamma_control_manager;
++ int num_outputs;
++ struct output *outputs;
++ int authorized;
++} wayland_state_t;
++
++struct output {
++ uint32_t global_id;
++ struct wl_output *output;
++ struct zwlr_gamma_control_v1 *gamma_control;
++ uint32_t gamma_size;
++};
++
++static int
++wayland_init(wayland_state_t **state)
++{
++ /* Initialize state. */
++ *state = malloc(sizeof(**state));
++ if (*state == NULL) return -1;
++
++ memset(*state, 0, sizeof **state);
++ return 0;
++}
++
++static void
++authorizer_feedback_granted(void *data, struct orbital_authorizer_feedback *feedback)
++{
++ wayland_state_t *state = data;
++ state->authorized = 1;
++}
++
++static void
++authorizer_feedback_denied(void *data, struct orbital_authorizer_feedback *feedback)
++{
++ fprintf(stderr, _("Fatal: redshift was not authorized to bind the 'zwlr_gamma_control_manager_v1' interface.\n"));
++ exit(EXIT_FAILURE);
++}
++
++static const struct orbital_authorizer_feedback_listener authorizer_feedback_listener = {
++ authorizer_feedback_granted,
++ authorizer_feedback_denied
++};
++
++static void
++registry_global(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version)
++{
++ wayland_state_t *state = data;
++
++ if (strcmp(interface, "zwlr_gamma_control_manager_v1") == 0) {
++ state->gamma_control_manager_id = id;
++ state->gamma_control_manager = wl_registry_bind(registry, id, &zwlr_gamma_control_manager_v1_interface, 1);
++ } else if (strcmp(interface, "wl_output") == 0) {
++ state->num_outputs++;
++ if (!(state->outputs = realloc(state->outputs, state->num_outputs * sizeof(struct output)))) {
++ fprintf(stderr, _("Failed to allcate memory\n"));
++ return;
++ }
++
++ struct output *output = &state->outputs[state->num_outputs - 1];
++ output->global_id = id;
++ output->output = wl_registry_bind(registry, id, &wl_output_interface, 1);
++ output->gamma_control = NULL;
++ } else if (strcmp(interface, "orbital_authorizer") == 0) {
++ struct wl_event_queue *queue = wl_display_create_queue(state->display);
++
++ struct orbital_authorizer *auth = wl_registry_bind(registry, id, &orbital_authorizer_interface, 1u);
++ wl_proxy_set_queue((struct wl_proxy *)auth, queue);
++
++ struct orbital_authorizer_feedback *feedback = orbital_authorizer_authorize(auth, "zwlr_gamma_control_manager_v1");
++ orbital_authorizer_feedback_add_listener(feedback, &authorizer_feedback_listener, state);
++
++ int ret = 0;
++ while (!state->authorized && ret >= 0) {
++ ret = wl_display_dispatch_queue(state->display, queue);
++ }
++
++ orbital_authorizer_feedback_destroy(feedback);
++ orbital_authorizer_destroy(auth);
++ wl_event_queue_destroy(queue);
++ }
++}
++
++static void
++registry_global_remove(void *data, struct wl_registry *registry, uint32_t id)
++{
++ wayland_state_t *state = data;
++
++ if (state->gamma_control_manager_id == id) {
++ fprintf(stderr, _("The zwlr_gamma_control_manager_v1 was removed\n"));
++ exit(EXIT_FAILURE);
++ }
++
++ for (int i = 0; i < state->num_outputs; ++i) {
++ struct output *output = &state->outputs[i];
++ if (output->global_id == id) {
++ if (output->gamma_control) {
++ zwlr_gamma_control_v1_destroy(output->gamma_control);
++ output->gamma_control = NULL;
++ }
++ wl_output_destroy(output->output);
++
++ /* If the removed output is not the last one in the array move the last one
++ * in the now empty slot. Then shrink the array */
++ if (i < --state->num_outputs) {
++ memcpy(output, &state->outputs[state->num_outputs], sizeof(struct output));
++ }
++ state->outputs = realloc(state->outputs, state->num_outputs * sizeof(struct output));
++
++ return;
++ }
++ }
++}
++
++static const struct wl_registry_listener registry_listener = {
++ registry_global,
++ registry_global_remove
++};
++
++static void
++gamma_control_gamma_size(void *data, struct zwlr_gamma_control_v1 *control, uint32_t size)
++{
++ struct output *output = data;
++ output->gamma_size = size;
++}
++
++static void
++gamma_control_failed(void *data, struct zwlr_gamma_control_v1 *control)
++{
++}
++
++
++static const struct zwlr_gamma_control_v1_listener gamma_control_listener = {
++ gamma_control_gamma_size,
++ gamma_control_failed
++};
++
++static int
++wayland_start(wayland_state_t *state)
++{
++ state->display = wl_display_connect(NULL);
++ if (!state->display) {
++ fputs(_("Could not connect to wayland display, exiting.\n"), stderr);
++ return -1;
++ }
++ state->registry = wl_display_get_registry(state->display);
++
++ wl_registry_add_listener(state->registry, &registry_listener, state);
++
++ wl_display_roundtrip(state->display);
++ if (!state->gamma_control_manager) {
++ return -1;
++ }
++ if (state->num_outputs > 0 && !state->outputs) {
++ return -1;
++ }
++
++ return 0;
++}
++
++static void
++wayland_restore(wayland_state_t *state)
++{
++ for (int i = 0; i < state->num_outputs; ++i) {
++ struct output *output = &state->outputs[i];
++ if (output->gamma_control) {
++ zwlr_gamma_control_v1_destroy(output->gamma_control);
++ output->gamma_control = NULL;
++ }
++ }
++ wl_display_flush(state->display);
++}
++
++static void
++wayland_free(wayland_state_t *state)
++{
++ int ret = 0;
++ /* Wait for the sync callback to destroy everything, otherwise
++ * we could destroy the gamma control before gamma has been set */
++ while (state->callback && ret >= 0) {
++ ret = wl_display_dispatch(state->display);
++ }
++ if (state->callback) {
++ fprintf(stderr, _("Ignoring error on wayland connection while waiting to disconnect: %d\n"), ret);
++ wl_callback_destroy(state->callback);
++ }
++
++ for (int i = 0; i < state->num_outputs; ++i) {
++ struct output *output = &state->outputs[i];
++ if (output->gamma_control) {
++ zwlr_gamma_control_v1_destroy(output->gamma_control);
++ output->gamma_control = NULL;
++ }
++ wl_output_destroy(output->output);
++ }
++
++ if (state->gamma_control_manager) {
++ zwlr_gamma_control_manager_v1_destroy(state->gamma_control_manager);
++ }
++ if (state->registry) {
++ wl_registry_destroy(state->registry);
++ }
++ if (state->display) {
++ wl_display_disconnect(state->display);
++ }
++
++ free(state);
++}
++
++static void
++wayland_print_help(FILE *f)
++{
++ fputs(_("Adjust gamma ramps with a Wayland compositor.\n"), f);
++ fputs("\n", f);
++}
++
++static int
++wayland_set_option(wayland_state_t *state, const char *key, const char *value)
++{
++ return 0;
++}
++
++static void
++callback_done(void *data, struct wl_callback *cb, uint32_t t)
++{
++ wayland_state_t *state = data;
++ state->callback = NULL;
++ wl_callback_destroy(cb);
++}
++
++static const struct wl_callback_listener callback_listener = {
++ callback_done
++};
++
++static int
++wayland_set_temperature(wayland_state_t *state, const color_setting_t *setting)
++{
++ int ret = 0, roundtrip = 0;
++
++ /* We wait for the sync callback to throttle a bit and not send more
++ * requests than the compositor can manage, otherwise we'd get disconnected.
++ * This also allows us to dispatch other incoming events such as
++ * wl_registry.global_remove. */
++ while (state->callback && ret >= 0) {
++ ret = wl_display_dispatch(state->display);
++ }
++ if (ret < 0) {
++ fprintf(stderr, _("The Wayland connection experienced a fatal error: %d\n"), ret);
++ return ret;
++ }
++
++ for (int i = 0; i < state->num_outputs; ++i) {
++ struct output *output = &state->outputs[i];
++ if (!output->gamma_control) {
++ output->gamma_control = zwlr_gamma_control_manager_v1_get_gamma_control(state->gamma_control_manager, output->output);
++ zwlr_gamma_control_v1_add_listener(output->gamma_control, &gamma_control_listener, output);
++ roundtrip = 1;
++ }
++ }
++ if (roundtrip) {
++ wl_display_roundtrip(state->display);
++ }
++
++ for (int i = 0; i < state->num_outputs; ++i) {
++ struct output *output = &state->outputs[i];
++ int size = output->gamma_size;
++ size_t ramp_bytes = size * sizeof(uint16_t);
++ size_t total_bytes = ramp_bytes * 3;
++
++ int fd = os_create_anonymous_file(total_bytes);
++ if (fd < 0) {
++ return -1;
++ }
++
++ void *ptr = mmap(NULL, total_bytes,
++ PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
++ if (ptr == MAP_FAILED) {
++ close(fd);
++ return -1;
++ }
++
++ uint16_t *r_gamma = ptr;
++ uint16_t *g_gamma = ptr + ramp_bytes;
++ uint16_t *b_gamma = ptr + 2 * ramp_bytes;
++
++ /* Initialize gamma ramps to pure state */
++ for (int i = 0; i < size; i++) {
++ uint16_t value = (double)i / size * (UINT16_MAX+1);
++ r_gamma[i] = value;
++ g_gamma[i] = value;
++ b_gamma[i] = value;
++ }
++
++ colorramp_fill(r_gamma, g_gamma, b_gamma, size, setting);
++ munmap(ptr, size);
++
++ zwlr_gamma_control_v1_set_gamma(output->gamma_control, fd);
++ close(fd);
++ }
++
++ state->callback = wl_display_sync(state->display);
++ wl_callback_add_listener(state->callback, &callback_listener, state);
++ wl_display_flush(state->display);
++
++ return 0;
++}
++
++const gamma_method_t wl_gamma_method = {
++ "wayland",
++ 1,
++ (gamma_method_init_func *) wayland_init,
++ (gamma_method_start_func *) wayland_start,
++ (gamma_method_free_func *) wayland_free,
++ (gamma_method_print_help_func *) wayland_print_help,
++ (gamma_method_set_option_func *) wayland_set_option,
++ (gamma_method_restore_func *) wayland_restore,
++ (gamma_method_set_temperature_func *) wayland_set_temperature,
++};
+diff --git a/src/gamma-wl.h b/src/gamma-wl.h
+new file mode 100644
+index 00000000..333e99b2
+--- /dev/null
++++ b/src/gamma-wl.h
+@@ -0,0 +1,32 @@
++/* gamma-wl.h -- Wayland gamma adjustment header
++ This file is part of Redshift.
++
++ Redshift is free software: you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation, either version 3 of the License, or
++ (at your option) any later version.
++
++ Redshift is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with Redshift. If not, see <http://www.gnu.org/licenses/>.
++
++ Copyright (c) 2015 Giulio Camuffo <giuliocamuffo@gmail.com>
++*/
++
++#ifndef REDSHIFT_GAMMA_WAYLAND_H
++#define REDSHIFT_GAMMA_WAYLAND_H
++
++#include <stdint.h>
++
++#include <wayland-client.h>
++
++#include "redshift.h"
++
++extern const gamma_method_t wl_gamma_method;
++
++
++#endif /* ! REDSHIFT_GAMMA_DRM_H */
+diff --git a/src/orbital-authorizer.xml b/src/orbital-authorizer.xml
+new file mode 100644
+index 00000000..bccaa081
+--- /dev/null
++++ b/src/orbital-authorizer.xml
+@@ -0,0 +1,61 @@
++<protocol name="orbital_authorizer">
++
++ <interface name="orbital_authorizer" version="1">
++ <description summary="authorize clients to use certain interfaces">
++ The orbital_authorizer global interface allows clients to
++ ask the compositor the authorization to bind certain restricted
++ global interfaces.
++ Any client that aims to bind restricted interfaces should first
++ request the authorization by using this interface. Failing to do
++ so will result in the compositor sending a protocol error to the
++ client when it binds the restricted interface.
++
++ The list of restricted interfaces is compositor dependant, but must
++ not include the core interfaces defined in wayland.xml.
++ </description>
++
++ <request name="destroy" type="destructor">
++ <description summary="destroy this orbital_authorizer object"/>
++ </request>
++
++ <request name="authorize">
++ <description summary="authorize a global interface">
++ The authorize request allows the client to ask the compositor the
++ authorization to bind a restricted global interface. The newly
++ created orbital_authorizer_feedback will be invalid after the
++ compositor send either the granted or denied event so the client
++ must destroy it immediately after.
++ </description>
++ <arg name="id" type="new_id" interface="orbital_authorizer_feedback" summary="the new feedback object"/>
++ <arg name="global" type="string" summary="the global interface the client wants to bind"/>
++ </request>
++ </interface>
++
++ <interface name="orbital_authorizer_feedback" version="1">
++ <description summary="feedback for an authorization request">
++ The orbital_authorizer_feedback interface is used by requesting
++ an authorization with the orbital_authorizer.authorize request.
++ The compositor will send either the granted or denied event based
++ on the system and user configuration. How the authorization process
++ works is compositor specific, but a compositor is allowed to ask
++ for user input, so the response for an authorization request may
++ come after some time.
++ </description>
++
++ <event name="granted">
++ <description summary="the authorization was granted">
++ The authorization was granted. The client can now bind the restricted
++ interface.
++ </description>
++ </event>
++
++ <event name="denied">
++ <description summary="the authorization was denied">
++ The authorization was denied. The client is not allowed to bind the
++ restricted interface and trying to do so will trigger a protocol
++ error killing the client.
++ </description>
++ </event>
++ </interface>
++
++</protocol>
+diff --git a/src/os-compatibility.c b/src/os-compatibility.c
+new file mode 100644
+index 00000000..32a9109e
+--- /dev/null
++++ b/src/os-compatibility.c
+@@ -0,0 +1,148 @@
++/*
++ * Copyright © 2012 Collabora, Ltd.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining
++ * a copy of this software and associated documentation files (the
++ * "Software"), to deal in the Software without restriction, including
++ * without limitation the rights to use, copy, modify, merge, publish,
++ * distribute, sublicense, and/or sell copies of the Software, and to
++ * permit persons to whom the Software is furnished to do so, subject to
++ * the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial
++ * portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
++ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++ * SOFTWARE.
++ */
++
++#define _POSIX_C_SOURCE 200809L
++#include <errno.h>
++#include <fcntl.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/socket.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <unistd.h>
++#include "os-compatibility.h"
++
++int os_fd_set_cloexec(int fd) {
++ if (fd == -1) {
++ return -1;
++ }
++
++ long flags = fcntl(fd, F_GETFD);
++ if (flags == -1) {
++ return -1;
++ }
++
++ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1) {
++ return -1;
++ }
++
++ return 0;
++}
++
++int set_cloexec_or_close(int fd) {
++ if (os_fd_set_cloexec(fd) != 0) {
++ close(fd);
++ return -1;
++ }
++ return fd;
++}
++
++int create_tmpfile_cloexec(char *tmpname) {
++ int fd;
++ mode_t prev_umask = umask(0066);
++#ifdef HAVE_MKOSTEMP
++ fd = mkostemp(tmpname, O_CLOEXEC);
++ if (fd >= 0) {
++ unlink(tmpname);
++ }
++#else
++ fd = mkstemp(tmpname);
++ if (fd >= 0) {
++ fd = set_cloexec_or_close(fd);
++ unlink(tmpname);
++ }
++#endif
++ umask(prev_umask);
++
++ return fd;
++}
++
++/*
++ * Create a new, unique, anonymous file of the given size, and
++ * return the file descriptor for it. The file descriptor is set
++ * CLOEXEC. The file is immediately suitable for mmap()'ing
++ * the given size at offset zero.
++ *
++ * The file should not have a permanent backing store like a disk,
++ * but may have if XDG_RUNTIME_DIR is not properly implemented in OS.
++ *
++ * The file name is deleted from the file system.
++ *
++ * The file is suitable for buffer sharing between processes by
++ * transmitting the file descriptor over Unix sockets using the
++ * SCM_RIGHTS methods.
++ *
++ * If the C library implements posix_fallocate(), it is used to
++ * guarantee that disk space is available for the file at the
++ * given size. If disk space is insufficient, errno is set to ENOSPC.
++ * If posix_fallocate() is not supported, program may receive
++ * SIGBUS on accessing mmap()'ed file contents instead.
++ */
++int os_create_anonymous_file(off_t size) {
++ static const char template[] = "/redshift-shared-XXXXXX";
++
++ const char *path = getenv("XDG_RUNTIME_DIR");
++ if (!path) {
++ errno = ENOENT;
++ return -1;
++ }
++
++ char *name = malloc(strlen(path) + sizeof(template));
++ if (!name) {
++ return -1;
++ }
++
++ strcpy(name, path);
++ strcat(name, template);
++
++ int fd = create_tmpfile_cloexec(name);
++ free(name);
++ if (fd < 0) {
++ return -1;
++ }
++
++#ifdef WLR_HAS_POSIX_FALLOCATE
++ int ret;
++ do {
++ ret = posix_fallocate(fd, 0, size);
++ } while (ret == EINTR);
++ if (ret != 0) {
++ close(fd);
++ errno = ret;
++ return -1;
++ }
++#else
++ int ret;
++ do {
++ ret = ftruncate(fd, size);
++ } while (ret < 0 && errno == EINTR);
++ if (ret < 0) {
++ close(fd);
++ return -1;
++ }
++#endif
++
++ return fd;
++}
+diff --git a/src/os-compatibility.h b/src/os-compatibility.h
+new file mode 100644
+index 00000000..2038025e
+--- /dev/null
++++ b/src/os-compatibility.h
+@@ -0,0 +1,9 @@
++#ifndef UTIL_OS_COMPATIBILITY_H
++#define UTIL_OS_COMPATIBILITY_H
++
++int os_fd_set_cloexec(int fd);
++int set_cloexec_or_close(int fd);
++int create_tmpfile_cloexec(char *tmpname);
++int os_create_anonymous_file(off_t size);
++
++#endif
+diff --git a/src/redshift.c b/src/redshift.c
+index e0221d5e..953d79e0 100644
+--- a/src/redshift.c
++++ b/src/redshift.c
+@@ -94,6 +94,10 @@ int poll(struct pollfd *fds, int nfds, int timeout) { abort(); return -1; }
+ # include "gamma-w32gdi.h"
+ #endif
+
++#ifdef ENABLE_WAYLAND
++# include "gamma-wl.h"
++#endif
++
+
+ #include "location-manual.h"
+
+@@ -902,6 +906,9 @@ main(int argc, char *argv[])
+
+ /* List of gamma methods. */
+ const gamma_method_t gamma_methods[] = {
++#ifdef ENABLE_WAYLAND
++ wl_gamma_method,
++#endif
+ #ifdef ENABLE_DRM
+ drm_gamma_method,
+ #endif
diff --git a/x11-misc/redshift/metadata.xml b/x11-misc/redshift/metadata.xml
new file mode 100644
index 0000000..13acdda
--- /dev/null
+++ b/x11-misc/redshift/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <use>
+ <flag name="geoclue">Control dependency on <pkg>app-misc/geoclue</pkg></flag>
+ </use>
+ <upstream>
+ <remote-id type="github">jonls/redshift</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/x11-misc/redshift/redshift-1.12-r4.ebuild b/x11-misc/redshift/redshift-1.12-r4.ebuild
new file mode 100644
index 0000000..6e03f65
--- /dev/null
+++ b/x11-misc/redshift/redshift-1.12-r4.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python3_{6,7} )
+
+inherit systemd autotools eutils gnome2-utils python-r1
+
+DESCRIPTION="A screen color temperature adjusting software"
+HOMEPAGE="http://jonls.dk/redshift/"
+SRC_URI="https://github.com/jonls/redshift/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="amd64 arm64 x86"
+IUSE="appindicator geoclue gtk nls wayland"
+
+COMMON_DEPEND=">=x11-libs/libX11-1.4
+ x11-libs/libXxf86vm
+ x11-libs/libxcb
+ x11-libs/libdrm
+ appindicator? ( dev-libs/libappindicator:3[introspection] )
+ geoclue? ( app-misc/geoclue:2.0 dev-libs/glib:2 )
+ gtk? ( ${PYTHON_DEPS} )
+ wayland? ( dev-libs/wayland )"
+RDEPEND="${COMMON_DEPEND}
+ gtk? ( dev-python/pygobject[${PYTHON_USEDEP}]
+ x11-libs/gtk+:3[introspection]
+ dev-python/pyxdg[${PYTHON_USEDEP}] )"
+DEPEND="${COMMON_DEPEND}
+ >=dev-util/intltool-0.50
+ nls? ( sys-devel/gettext )
+"
+REQUIRED_USE="gtk? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES+=( ${FILESDIR}/redshift-wlroots-gamma.patch )
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ use gtk && python_setup
+
+ econf \
+ $(use_enable nls) \
+ --enable-drm \
+ --enable-randr \
+ --enable-vidmode \
+ --disable-wingdi \
+ $(use_enable wayland) \
+ \
+ --disable-corelocation \
+ $(use_enable geoclue geoclue2) \
+ \
+ $(use_enable gtk gui) \
+ --with-systemduserunitdir="$(systemd_get_userunitdir)" \
+ --enable-apparmor \
+ --disable-quartz \
+ --disable-ubuntu
+}
+
+_impl_specific_src_install() {
+ emake DESTDIR="${D}" pythondir="$(python_get_sitedir)" \
+ -C src/redshift-gtk install
+}
+
+src_install() {
+ emake DESTDIR="${D}" UPDATE_ICON_CACHE=/bin/true install
+
+ if use gtk; then
+ python_foreach_impl _impl_specific_src_install
+ python_replicate_script "${D}"/usr/bin/redshift-gtk
+ dosym redshift-gtk /usr/bin/gtk-redshift
+
+ python_foreach_impl python_optimize
+ fi
+}
+
+pkg_preinst() {
+ use gtk && gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ use gtk && gnome2_icon_cache_update
+}
+
+pkg_postrm() {
+ use gtk && gnome2_icon_cache_update
+}