Dockerfile 3.4 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=201711201530
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=i686-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
RUN cd /build && \
21
    \
22 23 24
    GCC_VERSION=6.4.0 \
    MPFR_VERSION=3.1.6 \
    BINUTILS_VERSION=2.27 \
25 26 27
    GMP_VERSION=6.1.1 \
    MPC_VERSION=1.0.3 && \
    \
28 29 30
    mkdir $TOOLCHAIN_PREFIX && \
    mkdir $MINGW_PREFIX && \
    ln -s $MINGW_PREFIX $TOOLCHAIN_PREFIX/mingw && \
31
    wget -q http://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VERSION.tar.bz2 && \
32
    wget -q ftp://ftp.uvsq.fr/pub/gcc/releases/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.xz && \
33 34 35
    git config --global user.name "VideoLAN Buildbot" && \
    git config --global user.email buildbot@videolan.org && \
    git clone --depth=1 git://git.code.sf.net/p/mingw-w64/mingw-w64 && \
36
    tar xf gcc-$GCC_VERSION.tar.xz && \
37
    tar xf binutils-$BINUTILS_VERSION.tar.bz2 && \
38
    cd binutils-$BINUTILS_VERSION && mkdir build && cd build && \
39 40
    ../configure --prefix=$TOOLCHAIN_PREFIX --target=$TARGET_TUPLE \
                    --disable-werror --disable-multilib && make -j4 && make install && \
41
    cd /build/mingw-w64 && git am /build/patches/*.patch && \
42 43 44 45
    cd /build/mingw-w64/mingw-w64-headers && mkdir build && cd build && \
    ../configure --prefix=$MINGW_PREFIX \
                    --host=$TARGET_TUPLE && make install && \
    cd /build && \
46 47 48 49 50 51 52 53 54
    wget -q http://www.mpfr.org/mpfr-current/mpfr-$MPFR_VERSION.tar.gz && \
    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 && \
55
    cd gcc-$GCC_VERSION && mkdir build && cd build && \
56 57 58
    ../configure --prefix=$TOOLCHAIN_PREFIX \
                    --target=$TARGET_TUPLE \
                    --enable-languages=c,c++ \
59
                    --enable-lto \
60 61 62 63 64 65 66 67 68 69
                    --disable-shared \
                    --disable-multilib && \
                    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 && \
70
    cd /build/gcc-$GCC_VERSION/build && \
71 72 73 74 75 76 77 78 79 80 81 82 83
    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 && \
84
    cd / && rm -rf /build