1 # SPDX-License-Identifier: GPL-3.0-only
3 # Copyright (C) 2021 ImmortalWrt.org
5 include $(TOPDIR)/rules.mk
9 PKG_RELEASE:=$(AUTORELEASE)
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
13 PKG_HASH:=7a126bac7df32f627f34331778cb39ac99db18d7edcd45628db06e123fa0694b
16 PKG_LICENSE_FILES:=LICENSE
17 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
19 PKG_BUILD_DEPENDS:=golang/host
23 GO_PKG:=github.com/v2fly/v2ray-core/v4
24 GO_PKG_BUILD_PKG:=github.com/v2fly/v2ray-core/v4/main
26 $(GO_PKG).build=OpenWrt \
27 $(GO_PKG).version=$(PKG_VERSION)
29 include $(INCLUDE_DIR)/package.mk
30 include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
32 GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
34 define Package/v2ray/template
35 TITLE:=A platform for building proxies to bypass network restrictions
38 URL:=https://www.v2fly.org
41 define Package/v2ray-core
42 $(call Package/v2ray/template)
43 DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
46 define Package/v2ray-ctl
47 $(call Package/v2ray/template)
51 define Package/v2ray-extra
52 $(call Package/v2ray/template)
53 TITLE+= (extra resources)
58 define Package/v2ray/description
59 Project V is a set of network tools that help you to build your own computer network.
60 It secures your network connections and thus protects your privacy.
63 define Package/v2ray-core/description
64 $(call Package/v2ray/description)
67 define Package/v2ray-ctl/description
68 $(call Package/v2ray/description)
70 This includes configuration tool for v2ray-core.
73 define Package/v2ray-extra/description
74 $(call Package/v2ray/description)
76 This includes extra resources for v2ray-core.
80 $(call GoPackage/Build/Compile)
81 mv $(GO_PKG_BUILD_BIN_DIR)/main $(GO_PKG_BUILD_BIN_DIR)/v2ray
83 ifneq ($(CONFIG_PACKAGE_v2ray-ctl),)
84 $(eval GO_PKG_BUILD_PKG:=$(GO_PKG)/infra/control/main)
85 $(call GoPackage/Build/Compile)
86 mv $(GO_PKG_BUILD_BIN_DIR)/main $(GO_PKG_BUILD_BIN_DIR)/v2ctl
90 define Package/v2ray-core/install
91 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
92 $(INSTALL_DIR) $(1)/usr/bin/
93 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2ray $(1)/usr/bin/
96 define Package/v2ray-ctl/install
97 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
99 $(INSTALL_DIR) $(1)/usr/bin/
100 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/v2ctl $(1)/usr/bin/
103 define Package/v2ray-extra/install
104 $(INSTALL_DIR) $(1)/usr/share/v2ray/
105 $(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
108 $(eval $(call BuildPackage,v2ray-core))
109 $(eval $(call BuildPackage,v2ray-ctl))
110 $(eval $(call BuildPackage,v2ray-extra))