depot/third_party/nixpkgs/pkgs/development/libraries/rustls-ffi/default.nix
Default email 87f9c27ba9 Project import generated by Copybara.
GitOrigin-RevId: fe2ecaf706a5907b5e54d979fbde4924d84b65fc
2023-04-12 14:48:02 +02:00

40 lines
1,002 B
Nix

{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, apacheHttpd, curl }:
rustPlatform.buildRustPackage rec {
pname = "rustls-ffi";
version = "0.9.2";
src = fetchFromGitHub {
owner = "rustls";
repo = pname;
rev = "v${version}";
hash = "sha256-urDC/Tm+ZwEbf0orZzKSET5ljQGVcKPGxscctKOM/FU=";
};
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Security ];
cargoLock.lockFile = ./Cargo.lock;
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
installPhase = ''
runHook preInstall
make install DESTDIR=${placeholder "out"}
runHook postInstall
'';
passthru.tests = {
apacheHttpd = apacheHttpd.override { modTlsSupport = true; };
curl = curl.override { opensslSupport = false; rustlsSupport = true; };
};
meta = with lib; {
description = "C-to-rustls bindings";
homepage = "https://github.com/rustls/rustls-ffi/";
license = with lib.licenses; [ mit asl20 isc ];
maintainers = [ maintainers.lesuisse ];
};
}