Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zerotierone: Use pre-vendored cargo dependencies #193093

Merged
merged 1 commit into from
Sep 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' ""

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment that links back to more context, like the upstream issue? All the rest looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? I don't think there is an upstream issue here? I'm of the impression this is a packaging issue here and not an upstream issue. However, I can add some more details to clarify why it's needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zimbatm does that work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, it will help with the next release

# 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