Skip to content

Commit

Permalink
fix: GHA for windows (#168)
Browse files Browse the repository at this point in the history
use mbedtls 2.28 for 3+ does not support cfb
use ss-libev before shadowsocks/shadowsocks-libev@01dd7df
disable psl and link bcrypt for curl

fix #163
  • Loading branch information
Masaiki authored Jul 30, 2022
1 parent 306adca commit 8bcd7a3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
update: true
install: base-devel libtool autogen automake autoconf git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 mingw-w64-x86_64-freetype mingw-w64-x86_64-libpng mingw-w64-x86_64-bzip2 mingw-w64-x86_64-openssl mingw-w64-x86_64-mbedtls mingw-w64-x86_64-libsodium mingw-w64-x86_64-c-ares mingw-w64-x86_64-boost mingw-w64-x86_64-libmariadbclient unzip p7zip
install: base-devel libtool autogen automake autoconf git mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-libevent mingw-w64-x86_64-pcre2 mingw-w64-x86_64-freetype mingw-w64-x86_64-libpng mingw-w64-x86_64-bzip2 mingw-w64-x86_64-openssl mingw-w64-x86_64-libsodium mingw-w64-x86_64-c-ares mingw-w64-x86_64-boost mingw-w64-x86_64-libmariadbclient unzip p7zip
- name: Cache built dependencies
uses: actions/cache@v2
env:
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
- uses: msys2/setup-msys2@v2
with:
update: true
install: base-devel libtool autogen automake autoconf git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2 mingw-w64-i686-freetype mingw-w64-i686-libpng mingw-w64-i686-bzip2 mingw-w64-i686-openssl mingw-w64-i686-mbedtls mingw-w64-i686-libsodium mingw-w64-i686-c-ares mingw-w64-i686-boost mingw-w64-i686-libmariadbclient unzip p7zip
install: base-devel libtool autogen automake autoconf git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-libevent mingw-w64-i686-pcre2 mingw-w64-i686-freetype mingw-w64-i686-libpng mingw-w64-i686-bzip2 mingw-w64-i686-openssl mingw-w64-i686-libsodium mingw-w64-i686-c-ares mingw-w64-i686-boost mingw-w64-i686-libmariadbclient unzip p7zip
msystem: MINGW32
- name: Cache built dependencies
uses: actions/cache@v2
Expand Down
10 changes: 9 additions & 1 deletion scripts/build.windows.clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ mkdir "$USERPROFILE/clients/built"
cd "$USERPROFILE/clients"
set -xe

if [ ! -d mbedtls/ ]; then git clone https://github.com/Mbed-TLS/mbedtls --branch mbedtls-2.28 --depth=1; fi
cd mbedtls
git pull --ff-only
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DMBEDTLS_FATAL_WARNINGS=OFF -DUSE_STATIC_MBEDTLS_LIBRARY=ON -DCMAKE_INSTALL_PREFIX="$MINGW_PREFIX" -G "Unix Makefiles" .
make install -j4
cd ..

if [ ! -d libev-mingw/ ]; then # assume libev-mingw will never update again
curl -LO https://github.com/shadowsocks/libev/archive/mingw.tar.gz
tar xvf mingw.tar.gz
Expand Down Expand Up @@ -31,8 +38,9 @@ mv simple-obfs.exe ../built/
cd ..

if [ ! -d shadowsocks-libev/ ]; then
git clone https://github.com/shadowsocks/shadowsocks-libev --depth=1
git clone https://github.com/shadowsocks/shadowsocks-libev
cd shadowsocks-libev
git reset --hard c2fc967
git submodule update --init
./autogen.sh
./configure --disable-documentation --with-ev="$LIBEV_PATH"
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.windows.maindeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -xe
if [ ! -d curl/ ]; then git clone https://github.com/curl/curl --depth=1; fi
cd curl
git pull --ff-only
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 .
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 ..

Expand Down
2 changes: 1 addition & 1 deletion scripts/build.windows.release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ rm stairspeedtest.exe
export FREETYPE_DEPS=$(pkg-config --libs --static harfbuzz)
# build resources
windres -J rc -O coff -i res/res.rc -o res.res
g++ $(find CMakeFiles/stairspeedtest.dir/src -name "*.obj") "$USERPROFILE/maindeps/curl/lib/libcurl.a" res.res -o base/stairspeedtest.exe -static -levent -lPNGwriter -lfreetype $FREETYPE_DEPS -lpng -lpcre2-8 -lyaml-cpp -lssl -lcrypto -lws2_32 -lwsock32 -lcrypt32 -liphlpapi -lz -lbz2 -s
g++ $(find CMakeFiles/stairspeedtest.dir/src -name "*.obj") "$USERPROFILE/maindeps/curl/lib/libcurl.a" -lbcrypt res.res -o base/stairspeedtest.exe -static -levent -lPNGwriter -lfreetype $FREETYPE_DEPS -lpng -lpcre2-8 -lyaml-cpp -lssl -lcrypto -lws2_32 -lwsock32 -lcrypt32 -liphlpapi -lz -lbz2 -s

set +xe

0 comments on commit 8bcd7a3

Please sign in to comment.