1{ lib, stdenv, fetchurl, pkg-config, cmake, zlib, openssl, libsodium }:
2
3stdenv.mkDerivation rec {
4 pname = "libssh";
5 version = "0.9.6";
6
7 src = fetchurl {
8 url = "https://www.libssh.org/files/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
9 sha256 = "sha256-hrz4hb2bgEZv4OBUU8WLh332GvqLqUeljDVtfw+rgps=";
10 };
11
12 postPatch = ''
13 # Fix headers to use libsodium instead of NaCl
14 sed -i 's,nacl/,sodium/,g' ./include/libssh/curve25519.h src/curve25519.c
15 '';
16
17 # single output, otherwise cmake and .pc files point to the wrong directory
18 # outputs = [ "out" "dev" ];
19
20 buildInputs = [ zlib openssl libsodium ];
21
22 nativeBuildInputs = [ cmake pkg-config ];
23
24 meta = with lib; {
25 description = "SSH client library";
26 homepage = "https://libssh.org";
27 license = licenses.lgpl2Plus;
28 maintainers = with maintainers; [ sander ];
29 platforms = platforms.all;
30 };
31}