nixpkgs/pkgs/development/libraries/rustls-ffi/default.nix
Thomas Gerbet 74207b79f0 curl: add support for Rustls backend
No functional changes for the other TLS backend but it is now possible
to build curl with `rustls-ffi`.

```
> ./result-bin/bin/curl --version
curl 8.0.1 (x86_64-pc-linux-gnu) libcurl/8.0.1 rustls-ffi/0.9.2/rustls/0.20.8 zlib/1.2.13 brotli/1.0.9 zstd/1.5.4 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.51.0
Release-Date: 2023-03-20
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz SPNEGO SSL threadsafe UnixSockets zstd
```
2023-04-02 12:00:30 +02:00

41 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 ];
};
}