|
|
|
@ -1,6 +1,4 @@ |
|
|
|
|
{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute }: |
|
|
|
|
|
|
|
|
|
with stdenv.lib; |
|
|
|
|
{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute, ronn }: |
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec { |
|
|
|
|
version = "1.1.6"; |
|
|
|
@ -13,28 +11,38 @@ stdenv.mkDerivation rec { |
|
|
|
|
|
|
|
|
|
preConfigure = '' |
|
|
|
|
substituteInPlace ./make-linux.mk \ |
|
|
|
|
--replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc"; |
|
|
|
|
--replace 'CC=$(shell which clang gcc cc 2>/dev/null | head -n 1)' "CC=${gcc}/bin/gcc"; |
|
|
|
|
substituteInPlace ./make-linux.mk \ |
|
|
|
|
--replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++"; |
|
|
|
|
--replace 'CXX=$(shell which clang++ g++ c++ 2>/dev/null | head -n 1)' "CC=${gcc}/bin/g++"; |
|
|
|
|
substituteInPlace ./osdep/LinuxEthernetTap.cpp \ |
|
|
|
|
--replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",' |
|
|
|
|
''; |
|
|
|
|
--replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",' |
|
|
|
|
|
|
|
|
|
buildInputs = [ openssl lzo zlib gcc iproute ]; |
|
|
|
|
patchShebangs ./doc/build.sh |
|
|
|
|
substituteInPlace ./doc/build.sh \ |
|
|
|
|
--replace '/usr/bin/ronn' '${ronn}/bin/ronn' \ |
|
|
|
|
--replace 'ronn -r' '${ronn}/bin/ronn -r' |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
buildFlags = [ "one" ]; # TODO: Add support for building and installing manpages as well. |
|
|
|
|
buildInputs = [ openssl lzo zlib gcc iproute ronn ]; |
|
|
|
|
|
|
|
|
|
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 |
|
|
|
|
|
|
|
|
|
mkdir -p $man/share/man/man8 |
|
|
|
|
for cmd in zerotier-one.8 zerotier-cli.1 zerotier-idtool.1; do |
|
|
|
|
cat doc/$cmd | gzip -9 > $man/share/man/man8/$cmd.gz |
|
|
|
|
done |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
meta = { |
|
|
|
|
outputs = [ "out" "man" ]; |
|
|
|
|
|
|
|
|
|
meta = with stdenv.lib; { |
|
|
|
|
description = "Create flat virtual Ethernet networks of almost unlimited size"; |
|
|
|
|
homepage = https://www.zerotier.com; |
|
|
|
|
license = stdenv.lib.licenses.gpl3; |
|
|
|
|
maintainers = [ stdenv.lib.maintainers.sjmackenzie ]; |
|
|
|
|
platforms = with stdenv.lib; platforms.allBut [ "i686-linux" ]; |
|
|
|
|
license = licenses.gpl3; |
|
|
|
|
maintainers = [ sjmackenzie ]; |
|
|
|
|
platforms = platforms.allBut [ "i686-linux" ]; |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|