2011-04-25 16:03:13 +01: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 {
|
2013-06-18 21:53:19 +01:00
|
|
|
name = "dropbear-2013.58";
|
2010-03-09 23:11:12 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-06-18 21:53:19 +01:00
|
|
|
url = "http://matt.ucc.asn.au/dropbear/releases/${name}.tar.bz2";
|
|
|
|
sha256 = "0m9fhabs78v35fhqmji5gkm66ahkyqbbdzmlmr9m7q8l3ndihrnq";
|
2010-03-09 23:11:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontDisableStatic = enableStatic;
|
|
|
|
|
|
|
|
configureFlags = stdenv.lib.optional enableStatic "LDFLAGS=-static";
|
|
|
|
|
2011-04-25 16:04:56 +01:00
|
|
|
CFLAGS = "-DSFTPSERVER_PATH=\\\"${sftpPath}\\\"";
|
2011-04-25 16:03:13 +01:00
|
|
|
|
2013-06-18 21:53:19 +01:00
|
|
|
# http://www.gnu.org/software/make/manual/html_node/Libraries_002fSearch.html
|
|
|
|
preConfigure = ''
|
|
|
|
makeFlags=VPATH=`cat $NIX_GCC/nix-support/orig-libc`/lib
|
|
|
|
'';
|
|
|
|
|
|
|
|
crossAttrs = {
|
|
|
|
# This works for uclibc, at least.
|
|
|
|
preConfigure = ''
|
|
|
|
makeFlags=VPATH=`cat ${stdenv.gccCross}/nix-support/orig-libc`/lib
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2011-04-25 15:40:10 +01: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
|
2013-06-18 22:35:34 +01:00
|
|
|
|
|
|
|
# Bugfix
|
|
|
|
# http://article.gmane.org/gmane.network.ssh.dropbear/1361
|
|
|
|
./proxycrash.patch
|
2011-04-25 15:40:10 +01:00
|
|
|
];
|
|
|
|
|
2010-03-09 23:11:12 +00:00
|
|
|
buildInputs = [ zlib ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://matt.ucc.asn.au/dropbear/dropbear.html;
|
|
|
|
description = "An small footprint implementation of the SSH 2 protocol";
|
|
|
|
license = "mit";
|
|
|
|
};
|
|
|
|
}
|