Browse Source

Fix #2565 #2566

pull/2577/head
Max Lv 5 years ago
parent
commit
74daa50e59
5 changed files with 41 additions and 12 deletions
  1. 8
      docker/mingw/Dockerfile
  2. 31
      docker/mingw/apt.sh
  3. 1
      docker/mingw/build.sh
  4. 1
      docker/mingw/deps.sh
  5. 12
      docker/mingw/prepare.sh

8
docker/mingw/Dockerfile

@ -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 /

31
docker/mingw/apt.sh

@ -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
docker/mingw/build.sh

@ -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

1
docker/mingw/deps.sh

@ -53,6 +53,7 @@ build_deps() {
# sodium
cd "$SRC/$SODIUM_SRC"
./autogen.sh
./configure $args
make clean
make -j$cpu install

12
docker/mingw/prepare.sh

@ -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
@ -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}"

Loading…
Cancel
Save