mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-27 20:03:01 +00:00
66 lines
2.5 KiB
Bash
66 lines
2.5 KiB
Bash
#!/bin/bash
|
|
set -xe
|
|
|
|
# 获取系统架构
|
|
ARCH=$(uname -m)
|
|
|
|
if [ "$ARCH" == "x86_64" ]; then
|
|
MY_MINGW_PREFIX="/mingw64"
|
|
else
|
|
MY_MINGW_PREFIX="/mingw32"
|
|
fi
|
|
#git clone https://github.com/curl/curl --depth=1 --branch tiny-curl-8_4
|
|
#cd curl
|
|
#cmake -DCMAKE_BUILD_TYPE=Release -DCURL_USE_LIBSSH2=OFF -DHTTP_ONLY=ON -DCURL_USE_SCHANNEL=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_CURL_EXE=OFF -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" -DHAVE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF .
|
|
#make install -j4
|
|
#cd ..
|
|
#
|
|
git clone https://github.com/jbeder/yaml-cpp --depth=1
|
|
cd yaml-cpp
|
|
cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" .
|
|
make install -j4
|
|
cd ..
|
|
|
|
git clone https://github.com/ftk/quickjspp --depth=1
|
|
cd quickjspp
|
|
patch quickjs/quickjs-libc.c -i ../scripts/patches/0001-quickjs-libc-add-realpath-for-Windows.patch
|
|
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .
|
|
make quickjs -j4
|
|
install -d "$MINGW_PREFIX/lib/quickjs/"
|
|
install -m644 quickjs/libquickjs.a "$MINGW_PREFIX/lib/quickjs/"
|
|
install -d "$MINGW_PREFIX/include/quickjs"
|
|
install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h "$MINGW_PREFIX/include/quickjs/"
|
|
install -m644 quickjspp.hpp "$MINGW_PREFIX/include/"
|
|
cd ..
|
|
|
|
git clone https://github.com/PerMalmberg/libcron --depth=1
|
|
cd libcron
|
|
git submodule update --init
|
|
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" .
|
|
make libcron install -j4
|
|
cd ..
|
|
|
|
git clone https://github.com/Tencent/rapidjson --depth=1
|
|
cd rapidjson
|
|
cmake -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" .
|
|
make install -j4
|
|
cd ..
|
|
|
|
git clone https://github.com/ToruNiina/toml11 --branch="v3.7.1" --depth=1
|
|
cd toml11
|
|
cmake -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" -DCMAKE_CXX_STANDARD=11 .
|
|
make install -j4
|
|
cd ..
|
|
|
|
python -m ensurepip
|
|
python -m pip install gitpython
|
|
python scripts/update_rules.py -c scripts/rules_config.conf
|
|
|
|
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
|
|
# shellcheck disable=SC2046
|
|
g++ $(find CMakeFiles/subconverter.dir/src -name "*.obj") -lcurl -lssl -lcrypto -o base/subconverter.exe -static -lbcrypt -lpcre2-8 -l:quickjs/libquickjs.a -llibcron -lyaml-cpp -liphlpapi -lcrypt32 -lws2_32 -lwsock32 -lz -s -L"$MINGW_PREFIX/lib" -I"$MINGW_PREFIX/include" -L"$MY_MINGW_PREFIX/lib" -I"$MY_MINGW_PREFIX/include"
|
|
mv base subconverter
|