2022-03-14 19:23:55 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, perl
|
|
|
|
, rustPlatform
|
2023-02-07 18:43:12 +00:00
|
|
|
, darwin
|
|
|
|
, stdenv
|
2022-03-14 19:23:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rover";
|
2024-04-01 06:39:48 +00:00
|
|
|
version = "0.23.0";
|
2022-03-14 19:23:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "apollographql";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-04-01 06:39:48 +00:00
|
|
|
sha256 = "sha256-c1Tnb9ACyV6RZmYnLL+KnybGgy8kwGi0JyWYcoH1J6M=";
|
2022-03-14 19:23:55 +00:00
|
|
|
};
|
|
|
|
|
2024-04-01 06:39:48 +00:00
|
|
|
cargoSha256 = "sha256-wTvQ4QBysppMgwv9pjQckVjMoBzLiDReOt6sJImqKFY=";
|
2023-02-07 18:43:12 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
2024-01-11 19:39:04 +00:00
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
2023-02-07 18:43:12 +00:00
|
|
|
];
|
2022-03-14 19:23:55 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
perl
|
|
|
|
];
|
|
|
|
|
2023-02-07 18:43:12 +00:00
|
|
|
# This test checks whether the plugins specified in the plugins json file are
|
|
|
|
# valid by making a network call to the repo that houses their binaries; but, the
|
|
|
|
# build env can't make network calls (impurity)
|
|
|
|
cargoTestFlags = [
|
|
|
|
"-- --skip=latest_plugins_are_valid_versions"
|
|
|
|
];
|
|
|
|
|
2022-03-14 19:23:55 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
|
|
|
# Some tests try to write configuration data to a location in the user's home
|
|
|
|
# directory. Since this would be /homeless-shelter during the build, point at
|
|
|
|
# a writeable location instead.
|
|
|
|
preCheck = ''
|
|
|
|
export APOLLO_CONFIG_HOME="$PWD"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-02-07 18:43:12 +00:00
|
|
|
description = "A CLI for interacting with ApolloGraphQL's developer tooling, including managing self-hosted and GraphOS graphs.";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "rover";
|
2022-03-14 19:23:55 +00:00
|
|
|
homepage = "https://www.apollographql.com/docs/rover";
|
|
|
|
license = licenses.mit;
|
2023-02-07 18:58:58 +00:00
|
|
|
maintainers = [ maintainers.ivanbrennan maintainers.aaronarinder ];
|
2022-03-14 19:23:55 +00:00
|
|
|
};
|
|
|
|
}
|