2014-10-19 15:45:18 +08: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 22:03:01 +08:00
|
|
|
# /aria2/src/aria2c.exe. You can copy the binary using following
|
|
|
|
# commands:
|
2014-10-19 15:45:18 +08:00
|
|
|
#
|
2023-09-17 20:28:42 +08:00
|
|
|
# $ sudo docker run --rm -it -v /path/to/dest:/out aria2-mingw cp /aria2/src/aria2c.exe /out
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2023-09-15 20:44:49 +08:00
|
|
|
FROM ubuntu:22.04
|
2014-10-19 15:45:18 +08:00
|
|
|
|
|
|
|
MAINTAINER Tatsuhiro Tsujikawa
|
|
|
|
|
|
|
|
# Change HOST to x86_64-w64-mingw32 to build 64-bit binary
|
2023-09-16 17:30:17 +08:00
|
|
|
ARG HOST=i686-w64-mingw32
|
2014-10-19 15:45:18 +08:00
|
|
|
|
|
|
|
# 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 22:43:04 +08:00
|
|
|
RUN apt-get update && \
|
2021-08-12 20:51:23 +08:00
|
|
|
DEBIAN_FRONTEND="noninteractive" \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2016-04-18 22:43:04 +08:00
|
|
|
make binutils autoconf automake autotools-dev libtool \
|
2021-08-12 20:51:23 +08:00
|
|
|
patch ca-certificates \
|
2019-09-15 16:48:33 +08:00
|
|
|
pkg-config git curl dpkg-dev gcc-mingw-w64 g++-mingw-w64 \
|
2023-11-15 20:08:57 +08:00
|
|
|
autopoint libcppunit-dev libxml2-dev libgcrypt20-dev lzip \
|
|
|
|
python3-docutils
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2023-09-15 20:44:49 +08:00
|
|
|
RUN curl -L -O https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz && \
|
|
|
|
curl -L -O https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.bz2 && \
|
|
|
|
curl -L -O https://www.sqlite.org/2023/sqlite-autoconf-3430100.tar.gz && \
|
2024-01-24 18:41:05 +08:00
|
|
|
curl -L -O https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz && \
|
2024-06-10 16:45:55 +08:00
|
|
|
curl -L -O https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz && \
|
2023-09-15 20:44:49 +08:00
|
|
|
curl -L -O https://libssh2.org/download/libssh2-1.11.0.tar.bz2
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2023-09-15 20:44:49 +08:00
|
|
|
RUN tar xf gmp-6.3.0.tar.xz && \
|
|
|
|
cd gmp-6.3.0 && \
|
2014-10-19 15:45:18 +08:00
|
|
|
./configure \
|
2016-04-18 22:43:04 +08:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--disable-cxx \
|
|
|
|
--enable-fat \
|
|
|
|
CFLAGS="-mtune=generic -O2 -g0" && \
|
2023-09-17 18:52:59 +08:00
|
|
|
make -j$(nproc) install
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2023-09-15 20:44:49 +08:00
|
|
|
RUN tar xf expat-2.5.0.tar.bz2 && \
|
|
|
|
cd expat-2.5.0 && \
|
2014-10-19 15:45:18 +08:00
|
|
|
./configure \
|
2016-04-18 22:43:04 +08:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
|
2023-09-17 18:52:59 +08:00
|
|
|
make -j$(nproc) install
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2023-09-15 20:44:49 +08:00
|
|
|
RUN tar xf sqlite-autoconf-3430100.tar.gz && \
|
|
|
|
cd sqlite-autoconf-3430100 && \
|
2014-10-19 15:45:18 +08:00
|
|
|
./configure \
|
2016-04-18 22:43:04 +08:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
|
2023-09-17 18:52:59 +08:00
|
|
|
make -j$(nproc) install
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2024-01-24 18:41:05 +08:00
|
|
|
RUN tar xf zlib-1.3.1.tar.gz && \
|
|
|
|
cd zlib-1.3.1 && \
|
2014-10-19 15:45:18 +08:00
|
|
|
CC=$HOST-gcc \
|
|
|
|
AR=$HOST-ar \
|
|
|
|
LD=$HOST-ld \
|
|
|
|
RANLIB=$HOST-ranlib \
|
|
|
|
STRIP=$HOST-strip \
|
|
|
|
./configure \
|
2016-04-18 22:43:04 +08:00
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--libdir=/usr/local/$HOST/lib \
|
|
|
|
--includedir=/usr/local/$HOST/include \
|
|
|
|
--static && \
|
2023-09-17 18:52:59 +08:00
|
|
|
make -j$(nproc) install
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2023-11-14 22:10:43 +08:00
|
|
|
RUN tar xf c-ares-1.19.1.tar.gz && \
|
|
|
|
cd c-ares-1.19.1 && \
|
2014-10-19 15:45:18 +08:00
|
|
|
./configure \
|
2016-04-18 22:43:04 +08:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--without-random \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
|
|
|
|
LIBS="-lws2_32" && \
|
2023-09-17 18:52:59 +08:00
|
|
|
make -j$(nproc) install
|
2014-10-19 15:45:18 +08:00
|
|
|
|
2023-09-15 20:44:49 +08:00
|
|
|
RUN tar xf libssh2-1.11.0.tar.bz2 && \
|
|
|
|
cd libssh2-1.11.0 && \
|
2015-05-20 22:55:34 +08:00
|
|
|
./configure \
|
2016-04-18 22:43:04 +08:00
|
|
|
--disable-shared \
|
|
|
|
--enable-static \
|
|
|
|
--prefix=/usr/local/$HOST \
|
|
|
|
--host=$HOST \
|
|
|
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
|
|
|
|
LIBS="-lws2_32" && \
|
2023-09-17 18:52:59 +08:00
|
|
|
make -j$(nproc) install
|
2023-09-16 17:30:17 +08:00
|
|
|
|
|
|
|
ARG ARIA2_VERSION=master
|
|
|
|
ARG ARIA2_REF=refs/heads/master
|
|
|
|
|
|
|
|
ADD https://api.github.com/repos/aria2/aria2/git/$ARIA2_REF version.json
|
|
|
|
RUN git clone -b $ARIA2_VERSION --depth 1 https://github.com/aria2/aria2 && \
|
2023-09-17 18:52:59 +08:00
|
|
|
cd aria2 && autoreconf -i && ./mingw-config && make -j$(nproc) && \
|
2014-10-19 15:45:18 +08:00
|
|
|
$HOST-strip src/aria2c.exe
|