tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
vector: 0.25.2 -> 0.26.0
authored by
happysalada
and committed by
Yt
3 years ago
a71f67b5
ff229c7d
+42
-3
3 changed files
expand all
collapse all
unified
split
pkgs
tools
misc
vector
default.nix
pin.json
update.sh
+4
-3
pkgs/tools/misc/vector/default.nix
···
32
32
33
33
let
34
34
pname = "vector";
35
35
-
version = "0.25.2";
35
35
+
pinData = lib.importJSON ./pin.json;
36
36
+
version = pinData.version;
36
37
in
37
38
rustPlatform.buildRustPackage {
38
39
inherit pname version;
···
41
42
owner = "vectordotdev";
42
43
repo = pname;
43
44
rev = "v${version}";
44
44
-
hash = "sha256-gkhVabfAV250zofss7b/3ulb09Wk5EMGz9GSaS5eCzA=";
45
45
+
sha256 = pinData.sha256;
45
46
};
46
47
47
47
-
cargoHash = "sha256-zxwwXFCdcbB+Kx2SNyAIDsII6SN5+QHJQlzOUx+us2o=";
48
48
+
cargoSha256 = pinData.cargoSha256;
48
49
nativeBuildInputs = [ pkg-config cmake perl ];
49
50
buildInputs = [ oniguruma openssl protobuf rdkafka zstd ]
50
51
++ lib.optionals stdenv.isDarwin [ Security libiconv coreutils CoreServices ];
+5
pkgs/tools/misc/vector/pin.json
···
1
1
+
{
2
2
+
"version": "0.26.0",
3
3
+
"sha256": "sha256-0h9hcNgaVBDBeSKo39TvrMlloTS5ZoXrbVhm7Y43U+o=",
4
4
+
"cargoSha256": "sha256-UHc8ZyLJ1pxaBuP6bOXdbAI1oVZD4CVHAIa8URnNdaI="
5
5
+
}
+33
pkgs/tools/misc/vector/update.sh
···
1
1
+
#!/usr/bin/env nix-shell
2
2
+
#! nix-shell -i oil -p jq sd nix-prefetch-github ripgrep
3
3
+
4
4
+
# TODO set to `verbose` or `extdebug` once implemented in oil
5
5
+
shopt --set xtrace
6
6
+
# we need failures inside of command subs to get the correct cargoSha256
7
7
+
shopt --unset inherit_errexit
8
8
+
9
9
+
const directory = $(dirname $0 | xargs realpath)
10
10
+
const owner = "vectordotdev"
11
11
+
const repo = "vector"
12
12
+
const latest_rev = $(curl -q https://api.github.com/repos/${owner}/${repo}/releases/latest | \
13
13
+
jq -r '.tag_name')
14
14
+
const latest_version = $(echo $latest_rev | sd 'v' '')
15
15
+
const current_version = $(jq -r '.version' $directory/pin.json)
16
16
+
if ("$latest_version" === "$current_version") {
17
17
+
echo "$repo is already up-to-date"
18
18
+
return 0
19
19
+
} else {
20
20
+
const tarball_meta = $(nix-prefetch-github $owner $repo --rev "$latest_rev")
21
21
+
const tarball_hash = "sha256-$(echo $tarball_meta | jq -r '.sha256')"
22
22
+
23
23
+
jq ".version = \"$latest_version\" | \
24
24
+
.\"sha256\" = \"$tarball_hash\" | \
25
25
+
.\"cargoSha256\" = \"\"" $directory/pin.json | sponge $directory/pin.json
26
26
+
27
27
+
const new_cargo_sha256 = $(nix-build -A vector 2>&1 | \
28
28
+
tail -n 2 | \
29
29
+
head -n 1 | \
30
30
+
sd '\s+got:\s+' '')
31
31
+
32
32
+
jq ".cargoSha256 = \"$new_cargo_sha256\"" $directory/pin.json | sponge $directory/pin.json
33
33
+
}