Browse Source

Update mingw build scripts

pull/2390/head
Max Lv 6 years ago
parent
commit
dc4742be4a
3 changed files with 14 additions and 54 deletions
  1. 13
      docker/mingw/Dockerfile
  2. 6
      docker/mingw/Makefile
  3. 49
      docker/mingw/build.sh

13
docker/mingw/Dockerfile

@ -23,7 +23,7 @@ FROM debian:testing
ARG REPO=shadowsocks
ARG REV=master
ADD prepare.sh /
ADD docker/mingw/prepare.sh /
RUN \
/bin/bash -c "source /prepare.sh && dk_prepare" && \
@ -32,12 +32,15 @@ RUN \
RUN /bin/bash -c "source /prepare.sh && dk_download"
ADD deps.sh /
ADD docker/mingw/deps.sh /
RUN /bin/bash -c "source /deps.sh && dk_deps"
ADD build.sh /
ADD docker/mingw/build.sh /
ARG REBUILD=0
ARG PLUGIN=true
RUN /bin/bash -c "source /build.sh && dk_build && dk_package"
ADD . /build/src/proj
RUN /bin/bash -c "source /build.sh && dk_build"
RUN /bin/bash -c "source /build.sh && dk_package"

6
docker/mingw/Makefile

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

49
docker/mingw/build.sh

@ -32,15 +32,9 @@ build_proj() {
cpu="$(nproc --all)"
cd "$SRC"
if ! [ -d proj ]; then
git clone ${PROJ_URL} proj
cd proj
git checkout ${PROJ_REV}
git submodule update --init
./autogen.sh
else
cd proj
fi
cd proj
./autogen.sh
./configure --host=${host} --prefix=${prefix} \
--disable-documentation \
--with-ev="$dep" \
@ -52,29 +46,6 @@ build_proj() {
make clean
make -j$cpu LDFLAGS="-all-static -L${dep}/lib"
make install
# Reference SIP003 plugin (Experimental)
[[ "${PLUGIN}" != "true" ]] && return 0
PLUGIN_URL=https://github.com/${PROJ_SITE}/simple-obfs.git
PLUGIN_REV=master
cd "$SRC"
if ! [ -d plugin ]; then
git clone ${PLUGIN_URL} plugin
cd plugin
git checkout ${PLUGIN_REV}
git submodule update --init
./autogen.sh
else
cd plugin
fi
./configure --host=${host} --prefix=${prefix} \
--disable-documentation \
--with-ev="$dep"
make clean
make -j$cpu LDFLAGS="-all-static -L${dep}/lib"
make install
}
dk_build() {
@ -93,20 +64,6 @@ 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 || true
cp ${DIST}/x86_64/bin/obfs-${bin}.exe obfs-${bin}-x64.exe || true
done
pushd "$SRC/proj"
GIT_REV="$(git rev-parse --short HEAD)"
popd
echo "SHA1 checksum for build $(date +"%y%m%d")-${GIT_REV}" > checksum
for f in *.exe; do
echo " $f:" >> checksum
echo " $(sha1sum $f | cut -d ' ' -f 1)" >> checksum
done
sed -e 's/$/\r/' checksum > checksum.txt
rm -f checksum
cd ..
tar zcf /bin.tgz ss-libev-${PROJ_REV}
}
Loading…
Cancel
Save