Build everything in one cargo run, and package for the AUR
Four cargo builds with four target directories compiled the GTK and GStreamer bindings four times; one build with a shared target directory takes a package build from about an hour to about seven minutes. Adds the ahfail binary and /etc/pam.d/ahfail to the install, the update_check option, an AUR PKGBUILD (offline build after cargo fetch --locked) and a tag-triggered workflow that publishes it and mirrors the PKGBUILD to the tarballz index. Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# Maintainer: Asger Geel Weirsoe <asger@weircon.dk>
|
||||
pkgname=ahfail
|
||||
pkgver=0.0.0
|
||||
pkgrel=1
|
||||
pkgdesc="Screen locker that says 'ah ah ah, you didn't say the magic word' on a wrong password"
|
||||
arch=('x86_64')
|
||||
url="https://gitea.weircon.dk/agw/gtk-ahfail"
|
||||
license=('AGPL-3.0-only')
|
||||
# gst-plugins-bad-libs: libgstplayer. gst-plugins-base/-good are runtime plugins
|
||||
# (audio conversion, the mpg123 mp3 decoder) that namcap cannot see being used.
|
||||
depends=('gtk3' 'gtk-session-lock' 'gstreamer' 'gst-plugins-bad-libs' 'gst-plugins-base'
|
||||
'gst-plugins-good' 'pam' 'glib2' 'gdk-pixbuf2' 'cairo' 'pango' 'at-spi2-core' 'gst-plugins-base-libs' 'glibc' 'libgcc' 'libx11')
|
||||
makedepends=('meson' 'ninja' 'cargo')
|
||||
optdepends=('pipewire-pulse: raise the volume to 100% on a failed attempt (or libpulse)'
|
||||
'libpulse: raise the volume to 100% on a failed attempt'
|
||||
'swayidle: lock automatically on Wayland'
|
||||
'xss-lock: lock automatically on X11'
|
||||
'gtklock: legacy gtklock module (/usr/lib/gtklock/ahfail-module.so)')
|
||||
backup=('etc/pam.d/ahfail')
|
||||
install=ahfail.install
|
||||
options=('!lto')
|
||||
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
prepare() {
|
||||
cd "$srcdir/gtk-ahfail"
|
||||
export RUSTUP_TOOLCHAIN=stable
|
||||
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir/gtk-ahfail"
|
||||
export RUSTUP_TOOLCHAIN=stable
|
||||
export CARGO_NET_OFFLINE=true
|
||||
arch-meson . build -Dupdate_check=false
|
||||
meson compile -C build
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/gtk-ahfail"
|
||||
meson install -C build --destdir "$pkgdir"
|
||||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
_ahfail_msg() {
|
||||
cat <<'MSG'
|
||||
==> ahfail is its own screen locker and uses its own PAM service (/etc/pam.d/ahfail).
|
||||
Nothing in your other PAM files has been changed.
|
||||
|
||||
Check your setup: ahfail doctor
|
||||
See the effect safely: ahfail test
|
||||
Lock the screen: ahfail
|
||||
|
||||
Lock automatically:
|
||||
Wayland: swayidle -w timeout 300 'ahfail' before-sleep 'ahfail'
|
||||
X11: xss-lock -- ahfail
|
||||
|
||||
The old PAM hook (auth optional .../libahfail_pam.so in e.g. /etc/pam.d/i3lock)
|
||||
is no longer needed with `ahfail`. Remove that line yourself if you added it.
|
||||
MSG
|
||||
}
|
||||
|
||||
post_install() {
|
||||
_ahfail_msg
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
# Only when coming from before 0.10.0, when ahfail became its own locker;
|
||||
# repeating the message on every update would just teach people to skip it.
|
||||
if (( $(vercmp "$2" 0.10.0) < 0 )); then
|
||||
_ahfail_msg
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user