build: container: Add #:host-uids argument to call-with-container.
[jackhill/guix/guix.git] / gnu / packages / lsh.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;;
4 ;;; This file is part of GNU Guix.
5 ;;;
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
10 ;;;
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
15 ;;;
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19 (define-module (gnu packages lsh)
20 #:use-module (guix licenses)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages m4)
26 #:use-module (gnu packages linux)
27 #:use-module (gnu packages nettle)
28 #:use-module ((gnu packages compression) #:prefix guix:)
29 #:use-module (gnu packages multiprecision)
30 #:use-module (gnu packages readline)
31 #:use-module (gnu packages gperf)
32 #:use-module (gnu packages guile))
33
34 (define-public liboop
35 (package
36 (name "liboop")
37 (version "1.0")
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "http://download.ofb.net/liboop/liboop-"
42 version ".tar.gz"))
43 (sha256
44 (base32
45 "0z6rlalhvfca64jpvksppc9bdhs7jwhiw4y35g5ibvh91xp3rn1l"))
46 (patches (list (search-patch "liboop-mips64-deplibs-fix.patch")))))
47 (build-system gnu-build-system)
48 (home-page "http://www.lysator.liu.se/liboop/")
49 (synopsis "Event loop library")
50 (description "Liboop is a low-level event loop management library for
51 POSIX-based operating systems. It supports the development of modular,
52 multiplexed applications which may respond to events from several sources. It
53 replaces the \"select() loop\" and allows the registration of event handlers
54 for file and network I/O, timers and signals. Since processes use these
55 mechanisms for almost all external communication, liboop can be used as the
56 basis for almost any application.")
57 (license lgpl2.1+)))
58
59 (define-public lsh
60 (package
61 (name "lsh")
62 (version "2.1")
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "mirror://gnu/lsh/lsh-"
66 version ".tar.gz"))
67 (sha256
68 (base32
69 "1qqjy9zfzgny0rkb27c8c7dfsylvb6n0ld8h3an2r83pmaqr9gwb"))
70 (modules '((guix build utils)))
71 (snippet
72 '(begin
73 (substitute* "src/testsuite/functions.sh"
74 (("localhost")
75 ;; Avoid host name lookups since they don't work in
76 ;; chroot builds.
77 "127.0.0.1")
78 (("set -e")
79 ;; Make tests more verbose.
80 "set -e\nset -x"))
81
82 (substitute* (find-files "src/testsuite" "-test$")
83 (("localhost") "127.0.0.1"))
84
85 (substitute* "src/testsuite/login-auth-test"
86 (("/bin/cat") "cat"))))))
87 (build-system gnu-build-system)
88 (native-inputs
89 `(("m4" ,m4)
90 ("guile" ,guile-2.0)
91 ("gperf" ,gperf)
92 ("psmisc" ,psmisc))) ; for `killall'
93 (inputs
94 `(("nettle" ,nettle-2)
95 ("linux-pam" ,linux-pam)
96
97 ;; 'rl.c' uses the 'CPPFunction' type, which is no longer in
98 ;; Readline 6.3.
99 ("readline" ,readline-6.2)
100
101 ("liboop" ,liboop)
102 ("zlib" ,guix:zlib)
103 ("gmp" ,gmp)))
104 (arguments
105 '(;; Skip the `configure' test that checks whether /dev/ptmx &
106 ;; co. work as expected, because it relies on impurities (for
107 ;; instance, /dev/pts may be unavailable in chroots.)
108 #:configure-flags '("lsh_cv_sys_unix98_ptys=yes")
109
110 ;; FIXME: Tests won't run in a chroot, presumably because
111 ;; /etc/profile is missing, and thus clients get an empty $PATH
112 ;; and nothing works.
113 #:tests? #f
114
115 #:phases
116 (alist-cons-before
117 'configure 'pre-configure
118 (lambda* (#:key inputs #:allow-other-keys)
119 ;; Make sure 'lsh' and 'lshd' pick 'sexp-conv' in the right place by
120 ;; default.
121 (substitute* "src/environ.h.in"
122 (("^#define PATH_SEXP_CONV.*")
123 (let* ((nettle (assoc-ref inputs "nettle"))
124 (sexp-conv (string-append nettle "/bin/sexp-conv")))
125 (string-append "#define PATH_SEXP_CONV \""
126 sexp-conv "\"\n"))))
127
128 ;; Tests rely on $USER being set.
129 (setenv "USER" "guix"))
130 %standard-phases)))
131 (home-page "http://www.lysator.liu.se/~nisse/lsh/")
132 (synopsis "GNU implementation of the Secure Shell (ssh) protocols")
133 (description
134 "GNU lsh is a free implementation of the SSH version 2 protocol. It is
135 used to create a secure line of communication between two computers,
136 providing shell access to the server system from the client. It provides
137 both the server daemon and the client application, as well as tools for
138 manipulating key files.")
139 (license gpl2+)))