Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #
  2. # Copyright (C) 2020 SharerMax
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=v2ray-plugin
  9. PKG_VERSION:=4.41.1
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/teddysun/v2ray-plugin/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=3feda83874f154fa2806f9a1da1c7e58d6ffae2f89b5b4b38b018597078abf3a
  14. PKG_LICENSE:=MIT
  15. PKG_LICENSE_FILES:=LICENSE
  16. PKG_MAINTAINER:=madeye <[email protected]>
  17. PKG_BUILD_DEPENDS:=golang/host
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_USE_MIPS16:=0
  20. GO_PKG:=github.com/shadowsocks/v2ray-plugin
  21. GO_PKG_LDFLAGS:=-s -w
  22. GO_PKG_LDFLAGS_X:=main.VERSION=v$(PKG_VERSION)
  23. PKG_CONFIG_DEPENDS := CONFIG_$(PKG_NAME)_INCLUDE_GOPROXY
  24. include $(INCLUDE_DIR)/package.mk
  25. include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
  26. define Package/$(PKG_NAME)/config
  27. config $(PKG_NAME)_INCLUDE_GOPROXY
  28. bool "Compiling with GOPROXY proxy"
  29. default y
  30. endef
  31. ifeq ($(CONFIG_$(PKG_NAME)_INCLUDE_GOPROXY),y)
  32. export GO111MODULE=on
  33. export GOPROXY=https://goproxy.cn
  34. endif
  35. define Package/$(PKG_NAME)
  36. SECTION:=net
  37. CATEGORY:=Network
  38. TITLE:=SIP003 plugin for shadowsocks, based on v2ray
  39. URL:=https://github.com/teddysun/v2ray-plugin
  40. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates
  41. endef
  42. define Package/$(PKG_NAME)/description
  43. Yet another SIP003 plugin for shadowsocks, based on v2ray
  44. endef
  45. define Build/Compile
  46. $(call GoPackage/Build/Compile)
  47. $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin || true
  48. endef
  49. define Package/$(PKG_NAME)/install
  50. $(INSTALL_DIR) $(1)/usr/bin
  51. $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin $(1)/usr/bin/v2ray-plugin
  52. endef
  53. $(eval $(call GoBinPackage,$(PKG_NAME)))
  54. $(eval $(call BuildPackage,$(PKG_NAME)))