mirror of https://github.com/aria2/aria2
Merge 478d5c4c01
into b519ce04e3
commit
f15244f624
|
@ -1,8 +1,30 @@
|
||||||
name: build
|
name: build
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-windows:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
host: [i686-w64-mingw32, x86_64-w64-mingw32]
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build aria2
|
||||||
|
run: |
|
||||||
|
docker build --build-arg HOST=${{ matrix.host }} -t aria2-mingw -f ./Dockerfile.mingw .
|
||||||
|
docker run --rm -v .:/out aria2-mingw cp /aria2/src/aria2c.exe /out
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
|
uses: actions/upload-artifact@v4.3.1
|
||||||
|
with:
|
||||||
|
name: aria2-${{ matrix.host }}
|
||||||
|
path: ./aria2c.exe
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -100,3 +122,10 @@ jobs:
|
||||||
- name: Build aria2
|
- name: Build aria2
|
||||||
run: |
|
run: |
|
||||||
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" check
|
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" check
|
||||||
|
strip ./src/aria2c
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
|
uses: actions/upload-artifact@v4.3.1
|
||||||
|
with:
|
||||||
|
name: aria2-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.crypto }}-${{ matrix.bittorrent }}
|
||||||
|
path: ./src/aria2c
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
# Dockerfile to build aria2 Windows binary using ubuntu mingw-w64
|
# Dockerfile to build aria2 Windows binary using ubuntu mingw-w64
|
||||||
# cross compiler chain.
|
# cross compiler chain.
|
||||||
#
|
#
|
||||||
# $ sudo docker build -t aria2-mingw - < Dockerfile.mingw
|
# $ sudo docker build -t aria2-mingw -f Dockerfile.mingw .
|
||||||
|
# Be aware that there's a dot at the end of the command ↑
|
||||||
#
|
#
|
||||||
# After successful build, windows binary is located at
|
# After successful build, windows binary is located at
|
||||||
# /aria2/src/aria2c.exe. You can copy the binary using following
|
# /aria2/src/aria2c.exe. You can copy the binary using following
|
||||||
|
@ -25,15 +26,15 @@ RUN apt-get update && \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
make binutils autoconf automake autotools-dev libtool \
|
make binutils autoconf automake autotools-dev libtool \
|
||||||
patch ca-certificates \
|
patch ca-certificates \
|
||||||
pkg-config git curl dpkg-dev gcc-mingw-w64 g++-mingw-w64 \
|
pkg-config git curl dpkg-dev mingw-w64 \
|
||||||
autopoint libcppunit-dev libxml2-dev libgcrypt20-dev lzip \
|
autopoint libcppunit-dev libxml2-dev libgcrypt20-dev lzip \
|
||||||
python3-docutils
|
python3-docutils
|
||||||
|
|
||||||
RUN curl -L -O https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz && \
|
RUN curl -L -O https://ftp.gnu.org/gnu/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://github.com/libexpat/libexpat/releases/download/R_2_6_0/expat-2.6.0.tar.bz2 && \
|
||||||
curl -L -O https://www.sqlite.org/2023/sqlite-autoconf-3430100.tar.gz && \
|
curl -L -O https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz && \
|
||||||
curl -L -O https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz && \
|
curl -L -O https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz && \
|
||||||
curl -L -O https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz && \
|
curl -L -O https://github.com/c-ares/c-ares/releases/download/v1.30.0/c-ares-1.30.0.tar.gz && \
|
||||||
curl -L -O https://libssh2.org/download/libssh2-1.11.0.tar.bz2
|
curl -L -O https://libssh2.org/download/libssh2-1.11.0.tar.bz2
|
||||||
|
|
||||||
RUN tar xf gmp-6.3.0.tar.xz && \
|
RUN tar xf gmp-6.3.0.tar.xz && \
|
||||||
|
@ -48,8 +49,8 @@ RUN tar xf gmp-6.3.0.tar.xz && \
|
||||||
CFLAGS="-mtune=generic -O2 -g0" && \
|
CFLAGS="-mtune=generic -O2 -g0" && \
|
||||||
make -j$(nproc) install
|
make -j$(nproc) install
|
||||||
|
|
||||||
RUN tar xf expat-2.5.0.tar.bz2 && \
|
RUN tar xf expat-2.6.0.tar.bz2 && \
|
||||||
cd expat-2.5.0 && \
|
cd expat-2.6.0 && \
|
||||||
./configure \
|
./configure \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
|
@ -58,8 +59,8 @@ RUN tar xf expat-2.5.0.tar.bz2 && \
|
||||||
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
|
||||||
make -j$(nproc) install
|
make -j$(nproc) install
|
||||||
|
|
||||||
RUN tar xf sqlite-autoconf-3430100.tar.gz && \
|
RUN tar xf sqlite-autoconf-3450100.tar.gz && \
|
||||||
cd sqlite-autoconf-3430100 && \
|
cd sqlite-autoconf-3450100 && \
|
||||||
./configure \
|
./configure \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
|
@ -82,8 +83,8 @@ RUN tar xf zlib-1.3.1.tar.gz && \
|
||||||
--static && \
|
--static && \
|
||||||
make -j$(nproc) install
|
make -j$(nproc) install
|
||||||
|
|
||||||
RUN tar xf c-ares-1.19.1.tar.gz && \
|
RUN tar xf c-ares-1.30.0.tar.gz && \
|
||||||
cd c-ares-1.19.1 && \
|
cd c-ares-1.30.0 && \
|
||||||
./configure \
|
./configure \
|
||||||
--disable-shared \
|
--disable-shared \
|
||||||
--enable-static \
|
--enable-static \
|
||||||
|
@ -105,10 +106,7 @@ RUN tar xf libssh2-1.11.0.tar.bz2 && \
|
||||||
LIBS="-lws2_32" && \
|
LIBS="-lws2_32" && \
|
||||||
make -j$(nproc) install
|
make -j$(nproc) install
|
||||||
|
|
||||||
ARG ARIA2_VERSION=master
|
COPY . /aria2
|
||||||
ARG ARIA2_REF=refs/heads/master
|
|
||||||
|
|
||||||
ADD https://api.github.com/repos/aria2/aria2/git/$ARIA2_REF version.json
|
RUN cd aria2 && autoreconf -i && ./mingw-config && make -j$(nproc) && \
|
||||||
RUN git clone -b $ARIA2_VERSION --depth 1 https://github.com/aria2/aria2 && \
|
|
||||||
cd aria2 && autoreconf -i && ./mingw-config && make -j$(nproc) && \
|
|
||||||
$HOST-strip src/aria2c.exe
|
$HOST-strip src/aria2c.exe
|
||||||
|
|
|
@ -76,7 +76,7 @@ test -z "$PREFIX" && PREFIX=/usr/local/$HOST
|
||||||
--without-libnettle \
|
--without-libnettle \
|
||||||
--with-cppunit-prefix=$PREFIX \
|
--with-cppunit-prefix=$PREFIX \
|
||||||
ARIA2_STATIC=yes \
|
ARIA2_STATIC=yes \
|
||||||
CPPFLAGS="-I$PREFIX/include" \
|
CPPFLAGS="-I$PREFIX/include -DCARES_STATICLIB" \
|
||||||
LDFLAGS="-L$PREFIX/lib" \
|
LDFLAGS="-L$PREFIX/lib" \
|
||||||
PKG_CONFIG="/usr/bin/pkg-config" \
|
PKG_CONFIG="/usr/bin/pkg-config" \
|
||||||
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
|
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
|
||||||
|
|
|
@ -438,7 +438,7 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
|
||||||
{
|
{
|
||||||
OptionHandler* op(new NumberOptionHandler(PREF_MAX_CONNECTION_PER_SERVER,
|
OptionHandler* op(new NumberOptionHandler(PREF_MAX_CONNECTION_PER_SERVER,
|
||||||
TEXT_MAX_CONNECTION_PER_SERVER,
|
TEXT_MAX_CONNECTION_PER_SERVER,
|
||||||
"1", 1, 16, 'x'));
|
"16", 1, -1, 'x'));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
|
@ -499,7 +499,7 @@ std::vector<OptionHandler*> OptionHandlerFactory::createOptionHandlers()
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
OptionHandler* op(new UnitNumberOptionHandler(
|
OptionHandler* op(new UnitNumberOptionHandler(
|
||||||
PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, "20M", 1_m, 1_g, 'k'));
|
PREF_MIN_SPLIT_SIZE, TEXT_MIN_SPLIT_SIZE, "1M", 1_k, 1_g, 'k'));
|
||||||
op->addTag(TAG_BASIC);
|
op->addTag(TAG_BASIC);
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
|
|
Loading…
Reference in New Issue