2
0

Makefile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.40.0
  10. PKG_RELEASE:=1
  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:=03ba53550ee25a2421355b7a90409a6323056680f86a797ef7b34e8cbd3ccdea
  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. SUBMENU:=Project V
  39. TITLE:=SIP003 plugin for shadowsocks, based on v2ray
  40. URL:=https://github.com/teddysun/v2ray-plugin
  41. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-certificates
  42. endef
  43. define Package/$(PKG_NAME)/description
  44. Yet another SIP003 plugin for shadowsocks, based on v2ray
  45. endef
  46. define Build/Compile
  47. $(call GoPackage/Build/Compile)
  48. $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin || true
  49. endef
  50. define Package/$(PKG_NAME)/install
  51. $(INSTALL_DIR) $(1)/usr/bin
  52. $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/v2ray-plugin $(1)/usr/bin/v2ray-plugin
  53. endef
  54. $(eval $(call GoBinPackage,$(PKG_NAME)))
  55. $(eval $(call BuildPackage,$(PKG_NAME)))