nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 installShellFiles,
7 bzip2,
8 openssl,
9 xz,
10 zstd,
11 stdenv,
12 testers,
13 writableTmpDirAsHomeHook,
14 nix-update-script,
15}:
16
17rustPlatform.buildRustPackage (finalAttrs: {
18 pname = "espup";
19 version = "0.16.0";
20
21 src = fetchFromGitHub {
22 owner = "esp-rs";
23 repo = "espup";
24 tag = "v${finalAttrs.version}";
25 hash = "sha256-blEjUFBzkwplwZgTAtI84MCHvxujNF1WsPJJezRNjxQ=";
26 };
27
28 cargoHash = "sha256-Y6Y+62lJ3k6GMkU82CDkTt1Prd3UrtBKqA5Spctochw=";
29
30 nativeBuildInputs = [
31 pkg-config
32 installShellFiles
33 ];
34
35 buildInputs = [
36 bzip2
37 openssl
38 xz
39 zstd
40 ];
41
42 env = {
43 OPENSSL_NO_VENDOR = true;
44 ZSTD_SYS_USE_PKG_CONFIG = true;
45 };
46
47 nativeCheckInputs = [ writableTmpDirAsHomeHook ];
48
49 checkFlags = [
50 # makes network calls
51 "--skip=toolchain::rust::tests::test_xtensa_rust_parse_version"
52 ];
53
54 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
55 installShellCompletion --cmd espup \
56 --bash <($out/bin/espup completions bash) \
57 --fish <($out/bin/espup completions fish) \
58 --zsh <($out/bin/espup completions zsh)
59 '';
60
61 passthru = {
62 updateScript = nix-update-script { };
63 tests.version = testers.testVersion {
64 package = finalAttrs.finalPackage;
65 };
66 };
67
68 meta = {
69 description = "Tool for installing and maintaining Espressif Rust ecosystem";
70 homepage = "https://github.com/esp-rs/espup/";
71 license = with lib.licenses; [
72 mit
73 asl20
74 ];
75 maintainers = with lib.maintainers; [
76 knightpp
77 beeb
78 ];
79 mainProgram = "espup";
80 };
81})