Dockerfile 3.58 KB
Newer Older
1
FROM registry.videolan.org:5000/videolan-base-stretch:latest
2 3 4

MAINTAINER Hugo Beauzée-Luyssen <hugo@beauzee.fr>

5
ENV IMAGE_DATE=201803151150
6

7 8
RUN apt-get update -qq && apt-get install -qqy \
    git wget bzip2 file libwine-dev unzip libtool pkg-config cmake \
9 10
    build-essential automake texinfo ragel yasm p7zip-full autopoint \
    gettext flex bison && \
11 12 13 14 15 16 17
    apt-get clean -y && rm -rf /var/lib/apt/lists/*

ENV TARGET_TUPLE=x86_64-w64-mingw32
ENV TOOLCHAIN_PREFIX=/opt/gcc-$TARGET_TUPLE
ENV MINGW_PREFIX=$TOOLCHAIN_PREFIX/$TARGET_TUPLE
ENV PATH=$TOOLCHAIN_PREFIX/bin:$PATH

18
COPY patches /build/patches
19

20 21
RUN set -x && \
    cd /build && \
22
    \
23 24 25
    GCC_VERSION=6.4.0 \
    MPFR_VERSION=3.1.6 \
    BINUTILS_VERSION=2.27 \
26 27 28
    GMP_VERSION=6.1.1 \
    MPC_VERSION=1.0.3 && \
    \
29 30 31
    mkdir $TOOLCHAIN_PREFIX && \
    mkdir $MINGW_PREFIX && \
    ln -s $MINGW_PREFIX $TOOLCHAIN_PREFIX/mingw && \
32
    wget -q http://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.bz2 && \
33
    wget -q ftp://ftp.uvsq.fr/pub/gcc/releases/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz && \
34 35
    git config --global user.name "VideoLAN Buildbot" && \
    git config --global user.email buildbot@videolan.org && \
36
    git clone --depth=1 git://git.code.sf.net/p/mingw-w64/mingw-w64 && \
37
    tar xf gcc-$GCC_VERSION.tar.xz && \
38
    tar xf binutils-$BINUTILS_VERSION.tar.bz2 && \
39
    cd binutils-$BINUTILS_VERSION && mkdir build && cd build && \
40 41
    ../configure --prefix=$TOOLCHAIN_PREFIX --target=$TARGET_TUPLE \
                    --disable-werror --disable-multilib && make -j4 && make install && \
42
    cd /build/mingw-w64 && git am /build/patches/*.patch && \
43 44 45 46
    cd /build/mingw-w64/mingw-w64-headers && mkdir build && cd build && \
    ../configure --prefix=$MINGW_PREFIX \
                    --host=$TARGET_TUPLE && make install && \
    cd /build && \
47
    wget -q https://ftp.gnu.org/gnu/mpfr/mpfr-$MPFR_VERSION.tar.gz && \
48 49 50 51 52 53 54 55
    wget -q https://gmplib.org/download/gmp/gmp-$GMP_VERSION.tar.xz && \
    wget -q ftp://ftp.gnu.org/gnu/mpc/mpc-$MPC_VERSION.tar.gz && \
    tar xf mpfr-$MPFR_VERSION.tar.gz && \
    tar xf gmp-$GMP_VERSION.tar.xz && \
    tar xf mpc-$MPC_VERSION.tar.gz && \
    ln -s /build/mpfr-$MPFR_VERSION gcc-$GCC_VERSION/mpfr && \
    ln -s /build/gmp-$GMP_VERSION gcc-$GCC_VERSION/gmp && \
    ln -s /build/mpc-$MPC_VERSION gcc-$GCC_VERSION/mpc && \
56 57
    sed -i '79i#define _GLIBCXX_USE_WEAK_REF 0' \
        gcc-$GCC_VERSION/libstdc++-v3/config/os/mingw32-w64/os_defines.h && \
58
    cd gcc-$GCC_VERSION && mkdir build && cd build && \
59 60 61
    ../configure --prefix=$TOOLCHAIN_PREFIX \
                    --target=$TARGET_TUPLE \
                    --enable-languages=c,c++ \
62
                    --enable-lto \
63
                    --disable-shared \
64 65
                    --disable-multilib \
                    --enable-sjlj-exceptions && \
66 67 68 69 70 71 72 73
                    make -j4 all-gcc && \
                    make install-gcc && \
    cd /build/mingw-w64/mingw-w64-crt && \
    mkdir build && cd build && \
    ../configure --prefix=$MINGW_PREFIX \
                    --host=$TARGET_TUPLE && \
    make -j4 && \
    make install && \
74
    cd /build/gcc-$GCC_VERSION/build && \
75 76 77 78 79 80 81 82 83 84 85 86 87
    make -j4 && \
    make install && \
    cd /build/mingw-w64/mingw-w64-libraries/winstorecompat && \
    autoreconf -vif && \
    mkdir build && cd build && \
    ../configure --prefix=$MINGW_PREFIX \
        --host=$TARGET_TUPLE && \
    make -j4 && make install && \
    cd /build/mingw-w64/mingw-w64-tools/widl && \
    mkdir build && cd build && \
    ../configure --prefix=$TOOLCHAIN_PREFIX --target=$TARGET_TUPLE && \
    make -j4 && \
    make install && \
88
    cd / && rm -rf /build