1 # SPDX-License-Identifier: GPL-3.0-only
3 # Copyright (C) 2021 ImmortalWrt.org
5 include $(TOPDIR)/rules.mk
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:=86be35461a9dc7d037e0045771d99f1eae284fdb7aa0818a6782d18b6b003fca
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/v5
24 GO_PKG_BUILD_PKG:=$(GO_PKG)/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-extra
47 $(call Package/v2ray/template)
48 TITLE+= (extra resources)
53 define Package/v2ray/description
54 Project V is a set of network tools that help you to build your own computer network.
55 It secures your network connections and thus protects your privacy.
58 define Package/v2ray-core/description
59 $(call Package/v2ray/description)
62 define Package/v2ray-extra/description
63 $(call Package/v2ray/description)
65 This includes extra resources for v2ray-core.
68 define Package/v2ray-core/install
69 $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
70 $(INSTALL_DIR) $(1)/usr/bin/
71 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/v2ray
74 define Package/v2ray-extra/install
75 $(INSTALL_DIR) $(1)/usr/share/v2ray/
76 $(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
79 $(eval $(call BuildPackage,v2ray-core))
80 $(eval $(call BuildPackage,v2ray-extra))