2011-04-25 15:03:13 +00:00
|
|
|
{ stdenv, fetchurl, zlib, enableStatic ? false,
|
|
|
|
sftpPath ? "/var/run/current-system/sw/libexec/sftp-server" }:
|
2010-03-09 23:11:12 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-07-23 19:29:40 +00:00
|
|
|
name = "dropbear-2016.74";
|
2010-03-09 23:11:12 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-06-18 20:53:19 +00:00
|
|
|
url = "http://matt.ucc.asn.au/dropbear/releases/${name}.tar.bz2";
|
2016-07-23 19:29:40 +00:00
|
|
|
sha256 = "14c8f4gzixf0j9fkx68jgl85q7b05852kk0vf09gi6h0xmafl817";
|
2010-03-09 23:11:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontDisableStatic = enableStatic;
|
|
|
|
|
|
|
|
configureFlags = stdenv.lib.optional enableStatic "LDFLAGS=-static";
|
|
|
|
|
2011-04-25 15:04:56 +00:00
|
|
|
CFLAGS = "-DSFTPSERVER_PATH=\\\"${sftpPath}\\\"";
|
2011-04-25 15:03:13 +00:00
|
|
|
|
2013-06-18 20:53:19 +00:00
|
|
|
# http://www.gnu.org/software/make/manual/html_node/Libraries_002fSearch.html
|
|
|
|
preConfigure = ''
|
2014-12-17 18:11:30 +00:00
|
|
|
makeFlags=VPATH=`cat $NIX_CC/nix-support/orig-libc`/lib
|
2013-06-18 20:53:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
crossAttrs = {
|
|
|
|
# This works for uclibc, at least.
|
|
|
|
preConfigure = ''
|
2014-12-17 18:11:30 +00:00
|
|
|
makeFlags=VPATH=`cat ${stdenv.ccCross}/nix-support/orig-libc`/lib
|
2013-06-18 20:53:19 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-04-25 14:40:10 +00:00
|
|
|
patches = [
|
|
|
|
# Allow sessions to inherit the PATH from the parent dropbear.
|
|
|
|
# Otherwise they only get the usual /bin:/usr/bin kind of PATH
|
|
|
|
./pass-path.patch
|
|
|
|
];
|
|
|
|
|
2010-03-09 23:11:12 +00:00
|
|
|
buildInputs = [ zlib ];
|
|
|
|
|
2015-10-17 10:24:17 +00:00
|
|
|
meta = with stdenv.lib; {
|
2016-04-29 23:58:00 +00:00
|
|
|
homepage = "http://matt.ucc.asn.au/dropbear/dropbear.html";
|
2016-02-02 16:19:58 +00:00
|
|
|
description = "A small footprint implementation of the SSH 2 protocol";
|
2015-10-17 10:24:17 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ abbradar ];
|
2016-06-11 00:38:32 +00:00
|
|
|
platforms = platforms.linux;
|
2010-03-09 23:11:12 +00:00
|
|
|
};
|
|
|
|
}
|