0
0
mirror of https://github.com/openwrt/packages.git synced 2025-07-17 11:04:45 +00:00
Files
packages/net/zerotier/Makefile
Liangbin Lian d1b5a6d68f zerotier: fix system include path
`-isystem ext` makes `#include <miniupnpc/miniupnpc.h>` actually include `ext/miniupnpc/miniupnpc.h`.

we should use `$(STAGING_DIR)/usr/include` as a higher priority system include path.

Fix https://github.com/openwrt/openwrt/issues/18019

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
2025-06-11 16:15:21 +02:00

87 lines
2.2 KiB
Makefile

#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=zerotier
PKG_VERSION:=1.14.1
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
PKG_HASH:=4f9f40b27c5a78389ed3f3216c850921f6298749e5819e9f2edabb2672ce9ca0
PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION)
PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
PKG_LICENSE:=BSL 1.1
PKG_LICENSE_FILES:=LICENSE.txt
PKG_ASLR_PIE:=0
PKG_BUILD_PARALLEL:=1
PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
define Package/zerotier
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libpthread +libstdcpp +kmod-tun +ip +libminiupnpc +libnatpmp +libatomic
TITLE:=Create flat virtual Ethernet networks of almost unlimited size
URL:=https://www.zerotier.com
SUBMENU:=VPN
endef
define Package/zerotier/description
ZeroTier creates a global provider-independent virtual private cloud network.
endef
define Package/zerotier/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(CONFIG_ZEROTIER_ENABLE_DEBUG),y)
MAKE_FLAGS += ZT_DEBUG=1
endif
MAKE_FLAGS += \
ZT_EMBEDDED=1 \
ZT_SSO_SUPPORTED=0 \
DEFS="" \
OSTYPE="Linux" \
define Build/Compile
$(call Build/Compile/Default,one)
ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
$(call Build/Compile/Default,selftest)
endif
endef
# Make binary smaller
TARGET_CFLAGS += -Wl,-z,noexecstack
TARGET_LDFLAGS += -Wl,--as-needed -Wl,-z,noexecstack
# Prevent `-isystem ext` from causing the wrong miniupnpc header to be used (OpenWrt packages issue - 18019)
TARGET_CFLAGS += -isystem $(STAGING_DIR)/usr/include
define Package/zerotier/conffiles
/etc/config/zerotier
endef
define Package/zerotier/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/
$(LN) zerotier-one $(1)/usr/bin/zerotier-cli
$(LN) zerotier-one $(1)/usr/bin/zerotier-idtool
$(INSTALL_DIR) $(1)/etc/uci-defaults
ifeq ($(CONFIG_ZEROTIER_ENABLE_SELFTEST),y)
$(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-selftest $(1)/usr/bin/
endif
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,zerotier))