1{ lib
2, stdenv
3, fetchurl
4, pkg-config
5, cmake
6, zlib
7, openssl
8, libsodium
9
10# for passthru.tests
11, ffmpeg
12, sshping
13, wireshark
14}:
15
16stdenv.mkDerivation rec {
17 pname = "libssh";
18 version = "0.10.5";
19
20 src = fetchurl {
21 url = "https://www.libssh.org/files/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
22 sha256 = "sha256-tg4v9/Nnue7itWNNOmMwPd/t4OahjfyojESodw5+QjQ=";
23 };
24
25 # Do not split 'dev' output until lib/cmake/libssh/libssh-config.cmake
26 # is fixed to point INTERFACE_INCLUDE_DIRECTORIES to .dev output.
27 # Otherwise it breaks `plasma5Packages.kio-extras`:
28 # https://hydra.nixos.org/build/221540008/nixlog/3/tail
29 #outputs = [ "out" "dev" ];
30
31 postPatch = ''
32 # Fix headers to use libsodium instead of NaCl
33 sed -i 's,nacl/,sodium/,g' ./include/libssh/curve25519.h src/curve25519.c
34 '';
35
36 # single output, otherwise cmake and .pc files point to the wrong directory
37 # outputs = [ "out" "dev" ];
38
39 buildInputs = [ zlib openssl libsodium ];
40
41 nativeBuildInputs = [ cmake pkg-config ];
42
43 passthru.tests = {
44 inherit ffmpeg sshping wireshark;
45 };
46
47 meta = with lib; {
48 description = "SSH client library";
49 homepage = "https://libssh.org";
50 license = licenses.lgpl2Plus;
51 maintainers = with maintainers; [ sander ];
52 platforms = platforms.all;
53 };
54}