Files
nixpkgs/pkgs/by-name/li/libssh/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

68 lines
1.3 KiB
Nix
Raw Permalink 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.11.3";
src = fetchurl {
url = "https://www.libssh.org/files/${lib.versions.majorMinor version}/libssh-${version}.tar.xz";
hash = "sha256-fYoTYbsJTsP1EZZOeKWk26aJtZhuESr6vk9NDWxhJcM=";
};
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" ];
buildInputs = [
zlib
openssl
libsodium
];
nativeBuildInputs = [
cmake
pkg-config
];
postFixup = ''
substituteInPlace $dev/lib/cmake/libssh/libssh-config.cmake \
--replace-fail "set(_IMPORT_PREFIX \"$out\")" "set(_IMPORT_PREFIX \"$dev\")"
'';
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;
};
}