1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 10:31:51 +00:00
openmptcprouter-feeds/xray-core/Makefile

104 lines
2.5 KiB
Makefile
Raw Permalink Normal View History

2024-04-10 16:05:47 +00:00
#
2025-01-31 14:01:19 +00:00
# Copyright (C) 2023-2025 Ycarus (Yannick Chabanois) <ycarus@zugaina.org> for OpenMPTCProuter
2024-04-10 16:05:47 +00:00
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
2023-09-29 12:58:47 +00:00
include $(TOPDIR)/rules.mk
2024-01-10 16:41:04 +00:00
PKG_NAME:=xray
2025-01-31 14:01:19 +00:00
PKG_VERSION:=25.1.30
2023-09-29 12:58:47 +00:00
PKG_RELEASE:=1
PKG_LICENSE:=MPLv2
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Yannick Chabanois <contact@openmptcprouter.com>
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/XTLS/Xray-core.git
2025-01-31 14:01:19 +00:00
PKG_SOURCE_VERSION:=0a8470cb14ebbf7ee4cbb6c601bb9db072ace985
2023-09-29 12:58:47 +00:00
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
GO_PKG:=github.com/XTLS/Xray-core
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/openmptcprouter/golang/golang-package.mk
2024-01-10 16:41:04 +00:00
define Package/$(PKG_NAME)/template
2024-02-02 14:26:57 +00:00
SECTION:=net
CATEGORY:=Network
2023-09-29 12:58:47 +00:00
TITLE:=Xray-core
DEPENDS:=$(GO_ARCH_DEPENDS)
endef
2024-01-10 16:41:04 +00:00
define Package/$(PKG_NAME)-core
$(call Package/$(PKG_NAME)/template)
2024-01-27 06:55:11 +00:00
PROVIDES:=xray-core
2024-01-10 16:41:04 +00:00
endef
define Package/$(PKG_NAME)-config
$(call Package/$(PKG_NAME)/template)
TITLE+= (init script)
endef
define Package/$(PKG_NAME)-config-nft
$(call Package/$(PKG_NAME)/template)
TITLE+= (init script with nft)
endef
2024-01-18 09:20:35 +00:00
define Package/$(PKG_NAME)-core/description
2023-09-29 12:58:47 +00:00
Xray-core bare bones binary (compiled without cgo)
endef
2024-01-10 16:41:04 +00:00
define Package/$(PKG_NAME)-config/description
Xray-core init script
endef
define Package/$(PKG_NAME)-config-nft/description
Xray-core init script with nft support
endef
2024-01-18 09:20:35 +00:00
define Package/$(PKG_NAME)-core/config
2023-09-29 12:58:47 +00:00
menu "Xray Configuration"
2024-01-10 16:41:04 +00:00
depends on PACKAGE_$(PKG_NAME)-core
2023-09-29 12:58:47 +00:00
config PACKAGE_XRAY_ENABLE_GOPROXY_IO
bool "Use goproxy.io to speed up module fetching (recommended for some network situations)"
default n
endmenu
endef
USE_GOPROXY:=
ifdef CONFIG_PACKAGE_XRAY_ENABLE_GOPROXY_IO
USE_GOPROXY:=GOPROXY=https://goproxy.io,direct
endif
MAKE_PATH:=$(GO_PKG_WORK_DIR_NAME)/build/src/$(GO_PKG)
MAKE_VARS += $(GO_PKG_VARS)
define Build/Compile
cd $(PKG_BUILD_DIR); $(GO_PKG_VARS) $(USE_GOPROXY) CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o $(PKG_INSTALL_DIR)/bin/xray ./main;
endef
2024-01-10 16:41:04 +00:00
define Package/$(PKG_NAME)-core/install
2023-09-29 12:58:47 +00:00
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/xray $(1)/usr/bin/xray
2024-01-10 16:41:04 +00:00
endef
define Package/$(PKG_NAME)-config/install
$(CP) ./files/* $(1)/
rm -f $(1)/etc/init.d/xray-nft
endef
define Package/$(PKG_NAME)-config-nft/install
2023-09-29 12:58:47 +00:00
$(CP) ./files/* $(1)/
2024-01-10 16:41:04 +00:00
mv $(1)/etc/init.d/xray-nft $(1)/etc/init.d/xray
2023-09-29 12:58:47 +00:00
endef
2024-01-10 16:41:04 +00:00
$(eval $(call BuildPackage,$(PKG_NAME)-core))
$(eval $(call BuildPackage,$(PKG_NAME)-config))
$(eval $(call BuildPackage,$(PKG_NAME)-config-nft))