Merge pull request #173142 from cmm/zerotierone-1.8.9

zerotierone: 1.8.4 -> 1.8.9
This commit is contained in:
Rick van Schijndel 2022-05-15 18:40:12 +02:00 committed by GitHub
commit d7d27295c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,37 @@
{ lib, stdenv, buildPackages, fetchFromGitHub, openssl, lzo, zlib, iproute2, ronn }:
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, fetchurl
stdenv.mkDerivation rec {
, buildPackages
, iproute2
, lzo
, openssl
, pkg-config
, ronn
, zlib
}:
let
pname = "zerotierone";
version = "1.8.4";
version = "1.8.9";
src = fetchFromGitHub {
owner = "zerotier";
repo = "ZeroTierOne";
rev = version;
sha256 = "sha256-aM0FkcrSd5dEJVdJryIGuyWNFwvKH0SBfOuy4dIMK4A=";
sha256 = "sha256-N1VqzjaFJRJiSG4qHqRy4Fs8TlkUqyDoq0/3JQdGwfA=";
};
in stdenv.mkDerivation {
inherit pname version src;
cargoDeps = rustPlatform.fetchCargoTarball {
src = "${src}/zeroidc";
name = "${pname}-${version}";
sha256 = "sha256-PDsJtz279P2IpgiL0T92IbcANeGSUnGKhEH1dj9VtbM=";
};
postPatch = "cp ${src}/zeroidc/Cargo.lock Cargo.lock";
preConfigure = ''
patchShebangs ./doc/build.sh
@ -20,9 +42,19 @@ stdenv.mkDerivation rec {
--replace 'armv5' 'armv6'
'';
nativeBuildInputs = [ ronn ];
buildInputs = [ openssl lzo zlib iproute2 ];
nativeBuildInputs = [
pkg-config
ronn
rustPlatform.cargoSetupHook
rustPlatform.rust.cargo
rustPlatform.rust.rustc
];
buildInputs = [
iproute2
lzo
openssl
zlib
];
enableParallelBuilding = true;
@ -30,18 +62,20 @@ stdenv.mkDerivation rec {
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
checkPhase = ''
runHook preCheck
./zerotier-selftest
runHook postCheck
'';
installPhase = ''
install -Dt "$out/bin/" zerotier-one
ln -s $out/bin/zerotier-one $out/bin/zerotier-idtool
ln -s $out/bin/zerotier-one $out/bin/zerotier-cli
installFlags = [ "DESTDIR=$$out/upstream" ];
mkdir -p $man/share/man/man8
for cmd in zerotier-one.8 zerotier-cli.1 zerotier-idtool.1; do
cat doc/$cmd | gzip -9n > $man/share/man/man8/$cmd.gz
done
postInstall = ''
mv $out/upstream/usr/sbin $out/bin
mkdir -p $man/share
mv $out/upstream/usr/share/man $man/share/man
rm -rf $out/upstream
'';
outputs = [ "out" "man" ];