commit:     a7a9cb57dfb1f89bb7406daaf264633f3c19b0b9
Author:     stefson <herrtimson <AT> yahoo <DOT> de>
AuthorDate: Tue Jun 18 19:50:54 2019 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Jun 22 13:01:34 2019 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=a7a9cb57

x11-base/xorg-server: revbump to 1.20.4

Signed-off-by: Steffen Kuhn <herrtimson <AT> yahoo.de>
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 x11-base/xorg-server/Manifest                      |   2 +-
 ...ck-the-shm-dir-at-run-time-not-build-time.patch | 174 +++++++++++++++++++++
 ...1.20.4-shm-Use-memfd_create-when-possible.patch |  89 +++++++++++
 ...ndent-shm_tmpfile-to-follow-our-standards.patch |  72 +++++++++
 ...ver-1.20.3.ebuild => xorg-server-1.20.4.ebuild} |  48 +++---
 5 files changed, 362 insertions(+), 23 deletions(-)

diff --git a/x11-base/xorg-server/Manifest b/x11-base/xorg-server/Manifest
index 4dc1591..3dd24c9 100644
--- a/x11-base/xorg-server/Manifest
+++ b/x11-base/xorg-server/Manifest
@@ -1 +1 @@
-DIST xorg-server-1.20.3.tar.bz2 6205000 BLAKE2B 
9fc8acf1812d0aa4800941dd1846060f91edf1e7ebc92b35e8c2028266d88d3ab3ba14e95f535e5ee41941f8e20769ee75723ba609f5653d4892f97bc5cf91c4
 SHA512 
ee44554f86df4297f54c5871fe7a18954eeef4338775a25f36d6577b279c4775f61128da71b86cfaeadcc080838d6749dede138d4db178866579da2056543fba
+DIST xorg-server-1.20.4.tar.bz2 6123780 BLAKE2B 
224dda54f433315f6614cbee5bc54db91d9d9e190c06ac7f26e334b80b9d4a612ff4b2a4f10f50a6f928ecdbea40172d5578289fbf88411f006bcd473253b05d
 SHA512 
f1c92ef6d7613e0636973d3395b48dfdad42230847ab1c8b1cea84647a968f649f9aba97bdb01c10ee8351cbe954d4e6ca4a0fc84bb8fa662d49c8ba2aee00a8

diff --git 
a/x11-base/xorg-server/files/xorg-server-1.20.4-shm-Pick-the-shm-dir-at-run-time-not-build-time.patch
 
