btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / ru / rustlings / package.nix
blob80eecb46dbcd6be451b2f3d952519869985411c3
2   lib,
3   stdenv,
4   darwin,
5   rustPlatform,
6   fetchFromGitHub,
7   pkg-config,
8   cargo,
9   rustc,
10   clippy,
11   makeWrapper,
13 let
14   pname = "rustlings";
15   version = "6.4.0";
17 rustPlatform.buildRustPackage {
18   inherit pname version;
19   src = fetchFromGitHub {
20     owner = "rust-lang";
21     repo = "rustlings";
22     rev = "v${version}";
23     hash = "sha256-VdIIcpyoCuid3MECVc9aKeIOUlxGlxcG7znqbqo9pjc=";
24   };
26   cargoHash = "sha256-AU6OUGSWuxKmdoQLk+UiFzA7NRviDAgXrBDMdkjxOpA=";
28   # Disabled test that does not work well in an isolated environment
29   checkFlags = [
30     "--skip=run_compilation_success"
31     "--skip=run_test_success"
32   ];
34   nativeBuildInputs = [
35     pkg-config
36     makeWrapper
37   ];
39   buildInputs = lib.optionals stdenv.hostPlatform.isDarwin (
40     with darwin.apple_sdk.frameworks; [ CoreServices ]
41   );
43   postFixup = ''
44     wrapProgram $out/bin/rustlings --suffix PATH : ${
45       lib.makeBinPath [
46         cargo
47         rustc
48         clippy
49       ]
50     }
51   '';
53   meta = {
54     description = "Explore the Rust programming language and learn more about it while doing exercises";
55     homepage = "https://rustlings.cool/";
56     changelog = "https://github.com/rust-lang/rustlings/releases";
57     license = lib.licenses.mit;
58     maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
59     mainProgram = "rustlings";
60   };