simple-obfs: update from immortalwrt

This commit is contained in:
A-BO
2025-08-06 22:19:25 +08:00
parent 1013e7cb1d
commit e18c5b351c
2 changed files with 48 additions and 35 deletions

View File

@@ -1,6 +1,9 @@
#
# Copyright (C) 2017-2019 Jian Chang <aa65535@live.com>
#
# Copyright (C) 2021 ImmortalWrt
# <https://immortalwrt.org>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
@@ -9,55 +12,49 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=simple-obfs
PKG_VERSION:=0.0.5
PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/shadowsocks/simple-obfs.git
PKG_MIRROR_HASH:=ea8f2b9825bbb87d5d860524e29bade265141687338db2dbf7ecd32690cf02fc
PKG_SOURCE_DATE:=2019-08-17
PKG_SOURCE_VERSION:=486bebd9208539058e57e23a12f23103016e09b4
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=bc97eba511b86a089ab4bcf0ac78d9e4a39c59046d5cde77b79a118245daa0ba
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=COPYING LICENSE
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jian Chang <aa65535@live.com>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_USE_MIPS16:=0
PKG_BUILD_FLAGS:=no-mips16
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=libev
PKG_CONFIG_DEPENDS:= CONFIG_SIMPLE_OBFS_STATIC_LINK
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/simple-obfs
define Package/simple-obfs/template
SECTION:=net
CATEGORY:=Network
TITLE:=Simple-obfs
URL:=https://github.com/shadowsocks/simple-obfs
DEPENDS:=+libpthread +!SIMPLE_OBFS_STATIC_LINK:libev
DEPENDS:=+libpthread +libev
endef
Package/simple-obfs-server = $(Package/simple-obfs)
define Package/simple-obfs-client
$(call Package/simple-obfs/template)
TITLE+= (client)
PROVIDES:=simple-obfs
endef
define Package/simple-obfs-server/config
menu "Simple-obfs Compile Configuration"
depends on PACKAGE_simple-obfs || PACKAGE_simple-obfs-server
config SIMPLE_OBFS_STATIC_LINK
bool "enable static link libraries."
default n
endmenu
define Package/simple-obfs-server
$(call Package/simple-obfs/template)
TITLE+= (server)
endef
define Package/simple-obfs/description
Simple-obfs is a simple obfusacting tool, designed as plugin server of shadowsocks.
Simple-obfs is a simple obfusacting tool, designed as plugin server of shadowsocks.
endef
Package/simple-obfs-client/description = $(Package/simple-obfs/description)
Package/simple-obfs-server/description = $(Package/simple-obfs/description)
CONFIGURE_ARGS += \
@@ -65,21 +62,15 @@ CONFIGURE_ARGS += \
--disable-documentation \
--disable-assert
ifeq ($(CONFIG_SIMPLE_OBFS_STATIC_LINK),y)
CONFIGURE_ARGS += \
--with-ev="$(STAGING_DIR)/usr" \
LDFLAGS="-Wl,-static -static -static-libgcc"
endif
define Package/simple-obfs/install
define Package/simple-obfs-client/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/obfs-local $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/obfs-local $(1)/usr/bin/obfs-local
endef
define Package/simple-obfs-server/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/obfs-server $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/obfs-server $(1)/usr/bin/obfs-server
endef
$(eval $(call BuildPackage,simple-obfs))
$(eval $(call BuildPackage,simple-obfs-client))
$(eval $(call BuildPackage,simple-obfs-server))

View File

@@ -0,0 +1,22 @@
From bc8014cd6637798ee96b9394c716eff46115c002 Mon Sep 17 00:00:00 2001
From: DDoSolitary <DDoSolitary@gmail.com>
Date: Thu, 12 Mar 2020 12:15:37 +0800
Subject: [PATCH] Convert arguments of isdigit to int.
---
src/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils.c b/src/utils.c
index 67cc250..514a001 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -92,7 +92,7 @@ int
ss_isnumeric(const char *s) {
if (!s || !*s)
return 0;
- while (isdigit(*s))
+ while (isdigit((int)*s))
++s;
return *s == '\0';
}