diff mbox

[bug#59018,0/1] OAuth2 for mbsync

Message ID 87k03wtfeu.fsf@polidoro.io
State New
Headers show

Commit Message

Peter Polidoro Nov. 15, 2022, 2:55 p.m. UTC
Hi,

Ludovic Courtès <ludo@gnu.org> writes:

> Packages usually have a search path environment variable for 
> plugins.  I
> don’t see one for cyrus-sasl (I just grepped for “getenv” so I 
> might
> have overlooked it).  The “Guix way” would be to have cyrus-sasl 
> honor,
> say, $CYRUS_SASL_PLUGIN_PATH and look for plugins in those 
> directories,
> add a search path to the package¹, and have the plugin installed 
> in
> $prefix/lib/sasl2 like you did.
>
> Could you check whether cyrus-sasl already has such a mechanism, 
> or add
> one (possibly discussing with upstream), and send updated 
> patches?

Thank you for your help on this package.

According to the Cyrus SASL quickstart guide:

"Note that the library can use the environment variable SASL_PATH 
to locate the directory where the mechanisms are; this should be a 
colon-separated list of directories containing plugins."[1]

Unfortunately I still do not know enough about Guix packaging to 
set this environment variable properly, nor do I know how to 
properly set the installation path in the package configuration.

This plugin's build and installation instructions are:

./autogen.sh
./configure
sudo make install

Footnotes:
[1] 
https://www.cyrusimap.org/sasl/sasl/quickstart.html#typical-installation

Comments

Ludovic Courtès Nov. 17, 2022, 5:27 p.m. UTC | #1
Peter Polidoro <peter@polidoro.io> skribis:

> According to the Cyrus SASL quickstart guide:
>
> "Note that the library can use the environment variable SASL_PATH to
> locate the directory where the mechanisms are; this should be a
> colon-separated list of directories containing plugins."[1]
>
> Unfortunately I still do not know enough about Guix packaging to set
> this environment variable properly, nor do I know how to properly set
> the installation path in the package configuration.

We’d need to add a ‘native-search-paths’ field for “SASL_PATH” to
cyrus-sasl, as explained in the “Search Paths” section of the manual.
But that can come as a separate patch.

> From d5e9f604531dbf9cf7a16a107a3745d0203e1dd7 Mon Sep 17 00:00:00 2001
> Message-Id: <d5e9f604531dbf9cf7a16a107a3745d0203e1dd7.1668524316.git.peter@polidoro.io>
> From: Peter Polidoro <peter@polidoro.io>
> Date: Tue, 15 Nov 2022 09:50:51 -0500
> Subject: [PATCH] gnu: Add cyrus-sasl-xoauth2.
>
> * gnu/packages/cyrus-sasl.scm (cyrus-sasl-xoauth2): New variable.

It fails to build:

--8<---------------cut here---------------start------------->8---
starting phase `install'
make[1]: Entering directory '/tmp/guix-build-cyrus-sasl-xoauth2-0.2.drv-0/source'
 /gnu/store/d251rfgc9nm2clzffzhgiipdvfvzkvwi-coreutils-8.32/bin/mkdir -p '/usr/lib/sasl2'
/gnu/store/d251rfgc9nm2clzffzhgiipdvfvzkvwi-coreutils-8.32/bin/mkdir: cannot create directory ‘/usr’: Permission denied
make[1]: *** [Makefile:418: install-pkglibLTLIBRARIES] Error 1
--8<---------------cut here---------------end--------------->8---

Could you send an updated patch?  TIA!

Ludo’.
diff mbox

Patch

From d5e9f604531dbf9cf7a16a107a3745d0203e1dd7 Mon Sep 17 00:00:00 2001
Message-Id: <d5e9f604531dbf9cf7a16a107a3745d0203e1dd7.1668524316.git.peter@polidoro.io>
From: Peter Polidoro <peter@polidoro.io>
Date: Tue, 15 Nov 2022 09:50:51 -0500
Subject: [PATCH] gnu: Add cyrus-sasl-xoauth2.

* gnu/packages/cyrus-sasl.scm (cyrus-sasl-xoauth2): New variable.
---
 gnu/packages/cyrus-sasl.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm
index 2cd18f3e5e..abc0bc0c2b 100644
--- a/gnu/packages/cyrus-sasl.scm
+++ b/gnu/packages/cyrus-sasl.scm
@@ -3,6 +3,7 @@ 
 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2022 Peter Polidoro <peter@polidoro.io>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +29,7 @@  (define-module (gnu packages cyrus-sasl)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu))
 
 (define-public cyrus-sasl
@@ -78,3 +80,28 @@  (define-public cyrus-sasl
    (license (license:non-copyleft "file://COPYING"
                                   "See COPYING in the distribution."))
    (home-page "https://cyrusimap.org/sasl/")))
+
+(define-public cyrus-sasl-xoauth2
+  (package
+    (name "cyrus-sasl-xoauth2")
+    (version "0.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/moriyoshi/cyrus-sasl-xoauth2")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1py9f1mn5k5xihrk0lfrwr6723c22gjb7lmgya83ibvislm2x3wl"))))
+    (build-system gnu-build-system)
+    (native-inputs (list autoconf automake libtool))
+    (inputs (list cyrus-sasl))
+    (home-page "https://github.com/moriyoshi/cyrus-sasl-xoauth2")
+    (synopsis "XOAUTH2 mechanism plugin for cyrus-sasl")
+    (description "This package adds the Open Authorization standard, OAuth2,
+authentication mechanism to cyrus-sasl as a plugin.  OAuth is an open standard
+for access delegation, commonly used as a way for internet users to grant
+websites or applications access to their information on other websites but
+without giving them the passwords.")
+    (license (list license:expat license:expat))))
-- 
2.38.1