(define-module (nmail)
  #:use-module (guix build-system cmake)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #: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
    (package
      (name "nmail")
      (version "3.74")
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/d99kris/nmail/")
                      (commit (string-append "v" version))))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "07lkl5syx3l37dhsl41nhmjknhxqgmvwc4il4gygsnr333qk75c9"))))
      (build-system cmake-build-system)
      (arguments
       (list #:phases
             #~(modify-phases %standard-phases
                 (replace 'check
                   (lambda _
                     (invoke "ctest" "--output-on-failure"))))))
      (inputs
       (list libetpan xapian sqlite cyrus-sasl ncurses openssl
             file (list util-linux "lib")))
      (native-inputs (list pkg-config))
      (home-page "https://github.com/d99ris/nmail")
      (synopsis "Terminal-based email client")
      (description
       "@command{nmail} is a terminal-based email client with a
@code{ncurses} user interface similar to @code{alpine} and @code{pine}.")
      (license license:expat)))