b/x11-base/xorg-server/files/xorg-server-1.20.4-shm-Pick-the-shm-dir-at-run-time-not-build-time.patch
new file mode 100644
index 0000000..54ed629
--- /dev/null
+++ 
b/x11-base/xorg-server/files/xorg-server-1.20.4-shm-Pick-the-shm-dir-at-run-time-not-build-time.patch
@@ -0,0 +1,174 @@
+From 19f6cb570becbc4e355807199c6e251fc7935132 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <[email protected]>
+Date: Wed, 19 Sep 2018 13:28:06 -0700
+Subject: [PATCH xserver] shm: Pick the shm dir at run time, not build time.
+
+Prodding the builder's filesystem for tmp dirs doesn't necessarily
+tell you anything about what the actual host's filesystem is going to
+look like, so we should just try the dirs at runtime.
+
+Signed-off-by: Eric Anholt <[email protected]>
+---
+ Xext/shm.c              | 48 +++++++++++++++++++++++++----------------
+ configure.ac            | 43 ------------------------------------
+ include/dix-config.h.in |  3 ---
+ include/meson.build     |  5 -----
+ 4 files changed, 29 insertions(+), 70 deletions(-)
+
+diff --git a/Xext/shm.c b/Xext/shm.c
+index ed43b9202..2739a59e7 100644
+--- a/Xext/shm.c
++++ b/Xext/shm.c
+@@ -1194,36 +1194,46 @@ ProcShmAttachFd(ClientPtr client)
+ static int
+ shm_tmpfile(void)
+ {
+-#ifdef SHMDIR
++    const char *shmdirs[] = {
++        "/run/shm",
++        "/var/tmp",
++        "/tmp",
++    };
+     int       fd;
+-    char      template[] = SHMDIR "/shmfd-XXXXXX";
++
+ #ifdef O_TMPFILE
+-    fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
+-    if (fd >= 0) {
+-        DebugF ("Using O_TMPFILE\n");
+-        return fd;
++    for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
++        fd = open(shmdirs[i], O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
++        if (fd >= 0) {
++            DebugF ("Using O_TMPFILE\n");
++            return fd;
++        }
+     }
+     ErrorF ("Not using O_TMPFILE\n");
+ #endif
++
++    for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
++        char template[PATH_MAX];
++        snprintf(template, ARRAY_SIZE(template), "%s/shmfd-XXXXXX", 
shmdirs[i]);
+ #ifdef HAVE_MKOSTEMP
+-    fd = mkostemp(template, O_CLOEXEC);
++        fd = mkostemp(template, O_CLOEXEC);
+ #else
+-    fd = mkstemp(template);
++        fd = mkstemp(template);
+ #endif
+-    if (fd < 0)
+-        return -1;
+-    unlink(template);
++        if (fd < 0)
++            continue;
++        unlink(template);
+ #ifndef HAVE_MKOSTEMP
+-    int flags = fcntl(fd, F_GETFD);
+-    if (flags != -1) {
+-        flags |= FD_CLOEXEC;
+-        (void) fcntl(fd, F_SETFD, &flags);
+-    }
++        int flags = fcntl(fd, F_GETFD);
++        if (flags != -1) {
++            flags |= FD_CLOEXEC;
++            (void) fcntl(fd, F_SETFD, &flags);
++        }
+ #endif
+-    return fd;
+-#else
++        return fd;
++    }
++
+     return -1;
+-#endif
+ }
+ 
+ static int
+diff --git a/configure.ac b/configure.ac
+index 359b62cb5..57a233102 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1115,49 +1115,6 @@ case "$DRI2,$HAVE_DRI2PROTO" in
+ esac
+ AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
+ 
+-dnl
+-dnl Locate a suitable tmp file system for creating shared memeory files
+-dnl
+-
+-AC_ARG_WITH(shared-memory-dir, 
AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a 
world-writable temporary directory for anonymous shared memory (default: 
auto)]),
+-[],
+-[with_shared_memory_dir=yes])
+-
+-shmdirs="/run/shm /var/tmp /tmp"
+-
+-case x"$with_shared_memory_dir" in
+-xyes)
+-      for dir in $shmdirs; do
+-              case x"$with_shared_memory_dir" in
+-              xyes)
+-                      echo Checking temp dir "$dir"
+-                      if test -d "$dir"; then
+-                              with_shared_memory_dir="$dir"
+-                      fi
+-                      ;;
+-              esac
+-      done
+-      ;;
+-x/*)
+-      ;;
+-xno)
+-      ;;
+-*)
+-      AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: 
$with_shared_memory_dir])
+-      ;;
+-esac
+-
+-case x"$with_shared_memory_dir" in
+-xyes)
+-      AC_MSG_ERROR([No directory found for shared memory temp files.])
+-      ;;
+-xno)
+-      ;;
+-*)
+-      AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for 
shared memory temp files])
+-      ;;
+-esac
+-
+ AC_ARG_ENABLE(xtrans-send-fds,        
AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing 
(default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto])
+ 
+ case "x$XTRANS_SEND_FDS" in
+diff --git a/include/dix-config.h.in b/include/dix-config.h.in
+index f8df86608..3bd22b8bb 100644
+--- a/include/dix-config.h.in
++++ b/include/dix-config.h.in
+@@ -452,9 +452,6 @@
+ /* Wrap SIGBUS to catch MIT-SHM faults */
+ #undef BUSFAULT
+ 
+-/* Directory for shared memory temp files */
+-#undef SHMDIR
+-
+ /* Don't let Xdefs.h define 'pointer' */
+ #define _XTYPEDEF_POINTER       1
+ 
+diff --git a/include/meson.build b/include/meson.build
+index 4a0c12f5a..04c41e999 100644
+--- a/include/meson.build
++++ b/include/meson.build
+@@ -91,11 +91,6 @@ conf_data.set('SYSTEMD_LOGIND', build_systemd_logind)
+ conf_data.set('NEED_DBUS', build_systemd_logind or build_hal)
+ conf_data.set('CONFIG_WSCONS', host_machine.system() == 'openbsd')
+ 
+-# XXX: SHMDIR is weird in autoconf, probing the build system for
+-# various tmp directories.  Could we replace it with C code at runtime
+-# that just uses whatever directory works?
+-conf_data.set_quoted('SHMDIR', '/tmp')
+-
+ conf_data.set('HAVE_XSHMFENCE', xshmfence_dep.found())
+ conf_data.set('WITH_LIBDRM', libdrm_dep.found())
+ conf_data.set('GLAMOR_HAS_EGL_QUERY_DMABUF',
+-- 
+2.19.2
+

diff --git 
a/x11-base/xorg-server/files/xorg-server-1.20.4-shm-Use-memfd_create-when-possible.patch
 
b/x11-base/xorg-server/files/xorg-server-1.20.4-shm-Use-memfd_create-when-possible.patch
new file mode 100644
index 0000000..fce2594
--- /dev/null
+++ 
b/x11-base/xorg-server/files/xorg-server-1.20.4-shm-Use-memfd_create-when-possible.patch
@@ -0,0 +1,89 @@
+From f6753c117ef0f83499d5e2d6dda226fec9ddf803 Mon Sep 17 00:00:00 2001
+From: Alexander Volkov <[email protected]>
+Date: Mon, 11 Feb 2019 18:54:10 +0300
+Subject: [PATCH xserver] shm: Use memfd_create when possible
+
+It doesn't require shared memory dir and thus allows
+to avoid cases when this dir is detected incorrectly,
+as in https://bugreports.qt.io/browse/QTBUG-71440
+
+Signed-off-by: Alexander Volkov <[email protected]>
+---
+ Xext/shm.c              | 12 ++++++++++++
+ configure.ac            |  2 +-
+ include/dix-config.h.in |  3 +++
+ include/meson.build     |  1 +
+ 4 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/Xext/shm.c b/Xext/shm.c
+index 2739a59e7..506fd4df1 100644
+--- a/Xext/shm.c
++++ b/Xext/shm.c
+@@ -35,6 +35,9 @@ in this Software without prior written authorization from 
The Open Group.
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/shm.h>
++#ifdef HAVE_MEMFD_CREATE
++#include <sys/mman.h>
++#endif
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+@@ -1201,6 +1204,15 @@ shm_tmpfile(void)
+     };
+     int       fd;
+ 
++#ifdef HAVE_MEMFD_CREATE
++    fd = memfd_create("xorg", MFD_CLOEXEC|MFD_ALLOW_SEALING);
++    if (fd != -1) {
++        fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
++        DebugF ("Using memfd_create\n");
++        return fd;
++    }
++#endif
++
+ #ifdef O_TMPFILE
+     for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
+         fd = open(shmdirs[i], O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
+diff --git a/configure.ac b/configure.ac
+index 0ca96aeb8..79ff7fa64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -159,7 +159,7 @@ dnl Checks for library functions.
+ AC_CHECK_FUNCS([backtrace geteuid getuid issetugid getresuid \
+       getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
+       mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
+-      walkcontext setitimer poll epoll_create1 mkostemp])
++      walkcontext setitimer poll epoll_create1 mkostemp memfd_create])
+ AC_CONFIG_LIBOBJ_DIR([os])
+ AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\
+       timingsafe_memcmp])
+diff --git a/include/dix-config.h.in b/include/dix-config.h.in
+index 855b3d50c..9eb1a924e 100644
+--- a/include/dix-config.h.in
++++ b/include/dix-config.h.in
+@@ -128,6 +128,9 @@
+ /* Define to 1 if you have the <linux/fb.h> header file. */
+ #undef HAVE_LINUX_FB_H
+ 
++/* Define to 1 if you have the `memfd_create' function. */
++#undef HAVE_MEMFD_CREATE
++
+ /* Define to 1 if you have the `mkostemp' function. */
+ #undef HAVE_MKOSTEMP
+ 
+diff --git a/include/meson.build b/include/meson.build
+index 04c41e999..bbd5a6690 100644
+--- a/include/meson.build
++++ b/include/meson.build
+@@ -141,6 +141,7 @@ conf_data.set('HAVE_GETPEEREID', 
cc.has_function('getpeereid'))
+ conf_data.set('HAVE_GETPEERUCRED', cc.has_function('getpeerucred'))
+ conf_data.set('HAVE_GETPROGNAME', cc.has_function('getprogname'))
+ conf_data.set('HAVE_GETZONEID', cc.has_function('getzoneid'))
++conf_data.set('HAVE_MEMFD_CREATE', cc.has_function('memfd_create'))
+ conf_data.set('HAVE_MKOSTEMP', cc.has_function('mkostemp'))
+ conf_data.set('HAVE_MMAP', cc.has_function('mmap'))
+ conf_data.set('HAVE_POLL', cc.has_function('poll'))
+-- 
+2.19.2
+

