Peter Jung pushed to branch main at Arch Linux / Packaging / Packages / 
cosmic-osd


Commits:
6fa038c0 by Peter Jung at 2026-01-21T18:58:57+01:00
upgpkg: 1:1.0.3-2 Add SUID polkit agent helper wrapper

Suggested by @heftig

Upstream will not change their polkit helper to be compatible with the Arch 
Linux packaging. Create an own helper wrapper.

- - - - -


4 changed files:

- .SRCINFO
- PKGBUILD
- REUSE.toml
- + suid-polkit-agent-helper.rs


Changes:

=====================================
.SRCINFO
=====================================
@@ -1,7 +1,7 @@
 pkgbase = cosmic-osd
        pkgdesc = COSMIC On-Screen Display
        pkgver = 1.0.3
-       pkgrel = 1
+       pkgrel = 2
        epoch = 1
        url = https://github.com/pop-os/cosmic-osd
        arch = x86_64
@@ -22,6 +22,8 @@ pkgbase = cosmic-osd
        depends = systemd-libs
        depends = wayland
        source = git+https://github.com/pop-os/cosmic-osd.git#tag=epoch-1.0.3
+       source = suid-polkit-agent-helper.rs
        b2sums = 
fd816e79d0c68391afd893373beb72b0ef6d640c92c97465fef0ab6dc89b906ffba1eecb96ed0cfc26763a85a719e84a5e3af60a1aca57477e64b3d6e9a37543
+       b2sums = 
b2c1f956aad81b17fa82f0663e4b67265d904af04f67c003f39614f0338ee1ad0cd32e0ed9d7437800ef4b9f82f105533acd14c3b479ce289db4cee1c1309d92
 
 pkgname = cosmic-osd


=====================================
PKGBUILD
=====================================
@@ -4,7 +4,7 @@
 
 pkgname=cosmic-osd
 pkgver=1.0.3
-pkgrel=1
+pkgrel=2
 epoch=1
 pkgdesc='COSMIC On-Screen Display'
 arch=(x86_64)
@@ -31,21 +31,27 @@ makedepends=(
 )
 source=(
   git+https://github.com/pop-os/cosmic-osd.git#tag=epoch-${pkgver}
+  suid-polkit-agent-helper.rs
 )
-b2sums=('fd816e79d0c68391afd893373beb72b0ef6d640c92c97465fef0ab6dc89b906ffba1eecb96ed0cfc26763a85a719e84a5e3af60a1aca57477e64b3d6e9a37543')
+b2sums=('fd816e79d0c68391afd893373beb72b0ef6d640c92c97465fef0ab6dc89b906ffba1eecb96ed0cfc26763a85a719e84a5e3af60a1aca57477e64b3d6e9a37543'
+        
'b2c1f956aad81b17fa82f0663e4b67265d904af04f67c003f39614f0338ee1ad0cd32e0ed9d7437800ef4b9f82f105533acd14c3b479ce289db4cee1c1309d92')
 
 prepare() {
   cd cosmic-osd
   cargo fetch --locked
 }
 
-build() {
+build() (
+  export RUSTFLAGS+=" -C link-arg=-fuse-ld=lld"
+  rustc $RUSTFLAGS -O --edition 2024 suid-polkit-agent-helper.rs
+
   cd cosmic-osd
-  RUSTFLAGS+=" -C link-arg=-fuse-ld=lld" \
-  just polkit-agent-helper-1="/usr/lib/polkit-1/polkit-agent-helper-1" 
build-release
-}
+  just polkit-agent-helper-1="/usr/lib/${pkgname}/suid-polkit-agent-helper" 
build-release
+)
 
 package() {
+  install -Dm4755 suid-polkit-agent-helper -t "${pkgdir}/usr/lib/${pkgname}"
+
   cd cosmic-osd
   just rootdir="${pkgdir}" install
 }


=====================================
REUSE.toml
=====================================
@@ -17,6 +17,7 @@ path = [
     "*.timer",
     "*.desktop",
     "*.hook",
+    "suid-polkit-agent-helper.rs",
 ]
 SPDX-FileCopyrightText = "Arch Linux contributors"
 SPDX-License-Identifier = "0BSD"


=====================================
suid-polkit-agent-helper.rs
=====================================
@@ -0,0 +1,14 @@
+use std::{
+    env::args_os,
+    os::unix::process::CommandExt,
+    process::Command,
+};
+
+const HELPER: &str = "/usr/lib/polkit-1/polkit-agent-helper-1";
+
+fn main() {
+    let error = Command::new(HELPER)
+        .args(args_os().skip(1))
+        .exec();
+    panic!("Error running {HELPER}: {error}");
+}



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/cosmic-osd/-/commit/6fa038c0427ed004fbb1b4eb903d7ed1fcecd2fa

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/cosmic-osd/-/commit/6fa038c0427ed004fbb1b4eb903d7ed1fcecd2fa
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to