From 7de89fb2936a52d0c7b637143d783d7d04c060b8 Mon Sep 17 00:00:00 2001 From: stefan Date: Sun, 25 Jan 2026 00:18:51 -0800 Subject: [PATCH] soteria: 0.2.0 -> 0.3.1 Diff: https://github.com/imvaskel/soteria/compare/v0.2.0...v0.3.1 --- pkgs/by-name/so/soteria/package.nix | 37 +++++++++++++++++------------ 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/pkgs/by-name/so/soteria/package.nix b/pkgs/by-name/so/soteria/package.nix index 97fd607200b5..60b8b5aea133 100644 --- a/pkgs/by-name/so/soteria/package.nix +++ b/pkgs/by-name/so/soteria/package.nix @@ -4,32 +4,32 @@ fetchFromGitHub, pkg-config, wrapGAppsHook4, + nix-update-script, cairo, gdk-pixbuf, + gettext, glib, gtk4, pango, polkit, }: -let - version = "0.2.0"; -in -rustPlatform.buildRustPackage { +rustPlatform.buildRustPackage (finalAttrs: { pname = "soteria"; - inherit version; + version = "0.3.1"; src = fetchFromGitHub { owner = "imvaskel"; repo = "soteria"; - tag = "v${version}"; - hash = "sha256-bZhxz6aycx7J3itInSsl2glbIs6OpIEkfSp3nYfPojk="; + tag = "v${finalAttrs.version}"; + hash = "sha256-g6DGb8PWfc5YyjUpO9q3q0MxcPUbMjatOi6POFcZEE4="; }; - cargoHash = "sha256-rxZRDx+5srBbMTVLMNH8liOqjyg90FvTaTT7g+3fq7E="; + cargoHash = "sha256-6Pk60J2RAInRgCiIk9thZRwwAyCQvychh5nVHmKU7Iw="; nativeBuildInputs = [ pkg-config wrapGAppsHook4 + gettext ]; buildInputs = [ @@ -40,15 +40,22 @@ rustPlatform.buildRustPackage { pango ]; - # From upstream packaging: - # Takes advantage of nixpkgs manually editing PACKAGE_PREFIX by grabbing it from - # the binary itself. - # https://github.com/NixOS/nixpkgs/blob/9b5328b7f761a7bbdc0e332ac4cf076a3eedb89b/pkgs/development/libraries/polkit/default.nix#L142 - # https://github.com/polkit-org/polkit/blob/d89c3604e2a86f4904566896c89e1e6b037a6f50/src/polkitagent/polkitagentsession.c#L599 preBuild = '' - export POLKIT_AGENT_HELPER_PATH="$(strings ${polkit.out}/lib/libpolkit-agent-1.so | grep "polkit-agent-helper-1")" + export SOTERIA_DEFAULT_LOCALE_DIR=$out/share/locale ''; + postInstall = '' + mkdir -p $SOTERIA_DEFAULT_LOCALE_DIR + for file in po/*.po; do + lang=''${file%.*} + lang=''${lang#po/} + mkdir -p "$SOTERIA_DEFAULT_LOCALE_DIR/$lang/LC_MESSAGES" + msgfmt "$file" -o "$SOTERIA_DEFAULT_LOCALE_DIR/$lang/LC_MESSAGES/soteria.mo" + done + ''; + + passthru.updateScript = nix-update-script { }; + meta = { description = "Polkit authentication agent written in GTK designed to be used with any desktop environment"; homepage = "https://github.com/ImVaskel/soteria"; @@ -59,4 +66,4 @@ rustPlatform.buildRustPackage { ]; inherit (polkit.meta) platforms; }; -} +})