Skip to content

Commit

Permalink
zerotierone: Use pre-vendored cargo dependencies (#193093)
Browse files Browse the repository at this point in the history
ZeroTierOne already vendors the dependencies for us, so there is no point in doing it twice. Unfortunately, the ZeroTierOne developers forgot to specify rust-jwt in the cargo configuration file, so we have to manually do that to allow it to work as intended.
  • Loading branch information
JustTNE authored Sep 27, 2022
1 parent be01d84 commit c8b98ce
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pkgs/tools/networking/zerotierone/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ let
in stdenv.mkDerivation {
inherit pname version src;

cargoDeps = rustPlatform.fetchCargoTarball {
src = "${src}/zeroidc";
name = "${pname}-${version}";
sha256 = "sha256-8K4zAXo85MT4pfIsg7DZAO+snfwzdo2TozVw17KhX4Q=";
};
postPatch = "cp ${src}/zeroidc/Cargo.lock Cargo.lock";

preConfigure = ''
patchShebangs ./doc/build.sh
substituteInPlace ./doc/build.sh \
Expand All @@ -41,12 +34,17 @@ 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
];
Expand Down

0 comments on commit c8b98ce

Please sign in to comment.