1 { lib, stdenv, fetchurl, gperf, guile, gmp, zlib, liboop, readline, gnum4, pam
2 , nettools, lsof, procps, libxcrypt }:
4 stdenv.mkDerivation rec {
9 url = "mirror://gnu/lsh/lsh-${version}.tar.gz";
10 sha256 = "614b9d63e13ad3e162c82b6405d1f67713fc622a8bc11337e72949d613713091";
13 patches = [ ./pam-service-name.patch ./lshd-no-root-login.patch ];
16 # Patch `lsh-make-seed' so that it can gather enough entropy.
17 sed -i "src/lsh-make-seed.c" \
18 -e "s|/usr/sbin/arp|${nettools}/sbin/arp|g ;
19 s|/usr/bin/netstat|${nettools}/bin/netstat|g ;
20 s|/usr/local/bin/lsof|${lsof}/bin/lsof|g ;
21 s|/bin/vmstat|${procps}/bin/vmstat|g ;
22 s|/bin/ps|${procps}/bin/sp|g ;
23 s|/usr/bin/w|${procps}/bin/w|g ;
24 s|/usr/bin/df|$(type -P df)|g ;
25 s|/usr/bin/ipcs|$(type -P ipcs)|g ;
26 s|/usr/bin/uptime|$(type -P uptime)|g"
28 # Skip the `configure' script that checks whether /dev/ptmx & co. work as
29 # expected, because it relies on impurities (for instance, /dev/pts may
30 # be unavailable in chroots.)
31 export lsh_cv_sys_unix98_ptys=yes
34 # -fcommon: workaround build failure on -fno-common toolchains like upstream
35 # gcc-10. Otherwise build fails as:
36 # ld: liblsh.a(unix_user.o):/build/lsh-2.0.4/src/server_userauth.h:108: multiple definition of
37 # `server_userauth_none_preauth'; lshd.o:/build/lsh-2.0.4/src/server_userauth.h:108: first defined here
38 # Should be present in upcoming 2.1 release.
39 NIX_CFLAGS_COMPILE = "-std=gnu90 -fcommon";
41 buildInputs = [ gperf guile gmp zlib liboop readline gnum4 pam libxcrypt ];
44 description = "GPL'd implementation of the SSH protocol";
47 lsh is a free implementation (in the GNU sense) of the ssh
48 version 2 protocol, currently being standardised by the IETF
52 homepage = "http://www.lysator.liu.se/~nisse/lsh/";
53 license = lib.licenses.gpl2Plus;
56 platforms = [ "x86_64-linux" ];