OSDN Git Service

03ee53a8ea63a6e6d02690f9b92ab81e27bd97c2
[v2raya/v2raya-openwrt.git] / v2ray-core / Makefile
1 # SPDX-License-Identifier: GPL-3.0-only
2 #
3 # Copyright (C) 2021 ImmortalWrt.org
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=v2ray-core
8 PKG_VERSION:=5.4.0
9 PKG_RELEASE:=1
10
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
14
15 PKG_LICENSE:=MIT
16 PKG_LICENSE_FILES:=LICENSE
17 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
18
19 PKG_BUILD_DEPENDS:=golang/host
20 PKG_BUILD_PARALLEL:=1
21 PKG_USE_MIPS16:=0
22
23 GO_PKG:=github.com/v2fly/v2ray-core/v5
24 GO_PKG_BUILD_PKG:=$(GO_PKG)/main
25 GO_PKG_LDFLAGS_X:= \
26         $(GO_PKG).build=OpenWrt \
27         $(GO_PKG).version=$(PKG_VERSION)
28
29 include $(INCLUDE_DIR)/package.mk
30 include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
31
32 GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
33
34 define Package/v2ray/template
35   TITLE:=A platform for building proxies to bypass network restrictions
36   SECTION:=net
37   CATEGORY:=Network
38   URL:=https://www.v2fly.org
39 endef
40
41 define Package/v2ray-core
42   $(call Package/v2ray/template)
43   DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
44 endef
45
46 define Package/v2ray-extra
47   $(call Package/v2ray/template)
48   TITLE+= (extra resources)
49   DEPENDS:=v2ray-core
50   PKGARCH:=all
51 endef
52
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.
56 endef
57
58 define Package/v2ray-core/description
59   $(call Package/v2ray/description)
60 endef
61
62 define Package/v2ray-extra/description
63   $(call Package/v2ray/description)
64
65   This includes extra resources for v2ray-core.
66 endef
67
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
72 endef
73
74 define Package/v2ray-extra/install
75         $(INSTALL_DIR) $(1)/usr/share/v2ray/
76         $(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
77 endef
78
79 $(eval $(call BuildPackage,v2ray-core))
80 $(eval $(call BuildPackage,v2ray-extra))