2014-10-19 07:45:18 +00:00
|
|
|
# Dockerfile to build aria2 Windows binary using ubuntu mingw-w64
|
|
|
|
# cross compiler chain.
|
|
|
|
#
|
|
|
|
# $ sudo docker build -t aria2-mingw - < Dockerfile.mingw
|
|
|
|
#
|
|
|
|
# After successful build, windows binary is located at
|
2015-12-02 14:03:01 +00:00
|
|
|
# /aria2/src/aria2c.exe. You can copy the binary using following
|
|
|
|
# commands:
|
2014-10-19 07:45:18 +00:00
|
|
|
#
|
2016-01-29 11:54:43 +00:00
|
|
|
# $ id=$(sudo docker create aria2-mingw)
|
2015-12-02 14:03:01 +00:00
|
|
|
# $ sudo docker cp $id:/aria2/src/aria2c.exe <dest>
|
|
|
|
# $ sudo docker rm -v $id
|
2014-10-19 07:45:18 +00:00
|
|
|
|
2021-08-12 12:51:23 +00:00
|
|
|
FROM ubuntu:20.04
|
2014-10-19 07:45:18 +00:00
|
|
|
|
|
|
|
MAINTAINER Tatsuhiro Tsujikawa
|
|
|
|
|
|
|
|
# Change HOST to x86_64-w64-mingw32 to build 64-bit binary
|
|
|
|
ENV HOST i686-w64-mingw32
|
|
|
|
|
|
|
|
# It would be better to use nearest ubuntu archive mirror for faster
|
|
|
|
# downloads.
|
|
|
|
# RUN sed -ie 's/archive\.ubuntu/jp.archive.ubuntu/g' /etc/apt/sources.list
|
|
|
|
|
2016-04-18 14:43:04 +00:00
|
|
|
RUN apt-get update && \
|
2021-08-12 12:51:23 +00:00
|
|
|
DEBIAN_FRONTEND="noninteractive" \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2016-04-18 14:43:04 +00:00
|
|
|
make binutils autoconf automake autotools-dev libtool \
|
2021-08-12 12:51:23 +00:00
|
|
|
patch ca-certificates \
|
2019-09-15 08:48:33 +00:00
|
|
|
pkg-config git curl dpkg-dev gcc-mingw-w64 g++-mingw-w64 \
|
2021-08-12 12:51:23 +00:00
|
|
|
autopoint libcppunit-dev libxml2-dev libgcrypt20-dev lzip
|
2014-10-19 07:45:18 +00:00
|
|
|
|
2021-08-12 12:51:23 +00:00
|
|
|
RUN curl -L -O https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz && \
|
|
|
|
curl -L -O https://github.com/libexpat/libexpat/releases/download/R_2_4_1/expat-2.4.1.tar.bz2 && \
|
|
|
|
curl -L -O https://www.sqlite.org/2021/sqlite-autoconf-3360000.tar.gz && \
|
2017-01-16 12:30:20 +00:00
|
|
|
curl -L -O http://zlib.net/zlib-1.2.11.tar.gz && \
|
2021-08-12 12:51:23 +00:00
|
|
|
curl -L -O https://c-ares.haxx.se/download/c-ares-1.17.2.tar.gz && \
|
|
|
|
curl -L -O https://www.libssh2.org/download/libssh2-1.9.0.tar.gz && \
|
|
|
|
curl -L -O https://github.com/libssh2/libssh2/commit/ba149e804ef653cc05ed9803dfc94519ce9328f7.patch
|
2014-10-19 07:45:18 +00:00
|
|
|
|
2021-08-12 12:51:23 +00:00
|
|
|
RUN tar xf gmp-6.2.1.tar.lz && \
|
|
|
|
cd gmp-6.2.1 && \
|
2014-10-19 07:45:18 +00:00
|
|
|
./configure \
|
2016-04-18 14:43:04 +00:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--disable-cxx \
|
|
|
|
--enable-fat \
|
|
|
|
CFLAGS="-mtune=generic -O2 -g0" && \
|
2014-10-19 07:45:18 +00:00
|
|
|
make install
|
|
|
|
|
2021-08-12 12:51:23 +00:00
|
|
|
RUN tar xf expat-2.4.1.tar.bz2 && \
|
|
|
|
cd expat-2.4.1 && \
|
2014-10-19 07:45:18 +00:00
|
|
|
./configure \
|
2016-04-18 14:43:04 +00:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
|
2014-10-19 07:45:18 +00:00
|
|
|
make install
|
|
|
|
|
2021-08-12 12:51:23 +00:00
|
|
|
RUN tar xf sqlite-autoconf-3360000.tar.gz && \
|
|
|
|
cd sqlite-autoconf-3360000 && \
|
2014-10-19 07:45:18 +00:00
|
|
|
./configure \
|
2016-04-18 14:43:04 +00:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
|
2014-10-19 07:45:18 +00:00
|
|
|
make install
|
|
|
|
|
2017-01-16 12:30:20 +00:00
|
|
|
RUN tar xf zlib-1.2.11.tar.gz && \
|
|
|
|
cd zlib-1.2.11 && \
|
2014-10-19 07:45:18 +00:00
|
|
|
CC=$HOST-gcc \
|
|
|
|
AR=$HOST-ar \
|
|
|
|
LD=$HOST-ld \
|
|
|
|
RANLIB=$HOST-ranlib \
|
|
|
|
STRIP=$HOST-strip \
|
|
|
|
./configure \
|
2016-04-18 14:43:04 +00:00
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--libdir=/usr/local/$HOST/lib \
|
|
|
|
--includedir=/usr/local/$HOST/include \
|
|
|
|
--static && \
|
2014-10-19 07:45:18 +00:00
|
|
|
make install
|
|
|
|
|
2021-08-12 12:51:23 +00:00
|
|
|
RUN tar xf c-ares-1.17.2.tar.gz && \
|
|
|
|
cd c-ares-1.17.2 && \
|
2014-10-19 07:45:18 +00:00
|
|
|
./configure \
|
2016-04-18 14:43:04 +00:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--without-random \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
|
|
|
|
LIBS="-lws2_32" && \
|
2014-10-19 07:45:18 +00:00
|
|
|
make install
|
|
|
|
|
2019-09-15 08:48:33 +00:00
|
|
|
RUN tar xf libssh2-1.9.0.tar.gz && \
|
|
|
|
cd libssh2-1.9.0 && \
|
2021-08-12 12:51:23 +00:00
|
|
|
patch -p1 < ../ba149e804ef653cc05ed9803dfc94519ce9328f7.patch && \
|
2015-05-20 14:55:34 +00:00
|
|
|
./configure \
|
2016-04-18 14:43:04 +00:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
|
|
|
|
--without-openssl \
|
|
|
|
--with-wincng \
|
|
|
|
LIBS="-lws2_32" && \
|
2015-05-20 14:55:34 +00:00
|
|
|
make install
|
2017-07-26 03:16:48 +00:00
|
|
|
ADD https://api.github.com/repos/aria2/aria2/git/refs/heads/master version.json
|
2016-04-18 14:43:04 +00:00
|
|
|
RUN git clone https://github.com/aria2/aria2 && \
|
|
|
|
cd aria2 && autoreconf -i && ./mingw-config && make && \
|
2014-10-19 07:45:18 +00:00
|
|
|
$HOST-strip src/aria2c.exe
|