nixpkgs/pkgs/tools/networking/zerotierone/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.0 KiB
Nix
Raw Normal View History

2022-05-05 09:59:36 +01:00
{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, buildPackages
, cargo
2022-05-05 09:59:36 +01:00
, lzo
, openssl
, pkg-config
, ronn
, rustc
2022-05-05 09:59:36 +01:00
, zlib
}:
let
2019-07-30 18:19:15 +01:00
pname = "zerotierone";
version = "1.12.1";
2019-07-30 18:19:15 +01:00
src = fetchFromGitHub {
owner = "zerotier";
repo = "ZeroTierOne";
rev = version;
sha256 = "sha256-430wdPrSNohM3sXewusjsW3tbE7EFGISGxABZF21yRc=";
2022-05-05 09:59:36 +01:00
};
2022-05-05 09:59:36 +01:00
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";
2015-04-05 07:46:14 +01:00
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
}
2021-04-26 14:55:31 +01:00
patchShebangs ./doc/build.sh
substituteInPlace ./doc/build.sh \
--replace '/usr/bin/ronn' '${buildPackages.ronn}/bin/ronn' \
2021-04-26 14:55:31 +01:00
substituteInPlace ./make-linux.mk \
2022-06-18 14:29:49 +01:00
--replace '-march=armv6zk' "" \
--replace '-mcpu=arm1176jzf-s' ""
2016-06-30 11:12:20 +01:00
'';
2015-04-05 07:46:14 +01:00
2022-05-05 09:59:36 +01:00
nativeBuildInputs = [
pkg-config
ronn
rustPlatform.cargoSetupHook
cargo
rustc
2022-05-05 09:59:36 +01:00
];
buildInputs = [
lzo
openssl
zlib
];
2020-01-04 01:10:37 +00:00
enableParallelBuilding = true;
2016-06-30 02:20:26 +01:00
buildFlags = [ "all" "selftest" ];
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
checkPhase = ''
2022-05-05 09:59:36 +01:00
runHook preCheck
./zerotier-selftest
2022-05-05 09:59:36 +01:00
runHook postCheck
'';
2022-05-05 09:59:36 +01:00
installFlags = [ "DESTDIR=$$out/upstream" ];
postInstall = ''
mv $out/upstream/usr/sbin $out/bin
mkdir -p $man/share
mv $out/upstream/usr/share/man $man/share/man
2016-06-30 11:12:20 +01:00
2022-05-05 09:59:36 +01:00
rm -rf $out/upstream
2015-04-05 07:46:14 +01:00
'';
2016-06-30 11:12:20 +01:00
outputs = [ "out" "man" ];
passthru.updateScript = ./update.sh;
meta = with lib; {
2015-04-05 07:46:14 +01:00
description = "Create flat virtual Ethernet networks of almost unlimited size";
homepage = "https://www.zerotier.com";
2019-08-28 21:28:46 +01:00
license = licenses.bsl11;
maintainers = with maintainers; [ sjmackenzie zimbatm ehmry obadz danielfullmer ];
platforms = platforms.linux;
2015-04-05 07:46:14 +01:00
};
}