zerotierone: 1.10.3 -> 1.10.6 (#224992)

* zerotierone: 1.10.3 -> 1.10.6

They stopped vendoring Cargo deps before 1.10.4, hence the version
gap.

* zerotierone: add an update script
This commit is contained in:
Michael Livshin 2023-04-17 15:05:52 +03:00 committed by GitHub
parent d1f5735744
commit 15e8ee51d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1748 additions and 9 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,6 @@
, stdenv
, rustPlatform
, fetchFromGitHub
, fetchurl
, buildPackages
, iproute2
@ -15,18 +14,32 @@
let
pname = "zerotierone";
version = "1.10.3";
version = "1.10.6";
src = fetchFromGitHub {
owner = "zerotier";
repo = "ZeroTierOne";
rev = version;
sha256 = "sha256-MhkGcmt1YPvlePF54XsLVFUX+P979uUqhtJjudRx69g=";
sha256 = "sha256-mapFKeF+8jMGkxSuHaw5oUdTdSQgAdxEwF/S6iyVLbY=";
};
in stdenv.mkDerivation {
inherit pname version src;
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"jwt-0.16.0" = "sha256-P5aJnNlcLe9sBtXZzfqHdRvxNfm6DPBcfcKOVeLZxcM=";
};
};
postPatch = "cp ${./Cargo.lock} Cargo.lock";
preConfigure = ''
cmp ./Cargo.lock ./zeroidc/Cargo.lock || {
echo 1>&2 "Please make sure that the derivation's Cargo.lock is identical to ./zeroidc/Cargo.lock!"
exit 1
}
patchShebangs ./doc/build.sh
substituteInPlace ./doc/build.sh \
--replace '/usr/bin/ronn' '${buildPackages.ronn}/bin/ronn' \
@ -34,17 +47,12 @@ in stdenv.mkDerivation {
substituteInPlace ./make-linux.mk \
--replace '-march=armv6zk' "" \
--replace '-mcpu=arm1176jzf-s' ""
# Upstream does not define the cargo settings necessary to use the vendorized rust-jwt version, so it has to be added manually.
# Can be removed once ZeroTierOne's zeroidc no longer uses a git url in Cargo.toml for jwt
echo '[source."https://github.com/glimberg/rust-jwt"]
git = "https://github.com/glimberg/rust-jwt"
replace-with = "vendored-sources"' >> ./zeroidc/.cargo/config.toml
'';
nativeBuildInputs = [
pkg-config
ronn
rustPlatform.cargoSetupHook
rustPlatform.rust.cargo
rustPlatform.rust.rustc
];
@ -79,6 +87,8 @@ replace-with = "vendored-sources"' >> ./zeroidc/.cargo/config.toml
outputs = [ "out" "man" ];
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Create flat virtual Ethernet networks of almost unlimited size";
homepage = "https://www.zerotier.com";

View File

@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
version=$(curl --silent "https://api.github.com/repos/zerotier/ZeroTierOne/releases" | jq '.[0].tag_name' --raw-output)
curl --silent "https://raw.githubusercontent.com/zerotier/ZeroTierOne/$version/zeroidc/Cargo.lock" > "$(dirname "$0")/Cargo.lock"
update-source-version zerotierone "$version"