Dockerfile.mingw 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # Dockerfile to build aria2 Windows binary using ubuntu mingw-w64
  2. # cross compiler chain.
  3. #
  4. # $ sudo docker build -t aria2-mingw - < Dockerfile.mingw
  5. #
  6. # After successful build, windows binary is located at
  7. # /aria2/src/aria2c.exe. You can copy the binary using following
  8. # commands:
  9. #
  10. # $ sudo id=$(docker create aria2-mingw)
  11. # $ sudo docker cp $id:/aria2/src/aria2c.exe <dest>
  12. # $ sudo docker rm -v $id
  13. FROM ubuntu
  14. MAINTAINER Tatsuhiro Tsujikawa
  15. # Change HOST to x86_64-w64-mingw32 to build 64-bit binary
  16. ENV HOST i686-w64-mingw32
  17. # It would be better to use nearest ubuntu archive mirror for faster
  18. # downloads.
  19. # RUN sed -ie 's/archive\.ubuntu/jp.archive.ubuntu/g' /etc/apt/sources.list
  20. RUN apt-get update
  21. RUN apt-get install -y make binutils autoconf automake autotools-dev libtool \
  22. pkg-config git curl dpkg-dev gcc-mingw-w64 \
  23. autopoint libcppunit-dev libxml2-dev libgcrypt11-dev lzip
  24. RUN curl -L -O https://gmplib.org/download/gmp/gmp-6.0.0a.tar.lz
  25. RUN curl -L -O http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz
  26. RUN curl -L -O http://www.sqlite.org/2015/sqlite-autoconf-3080803.tar.gz
  27. RUN curl -L -O http://zlib.net/zlib-1.2.8.tar.xz
  28. RUN curl -L -O http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz
  29. RUN curl -L -O http://libssh2.org/download/libssh2-1.5.0.tar.gz
  30. RUN tar xf gmp-6.0.0a.tar.lz
  31. RUN cd gmp-6.0.0 && \
  32. ./configure \
  33. --disable-shared \
  34. --enable-static \
  35. --prefix=/usr/local/$HOST \
  36. --host=$HOST \
  37. --disable-cxx \
  38. --enable-fat \
  39. CFLAGS="-mtune=generic -O2 -g0" && \
  40. make install
  41. RUN tar xf expat-2.1.0.tar.gz
  42. RUN cd expat-2.1.0 && \
  43. ./configure \
  44. --disable-shared \
  45. --enable-static \
  46. --prefix=/usr/local/$HOST \
  47. --host=$HOST \
  48. --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
  49. make install
  50. RUN tar xf sqlite-autoconf-3080803.tar.gz
  51. RUN cd sqlite-autoconf-3080803 && \
  52. ./configure \
  53. --disable-shared \
  54. --enable-static \
  55. --prefix=/usr/local/$HOST \
  56. --host=$HOST \
  57. --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
  58. make install
  59. RUN tar xf zlib-1.2.8.tar.xz
  60. RUN cd zlib-1.2.8 && \
  61. CC=$HOST-gcc \
  62. AR=$HOST-ar \
  63. LD=$HOST-ld \
  64. RANLIB=$HOST-ranlib \
  65. STRIP=$HOST-strip \
  66. ./configure \
  67. --prefix=/usr/local/$HOST \
  68. --libdir=/usr/local/$HOST/lib \
  69. --includedir=/usr/local/$HOST/include \
  70. --static && \
  71. make install
  72. RUN tar xf c-ares-1.10.0.tar.gz
  73. RUN cd c-ares-1.10.0 && \
  74. ./configure \
  75. --disable-shared \
  76. --enable-static \
  77. --without-random \
  78. --prefix=/usr/local/$HOST \
  79. --host=$HOST \
  80. --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
  81. LIBS="-lws2_32" && \
  82. make install
  83. RUN tar xf libssh2-1.5.0.tar.gz
  84. RUN cd libssh2-1.5.0 && \
  85. ./configure \
  86. --disable-shared \
  87. --enable-static \
  88. --prefix=/usr/local/$HOST \
  89. --host=$HOST \
  90. --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
  91. --without-openssl \
  92. --with-wincng \
  93. LIBS="-lws2_32" && \
  94. make install
  95. RUN git clone https://github.com/tatsuhiro-t/aria2
  96. RUN cd aria2 && autoreconf -i && ./mingw-config && make && \
  97. $HOST-strip src/aria2c.exe