------- Original Message -------
On Saturday, October 28th, 2023 at 8:05 AM, Clément Lassieur
<clem...@lassieur.org> wrote:
>
>
> On Sat, Oct 28 2023, Christopher Baines wrote:
>
> > This passff-host package looks a bit odd to me, one thing to mention is
> > that guix show says it has no dependencies, but I don't think that's
> > correct:
I agree about this. When I packaged passff-host locally some time ago, I saw it
has a runtime dependency on python and also needs to be able to find the pass
binary. I've attached the bare (unfinished/unpolished) package definition
extracted from my local channel and attached it, for if it is of assistance to
folks. My definition tries to embed a sane path for finding pass with a default
of the path to the password-store package it was built against, and also tries
to copy the passff.json into the correct browser folder for Chromium, Firefox,
and Icecat based on the packaged install_host_app.sh script (note: I have only
used it with Icecat).
Cheers,
Kaelyn
> >
> > ./pre-inst-env guix show passff-host
> > name: passff-host
> > version: 1.2.3
> > outputs:
> > + out: everything
> > systems: x86_64-linux mips64el-linux aarch64-linux powerpc64le-linux
> > riscv64-linux
> > + i686-linux armhf-linux i586-gnu powerpc-linux
> > dependencies:
>
>
> I imagine it's a bug in `guix show`? As doc says:
>
> • Gexps carry information about the packages or derivations they
> refer to, and these dependencies are automatically added as inputs
> to the build processes that use them.
>
> > Was this change sent as a patch to guix-patches?
>
>
> No it wasn't.
I
(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"))
))
;; NOTE: python-build-system is used instead of copy-build-system to
;; automatically pick up the Python 3 dependency and to wrap the installed
;; Python script.
;; FIXME: The passff.json in etc/ needs to go into a browser-dependent
;; location to work with that specific browser. How to install it to the
;; right location needs to be figured out and documented.
(build-system python-build-system)
(arguments
(list #:tests? #f ; There are no tests
#:phases
#~(modify-phases %standard-phases
(replace 'build
(lambda _
;; TODO? Add password-store as an input and embed the store
;; path to the "pass" executable.
(substitute* "src/passff.py"
(("_VERSIONHOLDER_") #$(package-version this-package))
;; (("\"pass\"") (string-append
;; "\""
;; #$(this-package-input "password-store")
;; "/bin/pass\""))
(("\"PATH\": .*")
(string-join (list
"\"PATH\""
" \"/run/current-system/profile/bin"
"/run/booted-system/profile/bin"
(string-append
#$(this-package-input "password-store")
"/bin\",\n"))
":"))
)))
(replace 'install
(lambda _
(let ((etc (string-append #$output "/etc"))
(libexec (string-append #$output "/libexec")))
;; Install the host script in libexec
(install-file "src/passff.py" libexec)
;; Insert the script path and install the (example)
;; native host manifest to etc
(substitute* "src/passff.json"
(("PLACEHOLDER") (string-append libexec "/passff.py")))
(for-each
(lambda (dir)
(install-file "src/passff.json" dir))
(list etc ;; Generic location for easier access
;; Chromium location based on src/install_host_app.sh
(string-append etc "/chromium/native-messaging-hosts")
;; Firefox location based on src/install_host_app.sh
(string-append #$output "/lib/mozilla/native-messaging-hosts")
;; Icecat location derived from the above Firefox location
(string-append #$output "/lib/icecat/native-messaging-hosts")))
)))
)))
(inputs (list password-store))
(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 li:gpl2)))