diff --git 
a/x11-base/xorg-server/files/xorg-server-1.20.4-shm-reindent-shm_tmpfile-to-follow-our-standards.patch
 
b/x11-base/xorg-server/files/xorg-server-1.20.4-shm-reindent-shm_tmpfile-to-follow-our-standards.patch
new file mode 100644
index 0000000..1ce9e13
--- /dev/null
+++ 
b/x11-base/xorg-server/files/xorg-server-1.20.4-shm-reindent-shm_tmpfile-to-follow-our-standards.patch
@@ -0,0 +1,72 @@
+From 804a9b4f57107fa2d0ed1ae0becda5bebaffe6e1 Mon Sep 17 00:00:00 2001
+From: Eric Anholt <[email protected]>
+Date: Wed, 19 Sep 2018 13:20:12 -0700
+Subject: [PATCH xserver] shm: reindent shm_tmpfile to follow our standards.
+
+Signed-off-by: Eric Anholt <[email protected]>
+---
+ Xext/shm.c | 40 ++++++++++++++++++++--------------------
+ 1 file changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/Xext/shm.c b/Xext/shm.c
+index 589ed0b4d..ed43b9202 100644
+--- a/Xext/shm.c
++++ b/Xext/shm.c
+@@ -1195,34 +1195,34 @@ static int
+ shm_tmpfile(void)
+ {
+ #ifdef SHMDIR
+-      int     fd;
+-      char    template[] = SHMDIR "/shmfd-XXXXXX";
++    int       fd;
++    char      template[] = SHMDIR "/shmfd-XXXXXX";
+ #ifdef O_TMPFILE
+-      fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
+-      if (fd >= 0) {
+-              DebugF ("Using O_TMPFILE\n");
+-              return fd;
+-      }
+-      ErrorF ("Not using O_TMPFILE\n");
++    fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
++    if (fd >= 0) {
++        DebugF ("Using O_TMPFILE\n");
++        return fd;
++    }
++    ErrorF ("Not using O_TMPFILE\n");
+ #endif
+ #ifdef HAVE_MKOSTEMP
+-      fd = mkostemp(template, O_CLOEXEC);
++    fd = mkostemp(template, O_CLOEXEC);
+ #else
+-      fd = mkstemp(template);
++    fd = mkstemp(template);
+ #endif
+-      if (fd < 0)
+-              return -1;
+-      unlink(template);
++    if (fd < 0)
++        return -1;
++    unlink(template);
+ #ifndef HAVE_MKOSTEMP
+-      int flags = fcntl(fd, F_GETFD);
+-      if (flags != -1) {
+-              flags |= FD_CLOEXEC;
+-              (void) fcntl(fd, F_SETFD, &flags);
+-      }
++    int flags = fcntl(fd, F_GETFD);
++    if (flags != -1) {
++        flags |= FD_CLOEXEC;
++        (void) fcntl(fd, F_SETFD, &flags);
++    }
+ #endif
+-      return fd;
++    return fd;
+ #else
+-        return -1;
++    return -1;
+ #endif
+ }
+ 
+-- 
+2.19.2
+

