summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Väth <martin@mvath.de>2018-04-24 15:25:18 +0200
committerMartin Väth <martin@mvath.de>2018-04-24 15:25:18 +0200
commit8768791efa2a6a486fc613e2e9adf9ba3bb0738f (patch)
tree8a9c32c919e6815e13623fcc8972b88128000932
parentdev-util/replacer: Version bump (diff)
downloadmv-8768791efa2a6a486fc613e2e9adf9ba3bb0738f.tar.gz
mv-8768791efa2a6a486fc613e2e9adf9ba3bb0738f.tar.bz2
mv-8768791efa2a6a486fc613e2e9adf9ba3bb0738f.zip
Add weston to support USE=-pam w/ USE=launch
-rw-r--r--dev-libs/weston/Manifest1
-rw-r--r--dev-libs/weston/files/README.gentoo9
-rw-r--r--dev-libs/weston/files/pam.patch175
-rw-r--r--dev-libs/weston/metadata.xml26
-rw-r--r--dev-libs/weston/weston-3.0.0.ebuild149
-rw-r--r--metadata/pkg_desc_index1
-rw-r--r--profiles/use.local.desc16
7 files changed, 377 insertions, 0 deletions
diff --git a/dev-libs/weston/Manifest b/dev-libs/weston/Manifest
new file mode 100644
index 00000000..d64e8007
--- /dev/null
+++ b/dev-libs/weston/Manifest
@@ -0,0 +1 @@
+DIST weston-3.0.0.tar.xz 1300340 SHA512 b824c39f2a884f6d50d607613f447090621f684c96f7d905f25f6e500dabd03ecb2b1cd1030babc193c3417223cb220103abb792437e1a5ead7229a76b5c7a58
diff --git a/dev-libs/weston/files/README.gentoo b/dev-libs/weston/files/README.gentoo
new file mode 100644
index 00000000..ed8c5c3b
--- /dev/null
+++ b/dev-libs/weston/files/README.gentoo
@@ -0,0 +1,9 @@
+For running Weston you need to have $XDG_RUNTIME_DIR in your environment,
+directory must exist and have correct permissions. If you are not using systemd,
+it will not be created automatically, you can create it using your shell,
+add these lines to ~/.bash_profile:
+
+# wayland
+export XDG_RUNTIME_DIR=/tmp/.runtime-${USER}
+mkdir -p "${XDG_RUNTIME_DIR}"
+chmod 0700 "${XDG_RUNTIME_DIR}"
diff --git a/dev-libs/weston/files/pam.patch b/dev-libs/weston/files/pam.patch
new file mode 100644
index 00000000..190321b4
--- /dev/null
+++ b/dev-libs/weston/files/pam.patch
@@ -0,0 +1,175 @@
+https://github.com/Freescale/meta-freescale/raw/master/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
+From 8ff6ed03ec4079f32e9b34085414e57be4730e04 Mon Sep 17 00:00:00 2001
+From: Tom Hochstein <tom.hochstein@nxp.com>
+Date: Wed, 22 Feb 2017 15:53:30 +0200
+Subject: [PATCH] weston-launch: Provide a default version that doesn't require
+ PAM
+
+weston-launch requires PAM for starting weston as a non-root user.
+
+Since starting weston as root is a valid use case by itself, if
+PAM is not available, provide a default version of weston-launch
+without non-root-user support.
+
+Upstream-Status: Pending
+
+Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 9 +++++++--
+ libweston/weston-launch.c | 20 ++++++++++++++++++++
+ 2 files changed, 27 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 46cb2c7..bb45f46 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -435,13 +435,17 @@ AC_ARG_ENABLE(resize-optimization,
+ AS_IF([test "x$enable_resize_optimization" = "xyes"],
+ [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
+
++AC_ARG_WITH(pam,
++ AS_HELP_STRING([--with-pam], [Use PAM]),
++ [use_pam=$withval], [use_pam=yes])
+ AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
+ AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
+-if test x$enable_weston_launch = xyes; then
++if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then
+ WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
+ if test x$have_pam = xno; then
+- AC_ERROR([weston-launch requires pam])
++ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found])
+ fi
++ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available])
+ fi
+
+ AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
+@@ -701,6 +705,7 @@ AC_MSG_RESULT([
+ Enable developer documentation ${enable_devdocs}
+
+ weston-launch utility ${enable_weston_launch}
++ PAM support ${use_pam}
+ systemd-login support ${have_systemd_login}
+ systemd notify support ${enable_systemd_notify}
+
+diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
+index 0491896..07e7469 100644
+--- a/libweston/weston-launch.c
++++ b/libweston/weston-launch.c
+@@ -51,7 +51,9 @@
+
+ #include <pwd.h>
+ #include <grp.h>
++#ifdef HAVE_PAM
+ #include <security/pam_appl.h>
++#endif
+
+ #ifdef HAVE_SYSTEMD_LOGIN
+ #include <systemd/sd-login.h>
+@@ -93,8 +95,10 @@ drmSetMaster(int drm_fd)
+ #endif
+
+ struct weston_launch {
++#ifdef HAVE_PAM
+ struct pam_conv pc;
+ pam_handle_t *ph;
++#endif
+ int tty;
+ int ttynr;
+ int sock[2];
+@@ -181,6 +185,7 @@ weston_launch_allowed(struct weston_launch *wl)
+ return false;
+ }
+
++#ifdef HAVE_PAM
+ static int
+ pam_conversation_fn(int msg_count,
+ const struct pam_message **messages,
+@@ -221,6 +226,7 @@ setup_pam(struct weston_launch *wl)
+
+ return 0;
+ }
++#endif
+
+ static int
+ setup_launcher_socket(struct weston_launch *wl)
+@@ -414,6 +420,7 @@ quit(struct weston_launch *wl, int status)
+ close(wl->signalfd);
+ close(wl->sock[0]);
+
++#ifdef HAVE_PAM
+ if (wl->new_user) {
+ err = pam_close_session(wl->ph, 0);
+ if (err)
+@@ -421,6 +428,7 @@ quit(struct weston_launch *wl, int status)
+ err, pam_strerror(wl->ph, err));
+ pam_end(wl->ph, err);
+ }
++#endif
+
+ if (ioctl(wl->tty, KDSKBMUTE, 0) &&
+ ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
+@@ -600,6 +608,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
+ setenv("HOME", wl->pw->pw_dir, 1);
+ setenv("SHELL", wl->pw->pw_shell, 1);
+
++#ifdef HAVE_PAM
+ env = pam_getenvlist(wl->ph);
+ if (env) {
+ for (i = 0; env[i]; ++i) {
+@@ -608,6 +617,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
+ }
+ free(env);
+ }
++#endif
+
+ /*
+ * We open a new session, so it makes sense
+@@ -675,7 +685,9 @@ static void
+ help(const char *name)
+ {
+ fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
++#ifdef HAVE_PAM
+ fprintf(stderr, " -u, --user Start session as specified username\n");
++#endif
+ fprintf(stderr, " -t, --tty Start session on alternative tty\n");
+ fprintf(stderr, " -v, --verbose Be verbose\n");
+ fprintf(stderr, " -h, --help Display this help message\n");
+@@ -688,7 +700,9 @@ main(int argc, char *argv[])
+ int i, c;
+ char *tty = NULL;
+ struct option opts[] = {
++#ifdef HAVE_PAM
+ { "user", required_argument, NULL, 'u' },
++#endif
+ { "tty", required_argument, NULL, 't' },
+ { "verbose", no_argument, NULL, 'v' },
+ { "help", no_argument, NULL, 'h' },
+@@ -700,9 +714,13 @@ main(int argc, char *argv[])
+ while ((c = getopt_long(argc, argv, "u:t::vh", opts, &i)) != -1) {
+ switch (c) {
+ case 'u':
++#ifdef HAVE_PAM
+ wl.new_user = optarg;
+ if (getuid() != 0)
+ error(1, 0, "Permission denied. -u allowed for root only");
++#else
++ error(1, 0, "-u is unsupported in this weston-launch build");
++#endif
+ break;
+ case 't':
+ tty = optarg;
+@@ -740,8 +758,10 @@ main(int argc, char *argv[])
+ if (setup_tty(&wl, tty) < 0)
+ exit(EXIT_FAILURE);
+
++#ifdef HAVE_PAM
+ if (wl.new_user && setup_pam(&wl) < 0)
+ exit(EXIT_FAILURE);
++#endif
+
+ if (setup_launcher_socket(&wl) < 0)
+ exit(EXIT_FAILURE);
+--
+2.1.4
+
diff --git a/dev-libs/weston/metadata.xml b/dev-libs/weston/metadata.xml
new file mode 100644
index 00000000..54c40413
--- /dev/null
+++ b/dev-libs/weston/metadata.xml
@@ -0,0 +1,26 @@
+<?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="colord">Allow setting color managment</flag>
+ <flag name="drm">Enable drm compositor support</flag>
+ <flag name="editor">Install wayland-editor example application</flag>
+ <flag name="fbdev">Enable fbdev compositor support</flag>
+ <flag name="gles2">Use GLESv2 cairo instead of full GL</flag>
+ <flag name="headless">Headless backend and a noop renderer, mainly for testing purposes</flag>
+ <flag name="ivi">Enable the IVI shell</flag>
+ <flag name="launch">Install weston-launch utility</flag>
+ <flag name="rdp">Enable Remote Desktop Protocol compositor support</flag>
+ <flag name="resize-optimization">Increase performance, allocate more RAM. Recommended to disable on Raspberry Pi</flag>
+ <flag name="rpi">Raspberry Pi GPU support</flag>
+ <flag name="screen-sharing">Enable screen-sharing through RDP</flag>
+ <flag name="unwind">Enable libunwind usage for backtraces</flag>
+ <flag name="wayland-compositor">Enable Wayland compositor support</flag>
+ <flag name="webp">Add support for the WebP image format</flag>
+ <flag name="xwayland">Enable ability support native X11 applications</flag>
+</use>
+</pkgmetadata>
diff --git a/dev-libs/weston/weston-3.0.0.ebuild b/dev-libs/weston/weston-3.0.0.ebuild
new file mode 100644
index 00000000..599b42f0
--- /dev/null
+++ b/dev-libs/weston/weston-3.0.0.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} = 9999* ]]; then
+ EGIT_REPO_URI="https://anongit.freedesktop.org/git/wayland/weston.git"
+ GIT_ECLASS="git-r3"
+ EXPERIMENTAL="true"
+fi
+
+inherit autotools readme.gentoo-r1 toolchain-funcs $GIT_ECLASS
+
+DESCRIPTION="Wayland reference compositor"
+HOMEPAGE="https://wayland.freedesktop.org/"
+
+if [[ $PV = 9999* ]]; then
+ SRC_URI="${SRC_PATCHES}"
+ KEYWORDS=""
+else
+ SRC_URI="https://wayland.freedesktop.org/releases/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~x86 ~arm-linux"
+fi
+
+LICENSE="MIT CC-BY-SA-3.0"
+SLOT="0"
+
+IUSE="colord dbus +drm editor examples fbdev +gles2 headless ivi jpeg +launch lcms pam rdp +resize-optimization screen-sharing static-libs +suid systemd test unwind wayland-compositor webp +X xwayland"
+
+REQUIRED_USE="
+ drm? ( gles2 )
+ screen-sharing? ( rdp )
+ systemd? ( dbus )
+ test? ( headless xwayland )
+ wayland-compositor? ( gles2 )
+"
+
+RDEPEND="
+ >=dev-libs/libinput-0.8.0
+ >=dev-libs/wayland-1.12.0
+ >=dev-libs/wayland-protocols-1.8
+ lcms? ( media-libs/lcms:2 )
+ media-libs/libpng:0=
+ webp? ( media-libs/libwebp:0= )
+ jpeg? ( virtual/jpeg:0= )
+ >=x11-libs/cairo-1.11.3
+ >=x11-libs/libdrm-2.4.30
+ >=x11-libs/libxkbcommon-0.5.0
+ >=x11-libs/pixman-0.25.2
+ x11-misc/xkeyboard-config
+ fbdev? (
+ >=sys-libs/mtdev-1.1.0
+ >=virtual/udev-136
+ )
+ colord? ( >=x11-misc/colord-0.1.27 )
+ dbus? ( >=sys-apps/dbus-1.6 )
+ drm? (
+ media-libs/mesa[gbm]
+ >=sys-libs/mtdev-1.1.0
+ >=virtual/udev-136
+ )
+ editor? ( x11-libs/pango )
+ gles2? (
+ media-libs/mesa[gles2,wayland]
+ )
+ rdp? ( >=net-misc/freerdp-1.1.0_beta1_p20130710 )
+ systemd? (
+ pam? ( sys-auth/pambase[systemd?] )
+ >=sys-apps/systemd-209[pam?]
+ )
+ launch? ( pam? ( sys-auth/pambase ) )
+ unwind? ( sys-libs/libunwind )
+ X? (
+ >=x11-libs/libxcb-1.9
+ x11-libs/libX11
+ )
+ xwayland? (
+ x11-base/xorg-server[wayland]
+ x11-libs/cairo[xcb]
+ >=x11-libs/libxcb-1.9
+ x11-libs/libXcursor
+ )
+"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+"
+
+src_prepare() {
+ eapply "${FILESDIR}"/pam.patch
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+ if use examples || use test; then
+ myconf="--enable-simple-clients"
+ else
+ myconf="--disable-simple-clients"
+ fi
+
+ econf \
+ $(use_enable examples demo-clients-install) \
+ $(use_enable fbdev fbdev-compositor) \
+ $(use_enable dbus) \
+ $(use_enable drm drm-compositor) \
+ $(use_enable headless headless-compositor) \
+ $(use_enable ivi ivi-shell) \
+ $(use_enable lcms) \
+ $(use_enable rdp rdp-compositor) \
+ $(use_enable wayland-compositor) \
+ $(use_enable X x11-compositor) \
+ $(use_enable launch weston-launch) \
+ $(use_enable colord) \
+ $(use_enable gles2 egl) \
+ $(use_enable unwind libunwind) \
+ $(use_enable resize-optimization) \
+ $(use_enable screen-sharing) \
+ $(use_enable suid setuid-install) \
+ $(use_enable systemd systemd-login) \
+ $(use_enable systemd systemd-notify) \
+ $(use_enable xwayland) \
+ $(use_enable xwayland xwayland-test) \
+ $(use_with jpeg) \
+ $(use_with pam) \
+ $(use_with webp) \
+ --with-cairo=image \
+ --disable-junit-xml \
+ --disable-simple-dmabuf-drm-client \
+ --disable-simple-dmabuf-v4l-client \
+ --disable-simple-egl-clients \
+ --disable-vaapi-recorder \
+ ${myconf}
+}
+
+src_test() {
+ export XDG_RUNTIME_DIR="${T}/runtime-dir"
+ mkdir "${XDG_RUNTIME_DIR}" || die
+ chmod 0700 "${XDG_RUNTIME_DIR}" || die
+
+ cd "${BUILD_DIR}" || die
+ emake check
+}
+
+src_install() {
+ default
+
+ readme.gentoo_create_doc
+}
diff --git a/metadata/pkg_desc_index b/metadata/pkg_desc_index
index 687a665b..56cc6d3b 100644
--- a/metadata/pkg_desc_index
+++ b/metadata/pkg_desc_index
@@ -50,6 +50,7 @@ app-text/psjoin 0.3: concatenate postscript files. From new PostScript Utilities
app-text/stardict 3.0.6-r4 4.0.0_pre20160518-r2: A international dictionary supporting fuzzy and glob style matching
dev-cpp/cpplint 99999999: The google styleguide together with cpplint and an emacs file
dev-libs/osformat 1.0.5 999999999: C++ library for a typesafe printf/sprintf based on << conversion
+dev-libs/weston 3.0.0: Wayland reference compositor
dev-perl/File-lchown 0.20-r1: Use the lchown(2) and lutimes(2) system call from Perl
dev-tex/chklref 2.6.0: Finds useless references in latex files or unnecessarily numbered environments
dev-util/comp 4.3: compare files or directories, including metadata
diff --git a/profiles/use.local.desc b/profiles/use.local.desc
index f3154674..74eb2010 100644
--- a/profiles/use.local.desc
+++ b/profiles/use.local.desc
@@ -125,6 +125,22 @@ app-text/stardict:wikiparse - Enable plugin to parse dictionaries in wikimedia f
app-text/stardict:wordnet - Enable wordnet plugin to find similar English words using lexical database
app-text/stardict:xdxfparse - Enable plugin to parse dictionaries in xdxf (XML Dictionary eXchange Format)
app-text/stardict:youdaodict - Enable youdao.com network plugin (for Chinese language)
+dev-libs/weston:colord - Allow setting color managment
+dev-libs/weston:drm - Enable drm compositor support
+dev-libs/weston:editor - Install wayland-editor example application
+dev-libs/weston:fbdev - Enable fbdev compositor support
+dev-libs/weston:gles2 - Use GLESv2 cairo instead of full GL
+dev-libs/weston:headless - Headless backend and a noop renderer, mainly for testing purposes
+dev-libs/weston:ivi - Enable the IVI shell
+dev-libs/weston:launch - Install weston-launch utility
+dev-libs/weston:rdp - Enable Remote Desktop Protocol compositor support
+dev-libs/weston:resize-optimization - Increase performance, allocate more RAM. Recommended to disable on Raspberry Pi
+dev-libs/weston:rpi - Raspberry Pi GPU support
+dev-libs/weston:screen-sharing - Enable screen-sharing through RDP
+dev-libs/weston:unwind - Enable libunwind usage for backtraces
+dev-libs/weston:wayland-compositor - Enable Wayland compositor support
+dev-libs/weston:webp - Add support for the WebP image format
+dev-libs/weston:xwayland - Enable ability support native X11 applications
games-board/chessproblem:debug - Build with upstream's CXXFLAGS/LDFLAGS for debugging support; not recommended for normal use.
games-board/chessproblem:multithreading - Install multithreading version
games-board/chessproblem:optimization - Accept upstream's choices for CXXFLAGS/LDFLAGS for optimization. Absense of this USE flag does not strip user's *FLAGS