summaryrefslogtreecommitdiffstats
path: root/source/a/elogind/elogind.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/elogind/elogind.SlackBuild')
-rwxr-xr-xsource/a/elogind/elogind.SlackBuild57
1 files changed, 40 insertions, 17 deletions
diff --git a/source/a/elogind/elogind.SlackBuild b/source/a/elogind/elogind.SlackBuild
index dd89aa081..74d26ab85 100755
--- a/source/a/elogind/elogind.SlackBuild
+++ b/source/a/elogind/elogind.SlackBuild
@@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=elogind
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -98,30 +98,51 @@ find . \
# but sed will still happily scribble all over everything.
cat $CWD/elogind.nobody.nogroup.99.99.diff | patch -p1 --verbose || exit 1
+# OK, here's the scoop on s2idle. After doing some digging, it looks like both
+# Intel and AMD have stopped officially supporting S3 sleep (aka "deep") with
+# the latest generation of CPUs (although it "might work"). I've also seen a
+# few people say that S3 is "not secure"... which if you're worried that a
+# three letter agency might grab your sleeping laptop and extract the contents
+# of the RAM while keeping it powered up, well, maybe in that sense it isn't.
+# As far as s2idle, I have heard that it has the potential to be as much of a
+# low power mode as deep, but that depends on how low the IRQ rate gets. In
+# practice I have heard of s2idle draining a battery in half a day.
+#
+# Anyway, I tried s2idle here again (with the below sleep patches) and it still
+# locks up my machine (a fairly recent Thinkpad X1).
+#
+# S3 works and has the best power savings of all the partially-on modes.
+# Feel free to edit /etc/elogind/sleep.conf.d/10-elogind.conf if s2idle works
+# for you, but we'll continue to default to deep for now.
+#
+# Don't prefer s2idle, as it doesn't seem to work:
+cat $CWD/11-prefer-deep-suspend.patch | patch -p1 --verbose || exit 1
+cat $CWD/12-default-deep-suspend.patch | patch -p1 --verbose || exit 1
+
# Configure, build, and install:
export CFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"
mkdir meson-build
cd meson-build
-meson \
- --buildtype release \
- --prefix /usr \
- --libdir /usr/lib${LIBDIRSUFFIX} \
- -Drootlibdir="/lib${LIBDIRSUFFIX}" \
- -Drootlibexecdir="/lib${LIBDIRSUFFIX}/elogind" \
+meson setup \
+ --buildtype=release \
+ --prefix=/usr \
+ --libdir=/lib${LIBDIRSUFFIX} \
+ --libexecdir=/lib${LIBDIRSUFFIX}/elogind \
+ -Dpkgconfiglibdir=/usr/lib${LIBDIRSUFFIX}/pkgconfig \
+ -Dpamlibdir=/lib${LIBDIRSUFFIX}/security \
-Dudevrulesdir="/lib/udev/rules.d" \
-Ddocdir="/usr/doc/$PKGNAM-$VERSION" \
-Dhtmldir="/usr/doc/$PKGNAM-$VERSION/html" \
-Dmandir="/usr/man" \
- -Dman=true \
- -Dhtml=false \
+ -Dman=enabled \
+ -Dhtml=disabled \
-Dbashcompletiondir="/usr/share/bash-completion/completions" \
-Dnobody-user=nobody \
-Dnobody-group=nogroup \
- -Dpam=true \
- -Dpamlibdir="/lib${LIBDIRSUFFIX}/security" \
+ -Dpam=enabled \
-Dpamconfdir="/etc/pam.d" \
- -Dacl=true \
+ -Dacl=enabled \
-Dsmack=false \
-Dutmp=true \
-Ddefault-hierarchy=legacy \
@@ -130,19 +151,21 @@ meson \
-Dpoweroff-path=/sbin/poweroff \
-Dreboot-path=/sbin/reboot \
-Ddefault-kill-user-processes=false \
+ -Dmode=release \
.. || exit 1
"${NINJA:=ninja}" $NUMJOBS || exit 1
DESTDIR=$PKG $NINJA install || exit 1
cd ..
-# Create symlinks for elogind binaries to /usr/bin/:
-mkdir -p $PKG/usr/bin
-ln -sf /bin/elogind-inhibit $PKG/usr/bin/elogind-inhibit
-ln -sf /bin/loginctl $PKG/usr/bin/loginctl
+# Create symlinks for elogind binaries to /bin/:
+mkdir -p $PKG/bin
+ln -sf /usr/bin/elogind-inhibit $PKG/bin/elogind-inhibit
+ln -sf /usr/bin/loginctl $PKG/bin/loginctl
# Make sure we do not overwrite the user's customizations:
mv -i $PKG/etc/elogind/logind.conf{,.new}
mv -i $PKG/etc/elogind/sleep.conf{,.new}
+mv -i $PKG/etc/elogind/sleep.conf.d/10-elogind.conf{,.new}
mv -i $PKG/etc/pam.d/elogind-user{,.new}
# Strip binaries:
@@ -168,7 +191,7 @@ mkdir -p $PKG/etc/elogind/logind.conf.d/ $PKG/etc/elogind/sleep.conf.d/
# Add login1 policy file that allows users in the 'power' group
# to shutdown/reboot the computer:
mkdir -p $PKG/usr/share/polkit-1/rules.d
-zcat $CWD/10-enable-elogind-power.rules.gz > $PKG/usr/share/polkit-1/rules.d/10-enable-session-power.rules
+cat $CWD/10-enable-elogind-power.rules > $PKG/usr/share/polkit-1/rules.d/10-enable-session-power.rules
# We don't need the hidden files to make inferior package managers keep dirs:
find $PKG -type f -name ".keep_dir" -exec rm -f {} \;