From 335d377bce066ad13fa3fdc8683c2da5fd6611e1 Mon Sep 17 00:00:00 2001 From: Felitendo <95575686+Felitendo@users.noreply.github.com> Date: Wed, 23 Sep 2026 21:16:55 +0200 Subject: [PATCH] plasma-face-unlock: new package --- README.md | 1 + plasma-face-unlock/.SRCINFO | 39 +++++++++++++++++++ plasma-face-unlock/PKGBUILD | 33 ++++++++++++++++ plasma-face-unlock/pkg.sh | 29 ++++++++++++++ plasma-face-unlock/plasma-face-unlock.install | 29 ++++++++++++++ 5 files changed, 131 insertions(+) create mode 100644 plasma-face-unlock/.SRCINFO create mode 100644 plasma-face-unlock/PKGBUILD create mode 100644 plasma-face-unlock/pkg.sh create mode 100644 plasma-face-unlock/plasma-face-unlock.install diff --git a/README.md b/README.md index 349bd91..d412fd9 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ source in the `PKGBUILD` (and drop the `-bin` suffix), or don't package it. | `nextcloud-native` | [Obiente/native](https://github.com/Obiente/native) — adaptive native Nextcloud client for files, media and installed server apps (Compose Multiplatform, unofficial) | *built from source* | [nextcloud-native](https://aur.archlinux.org/packages/nextcloud-native) | | `nextcloud-native-bin` | [Obiente/native](https://github.com/Obiente/native) — prebuilt release of `nextcloud-native` | `.deb` | [nextcloud-native-bin](https://aur.archlinux.org/packages/nextcloud-native-bin) | | `nextcloud-native-git` | [Obiente/native](https://github.com/Obiente/native) — `main` branch of `nextcloud-native` | *built from source* | [nextcloud-native-git](https://aur.archlinux.org/packages/nextcloud-native-git) | +| `plasma-face-unlock` | [LoonixTools/plasma-face-unlock](https://github.com/LoonixTools/plasma-face-unlock): Face ID for KDE Plasma, for the lock screen, sudo and admin prompts, with a photo check (C++/Qt6, OpenCV) | *built from source* | [plasma-face-unlock](https://aur.archlinux.org/packages/plasma-face-unlock) | | `plezy-bin` | [edde746/plezy](https://github.com/edde746/plezy) — Plex, Jellyfin and Emby client (Flutter); the source package [lives in `extra`](https://archlinux.org/packages/extra/x86_64/plezy/) | `.deb` | [plezy-bin](https://aur.archlinux.org/packages/plezy-bin) | | `sharpemu-bin` | [sharpemu/sharpemu](https://github.com/sharpemu/sharpemu) — experimental PlayStation 5 emulator | tarball | [sharpemu-bin](https://aur.archlinux.org/packages/sharpemu-bin) | | `snapx-bin` | [SnapXL/SnapX](https://github.com/SnapXL/SnapX) — ShareX-fork screenshot/sharing tool | self-contained tarball | [snapx-bin](https://aur.archlinux.org/packages/snapx-bin) | diff --git a/plasma-face-unlock/.SRCINFO b/plasma-face-unlock/.SRCINFO new file mode 100644 index 0000000..b6af1d6 --- /dev/null +++ b/plasma-face-unlock/.SRCINFO @@ -0,0 +1,39 @@ +pkgbase = plasma-face-unlock + pkgdesc = Face ID for KDE Plasma: the lock screen, sudo and admin prompts by face, with a photo check + pkgver = 1.0.0 + pkgrel = 1 + url = https://github.com/LoonixTools/plasma-face-unlock + install = plasma-face-unlock.install + arch = x86_64 + arch = aarch64 + license = GPL-3.0-or-later + license = MIT + license = Apache-2.0 + makedepends = cmake + makedepends = scdoc + depends = bash + depends = coreutils + depends = gawk + depends = grep + depends = sed + depends = gettext + depends = systemd + depends = systemd-libs + depends = pam + depends = polkit + depends = opencv + depends = qt6-base + depends = qt6-declarative + depends = layer-shell-qt + depends = ki18n + depends = kscreenlocker + noextract = face_detection_yunet_2023mar.onnx + noextract = face_recognition_sface_2021dec.onnx + source = plasma-face-unlock-1.0.0.tar.gz::https://github.com/LoonixTools/plasma-face-unlock/archive/refs/tags/v1.0.0.tar.gz + source = face_detection_yunet_2023mar.onnx::https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx + source = face_recognition_sface_2021dec.onnx::https://github.com/opencv/opencv_zoo/raw/main/models/face_recognition_sface/face_recognition_sface_2021dec.onnx + sha256sums = SKIP + sha256sums = 8f2383e4dd3cfbb4553ea8718107fc0423210dc964f9f4280604804ed2552fa4 + sha256sums = 0ba9fbfa01b5270c96627c4ef784da859931e02f04419c829e83484087c34e79 + +pkgname = plasma-face-unlock diff --git a/plasma-face-unlock/PKGBUILD b/plasma-face-unlock/PKGBUILD new file mode 100644 index 0000000..7ab81c7 --- /dev/null +++ b/plasma-face-unlock/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: Felitendo +# This PKGBUILD is updated automatically: +# https://github.com/Felitendo/PKGBUILDS + +pkgname=plasma-face-unlock +pkgver=1.0.0 +pkgrel=1 +pkgdesc="Face ID for KDE Plasma: the lock screen, sudo and admin prompts by face, with a photo check" +arch=('x86_64' 'aarch64') +url="https://github.com/LoonixTools/plasma-face-unlock" +license=('GPL-3.0-or-later' 'MIT' 'Apache-2.0') +depends=('bash' 'coreutils' 'gawk' 'grep' 'sed' 'gettext' 'systemd' 'systemd-libs' 'pam' 'polkit' + 'opencv' 'qt6-base' 'qt6-declarative' 'layer-shell-qt' 'ki18n' 'kscreenlocker') +makedepends=('cmake' 'scdoc') +install="${pkgname}.install" +# The two face networks come from the OpenCV model zoo, pinned by checksum. +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz" + "face_detection_yunet_2023mar.onnx::https://github.com/opencv/opencv_zoo/raw/main/models/face_detection_yunet/face_detection_yunet_2023mar.onnx" + "face_recognition_sface_2021dec.onnx::https://github.com/opencv/opencv_zoo/raw/main/models/face_recognition_sface/face_recognition_sface_2021dec.onnx") +noextract=('face_detection_yunet_2023mar.onnx' 'face_recognition_sface_2021dec.onnx') +sha256sums=('SKIP' '8f2383e4dd3cfbb4553ea8718107fc0423210dc964f9f4280604804ed2552fa4' '0ba9fbfa01b5270c96627c4ef784da859931e02f04419c829e83484087c34e79') + +build() { + make -C "${pkgname}-${pkgver}" VERSION="$pkgver" +} + +check() { + make -C "${pkgname}-${pkgver}" VERSION="$pkgver" test +} + +package() { + make -C "${pkgname}-${pkgver}" VERSION="$pkgver" MODELS_SRC="$srcdir" DESTDIR="$pkgdir" install +} diff --git a/plasma-face-unlock/pkg.sh b/plasma-face-unlock/pkg.sh new file mode 100644 index 0000000..17240db --- /dev/null +++ b/plasma-face-unlock/pkg.sh @@ -0,0 +1,29 @@ +# plasma-face-unlock - Face ID for KDE Plasma +# (https://github.com/LoonixTools/plasma-face-unlock). +# +# Built from the release tarball with the upstream Makefile (CMake for the +# daemon, the agent and the PAM module). The two face networks are sources of +# their own from the OpenCV model zoo with fixed checksums, so a release only +# changes the tarball's. + +UPSTREAM_REPO="LoonixTools/plasma-face-unlock" + +# Installed in CI (pacman) before the makepkg test build, which skips the +# dependency check. check() runs the upstream tests and needs nothing more. +BUILD_DEPS=(cmake scdoc gettext opencv qt6-base qt6-declarative layer-shell-qt ki18n pam systemd-libs) + +latest_version() { + curl -sf "https://api.github.com/repos/$UPSTREAM_REPO/releases/latest" \ + | jq -r '.tag_name' | sed 's/^v//' +} + +# refresh_checksums +refresh_checksums() { + local ver="$1" pkgbuild="$2" + local sha + sha="$(curl -sfL \ + "https://github.com/$UPSTREAM_REPO/archive/refs/tags/v$ver.tar.gz" \ + | sha256sum | cut -d' ' -f1)" + # Only the first sum is the tarball's; the models' stay. + sed -i -E "s|^sha256sums=\('[^']*'|sha256sums=('$sha'|" "$pkgbuild" +} diff --git a/plasma-face-unlock/plasma-face-unlock.install b/plasma-face-unlock/plasma-face-unlock.install new file mode 100644 index 0000000..815a1b5 --- /dev/null +++ b/plasma-face-unlock/plasma-face-unlock.install @@ -0,0 +1,29 @@ +post_install() { + cat <<'MSG' + + plasma-face-unlock is installed but not active yet. + + plasma-face-unlock interactive menu + plasma-face-unlock enable set up your face and turn it on + + Run it as your own user, not with sudo. It asks for your password when it + needs to, and sudo and admin prompts stay with the password until you switch + them on under Settings. + +MSG +} + +pre_remove() { + cat <<'MSG' + + Before removing this package, run + + plasma-face-unlock disable + + as each user that turned it on. That takes face unlock back out of sudo and + polkit. (Removing it without that is safe too: the PAM line is written so + that a missing module is skipped, and sudo keeps asking for the password.) + +MSG + systemctl disable --now plasma-face-unlockd.socket plasma-face-unlockd.service >/dev/null 2>&1 || true +}