From 12e960f592f8cfa1faadc05cb0111bfd59a0eb7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Tue, 9 Mar 2010 23:11:12 +0000 Subject: [PATCH] Adding dropbear, a small implementation of ssh2 client and server. I made it statically build by default I had to fix the zlib static cross-build, because the native stripping corrupted the target static library. It is not the first time I see this. I add drobear to the cross-built packages for hydra. svn path=/nixpkgs/trunk/; revision=20518 --- pkgs/development/libraries/zlib/default.nix | 4 ++++ pkgs/tools/networking/dropbear/default.nix | 22 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 ++++++ pkgs/top-level/release-cross.nix | 1 + 4 files changed, 33 insertions(+) create mode 100644 pkgs/tools/networking/dropbear/default.nix diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index b4ae9e63ea08..95c891e9bc7a 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -15,6 +15,10 @@ stdenv.mkDerivation { fi ''; + crossAttrs = { + dontStrip = if static then true else false; + }; + # zlib doesn't like the automatic --disable-shared from the Cygwin stdenv. cygwinConfigureEnableShared = true; } diff --git a/pkgs/tools/networking/dropbear/default.nix b/pkgs/tools/networking/dropbear/default.nix new file mode 100644 index 000000000000..986c9806591a --- /dev/null +++ b/pkgs/tools/networking/dropbear/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl, zlib, enableStatic ? false }: + +stdenv.mkDerivation rec { + name = "dropbear-0.52"; + + src = fetchurl { + url = http://matt.ucc.asn.au/dropbear/releases/dropbear-0.52.tar.bz2; + sha256 = "1h84dwld8qm19m0a1zslm2ssz65nr93irw7p2h5fjrlh9ix74ywc"; + }; + + dontDisableStatic = enableStatic; + + configureFlags = stdenv.lib.optional enableStatic "LDFLAGS=-static"; + + buildInputs = [ zlib ]; + + meta = { + homepage = http://matt.ucc.asn.au/dropbear/dropbear.html; + description = "An small footprint implementation of the SSH 2 protocol"; + license = "mit"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 213c4d4e765e..ea0da3456724 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -630,6 +630,12 @@ let inherit builderDefs; }; + dropbear = makeOverridable (import ../tools/networking/dropbear) { + inherit fetchurl stdenv; + enableStatic = true; + zlib = zlibStatic; + }; + duplicity = import ../tools/backup/duplicity { inherit fetchurl stdenv librsync gnupg makeWrapper python; inherit (pythonPackages) boto; diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix index 695ee1c38e6b..7d4173bd988b 100644 --- a/pkgs/top-level/release-cross.nix +++ b/pkgs/top-level/release-cross.nix @@ -6,6 +6,7 @@ let basicHostDrv = { bison.hostDrv = nativePlatforms; busybox.hostDrv = nativePlatforms; + dropbear.hostDrv = nativePlatforms; tightvnc.hostDrv = nativePlatforms; #openoffice.hostDrv = nativePlatforms; wxGTK.hostDrv = nativePlatforms;