uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
50
pkgs/development/tools/rover/default.nix
Normal file
50
pkgs/development/tools/rover/default.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ lib
|
||||
, callPackage
|
||||
, fetchFromGitHub
|
||||
, perl
|
||||
, rustPlatform
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "rover";
|
||||
version = "0.5.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "apollographql";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-wBHMND/xpm9o7pkWMUj9lEtEkzy3mX+E4Dt7qDn6auY=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-n0R2MdAYGsOsYt4x1N1KdGvBZYTALyhSzCGW29bnFU4=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
perl
|
||||
];
|
||||
|
||||
# The rover-client's build script (crates/rover-client/build.rs) will try to
|
||||
# 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 = ''
|
||||
mkdir crates/rover-client/.schema
|
||||
cp ${./schema}/etag.id crates/rover-client/.schema/
|
||||
cp ${./schema}/schema.graphql crates/rover-client/.schema/
|
||||
'';
|
||||
|
||||
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; {
|
||||
description = "A CLI for managing and maintaining graphs with Apollo Studio";
|
||||
homepage = "https://www.apollographql.com/docs/rover";
|
||||
license = licenses.mit;
|
||||
maintainers = [ maintainers.ivanbrennan ];
|
||||
platforms = ["x86_64-linux"];
|
||||
};
|
||||
}
|
||||
1
pkgs/development/tools/rover/schema/etag.id
Normal file
1
pkgs/development/tools/rover/schema/etag.id
Normal file
|
|
@ -0,0 +1 @@
|
|||
2694c7b893d44c9ad8f5d7161116deb9985a6bd05e8e0cdcd7379947430e6f89
|
||||
172
pkgs/development/tools/rover/schema/schema.graphql
Normal file
172
pkgs/development/tools/rover/schema/schema.graphql
Normal file
File diff suppressed because one or more lines are too long
75
pkgs/development/tools/rover/update.sh
Executable file
75
pkgs/development/tools/rover/update.sh
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl gnugrep gnused jq nix-prefetch
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
dirname=$(realpath "$(dirname "$0")")
|
||||
nixpkgs=$(realpath "${dirname}/../../../..")
|
||||
|
||||
old_rover_version=$(nix eval --raw -f "$nixpkgs" rover.version)
|
||||
rover_url=https://api.github.com/repos/apollographql/rover/releases/latest
|
||||
rover_tag=$(curl "$rover_url" | jq --raw-output ".tag_name")
|
||||
rover_version="$(expr "$rover_tag" : 'v\(.*\)')"
|
||||
|
||||
if [[ "$old_rover_version" == "$rover_version" ]]; then
|
||||
echo "rover is up-to-date: ${old_rover_version}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Fetching rover"
|
||||
rover_tar_url="https://github.com/apollographql/rover/archive/refs/tags/${rover_tag}.tar.gz"
|
||||
{
|
||||
read rover_hash
|
||||
read repo
|
||||
} < <(nix-prefetch-url "$rover_tar_url" --unpack --type sha256 --print-path)
|
||||
|
||||
# Convert hash to SRI representation
|
||||
rover_sri_hash=$(nix hash to-sri --type sha256 "$rover_hash")
|
||||
|
||||
# Update rover version.
|
||||
sed --in-place \
|
||||
"s|version = \"[0-9.]*\"|version = \"$rover_version\"|" \
|
||||
"$dirname/default.nix"
|
||||
|
||||
# Update rover hash.
|
||||
sed --in-place \
|
||||
"s|sha256 = \"[a-zA-Z0-9\/+-=]*\"|sha256 = \"$rover_sri_hash\"|" \
|
||||
"$dirname/default.nix"
|
||||
|
||||
# Clear cargoSha256.
|
||||
sed --in-place \
|
||||
"s|cargoSha256 = \".*\"|cargoSha256 = \"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"|" \
|
||||
"$dirname/default.nix"
|
||||
|
||||
# Update cargoSha256
|
||||
echo "Computing cargoSha256"
|
||||
cargoSha256=$(
|
||||
nix-prefetch "{ sha256 }: (import $nixpkgs {}).rover.cargoDeps.overrideAttrs (_: { outputHash = sha256; })"
|
||||
)
|
||||
sed --in-place \
|
||||
"s|cargoSha256 = \".*\"|cargoSha256 = \"$cargoSha256\"|" \
|
||||
"$dirname/default.nix"
|
||||
|
||||
# Update apollo api schema info
|
||||
response="$(mktemp)"
|
||||
schemaUrl=https://graphql.api.apollographql.com/api/schema
|
||||
|
||||
mkdir -p "$dirname"/schema
|
||||
|
||||
# Fetch schema info
|
||||
echo "Fetching Apollo GraphQL schema"
|
||||
# include response headers, and append terminating newline to response body
|
||||
curl --include --write-out "\n" "$schemaUrl" > "$response"
|
||||
|
||||
# Parse response headers and write the etag to schema/etag.id
|
||||
grep \
|
||||
--max-count=1 \
|
||||
--only-matching \
|
||||
--perl-regexp \
|
||||
'^etag: \K\S*' \
|
||||
"$response" \
|
||||
> "$dirname"/schema/etag.id
|
||||
|
||||
# Discard headers and blank line (terminated by carriage return), and write the
|
||||
# response body to schema/schema.graphql
|
||||
sed '1,/^\r/d' "$response" > "$dirname"/schema/schema.graphql
|
||||
Loading…
Add table
Add a link
Reference in a new issue