OSDN Git Service

v2raya2: rename from v2raya-v5
[v2raya/v2raya-openwrt.git] / v2ray-v5-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.1.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:=b3dbd2bbee9486999b81d1968545c5a6caa7b0f4726a7259939f1bda54fcf5ea
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-v5/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-v5-core
42   $(call Package/v2rayv-5/template)
43   DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
44   CONFLICTS:=v2ray-core
45 endef
46
47 define Package/v2ray-v5-extra
48   $(call Package/v2ray-v5/template)
49   TITLE+= (extra resources)
50   DEPENDS:=v2ray-core
51   PKGARCH:=all
52   CONFLICTS:=v2ray-extra
53 endef
54
55 define Package/v2ray-v5/description
56   Project V is a set of network tools that help you to build your own computer network.
57   It secures your network connections and thus protects your privacy.
58 endef
59
60 define Package/v2ray-v5-core/description
61   $(call Package/v2ray-v5/description)
62 endef
63
64 define Package/v2ray-v5-extra/description
65   $(call Package/v2ray-v5/description)
66
67   This includes extra resources for v2ray-core.
68 endef
69
70 define Package/v2ray-v5-core/install
71         $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
72         $(INSTALL_DIR) $(1)/usr/bin/
73         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/v2ray
74 endef
75
76 define Package/v2ray-v5-extra/install
77         $(INSTALL_DIR) $(1)/usr/share/v2ray/
78         $(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
79 endef
80
81 $(eval $(call BuildPackage,v2ray-v5-core))
82 $(eval $(call BuildPackage,v2ray-v5-extra))