Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # SPDX-License-Identifier: GPL-3.0-only
  2. #
  3. # Copyright (C) 2021 ImmortalWrt.org
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=xray-plugin
  6. PKG_VERSION:=1.5.4
  7. PKG_RELEASE:=1
  8. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  9. PKG_SOURCE_URL:=https://codeload.github.com/teddysun/xray-plugin/tar.gz/v$(PKG_VERSION)?
  10. PKG_HASH:=b6b66ea091f6348c7f213a8f7a3be51be25cea2cdf9ea7fb5bb93e2e04077a6f
  11. PKG_LICENSE:=MIT
  12. PKG_LICENSE_FILES:=LICENSE
  13. PKG_MAINTAINER:=Tianling Shen <[email protected]>
  14. PKG_CONFIG_DEPENDS:= \
  15. CONFIG_XRAY_PLUGIN_COMPRESS_GOPROXY \
  16. CONFIG_XRAY_PLUGIN_COMPRESS_UPX
  17. PKG_BUILD_DEPENDS:=golang/host
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_USE_MIPS16:=0
  20. GO_PKG:=github.com/teddysun/xray-plugin
  21. GO_PKG_LDFLAGS:=-s -w
  22. include $(INCLUDE_DIR)/package.mk
  23. include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
  24. define Package/xray-plugin/config
  25. config XRAY_PLUGIN_COMPRESS_GOPROXY
  26. bool "Compiling with GOPROXY proxy"
  27. default n
  28. config XRAY_PLUGIN_COMPRESS_UPX
  29. bool "Compress executable files with UPX"
  30. depends on !mips64
  31. default n
  32. endef
  33. ifneq ($(CONFIG_XRAY_PLUGIN_COMPRESS_GOPROXY),)
  34. export GO111MODULE=on
  35. export GOPROXY=https://goproxy.bj.bcebos.com
  36. endif
  37. define Package/xray-plugin
  38. SECTION:=net
  39. CATEGORY:=Network
  40. SUBMENU:=Web Servers/Proxies
  41. TITLE:=SIP003 plugin for Shadowsocks, based on Xray
  42. URL:=https://github.com/teddysun/xray-plugin
  43. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  44. endef
  45. define Build/Compile
  46. $(call GoPackage/Build/Compile)
  47. ifneq ($(CONFIG_XRAY_PLUGIN_COMPRESS_UPX),)
  48. $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/xray-plugin
  49. endif
  50. endef
  51. $(eval $(call GoBinPackage,xray-plugin))
  52. $(eval $(call BuildPackage,xray-plugin))