desktop/weston: Updated for version 9.0.0, use PAM.

Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
This commit is contained in:
Logan Rathbone 2020-11-05 23:00:32 +01:00 committed by Robby Workman
parent cbe92a2153
commit ccf23e4bf2
5 changed files with 121 additions and 270 deletions

View File

@ -1,11 +1,3 @@
Weston: reference implementation of a Wayland compositor.
==========================================================
This README is current as of Weston 7.0.0.
Introduction
------------
Weston is the reference implementation of a Wayland compositor, as well
as a useful environment in and of itself.
@ -18,86 +10,3 @@ environments on top of Weston's core.
A small suite of example or demo clients are also provided: though they
can be useful in themselves, their main purpose is to be an example or
test case for others building compositors or clients.
Slackware-specific Information
------------------------------
*****************************************
IMPORTANT: MANUAL INTERVENTION REQUIRED.
*****************************************
This SlackBuild of Weston takes a fairly "hands off" approach, and there
are a few things users need to be aware of.
Firstly, it is, by default, patched to remove the PAM dependency. This
necessitates the elimination of the "-u" option of `weston-launch`, as
PAM is required for that feature to function.
To launch Weston, here are some required steps.
1. You must add a group to your system called "weston-launch". You may
do so, for instance, by running the following as root:
# groupadd weston-launch
2. Add users to the "weston-launch" group that you would like to be able
to run weston-launch:
# usermod -a -G weston-launch $USER
3. The `weston-launch` must be setuid root. This comes with the standard
warnings associated with doing so.
# chmod +s /usr/bin/weston-launch
4. If you do not have another script exporting XDG_RUNTIME_DIR, you
should enable the one that comes with this SlackBuild:
# chmod +x /etc/profile.d/weston.sh
(or .csh, depending on your shell)
Once you've logged out and back in as a normal user that has been
added to the "weston-launch" group from a virtual console, you should
be able to run `weston-launch` from that virtual console, and Weston
will then launch and run directly in that console.
You can use the Ctrl+Alt+Backspace keyboard combination to kill Weston.
PAM
---
Ordinarily, PAM is a mandatory dependency for Weston. This SlackBuild
of Weston is, by default, patched to remove that dependency. If you
happen to have PAM installed on your system and would like to build
Weston with PAM support, make sure the USE_PAM variable is set to
"true" (nb: nothing else, such as "1", "yes", "on", etc. will work)
before running the SlackBuild. For example:
# USE_PAM=true ./weston.SlackBuild
Optional Dependencies
---------------------
Above and beyond the hard dependencies listed in the .info file, Weston
contains many optional dependencies. Kindly consult the documentation
for a complete list.
At the present time, the only optional dependency that this SlackBuild
accounts for is colord, which is disabled by default. That is because
colord pulls in many large dependencies, most of which are present on
-current (at the time of writing) but not on 14.2, so disabling it seems
like a sensible default on a balance of convenience.
If you would like to enable colord functionality in this SlackBuild,
set the USE_COLORD variable to "true" before running the SlackBuild.
Known Issues
------------
I have not had success getting Weston to launch with the proprietary
nvidia drivers in use. YMMV. I have had the best luck with the Intel
KMS drivers.

112
desktop/weston/README.SBo Normal file
View File

