@@ -0,0 +1,48 @@
1+{ lib
2+, rustPlatform
3+, fetchFromGitHub
4+, installShellFiles
5+, mandown
6+}:
7+
8+rustPlatform.buildRustPackage rec {
9+ pname = "netavark";
10+ version = "1.0.0";
11+
12+ src = fetchFromGitHub {
13+ owner = "containers";
14+ repo = pname;
15+ rev = "v${version}";
16+ sha256 = "sha256-E3Mdrc8/IwuOOwwVf4LaLrNFzuO95MEvy8BbStQRgoE=";
17+ };
18+
19+ cargoVendorDir = "vendor";
20+
21+ preBuild = ''
22+ substituteInPlace Cargo.toml \
23+ --replace 'build = "build.rs"' ""
24+
25+ rm build.rs
26+
27+ export \
28+ VERGEN_BUILD_SEMVER="${version}" \
29+ VERGEN_BUILD_TIMESTAMP="$SOURCE_DATE_EPOCH" \
30+ VERGEN_GIT_SHA="${src.rev}" \
31+ VERGEN_RUSTC_HOST_TRIPLE=""
32+ '';
33+
34+ nativeBuildInputs = [ installShellFiles mandown ];
35+
36+ postBuild = ''
37+ make -C docs
38+ installManPage docs/*.1
39+ '';
40+
41+ meta = with lib; {
42+ description = "Rust based network stack for containers";
43+ homepage = "https://github.com/containers/netavark";
44+ license = licenses.asl20;
45+ maintainers = with maintainers; [ ] ++ teams.podman.members;
46+ platforms = platforms.linux;
47+ };
48+}