net-misc/zerotier: bump version to 1.4.6
authorLucas Ramage <ramage.lucas@protonmail.com>
Sat, 24 Aug 2019 16:38:32 +0000 (12:38 -0400)
committerJoonas Niilola <juippis@gentoo.org>
Wed, 26 Feb 2020 16:17:22 +0000 (18:17 +0200)
Closes: https://bugs.gentoo.org/692498
Package-Manager: Portage-2.3.71, Repoman-2.3.17
Signed-off-by: Lucas Ramage <ramage.lucas@protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/12788
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
licenses/BSL-1.1 [new file with mode: 0644]
net-misc/zerotier/Manifest
net-misc/zerotier/files/zerotier-1.4.6-add-armv7a-support.patch [new file with mode: 0644]
net-misc/zerotier/files/zerotier-1.4.6-add-mk-ctlr-node-target.patch [new file with mode: 0644]
net-misc/zerotier/files/zerotier-1.4.6-fixup-neon-support.patch [new file with mode: 0644]
net-misc/zerotier/files/zerotier-1.4.6-respect-ldflags.patch [new file with mode: 0644]
net-misc/zerotier/metadata.xml
net-misc/zerotier/zerotier-1.4.6.ebuild [new file with mode: 0644]

diff --git a/licenses/BSL-1.1 b/licenses/BSL-1.1
new file mode 100644 (file)
index 0000000..af9b4d9
--- /dev/null
@@ -0,0 +1,150 @@
+-----------------------------------------------------------------------------
+
+Business Source License 1.1
+
+License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
+"Business Source License" is a trademark of MariaDB Corporation Ab.
+
+-----------------------------------------------------------------------------
+
+Parameters
+
+Licensor:             ZeroTier, Inc.
+Licensed Work:        ZeroTier Network Virtualization Engine 1.4.4
+                      The Licensed Work is (c)2019 ZeroTier, Inc.
+Additional Use Grant: You may make use of the Licensed Work, provided you
+                      do not use it in any of the following ways:
+
+                      * Sell hosted ZeroTier services as a "SaaS" Product
+
+                      (1) Operate or sell access to ZeroTier root servers,
+                      network controllers, or authorization key or certificate
+                      generation components of the Licensed Work as a
+                      for-profit service, regardless of whether the use of
+                      these components is sold alone or is bundled with other
+                      services. Note that this does not apply to the use of
+                      ZeroTier behind the scenes to operate a service not
+                      related to ZeroTier network administration.
+
+                      * Create Non-Open-Source Commercial Derviative Works
+
+                      (2) Link or directly include the Licensed Work in a
+                      commercial or for-profit application or other product
+                      not distributed under an Open Source Initiative (OSI)
+                      compliant license. See: https://opensource.org/licenses
+
+                      (3) Remove the name, logo, copyright, or other branding
+                      material from the Licensed Work to create a "rebranded"
+                      or "white labeled" version to distribute as part of
+                      any commercial or for-profit product or service.
+
+                      * Certain Government Uses
+
+                      (4) Use or deploy the Licensed Work in a government
+                      setting in support of any active government function
+                      or operation with the exception of the following:
+                      physical or mental health care, family and social
+                      services, social welfare, senior care, child care, and
+                      the care of persons with disabilities.
+
+Change Date:          2023-01-01
+
+Change License:       Apache License version 2.0 as published by the Apache
+                      Software Foundation
+                                                                                       https://www.apache.org/licenses/
+
+Alternative Licensing
+
+If you would like to use the Licensed Work in any way that conflicts with
+the stipulations of the Additional Use Grant, contact ZeroTier, Inc. to
+obtain an alternative commercial license.
+
+Visit us on the web at: https://www.zerotier.com/
+
+Notice
+
+The Business Source License (this document, or the "License") is not an Open
+Source license. However, the Licensed Work will eventually be made available
+under an Open Source License, as stated in this License.
+
+For more information on the use of the Business Source License for ZeroTier
+products, please visit our pricing page which contains license details and
+and license FAQ: https://zerotier.com/pricing
+
+For more information on the use of the Business Source License generally,
+please visit the Adopting and Developing Business Source License FAQ at
+https://mariadb.com/bsl-faq-adopting.
+
+-----------------------------------------------------------------------------
+
+Business Source License 1.1
+
+Terms
+
+The Licensor hereby grants you the right to copy, modify, create derivative
+works, redistribute, and make non-production use of the Licensed Work. The
+Licensor may make an Additional Use Grant, above, permitting limited
+production use.
+
+Effective on the Change Date, or the fourth anniversary of the first publicly
+available distribution of a specific version of the Licensed Work under this
+License, whichever comes first, the Licensor hereby grants you rights under
+the terms of the Change License, and the rights granted in the paragraph
+above terminate.
+
+If your use of the Licensed Work does not comply with the requirements
+currently in effect as described in this License, you must purchase a
+commercial license from the Licensor, its affiliated entities, or authorized
+resellers, or you must refrain from using the Licensed Work.
+
+All copies of the original and modified Licensed Work, and derivative works
+of the Licensed Work, are subject to this License. This License applies
+separately for each version of the Licensed Work and the Change Date may vary
+for each version of the Licensed Work released by Licensor.
+
+You must conspicuously display this License on each original or modified copy
+of the Licensed Work. If you receive the Licensed Work in original or
+modified form from a third party, the terms and conditions set forth in this
+License apply to your use of that work.
+
+Any use of the Licensed Work in violation of this License will automatically
+terminate your rights under this License for the current and all other
+versions of the Licensed Work.
+
+This License does not grant you any right in any trademark or logo of
+Licensor or its affiliates (provided that you may use a trademark or logo of
+Licensor as expressly required by this License).
+
+TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
+AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
+EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
+TITLE.
+
+-----------------------------------------------------------------------------
+
+MariaDB hereby grants you permission to use this License’s text to license
+your works, and to refer to it using the trademark "Business Source License",
+as long as you comply with the Covenants of Licensor below.
+
+Covenants of Licensor
+
+In consideration of the right to use this License’s text and the "Business
+Source License" name and trademark, Licensor covenants to MariaDB, and to all
+other recipients of the licensed work to be provided by Licensor:
+
+1. To specify as the Change License the GPL Version 2.0 or any later version,
+   or a license that is compatible with GPL Version 2.0 or a later version,
+   where "compatible" means that software provided under the Change License can
+   be included in a program with software provided under GPL Version 2.0 or a
+   later version. Licensor may specify additional Change Licenses without
+   limitation.
+
+2. To either: (a) specify an additional grant of rights to use that does not
+   impose any additional restriction on the right granted in this License, as
+   the Additional Use Grant; or (b) insert the text "None".
+
+3. To specify a Change Date.
+
+4. Not to modify this License in any other way.
+
index 4df318d310eccd0704e316d7f9c8f257868f3ee4..68043e5890baeb5c963d2ae16aef4aa8e178f4ca 100644 (file)
@@ -1 +1,2 @@
 DIST zerotier-1.2.12.tar.gz 6058902 BLAKE2B 851d0d871fac7f6cdd9feafb375f97181f9155c265f13e44122424bd7adcaff10e3f2c2a4484d2e2ad1f4f2f174fc723681451c1a728c9aa324bdcb02300af57 SHA512 a35029993d9266f3529a9922daa606b0d56a332514545f8cfab2092a4c9db4fc7217223f3bd7dbe59e536de325ee9b4f0226d673c0f0ec5859cf2937e8a4a2d4
