mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 16:44:23 +08:00
🎉 Sync 2026-09-19 19:24:04
This commit is contained in:
1 parent
429c630d89
commit
367fd81688
11 files changed
+492
No files matched your search
@@ -0,0 +1,64 @@
|
||||
#
|
||||
# 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:=1.16.0
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/trojan-gfw/trojan/tar.gz/v$(PKG_VERSION)?
|
||||
PKG_HASH:=skip
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_DEPENDS:=openssl
|
||||
PKG_BUILD_FLAGS:=gc-sections lto
|
||||
|
||||
PKG_LICENSE:=GPL-3.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=GreaterFire
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
TARGET_CXXFLAGS += -Wall -Wextra
|
||||
TARGET_CXXFLAGS += $(FPIC)
|
||||
|
||||
# CXX standard
|
||||
TARGET_CXXFLAGS += -std=c++11
|
||||
TARGET_CXXFLAGS := $(filter-out -O%,$(TARGET_CXXFLAGS)) -O3
|
||||
|
||||
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
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=An unidentifiable mechanism that helps you bypass GFW
|
||||
URL:=https://github.com/trojan-gfw/trojan
|
||||
DEPENDS:= \
|
||||
+libpthread +libstdcpp +libopenssl \
|
||||
+boost +boost-program_options +boost-date_time
|
||||
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))
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -43,7 +43,7 @@ if(MSVC)
|
||||
add_definitions(-DBOOST_DATE_TIME_NO_LIB)
|
||||
endif()
|
||||
|
||||
-find_package(OpenSSL 1.1.0 REQUIRED)
|
||||
+find_package(OpenSSL 1.1.1 REQUIRED)
|
||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||
target_link_libraries(trojan ${OPENSSL_LIBRARIES})
|
||||
if(OPENSSL_VERSION VERSION_GREATER_EQUAL 1.1.1)
|
||||
@@ -0,0 +1,16 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -36,7 +36,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(trojan ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
-find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
|
||||
+find_package(Boost 1.66.0 REQUIRED)
|
||||
+if (Boost_MAJOR_VERSION LESS_EQUAL 1 AND Boost_MINOR_VERSION LESS 89)
|
||||
+ find_package(Boost 1.66.0 REQUIRED COMPONENTS system program_options)
|
||||
+else()
|
||||
+ find_package(Boost 1.66.0 REQUIRED COMPONENTS program_options)
|
||||
+endif()
|
||||
include_directories(${Boost_INCLUDE_DIR})
|
||||
target_link_libraries(trojan ${Boost_LIBRARIES})
|
||||
if(MSVC)
|
||||
Reference in new issue
Block a user