@ -0,0 +1,112 @@
Weston: reference implementation of a Wayland compositor.
==========================================================
This README is current as of Weston 9.0.0.
*** NOTE ***
------------
This is the bleeding edge version of this SlackBuild that is ONLY compatible
with Slackware Current which has been relatively newly PAM-ified as of the
time of writing (May, 2020).
If you are running Slackware stable (14.2 at the time of writing), you are NOT
in the right place. Please utilize the Slackbuild from slackbuilds.org ( git:
https://git.slackbuilds.org/slackbuilds/ ).
In addition to this SlackBuild not working unless your Slackware install is
PAM-ified, Weston >= 8.0.0 will not work on Slackware 14.2 as the graphics
stack is simply too old.
Introduction
------------
Weston is the reference implementation of a Wayland compositor, as well
as a useful environment in and of itself.
Out of the box, Weston provides a very basic desktop, or a full-featured
environment for non-desktop uses such as automotive, embedded,
in-flight, industrial, kiosks, set-top boxes and TVs. It also provides a
library allowing other projects to build their own full-featured
environments on top of Weston's core.
A small suite of example or demo clients are also provided: though they
can be useful in themselves, their main purpose is to be an example or
test case for others building compositors or clients.
Slackware-specific Information
------------------------------
*****************************************
IMPORTANT: MANUAL INTERVENTION REQUIRED.
*****************************************
This SlackBuild of Weston takes a fairly "hands off" approach, and there
are a few things users need to be aware of.
To launch Weston, here are some required steps.
Please note that setting weston-launch suid root is NOT required any longer
under PAM-ified Slackware Current.
1. If you do not have another script exporting XDG_RUNTIME_DIR, you
should enable the one that comes with this SlackBuild:
# chmod +x /etc/profile.d/weston.sh
(or .csh, depending on your shell)
(NOTE: You may want to grep your /etc/profile.d directory for other
scripts setting XDG_RUNTIME_DIR before doing this. AlienBob's ktown Plasma5
install, for instance, already includes a script that sets up XDG_RUNTIME_DIR,
so doubling up by doing Step 1 above may cause unwanted behaviour.)
2. Logout (if necessary) and re-login as root.
Once you've logged out and back in as root, run:
`exec weston-launch -u $USER`
where $USER is the username of the normal user you would like to launch Weston
as.
To launch with Xwayland support, run:
`exec weston-launch -u $USER -- --xwayland`
You can use the Ctrl+Alt+Backspace keyboard combination to kill Weston.
Optional Dependencies
---------------------
At the present time, the only optional dependency for this SlackBuild is
colord, which is disabled by default. That is because colord pulls in many
dependencies, while building Weston without colord requires no dependencies at
all on Slackware current, which may be more desirable for users that just want
to quickly test out Wayland by getting Weston up and running.
If you would like to enable colord functionality in this SlackBuild,
set the USE_COLORD variable to "true" before running the SlackBuild.
Known Issues
------------
* I have not had success getting Weston to launch with the proprietary nvidia
drivers in use. YMMV. I have had the best luck with the Intel KMS drivers.
* In testing 8.0.0 on the newly PAM-ified Slackware current, I have found that
after running Ctrl+Alt+Backspace to quit, I am brought back to a blank,
black screen. If this happens, try waiting a few seconds and then hit
Ctrl+Alt+F2 (for instance) followed by Ctrl+Alt+F1 to get back to the console.
* I want to stress and emphasize that this is still relatively experimental
software, that talks to your hardware at a fairly low level. For the most
part, I have not had any major issues, but I have seen some odd bugs and
behaviour, including Weston hard-locking my system upon exit and having to
reboot. I have also returned to my shell to find that some keystrokes I had
inputted while using Weston had been inputted into my console with a series of
"Command not found" errors. I do not believe Weston has been widely tested on
non-systemd/logind systems such as Slackware. Use at your own risk.

View File

@ -1,160 +0,0 @@
diff -Naur weston-7.0.0.orig/libweston/meson.build weston-7.0.0/libweston/meson.build
--- weston-7.0.0.orig/libweston/meson.build 2019-08-23 16:59:16.000000000 -0400
+++ weston-7.0.0/libweston/meson.build 2019-10-17 22:22:55.415927653 -0400
@@ -199,16 +199,11 @@
)
if get_option('weston-launch')
- dep_pam = cc.find_library('pam')
-
- if not cc.has_function('pam_open_session', dependencies: dep_pam)
- error('pam_open_session not found for weston-launch')
- endif
executable(
'weston-launch',
'weston-launch.c',
- dependencies: [dep_pam, systemd_dep, dep_libdrm],
+ dependencies: [systemd_dep, dep_libdrm],
include_directories: include_directories('..'),
install: true
)
diff -Naur weston-7.0.0.orig/libweston/weston-launch.c weston-7.0.0/libweston/weston-launch.c
--- weston-7.0.0.orig/libweston/weston-launch.c 2019-08-23 16:59:16.000000000 -0400
+++ weston-7.0.0/libweston/weston-launch.c 2019-10-17 22:52:18.991891665 -0400
@@ -51,7 +51,6 @@
#include <pwd.h>
#include <grp.h>
-#include <security/pam_appl.h>
#ifdef HAVE_SYSTEMD_LOGIN
#include <systemd/sd-login.h>
@@ -100,8 +99,6 @@
#endif
struct weston_launch {
- struct pam_conv pc;
- pam_handle_t *ph;
int tty;
int ttynr;
int sock[2];
@@ -193,47 +190,6 @@
}
static int
-pam_conversation_fn(int msg_count,
- const struct pam_message **messages,
- struct pam_response **responses,
- void *user_data)
-{
- return PAM_SUCCESS;
-}
-
-static int
-setup_pam(struct weston_launch *wl)
-{
- int err;
-
- wl->pc.conv = pam_conversation_fn;
- wl->pc.appdata_ptr = wl;
-
- err = pam_start("login", wl->pw->pw_name, &wl->pc, &wl->ph);
- if (err != PAM_SUCCESS) {
- fprintf(stderr, "failed to start pam transaction: %d: %s\n",
- err, pam_strerror(wl->ph, err));
- return -1;
- }
-
- err = pam_set_item(wl->ph, PAM_TTY, ttyname(wl->tty));
- if (err != PAM_SUCCESS) {
- fprintf(stderr, "failed to set PAM_TTY item: %d: %s\n",
- err, pam_strerror(wl->ph, err));
- return -1;
- }
-
- err = pam_open_session(wl->ph, 0);
- if (err != PAM_SUCCESS) {
- fprintf(stderr, "failed to open pam session: %d: %s\n",
- err, pam_strerror(wl->ph, err));
- return -1;
- }
-
- return 0;
-}
-
-static int
setup_launcher_socket(struct weston_launch *wl)
{
if (socketpair(AF_LOCAL, SOCK_SEQPACKET, 0, wl->sock) < 0) {
@@ -431,14 +387,6 @@
close(wl->signalfd);
close(wl->sock[0]);
- if (wl->new_user) {
- err = pam_close_session(wl->ph, 0);
- if (err)
- fprintf(stderr, "pam_close_session failed: %d: %s\n",
- err, pam_strerror(wl->ph, err));
- pam_end(wl->ph, err);
- }
-
if (ioctl(wl->tty, KDSKBMUTE, 0) &&
ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
fprintf(stderr, "failed to restore keyboard mode: %s\n",
@@ -660,15 +608,6 @@
setenv("HOME", wl->pw->pw_dir, 1);
setenv("SHELL", wl->pw->pw_shell, 1);
- env = pam_getenvlist(wl->ph);
- if (env) {
- for (i = 0; env[i]; ++i) {
- if (putenv(env[i]) != 0)
- fprintf(stderr, "putenv %s failed\n", env[i]);
- }
- free(env);
- }
-
/*
* We open a new session, so it makes sense
* to run a new login shell
@@ -739,8 +678,6 @@
help(const char *name)
{
fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
- fprintf(stderr, " -u, --user Start session as specified username,\n"
- " e.g. -u joe, requires root.\n");
fprintf(stderr, " -t, --tty Start session on alternative tty,\n"
" e.g. -t /dev/tty4, requires -u option.\n");
fprintf(stderr, " -v, --verbose Be verbose\n");
@@ -754,7 +691,6 @@
int i, c;
char *tty = NULL;
struct option opts[] = {
- { "user", required_argument, NULL, 'u' },
{ "tty", required_argument, NULL, 't' },
{ "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' },
@@ -766,11 +702,7 @@
while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) {
switch (c) {
case 'u':
- wl.new_user = optarg;
- if (getuid() != 0) {
- fprintf(stderr, "weston: Permission denied. -u allowed for root only\n");
- exit(EXIT_FAILURE);
- }
+ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n");
break;
case 't':
tty = optarg;
@@ -822,9 +754,6 @@
if (setup_tty(&wl, tty) < 0)
exit(EXIT_FAILURE);
- if (wl.new_user && setup_pam(&wl) < 0)
- exit(EXIT_FAILURE);
-
if (setup_launcher_socket(&wl) < 0)
exit(EXIT_FAILURE);

View File

@ -23,8 +23,8 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=weston
VERSION=${VERSION:-7.0.0}
BUILD=${BUILD:-2}
VERSION=${VERSION:-9.0.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@ -60,19 +60,9 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
# If you have PAM installed on your system and would like to make use
# of it, run this as USE_PAM=true ./weston.Slackbuild
# otherwise, a patch will be applied to remove the PAM dependency.
USE_PAM=${USE_PAM:-false}
if [ "$USE_PAM" != 'true' ]; then
patch -p1 < $CWD/weston-7.0.0-nopam.patch
fi
# Make sure ownerships and permissions are sane:
chown -R root:root .
find -L . \
@ -189,9 +179,9 @@ EOF
# Install some documentation and finish up.
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a COPYING README.md CONTRIBUTING.md $PKG/usr/doc/$PRGNAM-$VERSION
cp -a CONTRIBUTING.md COPYING DCO-1.1.txt README.md notes.txt $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README.Slackware
cat $CWD/README.SBo > $PKG/usr/doc/$PRGNAM-$VERSION/README.SBo
cat $CWD/slack-desc > $PKG/install/slack-desc

View File

@ -1,10 +1,10 @@
PRGNAM="weston"
VERSION="7.0.0"
VERSION="9.0.0"
HOMEPAGE="https://wayland.freedesktop.org/"
DOWNLOAD="https://wayland.freedesktop.org/releases/weston-7.0.0.tar.xz"
MD5SUM="cbfda483bc2501d0831af3f33c707850"
DOWNLOAD="https://github.com/wayland-project/weston/archive/9.0.0/weston-9.0.0.tar.gz"
MD5SUM="6c1cd2986d3d0782701d213e302b96e8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="libinput libwebp libxkbcommon wayland wayland-protocols"
REQUIRES=""
MAINTAINER="Logan Rathbone"
EMAIL="poprocks@gmail.com"