ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / ca / cargo-bisect-rustc / package.nix
blob8a89387ca8483e6a51c357be031e4cf368f0b61c
2   stdenv,
3   lib,
4   fetchFromGitHub,
5   darwin,
6   rustPlatform,
7   pkg-config,
8   openssl,
9   runCommand,
10   patchelf,
11   zlib,
14 rustPlatform.buildRustPackage rec {
15   pname = "cargo-bisect-rustc";
16   version = "0.6.8";
18   src = fetchFromGitHub {
19     owner = "rust-lang";
20     repo = pname;
21     rev = "v${version}";
22     hash = "sha256-7HiM1oRuLSfRaum66duag/w8ncFdxRLF0yeSGlIey0Y=";
23   };
25   patches =
26     let
27       patchelfPatch =
28         runCommand "0001-dynamically-patchelf-binaries.patch"
29           {
30             CC = stdenv.cc;
31             patchelf = patchelf;
32             libPath = "$ORIGIN/../lib:${lib.makeLibraryPath [ zlib ]}";
33           }
34           ''
35             export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
36             substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
37               --subst-var patchelf \
38               --subst-var dynamicLinker \
39               --subst-var libPath
40           '';
41     in
42     lib.optionals stdenv.hostPlatform.isLinux [ patchelfPatch ];
44   nativeBuildInputs = [ pkg-config ];
46   buildInputs =
47     [ openssl ]
48     ++ lib.optionals stdenv.hostPlatform.isDarwin [
49       darwin.apple_sdk.frameworks.Security
50       darwin.apple_sdk.frameworks.SystemConfiguration
51     ];
53   cargoHash = "sha256-CgEs0cejquFRY3VN6CgbE23Gipg+LEuWp/jSIkITrjw=";
55   checkFlags = [
56     "--skip test_github" # requires internet
57   ];
59   meta = with lib; {
60     description = "Bisects rustc, either nightlies or CI artifacts";
61     mainProgram = "cargo-bisect-rustc";
62     homepage = "https://github.com/rust-lang/cargo-bisect-rustc";
63     license = with licenses; [
64       asl20
65       mit
66     ];
67     maintainers = with maintainers; [ davidtwco ];
68   };