Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # SPDX-License-Identifier: GPL-3.0-only
  2. #
  3. # Copyright (C) 2021 ImmortalWrt.org
  4. include $(TOPDIR)/rules.mk
  5. PKG_NAME:=v2ray-core
  6. PKG_VERSION:=5.12.1
  7. PKG_RELEASE:=1
  8. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  9. PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
  10. PKG_HASH:=fa1845d42b46c6b5046a8f95d49cc7a9175e40efc5c13b95174b4c556567aca1
  11. PKG_LICENSE:=MIT
  12. PKG_LICENSE_FILES:=LICENSE
  13. PKG_MAINTAINER:=Tianling Shen <[email protected]>
  14. PKG_BUILD_DEPENDS:=golang/host
  15. PKG_BUILD_PARALLEL:=1
  16. PKG_USE_MIPS16:=0
  17. PKG_BUILD_FLAGS:=no-mips16
  18. GO_PKG:=github.com/v2fly/v2ray-core/v5
  19. GO_PKG_BUILD_PKG:=$(GO_PKG)/main
  20. GO_PKG_LDFLAGS_X:= \
  21. $(GO_PKG).build=OpenWrt \
  22. $(GO_PKG).version=$(PKG_VERSION)
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
  25. define Package/v2ray/template
  26. TITLE:=A platform for building proxies to bypass network restrictions
  27. SECTION:=net
  28. CATEGORY:=Network
  29. URL:=https://www.v2fly.org
  30. endef
  31. define Package/v2ray-core
  32. $(call Package/v2ray/template)
  33. DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
  34. endef
  35. define Package/v2ray-extra
  36. $(call Package/v2ray/template)
  37. TITLE+= (extra resources)
  38. DEPENDS:=v2ray-core
  39. PKGARCH:=all
  40. endef
  41. define Package/v2ray/description
  42. Project V is a set of network tools that help you to build your own computer network.
  43. It secures your network connections and thus protects your privacy.
  44. endef
  45. define Package/v2ray-core/description
  46. $(call Package/v2ray/description)
  47. endef
  48. define Package/v2ray-extra/description
  49. $(call Package/v2ray/description)
  50. This includes extra resources for v2ray-core.
  51. endef
  52. define Package/v2ray-core/install
  53. $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
  54. $(INSTALL_DIR) $(1)/usr/bin/
  55. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/main $(1)/usr/bin/v2ray
  56. endef
  57. define Package/v2ray-extra/install
  58. $(INSTALL_DIR) $(1)/usr/share/v2ray/
  59. $(CP) $(PKG_BUILD_DIR)/release/extra/* $(1)/usr/share/v2ray/
  60. endef
  61. $(eval $(call BuildPackage,v2ray-core))
  62. $(eval $(call BuildPackage,v2ray-extra))