forked from MetaCubeX/subconverter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.alpine.release.sh
56 lines (46 loc) · 1.69 KB
/
build.alpine.release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# git clone https://github.com/iyarivky/subconverter/
# cd subconverter
apk add gcc g++ build-base linux-headers cmake make autoconf automake libtool python3
apk add mbedtls-dev mbedtls-static zlib-dev rapidjson-dev libevent-dev libevent-static zlib-static pcre2-dev
git clone https://github.com/curl/curl
git clone https://github.com/jbeder/yaml-cpp --depth=1
git clone https://github.com/ftk/quickjspp --depth=1
git clone https://github.com/PerMalmberg/libcron --depth=1
git clone https://github.com/ToruNiina/toml11 --depth=1
cd curl
git checkout curl-7_88_0
cmake -DCURL_USE_MBEDTLS=ON -DHTTP_ONLY=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_USE_LIBSSH2=OFF -DBUILD_CURL_EXE=OFF . > /dev/null
make install -j2 > /dev/null
cd ..
cd yaml-cpp
cmake -DCMAKE_BUILD_TYPE=Release -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF . > /dev/null
make install -j2 > /dev/null
cd ..
cd quickjspp
cmake -DCMAKE_BUILD_TYPE=Release .
make quickjs -j2
install -m644 quickjs/libquickjs.a /usr/lib/
install -d /usr/include/quickjs/
install -m644 quickjs/quickjs.h quickjs/quickjs-libc.h /usr/include/quickjs/
install -m644 quickjspp.hpp /usr/include/
cd ..
cd libcron
git submodule update --init
cmake -DCMAKE_BUILD_TYPE=Release .
make libcron install -j2
cd ..
cd toml11
cmake -DCMAKE_CXX_STANDARD=11 .
make install -j4
cd ..
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig
cmake -DCMAKE_BUILD_TYPE=Release .
make -j2
rm subconverter
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 -lquickjs -llibcron -O3 -s
cd base
chmod +rx subconverter
chmod +r ./*
cd ..
mv base subconverter