From patchwork Thu Nov 7 22:27:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Giacomo Leidi X-Patchwork-Id: 70103 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F374B27BBE9; Thu, 7 Nov 2024 22:28:51 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D806D27BBE2 for ; Thu, 7 Nov 2024 22:28:49 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9AzB-0008AM-7N; Thu, 07 Nov 2024 17:28:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9Az4-00087z-MR for guix-patches@gnu.org; Thu, 07 Nov 2024 17:28:11 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9Az4-0007v1-6S for guix-patches@gnu.org; Thu, 07 Nov 2024 17:28:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=LbKhwQkwYr7fTV9xHrfwC4iIWZD3qZFddHpgFbPk0H4=; b=WmMIgqJtjgZyTQigqy+asp1NnI/su5VKuozvfqjOCiLHPW8HRfTGDtCC8a3pVDp/YYWifQRtNSnIuQZer/NmX8tjwLXsPCGKCUbZ7T0L1LyQWbLacqbmu78FUcywFtouaF8Cuh52Ph7nANBpUShmfBVTFX2aZuWJ2QDb3h5mlTOCyFm3r3sxxkrU9SGiJpNP2S3UCjA/pAVFVRKHyerOjujTKFoxI3xUj07jQOzB8MtCNXZF4xhOJ+cweSZB9DLXKB0aDFv2b/9uVkNXZ+xRhtQOtOmLDBhY0WdCLTykUB8t8WTaM0VLOuix8d7kieuzZulpxFWEgV4Ye36Z9h7Y7g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t9Az3-000844-UR; Thu, 07 Nov 2024 17:28:10 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74234] [PATCHv2 rust-team 20/20] gnu: Add gnome-authenticator. Resent-From: Giacomo Leidi Original-Sender: "Debbugs-submit" Resent-CC: efraim@flashner.co.il, guix-patches@gnu.org Resent-Date: Thu, 07 Nov 2024 22:28:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74234 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74234@debbugs.gnu.org Cc: Giacomo Leidi , Efraim Flashner X-Debbugs-Original-Xcc: Efraim Flashner Received: via spool by 74234-submit@debbugs.gnu.org id=B74234.173101848330865 (code B ref 74234); Thu, 07 Nov 2024 22:28:09 +0000 Received: (at 74234) by debbugs.gnu.org; 7 Nov 2024 22:28:03 +0000 Received: from localhost ([127.0.0.1]:50174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9Ayw-00081O-8W for submit@debbugs.gnu.org; Thu, 07 Nov 2024 17:28:03 -0500 Received: from confino.investici.org ([93.190.126.19]:60563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9Ayh-0007y0-Qi for 74234@debbugs.gnu.org; Thu, 07 Nov 2024 17:27:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1731018467; bh=LbKhwQkwYr7fTV9xHrfwC4iIWZD3qZFddHpgFbPk0H4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IghMMKSDgN2UXs+GYTlO7VTy9K0uoT7LC9fYlHEeoQIfU3ms0y6wcEVSdNA7IA3qA 7V4OG1Le+gn5QV4bhTQprt8STjYWvyjcfCEvr64o7MrXHTnkirN7oEhVcpGOhdwhwT P8B7M9pX1NjYSCYwOlSKUe0Vq2RN2ZsmQHwK3aqs= Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id 4XkxXg0bsBz113C; Thu, 7 Nov 2024 22:27:47 +0000 (UTC) Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19]) (Authenticated sender: goodoldpaul@autistici.org) by localhost (Postfix) with ESMTPSA id 4XkxXf6x47z1132; Thu, 7 Nov 2024 22:27:46 +0000 (UTC) Date: Thu, 7 Nov 2024 23:27:17 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: <509aa62709c43d2a92900d9249065342d14bc1fa.1731018436.git.goodoldpaul@autistici.org> References: <509aa62709c43d2a92900d9249065342d14bc1fa.1731018436.git.goodoldpaul@autistici.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Giacomo Leidi X-ACL-Warn: , Giacomo Leidi via Guix-patches X-Patchwork-Original-From: Giacomo Leidi via Guix-patches via From: Giacomo Leidi Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/rust-apps.scm (gnome-authenticator): New variable. Change-Id: Ibf3e0a3558c7623abdf313f9c4393825cd04f1c8 --- gnu/packages/rust-apps.scm | 235 +++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index 3844daa651..634efcd626 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -32,6 +32,7 @@ ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> ;;; Copyright © 2024 Suhail Singh ;;; Copyright © 2024 Jordan Moore +;;; Copyright © 2024 Giacomo Leidi ;;; ;;; This file is part of GNU Guix. ;;; @@ -61,6 +62,7 @@ (define-module (gnu packages rust-apps) #:use-module (guix utils) #:use-module (gnu packages) #:use-module (gnu packages admin) + #:use-module (gnu packages aidc) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages compression) @@ -80,8 +82,10 @@ (define-module (gnu packages rust-apps) #:use-module (gnu packages fontutils) #:use-module (gnu packages freedesktop) #:use-module (gnu packages haskell-xyz) + #:use-module (gnu packages gettext) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) + #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) #:use-module (gnu packages ibus) #:use-module (gnu packages icu4c) @@ -106,6 +110,7 @@ (define-module (gnu packages rust-apps) #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (gnu packages webkit) + #:use-module (gnu packages xml) #:use-module (gnu packages xorg)) (define-public aardvark-dns @@ -985,6 +990,236 @@ (define-public gitui (description "This package provides a fast Terminal UI for git.") (license license:expat))) +(define-public gnome-authenticator + (package + (name "gnome-authenticator") + (version "4.4.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.gnome.org/World/Authenticator.git/") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0zavax35n048spx097ymiq31s8b879qwbg8xmcxcx73r6m823mic")))) + (build-system cargo-build-system) + (arguments + (list + #:install-source? #f + #:cargo-inputs `(("rust-aes-gcm" ,rust-aes-gcm-0.10) + ("rust-anyhow" ,rust-anyhow-1) + ("rust-rust-argon2" ,rust-rust-argon2-2.0) + ("rust-aperture" ,rust-aperture-0.3) + ("rust-ashpd" ,rust-ashpd-0.6) + ("rust-data-encoding" ,rust-data-encoding-2) + ("rust-diesel" ,rust-diesel-2) + ("rust-diesel-migrations" ,rust-diesel-migrations-2) + ("rust-futures-channel" ,rust-futures-channel-0.3) + ("rust-futures-executor" ,rust-futures-executor-0.3) + ("rust-futures-util" ,rust-futures-util-0.3) + ("rust-gettext-rs" ,rust-gettext-rs-0.7) + ("rust-gtk4" ,rust-gtk4-0.7) + ("rust-hex" ,rust-hex-0.4) + ("rust-image" ,rust-image-0.24) + ("rust-libadwaita" ,rust-libadwaita-0.5) + ("rust-oo7" ,rust-oo7-0.2) + ("rust-percent-encoding" ,rust-percent-encoding-2.1) + ("rust-prost" ,rust-prost-0.12) + ("rust-qrencode" ,rust-qrencode-0.14) + ("rust-rand" ,rust-rand-0.8) + ("rust-reqwest" ,rust-reqwest-0.11) + ("rust-ring" ,rust-ring-0.17) + ("rust-scrypt" ,rust-scrypt-0.11) + ("rust-search-provider" ,rust-search-provider-0.6) + ("rust-serde" ,rust-serde-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-svg-metadata" ,rust-svg-metadata-0.4) + ("rust-tokio" ,rust-tokio-1) + ("rust-tracing" ,rust-tracing-0.1) + ("rust-tracing-subscriber" ,rust-tracing-subscriber-0.3) + ("rust-url" ,rust-url-2) + ("rust-uuid" ,rust-uuid-1) + ("rust-zbar-rust" ,rust-zbar-rust-0.0) + ("rust-zeroize" ,rust-zeroize-1)) + #:imported-modules `(,@%glib-or-gtk-build-system-modules + ,@%cargo-build-system-modules) + #:modules `((guix build cargo-build-system) + ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) + (guix build utils)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-in-files + (lambda _ + (let ((bindir + (string-append #$output "/bin")) + (localedir + (string-append "\"" #$output "share/locale\"")) + (pkgdatadir + (string-append "\"" #$output "/share/authenticator\""))) + + (substitute* "src/config.rs.in" + (("@APP_ID@") "\"com.belmoussaoui.Authenticator\"") + (("@PKGDATADIR@") pkgdatadir) + (("@PROFILE@") "\"\"") + (("@VERSION@") (string-append "\"" #$version "\"")) + (("@GETTEXT_PACKAGE@") "\"authenticator\"") + (("@LOCALEDIR@") localedir) + (("@OBJECT_PATH@") "\"/com/belmoussaoui/Authenticator/SearchProvider\"")) + (rename-file "src/config.rs.in" "src/config.rs") + + (substitute* "data/com.belmoussaoui.Authenticator.SearchProvider.service.in" + (("@app-id@") "com.belmoussaoui.Authenticator") + (("@bindir@") bindir) + (("@name@") "authenticator")) + (rename-file "data/com.belmoussaoui.Authenticator.SearchProvider.service.in" + "data/com.belmoussaoui.Authenticator.SearchProvider.service") + + (substitute* "data/com.belmoussaoui.Authenticator.metainfo.xml.in.in" + (("@app-id@") "com.belmoussaoui.Authenticator") + (("@gettext-package@") "authenticator")) + (rename-file "data/com.belmoussaoui.Authenticator.metainfo.xml.in.in" + "data/com.belmoussaoui.Authenticator.metainfo.xml") + + (substitute* "data/com.belmoussaoui.Authenticator.desktop.in.in" + (("@icon@") "com.belmoussaoui.Authenticator")) + (rename-file "data/com.belmoussaoui.Authenticator.desktop.in.in" + "data/com.belmoussaoui.Authenticator.desktop") + + (substitute* "data/com.belmoussaoui.Authenticator.gschema.xml.in" + (("@app-id@") "com.belmoussaoui.Authenticator") + (("@gettext-package@") "authenticator")) + (rename-file "data/com.belmoussaoui.Authenticator.gschema.xml.in" + "data/com.belmoussaoui.Authenticator.gschema.xml")))) + (add-before 'build 'build-locales + (lambda _ + (for-each + (lambda (po-file) + (invoke "msgfmt" "-c" "-o" + (string-append (string-drop-right po-file 3) ".mo") + po-file)) + (find-files "po" "\\.po")))) + (add-before 'build-locales 'build-resources + (lambda _ + (with-directory-excursion "data" + (invoke "glib-compile-resources" + "--generate" + "resources.gresource.xml")))) + (add-before 'install 'install-extra + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (here (getcwd)) + (source (assoc-ref inputs "source")) + (share (string-append out "/share")) + (hicolor (string-append share "/icons/hicolor"))) + (mkdir-p hicolor) + (with-directory-excursion hicolor + (mkdir-p "scalable/apps") + (install-file + (string-append source "/data/icons/com.belmoussaoui.Authenticator.svg") + "scalable/apps") + (mkdir-p "symbolic/apps") + (install-file + (string-append + source "/data/icons/com.belmoussaoui.Authenticator-symbolic.svg") + "symbolic/apps")) + (with-directory-excursion share + (mkdir-p "applications") + (with-directory-excursion "applications" + (install-file + (string-append + here "/data/com.belmoussaoui.Authenticator.desktop") ".")) + (mkdir-p "authenticator") + (with-directory-excursion "authenticator" + (copy-file + (string-append + here "/data/resources.gresource") + "authenticator.gresource")) + (mkdir-p "gnome-shell/search-providers") + (with-directory-excursion "gnome-shell/search-providers" + (install-file + (string-append + here + "/data/com.belmoussaoui.Authenticator.search-provider.ini") ".")) + (mkdir-p "locale") + (with-directory-excursion "locale" + (for-each + (lambda (mo-file) + (define mo-dir + (string-append + (string-drop-right (basename mo-file) 3) + "/LC_MESSAGES")) + (mkdir-p mo-dir) + (copy-file mo-file (string-append mo-dir "/authenticator.mo"))) + (find-files (string-append here "/po") "\\.mo"))) + (mkdir-p "metainfo") + (with-directory-excursion "metainfo" + (install-file + (string-append + here + "/data/com.belmoussaoui.Authenticator.metainfo.xml") ".")) + (mkdir-p "glib-2.0/schemas") + (with-directory-excursion "glib-2.0/schemas" + (install-file + (string-append + here + "/data/com.belmoussaoui.Authenticator.gschema.xml") ".")) + (mkdir-p "dbus-1/services") + (with-directory-excursion "dbus-1/services" + (install-file + (string-append + here + "/data/com.belmoussaoui.Authenticator.SearchProvider.service") ".")))))) + (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file + (assoc-ref glib-or-gtk:%standard-phases + 'generate-gdk-pixbuf-loaders-cache-file)) + (add-after 'install 'glib-or-gtk-compile-schemas + (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas)) + (add-after 'install 'glib-or-gtk-wrap + (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)) + (add-after 'glib-or-gtk-wrap 'wrap-extra-paths + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (gst-plugins-path (getenv "GST_PLUGIN_SYSTEM_PATH"))) + (for-each + (lambda (prog) + (wrap-program (string-append out "/bin/" prog) + `("GST_PLUGIN_SYSTEM_PATH" ":" suffix (,gst-plugins-path)))) + '("authenticator")))))))) + (native-inputs (list clang + gnu-gettext + `(,glib "bin") ; for glib-compile-schemas + libxml2 ; for xmllint + pkg-config)) + (inputs (list glib + gstreamer + gst-plugins-base + gst-plugins-bad + gtk + libadwaita + openssl + pango-1.52 + sqlite + zbar)) + (home-page "https://apps.gnome.org/Authenticator") + (synopsis "Generate two-factor codes") + (description "Simple application for generating Two-Factor Authentication +Codes: + +It features: + +@itemize +@item Time-based/Counter-based/Steam methods support +@item SHA-1/SHA-256/SHA-512 algorithms support +@item QR code scanner using a camera or from a screenshot +@item Lock the application with a password +@item Beautiful UI +@item GNOME Shell search provider +@item Backup/Restore from/into known applications like FreeOTP+, +Aegis (encrypted / plain-text), andOTP, Google Authenticator +@end itemize") + (license license:gpl3+))) + (define-public helvum (package (name "helvum")