Browse Source

Compile plugin in Docker for MinGW

pull/1978/head
Linus Yang 7 years ago
parent
commit
cb369919a7
4 changed files with 30 additions and 6 deletions
  1. 5
      README.md
  2. 4
      docker/mingw/Makefile
  3. 23
      docker/mingw/build.sh
  4. 4
      docker/mingw/make.bat

5
README.md

@ -354,10 +354,7 @@ Currently you need to use a patched libev library for MinGW:
* https://github.com/shadowsocks/libev/archive/mingw.zip
Notice that Windows (MinGW) version has some differences from other platforms:
1. No support of plugins at the moment.
2. TCP Fast Open (TFO) is only available on **Windows 10**, **1607** or later version (precisely, build >= 14393). If you are using **1709** (build 16299) or later version, you also need to run the following command in PowerShell/Command Prompt **as Administrator** and **reboot** to use TFO properly:
Notice that TCP Fast Open (TFO) is only available on **Windows 10**, **1607** or later version (precisely, build >= 14393). If you are using **1709** (build 16299) or later version, you also need to run the following command in PowerShell/Command Prompt **as Administrator** and **reboot** to use TFO properly:
netsh int tcp set global fastopenfallback=disabled

4
docker/mingw/Makefile

@ -20,6 +20,7 @@
REPO=shadowsocks
REV=master
PLUGIN=true
IMAGE=ss-build-mingw
DIST=ss-libev-win-dist.tar.gz
@ -28,7 +29,8 @@ all: build
build:
docker build --force-rm -t $(IMAGE) \
--build-arg REV=$(REV) --build-arg REPO=$(REPO) \
--build-arg REBUILD="$$(date +%Y-%m-%d-%H-%M-%S)" .
--build-arg REBUILD="$$(date +%Y-%m-%d-%H-%M-%S)" \
--build-arg PLUGIN=$(PLUGIN) .
docker run --rm --entrypoint cat $(IMAGE) /bin.tgz > $(DIST)
clean:

23
docker/mingw/build.sh

@ -47,6 +47,25 @@ build_proj() {
make clean
make LDFLAGS="-all-static -L${dep}/lib"
make install-strip
# Reference SIP003 plugin (Experimental)
[[ "${PLUGIN}" != "true" ]] && return 0
PLUGIN_URL=https://github.com/${PROJ_SITE}/simple-obfs.git
PLUGIN_REV=master
cd "$SRC"
git clone ${PLUGIN_URL} plugin
cd plugin
git checkout ${PLUGIN_REV}
git submodule update --init
./autogen.sh
./configure --host=${host} --prefix=${prefix} \
--disable-documentation \
--with-ev="$dep"
make clean
make LDFLAGS="-all-static -L${dep}/lib"
make install-strip
}
dk_build() {
@ -65,6 +84,10 @@ dk_package() {
cp ${DIST}/i686/bin/ss-${bin}.exe ss-${bin}-x86.exe
cp ${DIST}/x86_64/bin/ss-${bin}.exe ss-${bin}-x64.exe
done
for bin in local server; do
cp ${DIST}/i686/bin/obfs-${bin}.exe obfs-${bin}-x86.exe
cp ${DIST}/x86_64/bin/obfs-${bin}.exe obfs-${bin}-x64.exe
done
pushd "$SRC/proj"
GIT_REV="$(git rev-parse --short HEAD)"
popd

4
docker/mingw/make.bat

@ -2,10 +2,12 @@
pushd %~dp0
set "REPO=shadowsocks"
set "REV=master"
set "PLUGIN=true"
set "IMAGE=ss-build-mingw"
set "DIST=ss-libev-win-dist.tar.gz"
docker build --force-rm -t %IMAGE% ^
--build-arg REV=%REV% --build-arg REPO=%REPO% ^
--build-arg REBUILD=%RANDOM% .
--build-arg REBUILD=%RANDOM% ^
--build-arg PLUGIN=%PLUGIN% .
docker run --rm --entrypoint cat %IMAGE% /bin.tgz > %DIST%
pause
Loading…
Cancel
Save