(define-module (nmail)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system cmake)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages mail)
  #:use-module (gnu packages search)
  #:use-module (gnu packages file)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages cyrus-sasl)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages tls))

(define-public nmail
  (let ((commit "a03a0906faf0ad2589badce5a16957a020b46f25")
        (revision "1"))
    (package
      (name "nmail")
      (version (git-version "3.74" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/d99kris/nmail/")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "07lkl5syx3l37dhsl41nhmjknhxqgmvwc4il4gygsnr333qk75c9"))))
      (build-system cmake-build-system)
      (outputs '("out"))
      (arguments
       `(#:tests? #f)) ; Do not run the test suite
      (inputs
       `(("libetpan" ,libetpan)
         ("xapian" ,xapian)
         ("file" ,file)
         ("sqlite" ,sqlite)
         ("cyrus-sasl" ,cyrus-sasl)
         ("ncurses" ,ncurses)
         ("openssl" ,openssl)
         ("libuuid" ,util-linux "lib")
         ("file" ,file)))
      (native-inputs
       `(("pkg-config" ,pkg-config)))
      (home-page "https://github.com/d99ris/nmail/")
      (synopsis "Terminal-based email client for Linux and macOS")
      (description
       "@command{nmail} is a terminal-based email client for Linux and macOS 
       with a user interface similar to alpine/pine, supporting IMAP and SMTP.")
      (license license:expat))))
nmail