2022-03-14 20:23:55 +01:00
|
|
|
{ lib
|
|
|
|
, callPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, perl
|
|
|
|
, rustPlatform
|
2023-02-07 19:43:12 +01:00
|
|
|
, darwin
|
|
|
|
, stdenv
|
2022-03-14 20:23:55 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rover";
|
2023-05-04 21:40:28 +02:00
|
|
|
version = "0.14.0";
|
2022-03-14 20:23:55 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "apollographql";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-05-04 21:40:28 +02:00
|
|
|
sha256 = "sha256-fVgo5Ds/VK0kBpF+F2FdMvBnQj2IB+B5ToOK8ONdq6c=";
|
2022-03-14 20:23:55 +01:00
|
|
|
};
|
|
|
|
|
2023-05-04 21:40:28 +02:00
|
|
|
cargoSha256 = "sha256-fNqnpLNENLJEhbqxLFUqyjAf8tEPCLoGSRV91gOY9LI=";
|
2023-02-07 19:43:12 +01:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
|
|
|
];
|
2022-03-14 20:23:55 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
perl
|
|
|
|
];
|
|
|
|
|
2023-02-07 19:43:12 +01: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"
|
|
|
|
];
|
|
|
|
|
|
|
|
# The rover-client's build script (xtask/src/commands/prep/schema.rs) will try to
|
2022-03-14 20:23:55 +01:00
|
|
|
# download the API's graphql schema at build time to our read-only filesystem.
|
|
|
|
# To avoid this we pre-download it to a location the build script checks.
|
|
|
|
preBuild = ''
|
2023-02-07 19:43:12 +01:00
|
|
|
cp ${./schema}/hash.id crates/rover-client/.schema/
|
|
|
|
cp ${./schema}/etag.id crates/rover-client/.schema/
|
|
|
|
cp ${./schema}/schema.graphql crates/rover-client/.schema/
|
2022-03-14 20:23:55 +01: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 19:43:12 +01:00
|
|
|
description = "A CLI for interacting with ApolloGraphQL's developer tooling, including managing self-hosted and GraphOS graphs.";
|
2022-03-14 20:23:55 +01:00
|
|
|
homepage = "https://www.apollographql.com/docs/rover";
|
|
|
|
license = licenses.mit;
|
2023-02-07 19:58:58 +01:00
|
|
|
maintainers = [ maintainers.ivanbrennan maintainers.aaronarinder ];
|
2022-03-14 20:23:55 +01:00
|
|
|
};
|
|
|
|
}
|