2023-04-06 19:01:25 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
2019-01-30 17:38:40 +00:00
|
|
|
#
|
2023-04-06 19:01:25 +00:00
|
|
|
# Copyright (C) 2021-2022 ImmortalWrt.org
|
2019-01-30 17:38:40 +00:00
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=v2ray-core
|
2023-06-24 04:25:01 +00:00
|
|
|
PKG_VERSION:=5.7.0
|
2019-01-30 17:38:40 +00:00
|
|
|
PKG_RELEASE:=1
|
|
|
|
|
2023-08-02 10:51:03 +00:00
|
|
|
#PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
|
|
|
#PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
|
|
|
|
#PKG_HASH:=599fcd264537e39178b6008a11af68816dfd1609e19a9cf8adc8b2a4240ee370
|
|
|
|
PKG_SOURCE_PROTO:=git
|
|
|
|
PKG_SOURCE_URL:=https://github.com/v2fly/v2ray-core.git
|
2023-09-29 12:51:42 +00:00
|
|
|
PKG_SOURCE_VERSION:=8de2f27043b00612986d96f37975cd4aa98b49c3
|
2019-01-30 17:38:40 +00:00
|
|
|
|
2019-11-26 18:17:03 +00:00
|
|
|
PKG_LICENSE:=MIT
|
2019-01-30 17:38:40 +00:00
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
2023-04-06 19:01:25 +00:00
|
|
|
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
2019-01-30 17:38:40 +00:00
|
|
|
|
|
|
|
PKG_BUILD_DEPENDS:=golang/host
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
2023-06-28 16:26:23 +00:00
|
|
|
♯PKG_USE_MIPS16:=0
|
|
|
|
PKG_BUILD_FLAGS:=no-mips16
|
2019-01-30 17:38:40 +00:00
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
GO_PKG:=github.com/v2fly/v2ray-core/v5
|
|
|
|
GO_PKG_BUILD_PKG:=$(GO_PKG)/main
|
|
|
|
GO_PKG_LDFLAGS_X:= \
|
|
|
|
$(GO_PKG).build=OpenWrt \
|
|
|
|
$(GO_PKG).version=$(PKG_VERSION)
|
2019-01-30 17:38:40 +00:00
|
|
|
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
2022-05-30 19:54:45 +00:00
|
|
|
include $(TOPDIR)/feeds/openmptcprouter/golang/golang-package.mk
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray/template
|
|
|
|
TITLE:=A platform for building proxies to bypass network restrictions
|
2019-11-26 18:17:03 +00:00
|
|
|
SECTION:=net
|
|
|
|
CATEGORY:=Network
|
2023-04-06 19:01:25 +00:00
|
|
|
URL:=https://www.v2fly.org
|
2019-11-26 18:17:03 +00:00
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-core
|
|
|
|
$(call Package/v2ray/template)
|
|
|
|
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
|
2019-11-26 18:17:03 +00:00
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-example
|
|
|
|
$(call Package/v2ray/template)
|
|
|
|
TITLE+= (example configs)
|
|
|
|
DEPENDS:=v2ray-core
|
|
|
|
PKGARCH:=all
|
2019-11-26 18:17:03 +00:00
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-extra
|
|
|
|
$(call Package/v2ray/template)
|
|
|
|
TITLE+= (extra resources)
|
|
|
|
DEPENDS:=v2ray-core
|
|
|
|
PKGARCH:=all
|
2019-11-26 18:17:03 +00:00
|
|
|
endef
|
|
|
|
|
2024-01-10 16:40:43 +00:00
|
|
|
define Package/v2ray-config
|
|
|
|
$(call Package/v2ray/template)
|
|
|
|
TITLE+= (init script)
|
|
|
|
DEPENDS:=v2ray-core
|
|
|
|
PKGARCH:=all
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/v2ray-config-nft
|
|
|
|
$(call Package/v2ray/template)
|
|
|
|
TITLE+= (init script with nft)
|
|
|
|
DEPENDS:=v2ray-core
|
|
|
|
PKGARCH:=all
|
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray/description
|
|
|
|
Project V is a set of network tools that help you to build your own computer network.
|
|
|
|
It secures your network connections and thus protects your privacy.
|
2019-11-26 18:17:03 +00:00
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-core/description
|
|
|
|
$(call Package/v2ray/description)
|
|
|
|
endef
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-example/description
|
|
|
|
$(call Package/v2ray/description)
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
This includes example configuration files for v2ray-core.
|
2019-01-30 17:38:40 +00:00
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-extra/description
|
|
|
|
$(call Package/v2ray/description)
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
This includes extra resources for v2ray-core.
|
|
|
|
endef
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2024-01-10 16:40:43 +00:00
|
|
|
define Package/v2ray-config/description
|
|
|
|
$(call Package/v2ray/description)
|
|
|
|
|
|
|
|
This includes init script
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/v2ray-config-nft/description
|
|
|
|
$(call Package/v2ray/description)
|
|
|
|
|
|
|
|
This includes init script with nftables support
|
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-core/conffiles
|
|
|
|
/etc/config/v2ray
|
|
|
|
/etc/v2ray/
|
2019-01-30 17:38:40 +00:00
|
|
|
endef
|
|
|
|
|
2019-11-26 18:17:03 +00:00
|
|
|
define Package/v2ray-core/install
|
|
|
|
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
2023-04-06 19:01:25 +00:00
|
|
|
$(INSTALL_DIR) $(1)/usr/bin/
|
|
|
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/v2ray
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
$(INSTALL_DIR) $(1)/etc/v2ray/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/config.json $(1)/etc/v2ray/
|
2024-01-10 16:40:43 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
|
|
|
|
define Package/v2ray-config/install
|
|
|
|
$(CP) ./files/* $(1)/
|
|
|
|
rm $(1)/etc/init.d/v2ray-nft
|
|
|
|
endef
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2024-01-10 16:40:43 +00:00
|
|
|
define Package/v2ray-config-nft/install
|
2023-04-24 06:30:04 +00:00
|
|
|
$(CP) ./files/* $(1)/
|
2024-01-10 16:40:43 +00:00
|
|
|
mv $(1)/etc/init.d/v2ray-nft $(1)/etc/init.d/v2ray
|
2023-04-06 19:01:25 +00:00
|
|
|
endef
|
2019-11-26 18:17:03 +00:00
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-example/install
|
|
|
|
$(INSTALL_DIR) $(1)/etc/v2ray/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_socks_vmess.json $(1)/etc/v2ray/
|
|
|
|
$(INSTALL_DATA) $(PKG_BUILD_DIR)/release/config/vpoint_vmess_freedom.json $(1)/etc/v2ray/
|
2019-11-26 18:17:03 +00:00
|
|
|
endef
|
|
|
|
|
2023-04-06 19:01:25 +00:00
|
|
|
define Package/v2ray-extra/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/share/v2ray/
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
|
|
|
|
endef
|
2019-11-26 18:17:03 +00:00
|
|
|
|
|
|
|
$(eval $(call BuildPackage,v2ray-core))
|
2024-01-10 16:40:43 +00:00
|
|
|
$(eval $(call BuildPackage,v2ray-config))
|
|
|
|
$(eval $(call BuildPackage,v2ray-config-nft))
|
2023-04-06 19:01:25 +00:00
|
|
|
$(eval $(call BuildPackage,v2ray-example))
|
|
|
|
$(eval $(call BuildPackage,v2ray-extra))
|