1{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, apacheHttpd, curl }:
2
3rustPlatform.buildRustPackage rec {
4 pname = "rustls-ffi";
5 version = "0.10.0";
6
7 src = fetchFromGitHub {
8 owner = "rustls";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256-IDIWN5g1aaE6SDdXSm4WYK6n+BpuypPYQITuDj1WJEc=";
12 };
13
14 propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Security ];
15
16 cargoLock.lockFile = ./Cargo.lock;
17 postPatch = ''
18 cp ${./Cargo.lock} Cargo.lock
19 '';
20
21 installPhase = ''
22 runHook preInstall
23
24 make install DESTDIR=${placeholder "out"}
25
26 runHook postInstall
27 '';
28
29 passthru.tests = {
30 apacheHttpd = apacheHttpd.override { modTlsSupport = true; };
31 # Currently broken notably because of https://github.com/curl/curl/issues/13248
32 # curl = curl.override { opensslSupport = false; rustlsSupport = true; };
33 };
34
35 meta = with lib; {
36 description = "C-to-rustls bindings";
37 homepage = "https://github.com/rustls/rustls-ffi/";
38 license = with lib.licenses; [ mit asl20 isc ];
39 maintainers = [ maintainers.lesuisse ];
40 };
41}