diff options
Diffstat (limited to 'net-misc/zerotier/zerotier-1.4.6.ebuild')
-rw-r--r-- | net-misc/zerotier/zerotier-1.4.6.ebuild | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/net-misc/zerotier/zerotier-1.4.6.ebuild b/net-misc/zerotier/zerotier-1.4.6.ebuild new file mode 100644 index 000000000000..49c7f7ed5ff9 --- /dev/null +++ b/net-misc/zerotier/zerotier-1.4.6.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic llvm systemd toolchain-funcs + +HOMEPAGE="https://www.zerotier.com/" +DESCRIPTION="A software-based managed Ethernet switch for planet Earth" +SRC_URI="https://github.com/zerotier/ZeroTierOne/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSL-1.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~x86" +IUSE="clang neon" + +S="${WORKDIR}/ZeroTierOne-${PV}" + +RDEPEND=" + dev-libs/json-glib + net-libs/libnatpmp + net-libs/miniupnpc:= + clang? ( >=sys-devel/clang-6:* )" + +DEPEND="${RDEPEND}" + +PATCHES=( "${FILESDIR}/${P}-respect-ldflags.patch" + "${FILESDIR}/${P}-add-armv7a-support.patch" + "${FILESDIR}/${P}-fixup-neon-support.patch" ) + +DOCS=( README.md AUTHORS.md ) + +LLVM_MAX_SLOT=9 + +llvm_check_deps() { + if use clang ; then + if ! has_version --host-root "sys-devel/clang:${LLVM_SLOT}" ; then + ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." + return 1 + fi + + if ! has_version --host-root "=sys-devel/lld-${LLVM_SLOT}*" ; then + ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." + return 1 + fi + + einfo "Will use LLVM slot ${LLVM_SLOT}!" + fi +} + +pkg_setup() { + if use clang && ! tc-is-clang ; then + export CC=${CHOST}-clang + export CXX=${CHOST}-clang++ + else + tc-export CXX CC + fi + use neon || export ZT_DISABLE_NEON=1 +} + +src_compile() { + append-ldflags -Wl,-z,noexecstack + emake CXX="${CXX}" STRIP=: one +} + +src_test() { + emake selftest + ./zerotier-selftest || die +} + +src_install() { + default + # remove pre-zipped man pages + rm "${ED}"/usr/share/man/{man1,man8}/* || die + + newinitd "${FILESDIR}/${PN}".init "${PN}" + systemd_dounit "${FILESDIR}/${PN}".service + doman doc/zerotier-{cli.1,idtool.1,one.8} +} |