mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-09 05:33:25 +00:00
![aleksana](/assets/img/avatar_default.png)
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
57 lines
1.3 KiB
Nix
57 lines
1.3 KiB
Nix
{ lib
|
||
, stdenv
|
||
, fetchurl
|
||
, pkg-config
|
||
, cmake
|
||
, zlib
|
||
, openssl
|
||
, libsodium
|
||
|
||
# for passthru.tests
|
||
, ffmpeg
|
||
, sshping
|
||
, wireshark
|
||
}:
|
||
|
||
stdenv.mkDerivation rec {
|
||
pname = "libssh";
|
||
version = "0.11.1";
|
||
|
||
src = fetchurl {
|
||
url = "https://www.libssh.org/files/${lib.versions.majorMinor version}/libssh-${version}.tar.xz";
|
||
hash = "sha256-FLfcxy6R4IFRxYuYGntXCrJmP2MOfSg3ZF1anGEsG3k=";
|
||
};
|
||
|
||
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
|
||
'';
|
||
|
||
# Don’t 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;
|
||
};
|
||
}
|