zerotierone: build manpages

This commit is contained in:
zimbatm 2016-06-30 11:12:20 +01:00
parent 7298dd8cca
commit 4932524080

View File

@ -1,6 +1,4 @@
{ stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute }: { stdenv, fetchurl, openssl, lzo, zlib, gcc, iproute, ronn }:
with stdenv.lib;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.1.6"; version = "1.1.6";
@ -13,28 +11,38 @@ stdenv.mkDerivation rec {
preConfigure = '' preConfigure = ''
substituteInPlace ./make-linux.mk \ 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 \ 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 \ substituteInPlace ./osdep/LinuxEthernetTap.cpp \
--replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",' --replace 'execlp("ip",' 'execlp("${iproute}/bin/ip",'
patchShebangs ./doc/build.sh
substituteInPlace ./doc/build.sh \
--replace '/usr/bin/ronn' '${ronn}/bin/ronn' \
--replace 'ronn -r' '${ronn}/bin/ronn -r'
''; '';
buildInputs = [ openssl lzo zlib gcc iproute ]; buildInputs = [ openssl lzo zlib gcc iproute ronn ];
buildFlags = [ "one" ]; # TODO: Add support for building and installing manpages as well.
installPhase = '' installPhase = ''
install -Dt "$out/bin/" zerotier-one 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-idtool
ln -s $out/bin/zerotier-one $out/bin/zerotier-cli 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"; description = "Create flat virtual Ethernet networks of almost unlimited size";
homepage = https://www.zerotier.com; homepage = https://www.zerotier.com;
license = stdenv.lib.licenses.gpl3; license = licenses.gpl3;
maintainers = [ stdenv.lib.maintainers.sjmackenzie ]; maintainers = [ sjmackenzie ];
platforms = with stdenv.lib; platforms.allBut [ "i686-linux" ]; platforms = platforms.allBut [ "i686-linux" ];
}; };
} }