mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-26 02:42:25 +00:00
Enhancements
Add basic support for generating sing-box configs. Use cpp-httplib as web server. Optimize codes.
This commit is contained in:
@@ -7,7 +7,7 @@ ARG SHA=""
|
||||
WORKDIR /
|
||||
RUN set -xe && \
|
||||
apk add --no-cache --virtual .build-tools git g++ build-base linux-headers cmake python3 && \
|
||||
apk add --no-cache --virtual .build-deps curl-dev rapidjson-dev libevent-dev pcre2-dev yaml-cpp-dev && \
|
||||
apk add --no-cache --virtual .build-deps curl-dev rapidjson-dev pcre2-dev yaml-cpp-dev && \
|
||||
git clone https://github.com/ftk/quickjspp --depth=1 && \
|
||||
cd quickjspp && \
|
||||
git submodule update --init && \
|
||||
@@ -48,7 +48,7 @@ RUN set -xe && \
|
||||
FROM alpine:3.16
|
||||
LABEL maintainer="tindy.it@gmail.com"
|
||||
|
||||
RUN apk add --no-cache --virtual subconverter-deps pcre2 libcurl yaml-cpp libevent
|
||||
RUN apk add --no-cache --virtual subconverter-deps pcre2 libcurl yaml-cpp
|
||||
|
||||
COPY --from=builder /subconverter/subconverter /usr/bin/
|
||||
COPY --from=builder /subconverter/base /base/
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
set -xe
|
||||
|
||||
apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool python2 python3
|
||||
apk add mbedtls-dev mbedtls-static zlib-dev rapidjson-dev libevent-dev libevent-static zlib-static pcre2-dev
|
||||
apk add mbedtls-dev mbedtls-static zlib-dev rapidjson-dev zlib-static pcre2-dev
|
||||
|
||||
git clone https://github.com/curl/curl --depth=1 --branch curl-8_4_0
|
||||
cd curl
|
||||
@@ -45,7 +45,7 @@ cmake -DCMAKE_BUILD_TYPE=Release .
|
||||
make -j3
|
||||
rm subconverter
|
||||
# shellcheck disable=SC2046
|
||||
g++ -o base/subconverter $(find CMakeFiles/subconverter.dir/src/ -name "*.o") -static -lpcre2-8 -levent -lyaml-cpp -L/usr/lib64 -lcurl -lmbedtls -lmbedcrypto -lmbedx509 -lz -l:quickjs/libquickjs.a -llibcron -O3 -s
|
||||
g++ -o base/subconverter $(find CMakeFiles/subconverter.dir/src/ -name "*.o") -static -lpcre2-8 -lyaml-cpp -L/usr/lib64 -lcurl -lmbedtls -lmbedcrypto -lmbedx509 -lz -l:quickjs/libquickjs.a -llibcron -O3 -s
|
||||
|
||||
python3 -m ensurepip
|
||||
python3 -m pip install gitpython
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -xe
|
||||
|
||||
brew reinstall rapidjson libevent zlib pcre2 pkgconfig
|
||||
brew reinstall rapidjson zlib pcre2 pkgconfig
|
||||
|
||||
#git clone https://github.com/curl/curl --depth=1 --branch curl-7_88_1
|
||||
#cd curl
|
||||
@@ -46,13 +46,13 @@ cmake -DCMAKE_CXX_STANDARD=11 .
|
||||
make install -j4
|
||||
cd ..
|
||||
|
||||
cp /usr/local/lib/libevent.a .
|
||||
cp /usr/local/opt/zlib/lib/libz.a .
|
||||
cp /usr/local/lib/libpcre2-8.a .
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release .
|
||||
make -j8
|
||||
rm subconverter
|
||||
# shellcheck disable=SC2046
|
||||
c++ -Xlinker -unexported_symbol -Xlinker "*" -o base/subconverter -framework CoreFoundation -framework Security $(find CMakeFiles/subconverter.dir/src/ -name "*.o") $(find . -name "*.a") -lcurl -O3
|
||||
|
||||
python -m ensurepip
|
||||
|
||||
@@ -52,5 +52,6 @@ rm -f C:/Strawberry/perl/bin/pkg-config C:/Strawberry/perl/bin/pkg-config.bat
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" .
|
||||
make -j4
|
||||
rm subconverter.exe
|
||||
g++ $(find CMakeFiles/subconverter.dir/src -name "*.obj") curl/lib/libcurl.a -o base/subconverter.exe -static -lbcrypt -levent -lpcre2-8 -l:quickjs/libquickjs.a -llibcron -lyaml-cpp -liphlpapi -lcrypt32 -lws2_32 -lwsock32 -lz -s
|
||||
# shellcheck disable=SC2046
|
||||
g++ $(find CMakeFiles/subconverter.dir/src -name "*.obj") curl/lib/libcurl.a -o base/subconverter.exe -static -lbcrypt -lpcre2-8 -l:quickjs/libquickjs.a -llibcron -lyaml-cpp -liphlpapi -lcrypt32 -lws2_32 -lwsock32 -lz -s
|
||||
mv base subconverter
|
||||
|
||||
@@ -3,7 +3,7 @@ set -xe
|
||||
|
||||
apt update
|
||||
apt install -y git cmake clang pkg-config
|
||||
apt install -y libevent libcurl openssl pcre2
|
||||
apt install -y libcurl openssl pcre2
|
||||
|
||||
git clone https://github.com/jbeder/yaml-cpp --depth=1
|
||||
cd yaml-cpp
|
||||
|
||||
Reference in New Issue
Block a user