OSDN Git Service

CI: drop deprecated v2raya2 build
[v2raya/v2raya-openwrt.git] / xray-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:=xray-core
8 PKG_VERSION:=1.8.0
9 PKG_RELEASE:=1
10
11 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
12 PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)?
13 PKG_HASH:=35339ee4c2ebd46cebd95ad7791d38a97db3a6afd97277a33e4ee7be35c9a3b2
14
15 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
16 PKG_LICENSE:=MPL-2.0
17 PKG_LICENSE_FILES:=LICENSE
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/Xray-core-$(PKG_VERSION)
20 PKG_BUILD_DEPENDS:=golang/host
21 PKG_BUILD_PARALLEL:=1
22 PKG_USE_MIPS16:=0
23
24 GO_PKG:=github.com/xtls/xray-core
25 GO_PKG_BUILD_PKG:=github.com/xtls/xray-core/main
26 GO_PKG_LDFLAGS_X:= \
27         $(GO_PKG)/core.build=OpenWrt \
28         $(GO_PKG)/core.version=$(PKG_VERSION)
29
30 include $(INCLUDE_DIR)/package.mk
31 include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
32
33 GO_PKG_TARGET_VARS:=$(filter-out CGO_ENABLED=%,$(GO_PKG_TARGET_VARS)) CGO_ENABLED=0
34
35 define Package/xray-core
36   TITLE:=A platform for building proxies to bypass network restrictions
37   SECTION:=net
38   CATEGORY:=Network
39   URL:=https://xtls.github.io
40   DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
41 endef
42
43 define Package/xray-core/description
44   Xray, Penetrates Everything. It helps you to build your own computer network.
45   It secures your network connections and thus protects your privacy.
46 endef
47
48 define Package/xray-core/install
49         $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
50         $(INSTALL_DIR) $(1)/usr/bin/
51         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/xray
52 endef
53
54 $(eval $(call BuildPackage,xray-core))