91 lines
3.2 KiB
Makefile
91 lines
3.2 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# Copyright (C) 2017-2020 Yousong Zhou <yszhou4tech@gmail.com>
|
|
# Copyright (C) 2021 ImmortalWrt.org
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=shadowsocks-rust
|
|
PKG_VERSION:=1.19.2
|
|
PKG_RELEASE:=1
|
|
|
|
PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION)
|
|
PKG_SOURCE_BODY:=unknown-linux-musl
|
|
PKG_SOURCE_FOOTER:=tar.xz
|
|
|
|
ifeq ($(filter $(ARCH),mips mipsel),)
|
|
PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-rust/releases/download/v$(PKG_VERSION)/
|
|
else
|
|
PKG_SOURCE_URL:=https://github.com/sbwml/shadowsocks-rust-mips/releases/download/v$(PKG_VERSION)/
|
|
endif
|
|
|
|
ifeq ($(ARCH),aarch64)
|
|
PKG_SOURCE:=$(PKG_SOURCE_HEADER).aarch64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
|
|
PKG_HASH:=cf462a5f0d2c8d09babcf709978172a62d08758f67390fe09f5509dce454f511
|
|
else ifeq ($(ARCH),arm)
|
|
# Referred to golang/golang-values.mk
|
|
ARM_CPU_FEATURES:=$(word 2,$(subst +,$(space),$(call qstrip,$(CONFIG_CPU_TYPE))))
|
|
ifeq ($(ARM_CPU_FEATURES),)
|
|
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabi.$(PKG_SOURCE_FOOTER)
|
|
PKG_HASH:=f71fa138fda5cd5b22e35bf4991cd18db8dac1dea75b43ce835151f9d80a78c0
|
|
else
|
|
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER)
|
|
PKG_HASH:=5ac5267b25ed65d9943b5112a5bfd038f040b1458f200f14730be02a64fddbc0
|
|
endif
|
|
else ifeq ($(ARCH),i386)
|
|
PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
|
|
PKG_HASH:=4d08ec5232b8848902949c39f03a5f066d6d1acd8506306ea5de0f1c8734d90a
|
|
else ifeq ($(ARCH),x86_64)
|
|
PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
|
|
PKG_HASH:=19ecd3c86dbb05012b34c4d8c38eec2c24ca5d10ad52e2b7e7554f8176bf4fa8
|
|
else ifeq ($(ARCH),mips)
|
|
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
|
|
PKG_HASH:=2e3ec0d4b32c58b074290bd6764c17f1ba5972c28a39ef90463bfdea37830599
|
|
else ifeq ($(ARCH),mipsel)
|
|
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mipsel-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
|
|
PKG_HASH:=3f8920df884f115d838e070f6b67ea98d3fb97ad1ccb93b802615869c447230c
|
|
# Set the default value to make OpenWrt Package Checker happy
|
|
else
|
|
PKG_SOURCE:=dummy
|
|
PKG_HASH:=dummy
|
|
endif
|
|
|
|
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
|
|
PKG_LICENSE:=MIT
|
|
PKG_LICENSE_FILES:=LICENSE
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
|
|
|
|
define Package/shadowsocks-rust/Default
|
|
define Package/shadowsocks-rust-$(1)
|
|
SECTION:=net
|
|
CATEGORY:=Network
|
|
SUBMENU:=Web Servers/Proxies
|
|
TITLE:=shadowsocks-rust $(1)
|
|
URL:=https://github.com/shadowsocks/shadowsocks-rust
|
|
DEPENDS:=@(aarch64||arm||i386||mips||mipsel||x86_64) @!(TARGET_x86_geode||TARGET_x86_legacy)
|
|
endef
|
|
|
|
define Package/shadowsocks-rust-$(1)/install
|
|
$$(INSTALL_DIR) $$(1)/usr/bin
|
|
$$(INSTALL_BIN) $$(PKG_BUILD_DIR)/$(1) $$(1)/usr/bin
|
|
endef
|
|
endef
|
|
|
|
SHADOWSOCKS_COMPONENTS:=sslocal ssmanager ssserver ssurl ssservice
|
|
define shadowsocks-rust/templates
|
|
$(foreach component,$(SHADOWSOCKS_COMPONENTS),
|
|
$(call Package/shadowsocks-rust/Default,$(component))
|
|
)
|
|
endef
|
|
$(eval $(call shadowsocks-rust/templates))
|
|
|
|
define Build/Compile
|
|
endef
|
|
|
|
$(foreach component,$(SHADOWSOCKS_COMPONENTS), \
|
|
$(eval $(call BuildPackage,shadowsocks-rust-$(component))) \
|
|
)
|