From 63d81d1ac557f407cc18b6a118e1a96a39a3189e Mon Sep 17 00:00:00 2001 From: Jay Lanagan Date: Fri, 5 May 2023 20:27:37 +0100 Subject: [PATCH] desktop/gtklock: Added (screen locker for Wayland) Signed-off-by: bedlam Signed-off-by: Willy Sudiarto Raharjo --- desktop/gtklock/README | 5 ++ desktop/gtklock/doinst.sh | 12 ++++ desktop/gtklock/gtklock.SlackBuild | 93 ++++++++++++++++++++++++++++++ desktop/gtklock/gtklock.info | 10 ++++ desktop/gtklock/slack-desc | 19 ++++++ 5 files changed, 139 insertions(+) create mode 100644 desktop/gtklock/README create mode 100644 desktop/gtklock/doinst.sh create mode 100644 desktop/gtklock/gtklock.SlackBuild create mode 100644 desktop/gtklock/gtklock.info create mode 100644 desktop/gtklock/slack-desc diff --git a/desktop/gtklock/README b/desktop/gtklock/README new file mode 100644 index 0000000000..047a824996 --- /dev/null +++ b/desktop/gtklock/README @@ -0,0 +1,5 @@ +gtklock (screen locker for Wayland) + +gtklock is a lockscreen based on gtkgreet. It uses the wlr-layer-shell +and wlr-input-inhibitor Wayland protocols. Works on sway and other +wlroots-based compositors. diff --git a/desktop/gtklock/doinst.sh b/desktop/gtklock/doinst.sh new file mode 100644 index 0000000000..04d3b230fd --- /dev/null +++ b/desktop/gtklock/doinst.sh @@ -0,0 +1,12 @@ + +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + rm $NEW + fi +} + +config etc/pam.d/gtklock.new diff --git a/desktop/gtklock/gtklock.SlackBuild b/desktop/gtklock/gtklock.SlackBuild new file mode 100644 index 0000000000..d229340f63 --- /dev/null +++ b/desktop/gtklock/gtklock.SlackBuild @@ -0,0 +1,93 @@ +#!/bin/bash + +# Slackware build script for gtklock + +# Written by B. Watson (urchlay@slackware.uk) +# Maintained by Jay Lanagan (j@lngn.net) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=gtklock +VERSION=${VERSION:-2.0.1} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "aarch64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# 20230407 bkw: sed surgery. Slackware 15.0 doesn't have a pkg-config +# pam.pc, so we have to remove it from LIBS, then add -lpam to LDLIBS. +# Also, use our CFLAGS, fix the man page path, and install to /usr, +# not /usr/local. +sed -i -e '/^LIBS\>/s,\,,' \ + -e '/^LDLIBS\>/s,$, -lpam,' \ + -e "/-std=/s,= ,= $SLKCFLAGS ," \ + -e 's,share/man,man,g' \ + -e 's,usr/local,usr,g' \ + makefile + +make +strip $PRGNAM +make install DESTDIR=$PKG +gzip $PKG/usr/man/man?/* + +# It's a config file, so make it .new +rename lock lock.new $PKG/etc/pam.d/$PRGNAM + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a LICENSE README* $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/desktop/gtklock/gtklock.info b/desktop/gtklock/gtklock.info new file mode 100644 index 0000000000..483ed0c00b --- /dev/null +++ b/desktop/gtklock/gtklock.info @@ -0,0 +1,10 @@ +PRGNAM="gtklock" +VERSION="2.0.1" +HOMEPAGE="https://github.com/jovanlanik/gtklock/" +DOWNLOAD="https://github.com/jovanlanik/gtklock/archive/v2.0.1/gtklock-2.0.1.tar.gz" +MD5SUM="020de32d602b397491dcc112301521eb" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="gtk-layer-shell scdoc" +MAINTAINER="Jay Lanagan" +EMAIL="j@lngn.net" diff --git a/desktop/gtklock/slack-desc b/desktop/gtklock/slack-desc new file mode 100644 index 0000000000..f5863282bf --- /dev/null +++ b/desktop/gtklock/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +gtklock: gtklock (screen locker for Wayland) +gtklock: +gtklock: gtklock is a lockscreen based on gtkgreet. It uses the wlr-layer-shell +gtklock: and wlr-input-inhibitor Wayland protocols. Works on sway and other +gtklock: wlroots-based compositors. +gtklock: +gtklock: +gtklock: +gtklock: +gtklock: +gtklock: