kenzok8-package/shadowsocks-rust/Makefile

91 lines
3.2 KiB
Makefile
Raw Normal View History

2023-09-23 22:27:31 +08:00
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2017-2020 Yousong Zhou <yszhou4tech@gmail.com>
2024-02-19 12:47:17 +08:00
# Copyright (C) 2021 ImmortalWrt.org
2023-09-23 22:27:31 +08:00
include $(TOPDIR)/rules.mk
PKG_NAME:=shadowsocks-rust
2025-01-03 00:24:33 +08:00
PKG_VERSION:=1.22.0
2024-02-19 12:47:17 +08:00
PKG_RELEASE:=1
2023-09-23 22:27:31 +08:00
2024-02-19 12:47:17 +08:00
PKG_SOURCE_HEADER:=shadowsocks-v$(PKG_VERSION)
PKG_SOURCE_BODY:=unknown-linux-musl
2024-03-14 10:42:57 +08:00
PKG_SOURCE_FOOTER:=tar.xz
2024-03-02 09:07:54 +08:00
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
2024-02-19 12:47:17 +08:00
ifeq ($(ARCH),aarch64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).aarch64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
2025-01-03 00:24:33 +08:00
PKG_HASH:=4c20c76ff80e7671428068a1628b6269785fc0d22a127883ed82e2c79e6c332e
2024-02-19 12:47:17 +08:00
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)
2025-01-03 00:24:33 +08:00
PKG_HASH:=6724fcb42326b003e542fc2df6594dbd28259dc3df7644033844d6d7cba98b61
2024-02-19 12:47:17 +08:00
else
PKG_SOURCE:=$(PKG_SOURCE_HEADER).arm-$(PKG_SOURCE_BODY)eabihf.$(PKG_SOURCE_FOOTER)
2025-01-03 00:24:33 +08:00
PKG_HASH:=3af6c4e3e28b92957b869a6851296f882f906f30285cf9247ad59f163ce9d808
2024-02-19 12:47:17 +08:00
endif
else ifeq ($(ARCH),i386)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).i686-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
2025-01-03 00:24:33 +08:00
PKG_HASH:=01419d65ea1dcc41c103bc83601eda7dd7ce311f50097c826aa3262c539c3af3
2024-03-02 09:07:54 +08:00
else ifeq ($(ARCH),x86_64)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).x86_64-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
2025-01-03 00:24:33 +08:00
PKG_HASH:=5e3f4a7c78ffeb612620c5cfd4a99a25d1eabffbe9e00ce5a92ee72e99d1310b
2024-02-19 12:47:17 +08:00
else ifeq ($(ARCH),mips)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mips-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
2024-10-25 12:25:59 +08:00
PKG_HASH:=fa826d72de0c7713fe77570b56931f38e0bb575a370fd8de4e98b2bc29179e97
2024-02-19 12:47:17 +08:00
else ifeq ($(ARCH),mipsel)
PKG_SOURCE:=$(PKG_SOURCE_HEADER).mipsel-$(PKG_SOURCE_BODY).$(PKG_SOURCE_FOOTER)
2024-10-25 12:25:59 +08:00
PKG_HASH:=bb34a5fec2c7c3ae22a1bef06d8caf3cb5f06368e311d69189b713d3876dda43
2024-02-19 12:47:17 +08:00
# Set the default value to make OpenWrt Package Checker happy
else
PKG_SOURCE:=dummy
2024-03-02 09:07:54 +08:00
PKG_HASH:=dummy
2024-02-19 12:47:17 +08:00
endif
2023-09-23 22:27:31 +08:00
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
2024-02-03 16:20:41 +08:00
include $(INCLUDE_DIR)/package.mk
2024-02-19 12:47:17 +08:00
TAR_CMD:=$(HOST_TAR) -C $(PKG_BUILD_DIR) $(TAR_OPTIONS)
2023-09-23 22:27:31 +08:00
define Package/shadowsocks-rust/Default
define Package/shadowsocks-rust-$(1)
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
TITLE:=shadowsocks-rust $(1)
2024-02-19 12:47:17 +08:00
URL:=https://github.com/shadowsocks/shadowsocks-rust
2024-03-02 09:07:54 +08:00
DEPENDS:=@(aarch64||arm||i386||mips||mipsel||x86_64) @!(TARGET_x86_geode||TARGET_x86_legacy)
2024-02-16 13:39:52 +08:00
endef
2023-09-23 22:27:31 +08:00
define Package/shadowsocks-rust-$(1)/install
$$(INSTALL_DIR) $$(1)/usr/bin
2024-02-19 12:47:17 +08:00
$$(INSTALL_BIN) $$(PKG_BUILD_DIR)/$(1) $$(1)/usr/bin
2023-09-23 22:27:31 +08:00
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))
2024-02-19 12:47:17 +08:00
define Build/Compile
endef
2023-09-23 22:27:31 +08:00
$(foreach component,$(SHADOWSOCKS_COMPONENTS), \
$(eval $(call BuildPackage,shadowsocks-rust-$(component))) \
2024-03-14 10:42:57 +08:00
)