;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Thompson ;;; Copyright © 2016, 2019, 2020 Marius Bakke ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2018, 2020–2022 Tobias Geerinckx-Rice ;;; Copyright © 2016 Kei Kebreau ;;; Copyright © 2019, 2021, 2022, 2023 Ricardo Wurmus ;;; Copyright © 2020 Nicolas Goaziou ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 qblade ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR
aboutsummaryrefslogtreecommitdiff
blob: 5f2cd00ec32276a2e8284a9b9228d0c51b787d8d (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018, 2020, 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019, 2020, 2022 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages authentication)
  #:use-module (gnu packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages documentation)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages security-token)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages xml)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages))

(define-public oath-toolkit
  (package
    (name "oath-toolkit")
    (version "2.6.7")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://download.savannah.nongnu.org/releases/"
                           name "/" name "-" version ".tar.gz"))
       (sha256
        (base32 "1aa620k05lsw3l3slkp2mzma40q3p9wginspn9zk8digiz7dzv9n"))))
    (build-system gnu-build-system)
    (arguments
     ;; TODO ‘--enable-pskc’ causes xmlsec-related test suite failures.
     `(#:configure-flags
       (list "--enable-pam"
             "--enable-pskc"
             "--with-xmlsec-crypto-engine=openssl")
       #:phases
       (modify-phases %standard-phases
         (add-after 'install 'delete-static-libraries
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (lib (string-append out "/lib")))
               (for-each delete-file (find-files lib "\\.a$"))
               #t))))))
    (native-inputs
     (list pkg-config
           ;; XXX: Perhaps this should be propagated from xmlsec.
           libltdl))
    (inputs
     (list linux-pam openssl xmlsec-openssl))
    (home-page "https://www.nongnu.org/oath-toolkit/")
    (synopsis "One-time password (OTP) components")
    (description
     "The @dfn{OATH} (Open AuTHentication) Toolkit provides various components
for building one-time password (@dfn{OTP}) authentication systems:

@itemize
@item @command{oathtool}, a command-line tool for generating & validating OTPs.
@item @code{liboath}, a C library for OATH handling.
@item @command{pskctool}, a command-line tool for manipulating secret key
files in the Portable Symmetric Key Container (@dfn{PSKC}) format
described in RFC6030.
@item @code{libpskc}, a shared and static C library for PSKC handling.
@item @code{pam_oath}, a PAM module for pluggable login authentication.
@end itemize

Supported technologies include the event-based @acronym{HOTP, Hash-based Message
Authentication Code One-Time Password} algorithm (RFC4226), the time-based
@acronym{TOTP, Time-based One-Time Password} algorithm (RFC6238), and
@acronym{PSKC, Portable Symmetric Key Container} (RFC6030) to manage secret key
data.")
    (license (list license:lgpl2.1+     ; the libraries (liboath/ & libpskc/)
                   license:gpl3+))))    ; the tools (everything else)

(define-public yubico-pam
  (package
    (name "yubico-pam")
    (version "2.27")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/Yubico/yubico-pam")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0hb773zlf11xz4bwmsqv2mq5d4aq2g0crdr5cp9xwc4ivi5gd4kg"))))
    (build-system gnu-build-system)
    (arguments
     ;; The pam_test fails because ykclient fails to build a Curl handle.
     '(#:make-flags '("TESTS=util_test")))
    (inputs
     (list linux-pam libyubikey ykclient yubikey-personalization))
    (native-inputs
     (list autoconf automake libtool asciidoc pkg-config))
    (home-page "https://developers.yubico.com/yubico-pam")
    (synopsis "Yubico pluggable authentication module")
    (description "The Yubico PAM module provides an easy way to integrate the
YubiKey into your existing user authentication infrastructure.")
    (license license:bsd-2)))

(define-public pamtester
  (package
    (name "pamtester")
    (version "0.1.2")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "mirror://sourceforge/pamtester/pamtester/"
             version "/pamtester-" version ".tar.gz"))
       (sha256
        (base32 "1mdj1wj0adcnx354fs17928yn2xfr1hj5mfraq282dagi873sqw3"))))
    (build-system gnu-build-system)
    (native-inputs
     (list pkg-config))
    (inputs
     (list linux-pam))
    (home-page "http://pamtester.sourceforge.net/")
    (synopsis "Utility for testing pluggable authentication modules (PAM) facility")
    (description
     "Pamtester is a tiny utility program to test the pluggable authentication
modules (PAM) facility, specifically designed to help PAM module authors to
intensively test their own modules.")
    (license license:bsd-3)))
license license:asl2.0))) (define-public festival (package (name "festival") (version "2.5.0") (source (origin (method url-fetch) (uri (string-append "http://festvox.org/packed/festival/" (version-major+minor version) "/festival-" version "-release.tar.gz")) (sha256 (base32 "1d5415nckiv19adxisxfm1l1xxfyw88g87ckkmcr0lhjdd10g42c")))) (build-system gnu-build-system) (arguments `(#:tests? #f ; there is no test target #:make-flags (list (string-append "RM=" (assoc-ref %build-inputs "coreutils") "/bin/rm") (string-append "ECHO_N=" (assoc-ref %build-inputs "coreutils") "/bin/printf \"%s\"") "LINUXAUDIO=alsa") #:parallel-build? #f ; not supported #:modules ((guix build gnu-build-system) (guix build utils) (guix build emacs-utils)) #:imported-modules (,@%gnu-build-system-modules (guix build emacs-utils)) #:phases (modify-phases %standard-phases (add-after 'unpack 'unpack-and-patch-speech-tools (lambda* (#:key inputs #:allow-other-keys) (invoke "tar" "-C" ".." "-xf" (assoc-ref inputs "speech-tools")) (with-directory-excursion "../speech_tools" (substitute* '("config/rules/modules.mak" "config/rules/test_make_rules.mak" "config/make_system.mak") (("/bin/sh") (which "sh")))) #t)) (add-after 'unpack-and-patch-speech-tools 'set-fcommon (lambda _ (substitute* "../speech_tools/config/rules/defaults.mak" (("\\(CFLAGS\\)") "(CFLAGS) -fcommon") (("\\(CXXFLAGS\\)") "(CXXFLAGS) -fcommon")))) (add-after 'unpack 'patch-/bin/sh (lambda _ (substitute* '("config/test_make_rules" "config/make_system.mak") (("/bin/sh") (which "sh"))) #t)) (add-before 'build 'build-speech-tools (lambda* (#:key configure-flags make-flags #:allow-other-keys) (with-directory-excursion "../speech_tools" (apply invoke "sh" "configure" (string-append "CONFIG_SHELL=" (which "sh")) (string-append "SHELL=" (which "sh")) configure-flags) (apply invoke "make" make-flags)))) (add-after 'build 'build-documentation (lambda _ (with-directory-excursion "doc" (invoke "make" "festival.info")))) (add-after 'unpack 'set-installation-directories (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (substitute* "config/project.mak" (("^FTLIBDIR.*") (string-append "FTLIBDIR=" out "/share/festival/lib"))) (substitute* "config/systems/default.mak" (("^INSTALL_PREFIX.*") (string-append "INSTALL_PREFIX=" out))) #t))) (add-after 'install 'actually-install (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) ;; Install Speech Tools first (with-directory-excursion "../speech_tools" ;; Target directories (for-each (lambda (dir) (mkdir-p (string-append out dir))) '("/bin" "/lib" "/include/speech_tools/" "/include/speech_tools/instantiate" "/include/speech_tools/ling_class" "/include/speech_tools/rxp" "/include/speech_tools/sigpr" "/include/speech_tools/unix")) ;; Install binaries (for-each (lambda (file) (install-file file (string-append out "/bin"))) (find-files "bin" ".*")) (for-each (lambda (file) (delete-file (string-append out "/bin/" file))) '("est_gdb" "est_examples" "est_program")) ;; Install libraries (for-each (lambda (file) (install-file file (string-append out "/lib"))) (find-files "lib" "lib.*\\.so.*")) ;; Install headers (for-each (lambda (dir) (for-each (lambda (header) (install-file header (string-append out "/include/speech_tools/" dir))) (find-files (string-append "include/" dir) "\\.h$"))) '("." "instantiate" "ling_class" "rxp" "sigpr" "unix"))) ;; Unpack files that will be installed together with the ;; Festival libraries. (invoke "tar" "--strip-components=1" "-xvf" (assoc-ref inputs "festvox-cmu")) (invoke "tar" "--strip-components=1" "-xvf" (assoc-ref inputs "festvox-poslex")) (invoke "tar" "--strip-components=1" "-xvf" (assoc-ref inputs "default-voice")) ;; Install Festival (let ((bin (string-append out "/bin")) (incdir (string-append out "/include/festival")) (share (string-append out "/share/festival")) (info (string-append out "/share/info"))) (for-each (lambda (executable) (install-file executable bin)) '("src/main/festival" "src/main/festival_client" "examples/benchmark")) (let ((scripts '("examples/dumpfeats" "examples/durmeanstd" "examples/latest" "examples/make_utts" "examples/powmeanstd" "examples/run-festival-script" "examples/saytime" "examples/scfg_parse_text" "examples/text2pos" "examples/text2wave"))) (substitute* scripts (("exec /tmp/guix-build.*/bin/festival") (string-append "exec " bin "/festival"))) (for-each (lambda (script) (install-file script bin)) scripts)) ;; Documentation (for-each (lambda (file) (install-file file info)) (find-files "doc/info/" "festival.info.*")) ;; Headers (mkdir-p incdir) (for-each (lambda (header) (install-file header (string-append incdir "/" (dirname header)))) (find-files "src/include" "\\.h$")) ;; Data (mkdir-p share) (for-each (lambda (file) (install-file file (string-append share "/" (dirname file)))) (find-files "lib" ".*")) (for-each delete-file (append (find-files share "Makefile") (find-files bin "Makefile"))))) #t)) (add-after 'actually-install 'install-emacs-mode (lambda* (#:key outputs #:allow-other-keys) (let ((emacs-dir (string-append (assoc-ref outputs "out") "/share/emacs/site-lisp"))) (install-file "lib/festival.el" emacs-dir) (emacs-generate-autoloads ,name emacs-dir) #t))) ;; Rebuild the very old configure script that is confused by extra ;; arguments. (add-before 'configure 'bootstrap (lambda _ (invoke "autoreconf" "-vif")))))) (inputs (list alsa-lib ncurses)) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("texinfo" ,texinfo) ("emacs" ,emacs-minimal) ("festvox-cmu" ,(origin (method url-fetch) (uri (string-append "http://festvox.org/packed/festival/" (version-major+minor version) "/festlex_CMU.tar.gz")) (sha256 (base32 "01vwidqhhg2zifvk1gby91mckg1z2pv2mj6lihvdaifakf8k1561")))) ("festvox-poslex" ,(origin (method url-fetch) (uri (string-append "http://festvox.org/packed/festival/" (version-major+minor version) "/festlex_POSLEX.tar.gz")) (sha256 (base32 "18wywilxaqwy63lc47p5g5529mpxhslibh1bjij0snxx5mjf7ip7")))) ("default-voice" ,(origin (method url-fetch) (uri (string-append "http://festvox.org/packed/festival/" (version-major+minor version) "/voices/festvox_kallpc16k.tar.gz")) (sha256 (base32 "136hmsyiwnlg2qwa508dy0imf19mzrb5r3dmb2kg8kcyxnslm740")))) ("speech-tools" ,(origin (method url-fetch) (uri (string-append "http://festvox.org/packed/festival/" (version-major+minor version) "/speech_tools-" version "-release.tar.gz")) (sha256 (base32 "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4")))))) (home-page "https://www.cstr.ed.ac.uk/projects/festival/") (synopsis "Speech synthesis system") (description "Festival offers a general framework for building speech synthesis systems as well as including examples of various modules. As a whole it offers full text to speech through a number APIs: from shell level, though a Scheme command interpreter, as a C++ library, from Java, and an Emacs interface. Festival is multi-lingual though English is the most advanced. The system is written in C++ and uses the Edinburgh Speech Tools Library for low level architecture and has a Scheme (SIOD) based command interpreter for control.") (license (license:non-copyleft "file://COPYING")))) (define-public gst-vosk (package (name "gst-vosk") (version "0.3.1") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/PhilippeRo/gst-vosk") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1zxifssh57a251af9x4ahglcipvmkgc1pmc67l59s805za9yvq3p")) (modules '((guix build utils))) (snippet ;; Do not use prebuilt vosk library '(begin (delete-file-recursively "vosk") (substitute* "meson.build" (("subdir\\('vosk'\\)") "")) (substitute* "src/meson.build" (("vosk_libdir =.*") "") ((", dirs : vosk_libdir") "") (("include_directories : include_directories.*") "")) (substitute* '("src/gstvosk.h" "src/gstvosk.c") (("vosk-api.h") "vosk_api.h")))))) (build-system meson-build-system) (arguments (list #:phases '(modify-phases %standard-phases (add-after 'unpack 'install-vosk-api-header (lambda* (#:key inputs #:allow-other-keys) (install-file (search-input-file inputs "src/vosk_api.h") "src")))))) (inputs (list vosk-api gstreamer gobject-introspection)) (native-inputs (list pkg-config gettext-minimal)) (home-page "https://github.com/PhilippeRo/gst-vosk") (synopsis "Gstreamer plugin for VOSK voice recognition engine") (description "This package provides a Gstreamer plugin for the VOSK voice recognition engine.") (license license:gpl2+))) (define-public ekho (package (name "ekho") (version "8.6") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/e-guidedog/Ekho/" version "/ekho-" version ".tar.xz")) (sha256 (base32 "1hxdh8bs4zs83w19z897wb4n8n0kyv0ycjfwbi5w0j7mcxsqwh27")))) (native-inputs (list pkg-config)) (inputs (list alsa-lib espeak-ng libsndfile pulseaudio)) (build-system gnu-build-system) (native-search-paths (list (search-path-specification (variable "EKHO_DATA_PATH") (files '("share/ekho-data"))))) (home-page "https://eguidedog.net/ekho.php") (synopsis "Chinese text-to-speech software") (description "Ehko is a Text-To-Speech (TTS) software. It supports Cantonese, Mandarin, Toisanese, Zhaoan Hakka, Tibetan, Ngangien and Korean (in trial). It can also speak English through eSpeak or Festival.") (license (list license:gpl2+ ;; libmusicxml license:mpl2.0)))) (define-public sphinxbase (package (name "sphinxbase") (version "5prealpha") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/cmusphinx/" "sphinxbase/" version "/" "sphinxbase-" version ".tar.gz")) (sha256 (base32 "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp")) (patches (search-patches "sphinxbase-fix-doxygen.patch")))) (build-system gnu-build-system) (arguments `(#:parallel-tests? #f)) ;tests fail otherwise (native-inputs (list bison doxygen perl ;for tests python swig)) (inputs (list pulseaudio)) (home-page "https://cmusphinx.github.io/") (synopsis "Support library required by Pocketsphinx and Sphinxtrain") (description "This package contains the basic libraries shared by the CMU Sphinx trainer and all the Sphinx decoders (Sphinx-II, Sphinx-III, and PocketSphinx), as well as some common utilities for manipulating acoustic feature and audio files.") (license license:bsd-4))) (define-public pocketsphinx (package (name "pocketsphinx") (version "5prealpha") (source (origin (method url-fetch) (uri (string-append "mirror://sourceforge/cmusphinx/" "pocketsphinx/" version "/" "pocketsphinx-" version ".tar.gz")) (sha256 (base32 "1n9yazzdgvpqgnfzsbl96ch9cirayh74jmpjf7svs4i7grabanzg")))) (build-system gnu-build-system) (native-inputs (list pkg-config perl ;for tests python swig)) (inputs (list gstreamer libcap pulseaudio sphinxbase)) (home-page "https://cmusphinx.github.io/") (synopsis "Recognizer library written in C") (description "PocketSphinx is one of Carnegie Mellon University's large vocabulary, speaker-independent continuous speech recognition engine.") (license license:bsd-2)))