diff --git a/x11-base/xorg-server/xorg-server-1.20.3.ebuild 
b/x11-base/xorg-server/xorg-server-1.20.4.ebuild
similarity index 83%
rename from x11-base/xorg-server/xorg-server-1.20.3.ebuild
rename to x11-base/xorg-server/xorg-server-1.20.4.ebuild
index 6018177..ec78441 100644
--- a/x11-base/xorg-server/xorg-server-1.20.3.ebuild
+++ b/x11-base/xorg-server/xorg-server-1.20.4.ebuild
@@ -1,11 +1,12 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
 XORG_DOC=doc
-inherit xorg-2 multilib versionator flag-o-matic
-EGIT_REPO_URI="https://anongit.freedesktop.org/git/xorg/xserver.git";
+XORG_EAUTORECONF="yes"
+inherit xorg-3 multilib flag-o-matic
+EGIT_REPO_URI="https://gitlab.freedesktop.org/xorg/xserver.git";
 
 DESCRIPTION="X.Org X servers"
 SLOT="0/${PV}"
@@ -14,7 +15,7 @@ if [[ ${PV} != 9999* ]]; then
 fi
 
 IUSE_SERVERS="dmx kdrive wayland xephyr xnest xorg xvfb"
-IUSE="${IUSE_SERVERS} debug +glamor ipv6 libressl minimal selinux +suid 
systemd +udev unwind xcsecurity"
+IUSE="${IUSE_SERVERS} debug elogind +glamor ipv6 libressl minimal selinux 
+suid systemd +udev unwind xcsecurity"
 
 CDEPEND=">=app-eselect/eselect-opengl-1.3.0
        !libressl? ( dev-libs/openssl:0= )
