From de33d5fecf5cb2348d279e898644b4fec25c552c Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 6 Nov 2012 14:28:49 +0100 Subject: [PATCH] xinit: add support for systemd's logind (via Arch). --- srcpkgs/xinit/files/xinitrc | 17 ++++++++++++ srcpkgs/xinit/files/xserverrc | 6 +++++ srcpkgs/xinit/files/xsession | 10 +++++++ .../06_move_serverauthfile_into_tmp.patch | 18 +++++++++++++ srcpkgs/xinit/patches/fs25361.patch | 14 ++++++++++ srcpkgs/xinit/template | 27 ++++++++++++++----- 6 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 srcpkgs/xinit/files/xinitrc create mode 100644 srcpkgs/xinit/files/xserverrc create mode 100644 srcpkgs/xinit/files/xsession create mode 100644 srcpkgs/xinit/patches/06_move_serverauthfile_into_tmp.patch create mode 100644 srcpkgs/xinit/patches/fs25361.patch diff --git a/srcpkgs/xinit/files/xinitrc b/srcpkgs/xinit/files/xinitrc new file mode 100644 index 00000000000..dbd080d0036 --- /dev/null +++ b/srcpkgs/xinit/files/xinitrc @@ -0,0 +1,17 @@ +#!/bin/sh +# +# ~/.xinitrc +# +# Executed by startx (run your window manager from here) + +if [ -d /etc/X11/xinit/xinitrc.d ]; then + for f in /etc/X11/xinit/xinitrc.d/*; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +# exec gnome-session +# exec startkde +# exec startxfce4 +# ...or the Window Manager of your choice diff --git a/srcpkgs/xinit/files/xserverrc b/srcpkgs/xinit/files/xserverrc new file mode 100644 index 00000000000..6b57eeba6da --- /dev/null +++ b/srcpkgs/xinit/files/xserverrc @@ -0,0 +1,6 @@ +#!/bin/sh +if [ -z "$XDG_VTNR" ]; then + exec /usr/bin/X -nolisten tcp "$@" +else + exec /usr/bin/X -nolisten tcp "$@" vt$XDG_VTNR +fi diff --git a/srcpkgs/xinit/files/xsession b/srcpkgs/xinit/files/xsession new file mode 100644 index 00000000000..a16dc0b8421 --- /dev/null +++ b/srcpkgs/xinit/files/xsession @@ -0,0 +1,10 @@ +#!/bin/sh + +# +# ~/.xsession +# +# Executed by xdm/gdm/kdm at login +# + +/bin/bash --login -i ~/.xinitrc + diff --git a/srcpkgs/xinit/patches/06_move_serverauthfile_into_tmp.patch b/srcpkgs/xinit/patches/06_move_serverauthfile_into_tmp.patch new file mode 100644 index 00000000000..db9fbaa8b61 --- /dev/null +++ b/srcpkgs/xinit/patches/06_move_serverauthfile_into_tmp.patch @@ -0,0 +1,18 @@ +Move startx auth files in /tmp so they are removed on reboot. +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=357736 +The trap patch didn't seem to work on reboot. +--- + startx.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- startx.cpp ++++ startx.cpp +@@ -273,7 +273,7 @@ + dummy=0 + + XCOMM create a file with auth information for the server. ':0' is a dummy. +- xserverauthfile=$HOME/.serverauth.$$ ++ xserverauthfile=`mktemp -p /tmp serverauth.XXXXXXXXXX` + trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM + xauth -q -f "$xserverauthfile" << EOF + add :$dummy . $mcookie diff --git a/srcpkgs/xinit/patches/fs25361.patch b/srcpkgs/xinit/patches/fs25361.patch new file mode 100644 index 00000000000..ab105d1e98b --- /dev/null +++ b/srcpkgs/xinit/patches/fs25361.patch @@ -0,0 +1,14 @@ +--- startx.cpp 2011-08-02 18:26:57.161711018 +0400 ++++ startx.cpp 2011-08-02 19:06:39.348816866 +0400 +@@ -290,9 +290,9 @@ + XCOMM now add the same credentials to the client authority file + XCOMM if '$displayname' already exists do not overwrite it as another + XCOMM server man need it. Add them to the '$xserverauthfile' instead. +- for displayname in $authdisplay $hostname$authdisplay; do ++ for displayname in $authdisplay $hostname/unix$authdisplay; do + authcookie=`XAUTH list "$displayname" @@ +- | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; ++ | sed -n "s/.*$hostname\/unix$authdisplay[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; + if [ "z${authcookie}" = "z" ] ; then + XAUTH -q << EOF + add $displayname . $mcookie diff --git a/srcpkgs/xinit/template b/srcpkgs/xinit/template index c62674ea54b..0b41f43524a 100644 --- a/srcpkgs/xinit/template +++ b/srcpkgs/xinit/template @@ -1,18 +1,33 @@ # Template build file for 'xinit'. pkgname=xinit version=1.3.2 -distfiles="${XORG_SITE}/app/$pkgname-$version.tar.bz2" +revision=3 build_style=gnu-configure -make_build_args="XINITDIR=/etc/X11/xinit" -make_install_args="XINITDIR=/etc/X11/xinit" +configure_args="--with-xinitdir=/etc/X11/xinit" makedepends="pkg-config libX11-devel" -revision=1 short_desc="X init program" maintainer="Juan RP " +homepage="http://xorg.freedesktop.org/" +license="MIT" +distfiles="${XORG_SITE}/app/$pkgname-$version.tar.bz2" checksum=a1867fdaa83f68750b12ba4305c3c62f5992d0f52cfeb98e96c27a8e690e0235 long_desc=" This package provides xinit and startx, utilities for starting the - X Window System server. This is from the modular X.org." + X Window System server." -conf_files="/etc/X11/xinit/xinitrc" +conf_files=" + /etc/X11/xinit/xinitrc + /etc/X11/xinit/xserverrc + /etc/skel/.xinitrc + /etc/skel/.xsession" +pre_configure() { + sed -i -e 's/XSLASHGLOB.sh/XSLASHGLOB/' xinitrc.cpp +} + +post_install() { + vinstall ${FILESDIR}/xinitrc 644 etc/skel .xinitrc + vinstall ${FILESDIR}/xsession 644 etc/skel .xsession + vinstall ${FILESDIR}/xserverrc 644 etc/X11/xinit + vinstall COPYING 644 usr/share/licenses/${pkgname} +}