forked from fw876/helloworld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (67 loc) · 2.11 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# Copyright (C) 2021 ImmortalWrt
# <https://project-openwrt.eu.org>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=xray-plugin
PKG_VERSION:=1.4.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/teddysun/xray-plugin/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=a4483fa0e3071935da8b8bd19a9a6b349fc2c221ba2fe777ff2131915debb607
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tianling Shen <[email protected]>
PKG_CONFIG_DEPENDS:= \
CONFIG_XRAY_PLUGIN_PROVIDE_V2RAY_PLUGIN \
CONFIG_XRAY_PLUGIN_COMPRESS_GOPROXY \
CONFIG_XRAY_PLUGIN_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/teddysun/xray-plugin
GO_PKG_LDFLAGS:=-s -w
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/xray-plugin/config
config XRAY_PLUGIN_PROVIDE_V2RAY_PLUGIN
bool "Provide v2ray-plugin binary using xray-plugin"
default n
config XRAY_PLUGIN_COMPRESS_GOPROXY
bool "Compiling with GOPROXY proxy"
default n
config XRAY_PLUGIN_COMPRESS_UPX
bool "Compress executable files with UPX"
default y
endef
ifneq ($(CONFIG_XRAY_PLUGIN_COMPRESS_GOPROXY),)
export GO111MODULE=on
export GOPROXY=https://goproxy.io
endif
define Package/xray-plugin
SECTION:=net
CATEGORY:=Network
TITLE:=SIP003 plugin for Shadowsocks, based on Xray
URL:=https://github.com/teddysun/xray-plugin
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
endef
define Package/xray-plugin/description
Yet another SIP003 plugin for Shadowsocks, based on Xray.
endef
define Build/Compile
$(call GoPackage/Build/Compile)
ifneq ($(CONFIG_XRAY_PLUGIN_COMPRESS_UPX),)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/xray-plugin
endif
endef
define Package/xray-plugin/install
$(call GoPackage/Package/Install/Bin,$(1))
ifneq ($(CONFIG_XRAY_PLUGIN_PROVIDE_V2RAY_PLUGIN),)
$(LN) xray-plugin $(1)/usr/bin/v2ray-plugin
endif
endef
$(eval $(call GoBinPackage,xray-plugin))
$(eval $(call BuildPackage,xray-plugin))