Subject: [PATCH staging v3 2/2] gnu: Add cyrus-sasl-xoauth2.

From: Reily Siegel <[email-masked]>
Date: Fri, 23 Dec 2022 14:27:43 -0500

From: Morgan Smith <[email-masked]>

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

diff --git a/gnu/packages/cyrus-sasl.scm b/gnu/packages/cyrus-sasl.scm
index 8254e04993..efeeb519c4 100644
--- a/gnu/packages/cyrus-sasl.scm
+++ b/gnu/packages/cyrus-sasl.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2016 Leo Famulari <[email-masked]>
 ;;; Copyright © 2019 Mathieu Othacehe <[email-masked]>
 ;;; Copyright © 2022 Marius Bakke <[email-masked]>
+;;; Copyright © 2022 Morgan Smith <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,6 +31,7 @@ (define-module (gnu packages cyrus-sasl)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module (guix build-system gnu))
 
 (define-public cyrus-sasl
@@ -76,3 +78,34 @@ (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)
+    (arguments
+     (list #:configure-flags #~(list (string-append "--with-cyrus-sasl="
+                                                    #$output)
+                                     "--disable-static")
+           #:phases #~(modify-phases %standard-phases
+                        (add-before 'bootstrap 'fix-autogen
+                          (lambda _
+                            ;; autogen.sh is executable but does not have a shebang.
+                            (chmod "autogen.sh" #o400))))))
+    (inputs (list cyrus-sasl))
+    (native-inputs (list autoconf automake libtool))
+    (home-page "https://github.com/moriyoshi/cyrus-sasl-xoauth2")
+    (synopsis "XOAUTH2 plugin for Cyrus SASL")
+    (description "Adds support for XOAUTH2 authentication to Cyrus SASL.  This
+package can be used with isync to fetch mail from servers that support it.")
+    (license license:expat)))