diff options
author | Robin Lange | 2019-04-28 10:17:19 +1000 |
---|---|---|
committer | Robin Lange | 2019-04-28 10:19:31 +1000 |
commit | 9e7283e90683467f46cc13124966a30db0970473 (patch) | |
tree | 4b0d97453fe471e893997565b2f70ef7f8e9b9f0 | |
download | aur-9e7283e90683467f46cc13124966a30db0970473.tar.gz |
Initial release
-rw-r--r-- | .SRCINFO | 55 | ||||
-rw-r--r-- | 0001-Xsession-Don-t-start-ssh-agent-by-default.patch | 32 | ||||
-rw-r--r-- | 0002-nvidia-prime.patch | 154 | ||||
-rw-r--r-- | PKGBUILD | 97 |
4 files changed, 338 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..7cbe4a59658a --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,55 @@ +pkgbase = gdm-prime + pkgdesc = Display manager and login screen - patched with Prime support for Optimus laptops + pkgver = 3.32.0+2+g820f90f5 + pkgrel = 1 + url = https://wiki.gnome.org/Projects/GDM + arch = x86_64 + license = GPL + checkdepends = check + makedepends = yelp-tools + makedepends = gobject-introspection + makedepends = git + makedepends = docbook-xsl + depends = gnome-shell + depends = gnome-session + depends = upower + depends = xorg-xrdb + depends = xorg-server + depends = xorg-xhost + source = git+https://gitlab.gnome.org/GNOME/gdm.git#commit=820f90f5a78b81b2e4610da14627266c2135c8b0 + source = 0001-Xsession-Don-t-start-ssh-agent-by-default.patch + source = 0002-nvidia-prime.patch + sha256sums = SKIP + sha256sums = 3412f7da0205409f08a126a1d166b644fe0f1d0444f7cdebdce8e59cea2d672c + sha256sums = f2ac60c8e4d62805dc2f441a8754f1c15e12c64ec0dbb1031dbd91dd47df52d9 + +pkgname = gdm-prime + groups = gnome + depends = gnome-shell + depends = gnome-session + depends = upower + depends = xorg-xrdb + depends = xorg-server + depends = xorg-xhost + depends = libgdm + optdepends = fprintd: fingerprint authentication + provides = gdm + conflicts = gdm + backup = etc/pam.d/gdm-autologin + backup = etc/pam.d/gdm-fingerprint + backup = etc/pam.d/gdm-launch-environment + backup = etc/pam.d/gdm-password + backup = etc/pam.d/gdm-smartcard + backup = etc/gdm/custom.conf + backup = etc/gdm/Xsession + backup = etc/gdm/PostSession/Default + backup = etc/gdm/PreSession/Default + +pkgname = libgdm-prime + pkgdesc = GDM support library + depends = systemd + depends = glib2 + depends = dconf + provides = libgdm + conflicts = libgdm + diff --git a/0001-Xsession-Don-t-start-ssh-agent-by-default.patch b/0001-Xsession-Don-t-start-ssh-agent-by-default.patch new file mode 100644 index 000000000000..997e9e39ce01 --- /dev/null +++ b/0001-Xsession-Don-t-start-ssh-agent-by-default.patch @@ -0,0 +1,32 @@ +From 328a315c21ec71e563d00699f0a79186b229270a Mon Sep 17 00:00:00 2001 +Message-Id: <328a315c21ec71e563d00699f0a79186b229270a.1541542184.git.jan.steffens@gmail.com> +From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com> +Date: Sat, 20 Jun 2015 17:22:38 +0200 +Subject: [PATCH] Xsession: Don't start ssh-agent by default + +--- + data/Xsession.in | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/data/Xsession.in b/data/Xsession.in +index 9d79558c..ff6d9de0 100755 +--- a/data/Xsession.in ++++ b/data/Xsession.in +@@ -175,14 +175,6 @@ if [ "x$command" = "xdefault" ] ; then + fi + fi + +-# add ssh-agent if found +-sshagent="`gdmwhich ssh-agent`" +-if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then +- command="$sshagent -- $command" +-elif [ -z "$sshagent" ] ; then +- echo "$0: ssh-agent not found!" +-fi +- + echo "$0: Setup done, will execute: $command" + + eval exec $command +-- +2.19.1 + diff --git a/0002-nvidia-prime.patch b/0002-nvidia-prime.patch new file mode 100644 index 000000000000..b11baa16202e --- /dev/null +++ b/0002-nvidia-prime.patch @@ -0,0 +1,154 @@ +From: Tim Lunn <tim@feathertop.org> +Date: Sat, 22 Mar 2014 00:23:12 +0100 +Subject: Add hooks to run prime scripts (as root) before and after a + gdm-session + +This allows enabling and disabling the dGPU on log out. +--- + common/gdm-common.c | 2 +- + daemon/gdm-session.c | 6 ++++++ + daemon/gdm-x-session.c | 5 +++++ + data/Makefile.am | 28 ++++++++++++++++++++++++++-- + data/Prime | 6 ++++++ + data/PrimeOff | 6 ++++++ + 6 files changed, 50 insertions(+), 3 deletions(-) + create mode 100644 data/Prime + create mode 100644 data/PrimeOff + +diff --git a/common/gdm-common.c b/common/gdm-common.c +index 373d5b8..02a6044 100644 +--- a/common/gdm-common.c ++++ b/common/gdm-common.c +@@ -721,7 +721,7 @@ gdm_run_script (const char *dir, + goto out; + } + +- env = gdm_get_script_environment (username, ++ env = gdm_get_script_environment ((g_strcmp0 (username, "root") == 0)?NULL:username, + display_name, + display_hostname, + display_x11_authority_file); +diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c +index 6a116a8..1792bfd 100644 +--- a/daemon/gdm-session.c ++++ b/daemon/gdm-session.c +@@ -2970,6 +2970,12 @@ gdm_session_close (GdmSession *self) + + g_list_free_full (self->outside_connections, g_object_unref); + self->outside_connections = NULL; ++ ++ /* Run PrimeOff after the session is closed */ ++ gdm_run_script (GDMCONFDIR "/PrimeOff", "root", ++ NULL, ++ NULL, ++ NULL); + } + + void +diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c +index 3b2fcef..9a57300 100644 +--- a/daemon/gdm-x-session.c ++++ b/daemon/gdm-x-session.c +@@ -614,6 +614,11 @@ spawn_session (State *state, + + g_debug ("Running X session"); + ++ gdm_run_script (GDMCONFDIR "/Prime", "root", ++ state->display_name, ++ NULL, /* hostname */ ++ state->auth_file); ++ + launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE); + + if (state->environment != NULL) { +diff --git a/data/Makefile.am b/data/Makefile.am +index 210bf5d..7bca5e4 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -10,6 +10,8 @@ SUBDIRS = \ + initdir = $(gdmconfdir)/Init + postdir = $(gdmconfdir)/PostSession + predir = $(gdmconfdir)/PreSession ++primedir = $(gdmconfdir)/Prime ++primeoffdir = $(gdmconfdir)/PrimeOff + postlogindir = $(gdmconfdir)/PostLogin + workingdir = $(GDM_WORKING_DIR) + xauthdir = $(GDM_XAUTH_DIR) +@@ -174,6 +176,8 @@ EXTRA_DIST += \ + Xsession.in \ + Init.in \ + PreSession.in \ ++ Prime \ ++ PrimeOff \ + PostSession.in \ + PostLogin \ + $(NULL) +@@ -237,6 +241,8 @@ uninstall-hook: + $(DESTDIR)$(initdir)/Default \ + $(DESTDIR)$(postlogindir)/Default.sample \ + $(DESTDIR)$(predir)/Default \ ++ $(DESTDIR)$(primedir)/Default \ ++ $(DESTDIR)$(primeoffdir)/Default \ + $(DESTDIR)$(postdir)/Default \ + $(DESTDIR)$(sysconfdir)/dconf/db/gdm \ + $(DESTDIR)$(sysconfdir)/dconf/profile/gdm \ +@@ -281,7 +287,25 @@ endif + -if test -f $(DESTDIR)$(predir)/Default; then \ + cp -f $(DESTDIR)$(predir)/Default $(DESTDIR)$(predir)/Default.orig; \ + fi +- $(INSTALL_SCRIPT) PreSession $(DESTDIR)$(predir)/Default ++ $(INSTALL_SCRIPT) $(builddir)/PreSession $(DESTDIR)$(predir)/Default ++ ++ if test '!' -d $(DESTDIR)$(primedir); then \ ++ $(mkinstalldirs) $(DESTDIR)$(primedir); \ ++ chmod 755 $(DESTDIR)$(primedir); \ ++ fi ++ -if test -f $(DESTDIR)$(primedir)/Default; then \ ++ cp -f $(DESTDIR)$(primedir)/Default $(DESTDIR)$(primedir)/Default.orig; \ ++ fi ++ $(INSTALL_SCRIPT) $(srcdir)/Prime $(DESTDIR)$(primedir)/Default ++ ++ if test '!' -d $(DESTDIR)$(primeoffdir); then \ ++ $(mkinstalldirs) $(DESTDIR)$(primeoffdir); \ ++ chmod 755 $(DESTDIR)$(primeoffdir); \ ++ fi ++ -if test -f $(DESTDIR)$(primeoffdir)/Default; then \ ++ cp -f $(DESTDIR)$(primeoffdir)/Default $(DESTDIR)$(primeoffdir)/Default.orig; \ ++ fi ++ $(INSTALL_SCRIPT) $(srcdir)/PrimeOff $(DESTDIR)$(primeoffdir)/Default + + if test '!' -d $(DESTDIR)$(postdir); then \ + $(mkinstalldirs) $(DESTDIR)$(postdir); \ +@@ -290,7 +314,7 @@ endif + -if test -f $(DESTDIR)$(postdir)/Default; then \ + cp -f $(DESTDIR)$(postdir)/Default $(DESTDIR)$(postdir)/Default.orig; \ + fi +- $(INSTALL_SCRIPT) PostSession $(DESTDIR)$(postdir)/Default ++ $(INSTALL_SCRIPT) $(builddir)/PostSession $(DESTDIR)$(postdir)/Default + + if test '!' -d $(DESTDIR)$(logdir); then \ + $(mkinstalldirs) $(DESTDIR)$(logdir); \ +diff --git a/data/Prime b/data/Prime +new file mode 100644 +index 0000000..30caf03 +--- /dev/null ++++ b/data/Prime +@@ -0,0 +1,6 @@ ++#!/bin/sh ++ ++primeoffload=/sbin/prime-offload ++if [ -f "$primeoffload" ]; then ++ $primeoffload ++fi +diff --git a/data/PrimeOff b/data/PrimeOff +new file mode 100644 +index 0000000..5a61c3c +--- /dev/null ++++ b/data/PrimeOff +@@ -0,0 +1,6 @@ ++#!/bin/sh ++ ++primeswitch=/sbin/prime-switch ++if [ -f "$primeswitch" ]; then ++ $primeswitch ++fi diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..495b0e08be3c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,97 @@ +# Maintainer: Robin Lange <robin dot langenc at gmail dot com> +# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com> +# Contributor: Jan de Groot <jgc@archlinux.org> + +pkgbase=gdm-prime +pkgname=(gdm-prime libgdm-prime) +pkgver=3.32.0+2+g820f90f5 +pkgrel=1 +pkgdesc="Display manager and login screen - patched with Prime support for Optimus laptops" +url="https://wiki.gnome.org/Projects/GDM" +arch=(x86_64) +license=(GPL) +depends=(gnome-shell gnome-session upower xorg-xrdb xorg-server xorg-xhost) +makedepends=(yelp-tools gobject-introspection git docbook-xsl) +checkdepends=(check) +_commit=820f90f5a78b81b2e4610da14627266c2135c8b0 # master +source=("git+https://gitlab.gnome.org/GNOME/gdm.git#commit=$_commit" + 0001-Xsession-Don-t-start-ssh-agent-by-default.patch + 0002-nvidia-prime.patch) +sha256sums=('SKIP' + '3412f7da0205409f08a126a1d166b644fe0f1d0444f7cdebdce8e59cea2d672c' + 'f2ac60c8e4d62805dc2f441a8754f1c15e12c64ec0dbb1031dbd91dd47df52d9') + +pkgver() { + cd gdm + git describe --tags | sed 's/-/+/g' +} + +prepare() { + mkdir build + cd gdm + patch -Np1 -i ../0001-Xsession-Don-t-start-ssh-agent-by-default.patch + patch -Np1 -i ../0002-nvidia-prime.patch + NOCONFIGURE=1 ./autogen.sh +} + +build() { + cd build + ../gdm/configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --sbindir=/usr/bin \ + --libexecdir=/usr/lib \ + with_dbus_sys=/usr/share/dbus-1/system.d \ + --disable-schemas-compile \ + --disable-static \ + --enable-gdm-xsession \ + --enable-ipv6 \ + --with-default-pam-config=arch \ + --with-default-path=/usr/local/bin:/usr/local/sbin:/usr/bin \ + --without-plymouth \ + --without-tcp-wrappers + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make +} + +check() { + make -C build check +} + +package_gdm-prime() { + provides=(gdm) + conflicts=(gdm) + depends+=(libgdm) + optdepends=('fprintd: fingerprint authentication') + backup=(etc/pam.d/gdm-autologin etc/pam.d/gdm-fingerprint etc/pam.d/gdm-launch-environment + etc/pam.d/gdm-password etc/pam.d/gdm-smartcard etc/gdm/custom.conf + etc/gdm/Xsession etc/gdm/PostSession/Default etc/gdm/PreSession/Default) + groups=(gnome) + + DESTDIR="$pkgdir" make -C build install + + chown -Rc 120:120 "$pkgdir/var/lib/gdm" + + # Unused or created at start + rm -r "$pkgdir"/var/{cache,log,run} + + install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/gdm.conf" <<END +g gdm 120 - +u gdm 120 "Gnome Display Manager" /var/lib/gdm +END + +### Split libgdm + mkdir -p libgdm/{lib,share} + mv -t libgdm "$pkgdir"/usr/include + mv -t libgdm/lib "$pkgdir"/usr/lib/{girepository-1.0,libgdm*,pkgconfig} + mv -t libgdm/share "$pkgdir"/usr/share/{gir-1.0,glib-2.0} +} + +package_libgdm-prime() { + provides=(libgdm) + conflicts=(libgdm) + pkgdesc="GDM support library" + depends=(systemd glib2 dconf) + mv libgdm "$pkgdir/usr" +} |