guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: passff-host: Add explicit references to inputs and remove so


From: guix-commits
Subject: 02/02: gnu: passff-host: Add explicit references to inputs and remove some.
Date: Fri, 3 Nov 2023 20:01:09 -0400 (EDT)

snape pushed a commit to branch master
in repository guix.

commit f54f36b363a86bb033275e3a0594974d3d91bd53
Author: Clément Lassieur <clement@lassieur.org>
AuthorDate: Wed Nov 1 02:16:48 2023 +0100

    gnu: passff-host: Add explicit references to inputs and remove some.
    
    This removes ‘coreutils’, ‘grep’, ‘sed’, ‘which’, ‘bash-minimal’ and
    ‘gnu-make’ inputs, which were only used by the Makefile and
    install_host_app.sh.  Instead of running install_host_app.sh (through
    ‘make’) which does a few text substitutions, do the text substitutions with
    Scheme code.  This simplifies things and avoids unnecessary native inputs.
    
    * gnu/packages/browser-extensions.scm (passff-host)[build-system]: Change to
    copy-build-system.
    [arguments]: Copy passff.json and passff.py.  Do text substitutions on
    them rather than running make.  Refer to ‘password-store’ and ‘python’ 
through
    inputs rather than directly.
    [inputs]: Add PASSWORD-STORE and PYTHON.
    
    Change-Id: I8fdb757516a7c30eae36b15f2a8d91e1445b19a5
---
 gnu/packages/browser-extensions.scm | 43 ++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/browser-extensions.scm 
b/gnu/packages/browser-extensions.scm
index 99dc7de109..8ae6fbf497 100644
--- a/gnu/packages/browser-extensions.scm
+++ b/gnu/packages/browser-extensions.scm
@@ -24,12 +24,9 @@
   #: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))
@@ -167,28 +164,26 @@ ungoogled-chromium.")
               (sha256
                (base32
                 "1p18l1jh20x4v8dj64z9qjlp96fxsl5h069iynxfpbkzj6hd74yl"))))
-    (build-system trivial-build-system)
+    (build-system copy-build-system)
     (arguments
-     (list
-      #:modules '((guix build utils))
-      #:builder
-      #~(begin
-          (use-modules (guix build utils))
-          (setenv "PATH" (string-join '(#$coreutils
-                                        #$grep
-                                        #$password-store
-                                        #$python
-                                        #$sed
-                                        #$which) "/bin:" 'suffix))
-          (copy-recursively #$source ".")
-          (patch-shebang "src/install_host_app.sh"
-                         (list (in-vicinity #$bash-minimal "bin")))
-          (substitute* "src/install_host_app.sh"
-            (("(TARGET_DIR_FIREFOX=).*" all var)
-             (string-append var #$output "/lib/icecat/native-messaging-hosts"
-                            "\n")))
-          (invoke #$(file-append gnu-make "/bin/make")
-                  (string-append "VERSION=" #$version) "install-unix"))))
+     (let ((native-manifests "lib/icecat/native-messaging-hosts"))
+       (list
+        #:install-plan
+        `'(("src" ,native-manifests #:include ("passff.json" "passff.py")))
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'substitute
+              (lambda _
+                (substitute* "src/passff.json"
+                  (("PLACEHOLDER")
+                   (format #f "~a/~a/passff.py" #$output #$native-manifests)))
+                (substitute* "src/passff.py"
+                  (("_VERSIONHOLDER_") #$version)
+                  (("^COMMAND = .*")
+                   (format #f "COMMAND = \"~a/bin/pass\"~%"
+                           #$(this-package-input "password-store"))))
+                (patch-shebang "src/passff.py")))))))
+    (inputs (list password-store python))
     (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]