1 { lib, stdenv, buildRustCrate, fetchgit }:
2 let kernel = stdenv.buildPlatform.parsed.kernel.name;
3 abi = stdenv.buildPlatform.parsed.abi.name;
4 include = includedFiles: src: builtins.filterSource (path: type:
6 let p = toString (src + ("/" + f)); in
7 (path == p) || (type == "directory" && lib.strings.hasPrefix path p)
10 updateFeatures = f: up: functions: builtins.deepSeq f (lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions);
11 mapFeatures = features: map (fun: fun { features = features; });
12 mkFeatures = feat: lib.lists.foldl (features: featureName:
13 if feat.${featureName} or false then
14 [ featureName ] ++ features
17 ) [] (builtins.attrNames feat);
20 alloc_no_stdlib_1_3_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
21 crateName = "alloc-no-stdlib";
23 authors = [ "Daniel Reiter Horn <danielrh@dropbox.com>" ];
24 sha256 = "1jcp27pzmqdszgp80y484g4kwbjbg7x8a589drcwbxg0i8xwkir9";
25 crateBin = [ { name = "example"; } ];
26 inherit dependencies buildDependencies features;
28 brotli_2_5_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
31 authors = [ "Daniel Reiter Horn <danielrh@dropbox.com>" "The Brotli Authors" ];
32 sha256 = "1ynw4hkdwnp0kj30p86ls44ahv4s99258s019bqrq4mya8hlsb5b";
33 crateBin = [ { name = "brotli"; } ];
34 inherit dependencies buildDependencies features;
36 brotli_decompressor_1_3_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
37 crateName = "brotli-decompressor";
39 authors = [ "Daniel Reiter Horn <danielrh@dropbox.com>" "The Brotli Authors" ];
40 sha256 = "022g69q1xzwdj0130qm3fa4qwpn4q1jx3lc8yz0v0v201p7bm8fb";
41 crateBin = [ { name = "brotli-decompressor"; } ];
42 inherit dependencies buildDependencies features;
44 alloc_no_stdlib_1_3_0 = { features?(alloc_no_stdlib_1_3_0_features {}) }: alloc_no_stdlib_1_3_0_ {
45 features = mkFeatures (features.alloc_no_stdlib_1_3_0 or {});
47 alloc_no_stdlib_1_3_0_features = f: updateFeatures f ({
48 alloc_no_stdlib_1_3_0.default = (f.alloc_no_stdlib_1_3_0.default or true);
50 brotli_2_5_0 = { features?(brotli_2_5_0_features {}) }: brotli_2_5_0_ {
51 dependencies = mapFeatures features ([ alloc_no_stdlib_1_3_0 brotli_decompressor_1_3_1 ]);
52 features = mkFeatures (features.brotli_2_5_0 or {});
54 brotli_2_5_0_features = f: updateFeatures f (rec {
55 alloc_no_stdlib_1_3_0.no-stdlib =
56 (f.alloc_no_stdlib_1_3_0.no-stdlib or false) ||
57 (brotli_2_5_0.no-stdlib or false) ||
58 (f.brotli_2_5_0.no-stdlib or false);
59 alloc_no_stdlib_1_3_0.default = true;
60 brotli_2_5_0.default = (f.brotli_2_5_0.default or true);
61 brotli_decompressor_1_3_1.disable-timer =
62 (f.brotli_decompressor_1_3_1.disable-timer or false) ||
63 (brotli_2_5_0.disable-timer or false) ||
64 (f.brotli_2_5_0.disable-timer or false);
65 brotli_decompressor_1_3_1.no-stdlib =
66 (f.brotli_decompressor_1_3_1.no-stdlib or false) ||
67 (brotli_2_5_0.no-stdlib or false) ||
68 (f.brotli_2_5_0.no-stdlib or false);
69 brotli_decompressor_1_3_1.benchmark =
70 (f.brotli_decompressor_1_3_1.benchmark or false) ||
71 (brotli_2_5_0.benchmark or false) ||
72 (f.brotli_2_5_0.benchmark or false);
73 brotli_decompressor_1_3_1.default = true;
74 brotli_decompressor_1_3_1.seccomp =
75 (f.brotli_decompressor_1_3_1.seccomp or false) ||
76 (brotli_2_5_0.seccomp or false) ||
77 (f.brotli_2_5_0.seccomp or false);
78 }) [ alloc_no_stdlib_1_3_0_features brotli_decompressor_1_3_1_features ];
79 brotli_decompressor_1_3_1 = { features?(brotli_decompressor_1_3_1_features {}) }: brotli_decompressor_1_3_1_ {
80 dependencies = mapFeatures features ([ alloc_no_stdlib_1_3_0 ]);
81 features = mkFeatures (features.brotli_decompressor_1_3_1 or {});
83 brotli_decompressor_1_3_1_features = f: updateFeatures f (rec {
84 alloc_no_stdlib_1_3_0.no-stdlib =
85 (f.alloc_no_stdlib_1_3_0.no-stdlib or false) ||
86 (brotli_decompressor_1_3_1.no-stdlib or false) ||
87 (f.brotli_decompressor_1_3_1.no-stdlib or false);
88 alloc_no_stdlib_1_3_0.default = true;
89 alloc_no_stdlib_1_3_0.unsafe =
90 (f.alloc_no_stdlib_1_3_0.unsafe or false) ||
91 (brotli_decompressor_1_3_1.unsafe or false) ||
92 (f.brotli_decompressor_1_3_1.unsafe or false);
93 brotli_decompressor_1_3_1.default = (f.brotli_decompressor_1_3_1.default or true);
94 }) [ alloc_no_stdlib_1_3_0_features ];