From 6c894b7a1a6a7a0f7c51a44136bba00dc0b5250c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= Date: Tue, 17 Oct 2023 16:53:57 +0200 Subject: [PATCH] gnu: Add passff. * gnu/packages/browser-extensions.scm (passff-host): New variable. (passff): New variable. Change-Id: I0f6f4b0c319e5cffd0940421a4d8bdc73d8d806b --- gnu/packages/browser-extensions.scm | 76 +++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 252c95729d..5b34972499 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -24,10 +24,14 @@ #:use-module (guix git-download) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu build chromium-extension) #:use-module (gnu build icecat-extension) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) #:use-module (gnu packages compression) + #:use-module (gnu packages password-utils) #:use-module (gnu packages python)) (define play-to-kodi @@ -150,3 +154,75 @@ ungoogled-chromium.") (define-public ublock-origin/icecat (make-icecat-extension ublock-origin "firefox")) + +(define-public passff-host + (package + (name "passff-host") + (version "1.2.3") + (home-page "https://github.com/passff/passff-host") + (source (origin + (method git-fetch) + (uri (git-reference (url home-page) (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1p18l1jh20x4v8dj64z9qjlp96fxsl5h069iynxfpbkzj6hd74yl")))) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (setenv "PATH" (string-join + (list #$(file-append coreutils "/bin") + #$(file-append grep "/bin") + #$(file-append password-store "/bin") + #$(file-append python "/bin") + #$(file-append sed "/bin") + #$(file-append which "/bin")) ":")) + (copy-recursively #$source ".") + (substitute* "src/install_host_app.sh" + (("#!/usr/bin/env sh") #$(file-append bash-minimal "/bin/sh")) + (("(TARGET_DIR_FIREFOX=).*" all var) + (string-append var #$output + "/lib/icecat/native-messaging-hosts"))) + (invoke #$(file-append gnu-make "/bin/make") + (string-append "VERSION=" #$version) "install-unix")))) + (synopsis "Host app for the WebExtension PassFF") + (description "This piece of software wraps around the zx2c4 pass shell +command. It has to be installed for the PassFF browser extension to work +properly.") + (license license:gpl2+))) + +(define passff + (package + (name "passff") + (version "1.15") + (home-page "https://github.com/passff/passff") + (source (origin + (method git-fetch) + (uri (git-reference (url home-page) (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1gymqyqppr8k9fqv5js7f6pk6hcc47qpf51x5cy6aahsk2v1qssj")))) + (propagated-inputs (list passff-host)) + (build-system copy-build-system) + (properties '((addon-id . "passff@invicem.pro"))) + (arguments + `(#:install-plan '(("src" ,(assq-ref properties 'addon-id))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'substitute-placeholder + (lambda _ + (substitute* "src/manifest.json" + (("_VERSIONHOLDER_") ,version))))))) + (synopsis "zx2c4 pass management extension for Mozilla Firefox") + (description "This extension will allow you to access your zx2c4 pass +repository directly from your web browser. You can choose to automatically +fill and submit login forms if a matching password entry is found.") + (license license:gpl2+))) + +(define-public passff/icecat + (make-icecat-extension passff))