Skip to content

Commit

Permalink
Fix #2565 #2566
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Dec 24, 2019
1 parent ffc2ea4 commit 74daa50
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
8 changes: 5 additions & 3 deletions docker/mingw/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
# <http://www.gnu.org/licenses/>.
#

FROM debian:testing
FROM debian:stretch

ARG REPO=shadowsocks
ARG REV=master

ADD docker/mingw/prepare.sh /
ADD docker/mingw/apt.sh /

RUN \
/bin/bash -c "source /prepare.sh && dk_prepare" && \
/bin/bash -c "source /apt.sh && dk_prepare" && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /build

ADD docker/mingw/prepare.sh /

RUN /bin/bash -c "source /prepare.sh && dk_download"

ADD docker/mingw/deps.sh /
Expand Down
31 changes: 31 additions & 0 deletions docker/mingw/apt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Functions for building MinGW port in Docker
#
# This file is part of the shadowsocks-libev.
#
# shadowsocks-libev is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# shadowsocks-libev is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with shadowsocks-libev; see the file COPYING. If not, see
# <http://www.gnu.org/licenses/>.
#

# Exit on error
set -e

# Build steps

dk_prepare() {
apt-get update -y
apt-get install --no-install-recommends -y \
mingw-w64 aria2 git make automake autoconf libtool ca-certificates
}
1 change: 1 addition & 0 deletions docker/mingw/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ build_proj() {
--with-pcre="$dep" \
--with-cares="$dep" \
CFLAGS="-DCARES_STATICLIB -DPCRE_STATIC"

make clean
make -j$cpu LDFLAGS="-all-static -L${dep}/lib"
make install
Expand Down
1 change: 1 addition & 0 deletions docker/mingw/deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ build_deps() {

# sodium
cd "$SRC/$SODIUM_SRC"
./autogen.sh
./configure $args
make clean
make -j$cpu install
Expand Down
12 changes: 3 additions & 9 deletions docker/mingw/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ MBEDTLS_SRC=mbedtls-${MBEDTLS_VER}
MBEDTLS_URL=https://tls.mbed.org/download/mbedtls-${MBEDTLS_VER}-apache.tgz

## Sodium
SODIUM_VER=1.0.16
SODIUM_SRC=libsodium-${SODIUM_VER}
SODIUM_URL=https://download.libsodium.org/libsodium/releases/${SODIUM_SRC}.tar.gz
SODIUM_VER=1.0.18
SODIUM_SRC=libsodium-${SODIUM_VER}-RELEASE
SODIUM_URL=https://github.com/jedisct1/libsodium/archive/${SODIUM_VER}-RELEASE.tar.gz

## PCRE
PCRE_VER=8.41
Expand All @@ -64,12 +64,6 @@ CARES_URL=https://c-ares.haxx.se/download/${CARES_SRC}.tar.gz

# Build steps

dk_prepare() {
apt-get update -y
apt-get install --no-install-recommends -y \
mingw-w64 aria2 git make automake autoconf libtool ca-certificates
}

dk_download() {
mkdir -p "${SRC}"
cd "${SRC}"
Expand Down

0 comments on commit 74daa50

Please sign in to comment.