trojan-go/trojan-plus: introduce package
This commit is contained in:
parent
2b832ba5c3
commit
8f32714143
85
package/lienol/trojan-go/Makefile
Normal file
85
package/lienol/trojan-go/Makefile
Normal file
@ -0,0 +1,85 @@
|
||||
# Copyright (C) 2020 Lienol
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=trojan-go
|
||||
PKG_VERSION:=0.7.8
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/p4gefau1t/trojan-go.git
|
||||
PKG_SOURCE_VERSION:=9866c030058870bf18d60f1d3677c6d4ed9de35d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_CONFIG_DEPENDS := \
|
||||
CONFIG_TROJAN_GO_COMPRESS_GOPROXY \
|
||||
CONFIG_TROJAN_GO_COMPRESS_UPX
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/p4gefau1t/trojan-go
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
$(GO_PKG)/constant.Version=$(PKG_VERSION) \
|
||||
$(GO_PKG)/constant.Commit=$(PKG_SOURCE_VERSION)
|
||||
GO_PKG_TAG:=-tags full
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=$$(GO_ARCH_DEPENDS)
|
||||
TITLE:=An unidentifiable mechanism that helps you bypass GFW. It's compatible with original trojan with experimental features.
|
||||
URL:=https://github.com/p4gefau1t/trojan-go
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
|
||||
menu "Configuration"
|
||||
depends on PACKAGE_$(PKG_NAME)
|
||||
|
||||
config TROJAN_GO_COMPRESS_GOPROXY
|
||||
bool "Compiling with GOPROXY proxy"
|
||||
default n
|
||||
|
||||
config TROJAN_GO_COMPRESS_UPX
|
||||
bool "Compress executable files with UPX"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TROJAN_GO_COMPRESS_GOPROXY),y)
|
||||
export GO111MODULE=on
|
||||
export GOPROXY=https://goproxy.cn
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components 1
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call GoPackage/Build/Configure)
|
||||
$(call GoPackage/Build/Compile)
|
||||
ifeq ($(CONFIG_TROJAN_GO_COMPRESS_UPX),y)
|
||||
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/$(PKG_NAME)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
69
package/lienol/trojan-plus/Makefile
Normal file
69
package/lienol/trojan-plus/Makefile
Normal file
@ -0,0 +1,69 @@
|
||||
#
|
||||
# Copyright (C) 2018-2019 wongsyrone
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=trojan
|
||||
PKG_VERSION:=10.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/Trojan-Plus-Group/trojan-plus.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=4af7ff4dd48c7257c354d4e6dafafcdf5f12379c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
CMAKE_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=0
|
||||
PKG_BUILD_DEPENDS:=openssl
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_MAINTAINER:=Trojan-Plus-Group
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
TARGET_CXXFLAGS += -Wall -Wextra
|
||||
TARGET_CXXFLAGS += $(FPIC)
|
||||
|
||||
# LTO
|
||||
TARGET_CXXFLAGS += -flto
|
||||
TARGET_LDFLAGS += -flto
|
||||
|
||||
# CXX standard
|
||||
TARGET_CXXFLAGS += -std=c++11
|
||||
TARGET_CXXFLAGS := $(filter-out -O%,$(TARGET_CXXFLAGS)) -O3
|
||||
TARGET_CXXFLAGS += -ffunction-sections -fdata-sections
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DENABLE_MYSQL=OFF \
|
||||
-DENABLE_NAT=ON \
|
||||
-DENABLE_REUSE_PORT=ON \
|
||||
-DENABLE_SSL_KEYLOG=ON \
|
||||
-DENABLE_TLS13_CIPHERSUITES=ON \
|
||||
-DFORCE_TCP_FASTOPEN=OFF \
|
||||
-DSYSTEMD_SERVICE=OFF \
|
||||
-DOPENSSL_USE_STATIC_LIBS=FALSE \
|
||||
-DBoost_DEBUG=ON \
|
||||
-DBoost_NO_BOOST_CMAKE=ON
|
||||
|
||||
define Package/trojan
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=An unidentifiable mechanism that helps you bypass GFW. It's compatible with original trojan with experimental features.
|
||||
URL:=https://github.com/Trojan-Plus-Group/trojan-plus
|
||||
DEPENDS:=+libpthread +libstdcpp +libopenssl \
|
||||
+boost +boost-system +boost-program_options
|
||||
endef
|
||||
|
||||
define Package/trojan/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/trojan $(1)/usr/sbin/trojan
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,trojan))
|
||||
|
||||
3339
package/lienol/trojan-plus/patches/0001-C-S-Binary-Mods.patch
Normal file
3339
package/lienol/trojan-plus/patches/0001-C-S-Binary-Mods.patch
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user