@@ -80,7 +81,13 @@ CDEPEND=">=app-eselect/eselect-opengl-1.3.0
        systemd? (
                sys-apps/dbus
                sys-apps/systemd
-       )"
+       )
+       elogind? (
+               sys-apps/dbus
+               sys-auth/elogind
+               sys-auth/pambase[elogind]
+       )
+       "
 
 DEPEND="${CDEPEND}
        sys-devel/flex
@@ -101,15 +108,20 @@ RDEPEND="${CDEPEND}
 "
 
 PDEPEND="
-       xorg? ( >=x11-base/xorg-drivers-$(get_version_component_range 1-2) )"
+       xorg? ( >=x11-base/xorg-drivers-$(ver_cut 1-2) )"
 
 REQUIRED_USE="!minimal? (
                || ( ${IUSE_SERVERS} )
        )
+       elogind? ( udev )
+       ?? ( elogind systemd )
        minimal? ( !glamor !wayland )
        xephyr? ( kdrive )"
 
 UPSTREAMED_PATCHES=(
+       
"${FILESDIR}"/${P}-shm-reindent-shm_tmpfile-to-follow-our-standards.patch
+       "${FILESDIR}"/${P}-shm-Pick-the-shm-dir-at-run-time-not-build-time.patch
+       "${FILESDIR}"/${P}-shm-Use-memfd_create-when-possible.patch
 )
 
 PATCHES=(
@@ -120,20 +132,12 @@ PATCHES=(
        "${FILESDIR}"/${PN}-1.17.4-arm-musl.patch
 )
 
-pkg_pretend() {
-       # older gcc is not supported
-       [[ "${MERGE_TYPE}" != "binary" && $(gcc-major-version) -lt 4 ]] && \
-               die "Sorry, but gcc earlier than 4.0 will not work for 
xorg-server."
-}
-
 pkg_setup() {
        if use wayland && ! use glamor; then
                ewarn "glamor is necessary for acceleration under Xwayland."
                ewarn "Performance may be unacceptable without it."
        fi
-}
 
-src_configure() {
        # localstatedir is used for the log location; we need to override the 
default
        #       from ebuild.sh
        # sysconfdir is used for the xorg.conf location; same applies
@@ -161,8 +165,8 @@ src_configure() {
                $(use_enable udev config-udev)
                $(use_with doc doxygen)
                $(use_with doc xmlto)
+               $(usex !elogind $(use_enable systemd systemd-logind) 
'--enable-systemd-logind')
                $(use_with systemd systemd-daemon)
-               $(use_enable systemd systemd-logind)
                $(usex suid $(use_enable systemd suid-wrapper) 
'--disable-suid-wrapper')
                $(usex suid $(use_enable !systemd install-setuid) 
'--disable-install-setuid')
                --enable-libdrm
@@ -177,18 +181,16 @@ src_configure() {
                --with-os-vendor=Gentoo
                --with-sha1=libcrypto
        )
-
-       xorg-2_src_configure
 }
 
 src_install() {
-       xorg-2_src_install
+       xorg-3_src_install
 
        server_based_install
 
        if ! use minimal && use xorg; then
                # Install xorg.conf.example into docs
-               dodoc "${AUTOTOOLS_BUILD_DIR}"/hw/xfree86/xorg.conf.example
+               dodoc "${S}"/hw/xfree86/xorg.conf.example
        fi
 
        newinitd "${FILESDIR}"/xdm-setup.initd-1 xdm-setup
@@ -203,8 +205,10 @@ src_install() {
 }
 
 pkg_postinst() {
-       # sets up libGL and DRI2 symlinks if needed (ie, on a fresh install)
-       eselect opengl set xorg-x11 --use-old
+       if ! use minimal; then
+               # sets up libGL and DRI2 symlinks if needed (ie, on a fresh 
install)
+               eselect opengl set xorg-x11 --use-old
+       fi
 }
 
 pkg_postrm() {

Reply via email to