# SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2017-2020 Yousong Zhou # Copyright (C) 2021 ImmortalWrt.org include $(TOPDIR)/rules.mk PKG_NAME:=shadowsocks-rust PKG_VERSION:=1.20.1 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:=8c0d0cd3b614888cd3ffcdf9e007ba8697aa6331f8433c90b0a3b2bc3eb37e8b 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:=4c24eab26472dfb332ccbb5a8c15d6e1ecc4a857d915ffa853372bde55f0eeeb else PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER) PKG_HASH:=35044b469236cab55902c09074c9c05af2192e60eba327688685f0b97c0de5e7 endif else ifeq ($(ARCH),i386) PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) PKG_HASH:=0b6916aa85763764e3896b31900229503802f5d76d3bd35b341fa45bf87486f9 else ifeq ($(ARCH),x86_64) PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) PKG_HASH:=41a8d242409e4f46f0588d5cecc8ea41b420978f83083ed52443544b5d71936f else ifeq ($(ARCH),mips) PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) PKG_HASH:=0d64790a2dad37ee43cc9847169a216f5611ce0a1f37d1be1babf968196e8288 else ifeq ($(ARCH),mipsel) PKG_SOURCE:=$(PKG_SOURCE_HEADER).mipsel-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER) PKG_HASH:=8e101612fcc9db88336343a480d5e410ae0f89192c6847439d8131cccfc31943 # Set the default value to make OpenWrt Package Checker happy else PKG_SOURCE:=dummy PKG_HASH:=dummy endif PKG_MAINTAINER:=Tianling Shen 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))) \ )