diff mbox series

[bug#57326,7/7] gnu: Add hydroxide.

Message ID 20220821234426.16349-1-cairn@pm.me
State New
Headers show
Series gnu: Add hydroxide. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Cairn Aug. 21, 2022, 11:44 p.m. UTC
* gnu/packages/mail.scm (hydroxide): New variable.
---
 gnu/packages/mail.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

Comments

\( Aug. 28, 2022, 7:56 a.m. UTC | #1
On Mon Aug 22, 2022 at 12:44 AM BST, Cairn via Guix-patches via wrote:
> +(define-public hydroxide
> +  (let ((commit "4c32801c34b75696003ef534fc718d86787f8048")
> +         (revision "8"))

Change to revision 0.

> +      (arguments
> +        `(#:import-path "github.com/emersion/hydroxide/cmd/hydroxide"
> +          #:unpack-path "github.com/emersion/hydroxide"))

Use list style.

> +      (inputs (list go-github-com-protonmail-go-crypto
> +                     go-github-com-boltdb-bolt
> +                     go-github-com-emersion-go-bcrypt
> +                     go-github-com-emersion-go-imap
> +                     go-github-com-emersion-go-mbox
> +                     go-github-com-emersion-go-message
> +                     go-github-com-emersion-go-smtp
> +                     go-github-com-emersion-go-vcard
> +                     go-github-com-emersion-go-webdav
> +                     go-golang-org-x-term))

Convert to something like:

  (inputs
   (list go-github-com-protonmail-go-crypto
         ...))

> +      (description "This CLI tool is an alternative to the official
> +Proton Mail Bridge.  It allows you to use your preferred e-mail
> +clients and git-send-email with Proton Mail.")

  (description
   "This package provides an alternative client for the ProtonMail
  Bridge.  It allows you to use SMTP and IMAP email clients with a
  ProtonMail account.")

    -- (
\( Aug. 28, 2022, 7:59 a.m. UTC | #2
On Mon Aug 22, 2022 at 12:44 AM BST, Cairn via Guix-patches via wrote:
> +  (let ((commit "4c32801c34b75696003ef534fc718d86787f8048")

Please add a comment explaining why you're using the latest commit.

> +         (revision "8"))

           ^ Wonky indentation.

    -- (
Cairn Aug. 29, 2022, 12:23 a.m. UTC | #3
Thanks for all the feedback (. I'll implement it all soon and send the set again. I have just a couple questions:

> inputs -> propagated-inputs (sadly necessary due to the way the
> go-build-system works)

Could you explain why this is necessary? It doesn't seem to require it to build or run, at least for me. And do you mean for every package, or just this particular case?

> Description formatting here, too. Also, IMO "parse and format vCard" sounds
> a little weird.

Sounds fine to me. Also, I'm just borrowing the description from the GitHub page. If you do think it should be changed though, what would be a good change?
Olivier Dion Sept. 8, 2022, 2:18 p.m. UTC | #4
On Mon, 29 Aug 2022, Cairn via Guix-patches via <guix-patches@gnu.org> wrote:
> Thanks for all the feedback (. I'll implement it all soon and send the
> set again. I have just a couple questions:

While thing are getting fixed.  Did you manage to configure a proton
mail account to hydroxide correctly?  If so, I would use your current
patch locally for setting up my mail account.
\( Sept. 10, 2022, 7:51 a.m. UTC | #5
Hi Cairn, sorry for the delay!

On Mon Aug 29, 2022 at 1:23 AM BST, Cairn wrote:
> Could you explain why this is necessary? It doesn't seem to require it to build or run, at least for me. And do you mean for every package, or just this particular case?

This is because Go libraries (though not programs) are stored as source code in the
output directory and later fetched and rebuilt when you build one of their dependents.

So, if go-foo requires go-bar requires go-baz, go-bar will be rebuilt whenever go-foo
is built. But if go-bar doesn't use propagated-inputs, the go-baz dependency of go-bar
will be absent from the build environment.

In this case, we're talking about go-github-com-emersion-go-bcrypt depending on the
go-golang-org-x-crypto package; since x-crypto is probably already propagated in the
hydroxide build environment, as it's quite a common package, you don't see any issues;
but were you to write a package that solely depended on go-bcrypt, it'd fail to build
because x-crypto wasn't in the build environment.

> Sounds fine to me. Also, I'm just borrowing the description from the GitHub page. If you do think it should be changed though, what would be a good change?

IMO, the use of `vCard' as the object of that phrase without any further explanation
of what `vCard' is sounds a wee bit strange, so maybe something like:

  parse and format the vCard file format

Assuming vCard is a file format.

    -- (
Cairn Sept. 10, 2022, 9:32 a.m. UTC | #6
Thanks for the responses (. They both make sense. I'll start implementing these changes.
Cairn Sept. 10, 2022, 9:39 a.m. UTC | #7
> While thing are getting fixed. Did you manage to configure a proton
> mail account to hydroxide correctly? If so, I would use your current
> patch locally for setting up my mail account.
> 

> --
> Olivier Dion
> oldiob.dev

Yep! The SMTP server worked at least; I don't have a use case for IMAP. You can either try this or podiki's Peroxide (which you can ask about on the IRC I think). I'm gonna be working on V2 of Hydroxide in order to make it more compatible with Peroxide for whenever it gets sent as a patchset.
diff mbox series

Patch

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 646902b4db..45023c0f7c 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -4675,3 +4675,39 @@  (define-public smtpmail
 mailserver on their machine.  It enables these users to send their mail over a
 remote SMTP server.")
     (license license:gpl2+)))
+
+(define-public hydroxide
+  (let ((commit "4c32801c34b75696003ef534fc718d86787f8048")
+         (revision "8"))
+    (package
+      (name "hydroxide")
+      (version (git-version "0.2.23" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/emersion/hydroxide")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "111hjm4ba7c9x897sh8vycqw3p61kh664i72rnw906pdyj1npjq6"))))
+      (build-system go-build-system)
+      (arguments
+        `(#:import-path "github.com/emersion/hydroxide/cmd/hydroxide"
+          #:unpack-path "github.com/emersion/hydroxide"))
+      (inputs (list go-github-com-protonmail-go-crypto
+                     go-github-com-boltdb-bolt
+                     go-github-com-emersion-go-bcrypt
+                     go-github-com-emersion-go-imap
+                     go-github-com-emersion-go-mbox
+                     go-github-com-emersion-go-message
+                     go-github-com-emersion-go-smtp
+                     go-github-com-emersion-go-vcard
+                     go-github-com-emersion-go-webdav
+                     go-golang-org-x-term))
+      (home-page "https://github.com/emersion/hydroxide")
+      (synopsis "Third-party Proton Mail bridge supporting CardDAV, IMAP and SMTP")
+      (description "This CLI tool is an alternative to the official
+Proton Mail Bridge.  It allows you to use your preferred e-mail
+clients and git-send-email with Proton Mail.")
+      (license license:expat))))