+DIST zerotier-1.4.6.tar.gz 13055818 BLAKE2B 46003d9c3ad09e30dbefaa441422ed4570bdbdfb99f2f24fb82246f9e970501d38d96c19dc9771a1d0d30bc49bd8be2b79ebd2e5c8bd85e88b738b29f0a1dcc3 SHA512 72f00602f67190d03ac0c8caa6b79e7f346b10745bdf772c68f77a3a940cdd718d05ec642bc862a6235aab9bd3bfefb0c57571f358ae55f38761f45500f0f189
diff --git a/net-misc/zerotier/files/zerotier-1.4.6-add-armv7a-support.patch b/net-misc/zerotier/files/zerotier-1.4.6-add-armv7a-support.patch
new file mode 100644 (file)
index 0000000..802b1a8
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/make-linux.mk    2019-09-05 11:02:16.000000000 -0700
++++ b/make-linux.mk    2019-09-27 21:01:21.000000000 -0700
+@@ -195,6 +195,11 @@
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+       ZT_USE_ARM32_NEON_ASM_CRYPTO=1
+ endif
++ifeq ($(CC_MACH),armv7a)
++      ZT_ARCHITECTURE=3
++      override DEFS+=-DZT_NO_TYPE_PUNNING
++      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++endif
+ ifeq ($(CC_MACH),armv7l)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
diff --git a/net-misc/zerotier/files/zerotier-1.4.6-add-mk-ctlr-node-target.patch b/net-misc/zerotier/files/zerotier-1.4.6-add-mk-ctlr-node-target.patch
new file mode 100644 (file)
index 0000000..0d19099
--- /dev/null
@@ -0,0 +1,27 @@
+diff --git a/make-linux.mk b/make-linux.mk
+index 9fd4f7b9..a7eb7f6a 100644
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -45,6 +45,12 @@ endif
+ # Trying to use dynamically linked libhttp-parser causes tons of compatibility problems.
+ ONE_OBJS+=ext/http-parser/http_parser.o
++ifeq ($(ZT_CONTROLLER),1)
++      #LIBS+=-lpq -lrabbitmq
++      #DEFS+=-DZT_CONTROLLER_USE_LIBPQ -DZT_CONTROLLER
++      override DEFS+=-DZT_CONTROLLER
++endif
++
+ # Build with address sanitization library for advanced debugging (clang)
+ ifeq ($(ZT_SANITIZE),1)
+       DEFS+=-fsanitize=address -DASAN_OPTIONS=symbolize=1
+@@ -331,6 +337,9 @@ official:  FORCE
+ docker:       FORCE
+       docker build -f ext/installfiles/linux/zerotier-containerized/Dockerfile -t zerotier-containerized .
++controller-node:      FORCE
++      make DEFS+="-DZT_CONTROLLER" one
++
+ central-controller:   FORCE
+       make -j4 LDLIBS="-L/usr/pgsql-10/lib/ -lpq -Lext/librabbitmq/centos_x64/lib/ -lrabbitmq" CXXFLAGS="-I/usr/pgsql-10/include -I./ext/librabbitmq/centos_x64/include -fPIC" DEFS="-DZT_CONTROLLER_USE_LIBPQ -DZT_CONTROLLER" ZT_OFFICIAL=1 ZT_USE_X64_ASM_ED25519=1 one
diff --git a/net-misc/zerotier/files/zerotier-1.4.6-fixup-neon-support.patch b/net-misc/zerotier/files/zerotier-1.4.6-fixup-neon-support.patch
new file mode 100644 (file)
index 0000000..a6ca7f7
--- /dev/null
@@ -0,0 +1,96 @@
+--- a/make-linux.mk    2019-09-27 21:35:39.000000000 -0700
++++ b/make-linux.mk    2019-09-27 21:36:01.000000000 -0700
+@@ -118,6 +118,7 @@
+ # Determine system build architecture from compiler target
+ CC_MACH=$(shell $(CC) -dumpmachine | cut -d '-' -f 1)
+ ZT_ARCHITECTURE=999
++ZT_DISABLE_NEON?=
+ ifeq ($(CC_MACH),x86_64)
+       ZT_ARCHITECTURE=2
+       ZT_USE_X64_ASM_SALSA=1
+@@ -158,57 +159,57 @@
+ ifeq ($(CC_MACH),arm)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=0
+ endif
+ ifeq ($(CC_MACH),armel)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=1
+ endif
+ ifeq ($(CC_MACH),armhf)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=0
+ endif
+ ifeq ($(CC_MACH),armv6)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=1
+ endif
+ ifeq ($(CC_MACH),armv6l)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=1
+ endif
+ ifeq ($(CC_MACH),armv6zk)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=1
+ endif
+ ifeq ($(CC_MACH),armv6kz)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=1
+ endif
+ ifeq ($(CC_MACH),armv7)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=0
+ endif
+ ifeq ($(CC_MACH),armv7a)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=0
+ endif
+ ifeq ($(CC_MACH),armv7l)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=0
+ endif
+ ifeq ($(CC_MACH),armv7hl)
+       ZT_ARCHITECTURE=3
+       override DEFS+=-DZT_NO_TYPE_PUNNING
+-      ZT_USE_ARM32_NEON_ASM_CRYPTO=1
++      ZT_DISABLE_NEON?=0
+ endif
+ ifeq ($(CC_MACH),arm64)
+       ZT_ARCHITECTURE=4
+@@ -268,10 +269,13 @@
+               override CFLAGS+=-march=armv5 -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
+               override CXXFLAGS+=-march=armv5 -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
+               ZT_USE_ARM32_NEON_ASM_CRYPTO=0
+-      else
+-              override CFLAGS+=-march=armv5 -mno-unaligned-access -marm -fexceptions
+-              override CXXFLAGS+=-march=armv5 -mno-unaligned-access -marm -fexceptions
++      endif
++      ifeq ($(ZT_DISABLE_NEON),1)
++              override CFLAGS+=-mno-unaligned-access -marm -fexceptions
++              override CXXFLAGS+=-mno-unaligned-access -marm -fexceptions
+               ZT_USE_ARM32_NEON_ASM_CRYPTO=0
++      else
++              ZT_USE_ARM32_NEON_ASM_CRYPTO=1
+       endif
+ endif
diff --git a/net-misc/zerotier/files/zerotier-1.4.6-respect-ldflags.patch b/net-misc/zerotier/files/zerotier-1.4.6-respect-ldflags.patch
new file mode 100644 (file)
index 0000000..46e24fd
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/make-linux.mk    2019-09-05 11:02:16.000000000 -0700
++++ b/make-linux.mk    2019-09-27 21:01:21.000000000 -0700
+@@ -77,7 +77,7 @@
+       override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS)
+       CXXFLAGS?=-O3 -fstack-protector -fPIE
+       override CXXFLAGS+=-Wall -Wno-deprecated -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
+-      LDFLAGS=-pie -Wl,-z,relro,-z,now
++      LDFLAGS?=-pie -Wl,-z,relro,-z,now
+       STRIP?=strip
+       STRIP+=--strip-all
+ endif
index 9a0bb99004b43d9b1ee7eb6b29f4743feacc387f..1071ed3d5c62c8e48cdabe664582f470602247f8 100644 (file)
@@ -13,4 +13,8 @@
                <changelog>https://github.com/zerotier/ZeroTierOne/raw/master/RELEASE-NOTES.md</changelog>
                <remote-id type="github">zerotier/ZeroTierOne</remote-id>
        </upstream>
+<use>
+       <flag name="clang">Use Clang compiler instead of GCC</flag>
+       <flag name="neon">Enable ARM32 neon-salsa2012-asm code</flag>
+</use>
 </pkgmetadata>
diff --git a/net-misc/zerotier/zerotier-1.4.6.ebuild b/net-misc/zerotier/zerotier-1.4.6.ebuild
new file mode 100644 (file)
index 0000000..f2553f6
--- /dev/null
@@ -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}
+}