depot/third_party/nixpkgs/pkgs/development/libraries/libssh/default.nix
Default email 9c6ee729d6 Project import generated by Copybara.
GitOrigin-RevId: 6cee3b5893090b0f5f0a06b4cf42ca4e60e5d222
2023-07-15 19:15:38 +02:00

58 lines
1.5 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib
, stdenv
, fetchurl
, pkg-config
, cmake
, zlib
, openssl
, libsodium
# for passthru.tests
, ffmpeg
, sshping
, wireshark
}:
stdenv.mkDerivation rec {
pname = "libssh";
version = "0.10.5";
src = fetchurl {
url = "https://www.libssh.org/files/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "sha256-tg4v9/Nnue7itWNNOmMwPd/t4OahjfyojESodw5+QjQ=";
};
# Do not split 'dev' output until lib/cmake/libssh/libssh-config.cmake
# is fixed to point INTERFACE_INCLUDE_DIRECTORIES to .dev output.
# Otherwise it breaks `plasma5Packages.kio-extras`:
# https://hydra.nixos.org/build/221540008/nixlog/3/tail
#outputs = [ "out" "dev" ];
postPatch = ''
# Fix headers to use libsodium instead of NaCl
sed -i 's,nacl/,sodium/,g' ./include/libssh/curve25519.h src/curve25519.c
'';
# Dont build examples, which are not installed and require additional dependencies not
# included in `buildInputs` such as libX11.
cmakeFlags = [ "-DWITH_EXAMPLES=OFF" ];
# single output, otherwise cmake and .pc files point to the wrong directory
# outputs = [ "out" "dev" ];
buildInputs = [ zlib openssl libsodium ];
nativeBuildInputs = [ cmake pkg-config ];
passthru.tests = {
inherit ffmpeg sshping wireshark;
};
meta = with lib; {
description = "SSH client library";
homepage = "https://libssh.org";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ sander ];
platforms = platforms.all;
};
}