nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 c-ares,
7 python3,
8 lua5_4,
9 capnproto,
10 openssl,
11 rust-bindgen,
12 nix-update-script,
13}:
14
15rustPlatform.buildRustPackage (finalAttrs: {
16 pname = "g3proxy";
17 version = "1.11.9";
18
19 src = fetchFromGitHub {
20 owner = "bytedance";
21 repo = "g3";
22 tag = "g3proxy-v${finalAttrs.version}";
23 hash = "sha256-N6Fvdc+Vj7S9CgBby9unKBVBoM9pPlmfyJPxY3KdSXg=";
24 };
25
26 cargoHash = "sha256-bLzkA50XiIUrGyKZ3upo2psjFnjUNups0aIEou+J5IA=";
27
28 cargoBuildFlags = [
29 "-p"
30 "g3proxy"
31 ];
32 cargoTestFlags = finalAttrs.cargoBuildFlags;
33
34 nativeBuildInputs = [
35 pkg-config
36 python3
37 capnproto
38 rust-bindgen
39 ];
40
41 buildInputs = [
42 c-ares
43 lua5_4
44 openssl
45 ];
46
47 passthru.updateScript = nix-update-script {
48 extraArgs = [
49 "--version-regex"
50 "^g3proxy-v([0-9.]+)$"
51 ];
52 };
53
54 meta = {
55 description = "Enterprise-oriented Generic Proxy Solutions";
56 homepage = "https://github.com/bytedance/g3";
57 changelog = "https://github.com/bytedance/g3/blob/${finalAttrs.src.rev}/CHANGELOG.md";
58 license = lib.licenses.asl20;
59 maintainers = with lib.maintainers; [ raitobezarius ];
60 mainProgram = "g3proxy";
61 };
62})