about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libssh')
-rw-r--r--nixpkgs/pkgs/development/libraries/libssh/default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libssh/default.nix b/nixpkgs/pkgs/development/libraries/libssh/default.nix
new file mode 100644
index 000000000000..c6accad9c3c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libssh/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, cmake, zlib, openssl, libsodium }:
+
+stdenv.mkDerivation rec {
+  pname = "libssh";
+  version = "0.8.9";
+
+  src = fetchurl {
+    url = "https://www.libssh.org/files/0.8/${pname}-${version}.tar.xz";
+    sha256 = "09b8w9m5qiap8wbvz4613nglsynpk8hn0q9b929ny2y4l2fy2nc5";
+  };
+
+  postPatch = ''
+    # Fix headers to use libsodium instead of NaCl
+    sed -i 's,nacl/,sodium/,g' ./include/libssh/curve25519.h src/curve25519.c
+  '';
+
+  # single output, otherwise cmake and .pc files point to the wrong directory
+  # outputs = [ "out" "dev" ];
+
+  buildInputs = [ zlib openssl libsodium ];
+
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "SSH client library";
+    homepage = "https://libssh.org";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ sander ];
+    platforms = platforms.all;
+  };
+}