From 067c81091cd693543dd2efaac522a3d09359025c Mon Sep 17 00:00:00 2001 From: miwu04 Date: Mon, 13 Apr 2026 01:12:47 +0800 Subject: [PATCH 1/3] ci: add more arch support --- .github/workflows/release.yml | 375 ++++++++++++++++++++++++++++++++++ 1 file changed, 375 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f9e99efa8..b771c48b22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -626,6 +626,378 @@ jobs: name: windows-x86_64 path: aria2-*-windows-x86_64.zip + # --------------------------------------------------------------------------- + # Linux ppc64le (cross-compiled on Ubuntu) + # --------------------------------------------------------------------------- + build-linux-ppc64le: + name: Linux ppc64le + runs-on: ubuntu-24.04 + env: + HOST: powerpc64le-linux-gnu + PREFIX: /usr/local/ppc64le-linux-gnu + steps: + - uses: actions/checkout@v4 + + - name: Install cross-compilation toolchain + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + make binutils autoconf automake autotools-dev autopoint libtool \ + patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ + gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu + + - name: Download dependencies + run: | + curl -L --retry 5 --connect-timeout 15 -O https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://www.sqlite.org/2023/sqlite-autoconf-3430100.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://github.com/openssl/openssl/releases/download/openssl-3.4.4/openssl-3.4.4.tar.gz + + - name: Build zlib + run: | + tar xf zlib-1.3.1.tar.gz && cd zlib-1.3.1 + CC=$HOST-gcc AR=$HOST-ar LD=$HOST-ld \ + RANLIB=$HOST-ranlib STRIP=$HOST-strip \ + ./configure \ + --prefix=$PREFIX \ + --libdir=$PREFIX/lib \ + --includedir=$PREFIX/include \ + --static + sudo make -j$(nproc) install + + - name: Build expat + run: | + tar xf expat-2.5.0.tar.bz2 && cd expat-2.5.0 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + sudo make -j$(nproc) install + + - name: Build sqlite3 + run: | + tar xf sqlite-autoconf-3430100.tar.gz && cd sqlite-autoconf-3430100 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + sudo make -j$(nproc) install + + - name: Build c-ares + run: | + tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 + ./configure \ + --disable-shared --enable-static --without-random \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + ac_cv_func_if_indextoname=no + sudo make -j$(nproc) install + + - name: Build OpenSSL + run: | + tar xf openssl-3.4.4.tar.gz && cd openssl-3.4.4 + ./Configure linux-ppc64le no-shared no-module no-tests \ + --cross-compile-prefix=$HOST- \ + --prefix=$PREFIX --libdir=lib \ + -O2 + make -j$(nproc) + sudo make install_sw + + - name: Build libssh2 + run: | + tar xf libssh2-1.11.0.tar.bz2 && cd libssh2-1.11.0 + ./configure \ + --disable-shared --enable-static \ + --disable-examples-build \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + --with-crypto=openssl --with-libssl-prefix=$PREFIX \ + CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + sudo make -j$(nproc) install + + - name: Build aria2 + run: | + autoreconf -i + ./configure \ + --host=$HOST --prefix=$PREFIX \ + --without-included-gettext --disable-nls \ + --with-libcares --without-gnutls --with-openssl \ + --with-sqlite3 --without-libxml2 --with-libexpat \ + --with-libz --with-libssh2 \ + --without-libgcrypt --without-libnettle \ + ARIA2_STATIC=yes \ + CPPFLAGS="-I$PREFIX/include" \ + LDFLAGS="-L$PREFIX/lib" \ + PKG_CONFIG="/usr/bin/pkg-config" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + make -j$(nproc) + $HOST-strip src/aria2c + + - name: Package + run: | + VERSION="${GITHUB_REF_NAME#v}" + DIRNAME="aria2-${VERSION}-linux-ppc64le" + mkdir -p "${DIRNAME}" + cp src/aria2c "${DIRNAME}/" + cp COPYING README.rst "${DIRNAME}/" + tar cJf "${DIRNAME}.tar.xz" "${DIRNAME}" + + - uses: actions/upload-artifact@v4 + with: + name: linux-ppc64le + path: aria2-*-linux-ppc64le.tar.xz + + # --------------------------------------------------------------------------- + # Linux riscv64 (cross-compiled on Ubuntu) + # --------------------------------------------------------------------------- + build-linux-riscv64: + name: Linux riscv64 + runs-on: ubuntu-24.04 + env: + HOST: riscv64-linux-gnu + PREFIX: /usr/local/riscv64-linux-gnu + steps: + - uses: actions/checkout@v4 + + - name: Install cross-compilation toolchain + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + make binutils autoconf automake autotools-dev autopoint libtool \ + patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ + gcc-riscv64-linux-gnu g++-riscv64-linux-gnu + + - name: Download dependencies + run: | + curl -L --retry 5 --connect-timeout 15 -O https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://www.sqlite.org/2023/sqlite-autoconf-3430100.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://github.com/openssl/openssl/releases/download/openssl-3.4.4/openssl-3.4.4.tar.gz + + - name: Build zlib + run: | + tar xf zlib-1.3.1.tar.gz && cd zlib-1.3.1 + CC=$HOST-gcc AR=$HOST-ar LD=$HOST-ld \ + RANLIB=$HOST-ranlib STRIP=$HOST-strip \ + ./configure \ + --prefix=$PREFIX \ + --libdir=$PREFIX/lib \ + --includedir=$PREFIX/include \ + --static + sudo make -j$(nproc) install + + - name: Build expat + run: | + tar xf expat-2.5.0.tar.bz2 && cd expat-2.5.0 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + sudo make -j$(nproc) install + + - name: Build sqlite3 + run: | + tar xf sqlite-autoconf-3430100.tar.gz && cd sqlite-autoconf-3430100 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + sudo make -j$(nproc) install + + - name: Build c-ares + run: | + tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 + ./configure \ + --disable-shared --enable-static --without-random \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + ac_cv_func_if_indextoname=no + sudo make -j$(nproc) install + + - name: Build OpenSSL + run: | + tar xf openssl-3.4.4.tar.gz && cd openssl-3.4.4 + ./Configure linux-riscv64 no-shared no-module no-tests \ + --cross-compile-prefix=$HOST- \ + --prefix=$PREFIX --libdir=lib \ + -O2 + make -j$(nproc) + sudo make install_sw + + - name: Build libssh2 + run: | + tar xf libssh2-1.11.0.tar.bz2 && cd libssh2-1.11.0 + ./configure \ + --disable-shared --enable-static \ + --disable-examples-build \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + --with-crypto=openssl --with-libssl-prefix=$PREFIX \ + CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + sudo make -j$(nproc) install + + - name: Build aria2 + run: | + autoreconf -i + ./configure \ + --host=$HOST --prefix=$PREFIX \ + --without-included-gettext --disable-nls \ + --with-libcares --without-gnutls --with-openssl \ + --with-sqlite3 --without-libxml2 --with-libexpat \ + --with-libz --with-libssh2 \ + --without-libgcrypt --without-libnettle \ + ARIA2_STATIC=yes \ + CPPFLAGS="-I$PREFIX/include" \ + LDFLAGS="-L$PREFIX/lib" \ + PKG_CONFIG="/usr/bin/pkg-config" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + make -j$(nproc) + $HOST-strip src/aria2c + + - name: Package + run: | + VERSION="${GITHUB_REF_NAME#v}" + DIRNAME="aria2-${VERSION}-linux-riscv64" + mkdir -p "${DIRNAME}" + cp src/aria2c "${DIRNAME}/" + cp COPYING README.rst "${DIRNAME}/" + tar cJf "${DIRNAME}.tar.xz" "${DIRNAME}" + + - uses: actions/upload-artifact@v4 + with: + name: linux-riscv64 + path: aria2-*-linux-riscv64.tar.xz + + # --------------------------------------------------------------------------- + # Linux loongarch64 (cross-compiled on Ubuntu) + # --------------------------------------------------------------------------- + build-linux-loongarch64: + name: Linux loongarch64 + runs-on: ubuntu-24.04 + env: + HOST: loongarch64-linux-gnu + PREFIX: /usr/local/loongarch64-linux-gnu + steps: + - uses: actions/checkout@v4 + + - name: Install cross-compilation toolchain + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + make binutils autoconf automake autotools-dev autopoint libtool \ + patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ + gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu + + - name: Download dependencies + run: | + curl -L --retry 5 --connect-timeout 15 -O https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://www.sqlite.org/2023/sqlite-autoconf-3430100.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://github.com/openssl/openssl/releases/download/openssl-3.4.4/openssl-3.4.4.tar.gz + + - name: Build zlib + run: | + tar xf zlib-1.3.1.tar.gz && cd zlib-1.3.1 + CC=$HOST-gcc AR=$HOST-ar LD=$HOST-ld \ + RANLIB=$HOST-ranlib STRIP=$HOST-strip \ + ./configure \ + --prefix=$PREFIX \ + --libdir=$PREFIX/lib \ + --includedir=$PREFIX/include \ + --static + sudo make -j$(nproc) install + + - name: Build expat + run: | + tar xf expat-2.5.0.tar.bz2 && cd expat-2.5.0 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + sudo make -j$(nproc) install + + - name: Build sqlite3 + run: | + tar xf sqlite-autoconf-3430100.tar.gz && cd sqlite-autoconf-3430100 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + sudo make -j$(nproc) install + + - name: Build c-ares + run: | + tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 + ./configure \ + --disable-shared --enable-static --without-random \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + ac_cv_func_if_indextoname=no + sudo make -j$(nproc) install + + - name: Build OpenSSL + run: | + tar xf openssl-3.4.4.tar.gz && cd openssl-3.4.4 + ./Configure linux-loongarch64 no-shared no-module no-tests \ + --cross-compile-prefix=$HOST- \ + --prefix=$PREFIX --libdir=lib \ + -O2 + make -j$(nproc) + sudo make install_sw + + - name: Build libssh2 + run: | + tar xf libssh2-1.11.0.tar.bz2 && cd libssh2-1.11.0 + ./configure \ + --disable-shared --enable-static \ + --disable-examples-build \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + --with-crypto=openssl --with-libssl-prefix=$PREFIX \ + CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + sudo make -j$(nproc) install + + - name: Build aria2 + run: | + autoreconf -i + ./configure \ + --host=$HOST --prefix=$PREFIX \ + --without-included-gettext --disable-nls \ + --with-libcares --without-gnutls --with-openssl \ + --with-sqlite3 --without-libxml2 --with-libexpat \ + --with-libz --with-libssh2 \ + --without-libgcrypt --without-libnettle \ + ARIA2_STATIC=yes \ + CPPFLAGS="-I$PREFIX/include" \ + LDFLAGS="-L$PREFIX/lib" \ + PKG_CONFIG="/usr/bin/pkg-config" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + make -j$(nproc) + $HOST-strip src/aria2c + + - name: Package + run: | + VERSION="${GITHUB_REF_NAME#v}" + DIRNAME="aria2-${VERSION}-linux-loongarch64" + mkdir -p "${DIRNAME}" + cp src/aria2c "${DIRNAME}/" + cp COPYING README.rst "${DIRNAME}/" + tar cJf "${DIRNAME}.tar.xz" "${DIRNAME}" + + - uses: actions/upload-artifact@v4 + with: + name: linux-loongarch64 + path: aria2-*-linux-loongarch64.tar.xz + # --------------------------------------------------------------------------- # Windows ARM64 (cross-compiled on Ubuntu with llvm-mingw) # --------------------------------------------------------------------------- @@ -785,6 +1157,9 @@ jobs: needs: - build-linux-x64 - build-linux-arm64 + - build-linux-ppc64le + - build-linux-riscv64 + - build-linux-loongarch64 - build-macos-arm64 - build-macos-intel - build-windows-x64 From 6228f1878abc73fa485c3269c43bed6224495f5c Mon Sep 17 00:00:00 2001 From: miwu04 Date: Mon, 13 Apr 2026 03:37:52 +0800 Subject: [PATCH 2/3] ci: migrate all Linux builds to debian:13 containers and use cross-compilation --- .github/workflows/release.yml | 204 +++++++++++++++++++--------------- 1 file changed, 115 insertions(+), 89 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b771c48b22..4e2c45152c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,8 @@ jobs: # --------------------------------------------------------------------------- build-linux-x64: name: Linux x86_64 - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + container: debian:13 env: PREFIX: /usr/local steps: @@ -27,10 +28,11 @@ jobs: - name: Install build tools run: | - sudo apt-get update - sudo apt-get install -y \ - autoconf automake autotools-dev autopoint libtool pkg-config \ - gettext + apt-get update + apt-get install -y --no-install-recommends \ + make binutils autoconf automake autotools-dev autopoint libtool \ + patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ + gcc g++ - name: Download dependency sources run: | @@ -46,28 +48,28 @@ jobs: tar xf zlib-1.3.1.tar.gz && cd zlib-1.3.1 ./configure --prefix=$PREFIX --static make -j$(nproc) - sudo make install + make install - name: Build expat run: | tar xf expat-2.5.0.tar.bz2 && cd expat-2.5.0 ./configure --disable-shared --enable-static --prefix=$PREFIX make -j$(nproc) - sudo make install + make install - name: Build sqlite3 run: | tar xf sqlite-autoconf-3430100.tar.gz && cd sqlite-autoconf-3430100 ./configure --disable-shared --enable-static --prefix=$PREFIX make -j$(nproc) - sudo make install + make install - name: Build c-ares run: | tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 ./configure --disable-shared --enable-static --prefix=$PREFIX make -j$(nproc) - sudo make install + make install - name: Build OpenSSL run: | @@ -76,7 +78,7 @@ jobs: --prefix=$PREFIX --libdir=lib \ -O2 make -j$(nproc) - sudo make install_sw + make install_sw - name: Build libssh2 run: | @@ -86,7 +88,7 @@ jobs: CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" make -j$(nproc) - sudo make install + make install - name: Build aria2 run: | @@ -126,18 +128,21 @@ jobs: # --------------------------------------------------------------------------- build-linux-arm64: name: Linux ARM64 - runs-on: ubuntu-22.04-arm + runs-on: ubuntu-latest + container: debian:13 env: - PREFIX: /usr/local + HOST: aarch64-linux-gnu + PREFIX: /usr/local/aarch64-linux-gnu steps: - uses: actions/checkout@v4 - - name: Install build tools + - name: Install cross-compilation toolchain run: | - sudo apt-get update - sudo apt-get install -y \ - autoconf automake autotools-dev autopoint libtool pkg-config \ - gettext + apt-get update + apt-get install -y --no-install-recommends \ + make binutils autoconf automake autotools-dev autopoint libtool \ + patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ + gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - name: Download dependency sources run: | @@ -151,54 +156,71 @@ jobs: - name: Build zlib run: | tar xf zlib-1.3.1.tar.gz && cd zlib-1.3.1 - ./configure --prefix=$PREFIX --static - make -j$(nproc) - sudo make install + CC=$HOST-gcc AR=$HOST-ar LD=$HOST-ld \ + RANLIB=$HOST-ranlib STRIP=$HOST-strip \ + ./configure \ + --prefix=$PREFIX \ + --libdir=$PREFIX/lib \ + --includedir=$PREFIX/include \ + --static + make -j$(nproc) install - name: Build expat run: | tar xf expat-2.5.0.tar.bz2 && cd expat-2.5.0 - ./configure --disable-shared --enable-static --prefix=$PREFIX - make -j$(nproc) - sudo make install + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + make -j$(nproc) install - name: Build sqlite3 run: | tar xf sqlite-autoconf-3430100.tar.gz && cd sqlite-autoconf-3430100 - ./configure --disable-shared --enable-static --prefix=$PREFIX - make -j$(nproc) - sudo make install + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + make -j$(nproc) install - name: Build c-ares run: | tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 - ./configure --disable-shared --enable-static --prefix=$PREFIX - make -j$(nproc) - sudo make install + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + ac_cv_func_if_indextoname=no + make -j$(nproc) install - name: Build OpenSSL run: | tar xf openssl-3.4.4.tar.gz && cd openssl-3.4.4 ./Configure linux-aarch64 no-shared no-module no-tests \ + --cross-compile-prefix=$HOST- \ --prefix=$PREFIX --libdir=lib \ -O2 make -j$(nproc) - sudo make install_sw + make install_sw - name: Build libssh2 run: | tar xf libssh2-1.11.0.tar.bz2 && cd libssh2-1.11.0 - ./configure --disable-shared --enable-static --prefix=$PREFIX \ + ./configure \ + --disable-shared --enable-static \ + --disable-examples-build \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ --with-crypto=openssl --with-libssl-prefix=$PREFIX \ CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" - make -j$(nproc) - sudo make install + make -j$(nproc) install - name: Build aria2 run: | autoreconf -i ./configure \ + --host=$HOST --prefix=$PREFIX \ --without-gnutls --with-openssl \ --without-libxml2 --with-libexpat \ --with-libcares --with-libz --with-sqlite3 --with-libssh2 \ @@ -207,11 +229,12 @@ jobs: CXXFLAGS="-O2" CFLAGS="-O2" \ LDFLAGS="-L$PREFIX/lib -static-libgcc -static-libstdc++" \ CPPFLAGS="-I$PREFIX/include" \ + PKG_CONFIG="/usr/bin/pkg-config" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" make -j$(nproc) - strip src/aria2c + $HOST-strip src/aria2c # Verify static linkage - ldd src/aria2c || true + file src/aria2c - name: Package run: | @@ -627,11 +650,12 @@ jobs: path: aria2-*-windows-x86_64.zip # --------------------------------------------------------------------------- - # Linux ppc64le (cross-compiled on Ubuntu) + # Linux ppc64le (cross-compiled in debian:13 container) # --------------------------------------------------------------------------- build-linux-ppc64le: name: Linux ppc64le - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest + container: debian:13 env: HOST: powerpc64le-linux-gnu PREFIX: /usr/local/ppc64le-linux-gnu @@ -640,8 +664,8 @@ jobs: - name: Install cross-compilation toolchain run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ + apt-get update + apt-get install -y --no-install-recommends \ make binutils autoconf automake autotools-dev autopoint libtool \ patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu @@ -665,7 +689,7 @@ jobs: --libdir=$PREFIX/lib \ --includedir=$PREFIX/include \ --static - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build expat run: | @@ -674,7 +698,7 @@ jobs: --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build sqlite3 run: | @@ -683,17 +707,17 @@ jobs: --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build c-ares run: | tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 ./configure \ - --disable-shared --enable-static --without-random \ + --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ ac_cv_func_if_indextoname=no - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build OpenSSL run: | @@ -703,7 +727,7 @@ jobs: --prefix=$PREFIX --libdir=lib \ -O2 make -j$(nproc) - sudo make install_sw + make install_sw - name: Build libssh2 run: | @@ -716,21 +740,21 @@ jobs: --with-crypto=openssl --with-libssl-prefix=$PREFIX \ CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build aria2 run: | autoreconf -i ./configure \ --host=$HOST --prefix=$PREFIX \ - --without-included-gettext --disable-nls \ - --with-libcares --without-gnutls --with-openssl \ - --with-sqlite3 --without-libxml2 --with-libexpat \ - --with-libz --with-libssh2 \ - --without-libgcrypt --without-libnettle \ + --without-gnutls --with-openssl \ + --without-libxml2 --with-libexpat \ + --with-libcares --with-libz --with-sqlite3 --with-libssh2 \ + --disable-nls \ ARIA2_STATIC=yes \ + CXXFLAGS="-O2" CFLAGS="-O2" \ + LDFLAGS="-L$PREFIX/lib -static-libgcc -static-libstdc++" \ CPPFLAGS="-I$PREFIX/include" \ - LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG="/usr/bin/pkg-config" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" make -j$(nproc) @@ -751,11 +775,12 @@ jobs: path: aria2-*-linux-ppc64le.tar.xz # --------------------------------------------------------------------------- - # Linux riscv64 (cross-compiled on Ubuntu) + # Linux riscv64 (cross-compiled in debian:13 container) # --------------------------------------------------------------------------- build-linux-riscv64: name: Linux riscv64 - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest + container: debian:13 env: HOST: riscv64-linux-gnu PREFIX: /usr/local/riscv64-linux-gnu @@ -764,8 +789,8 @@ jobs: - name: Install cross-compilation toolchain run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ + apt-get update + apt-get install -y --no-install-recommends \ make binutils autoconf automake autotools-dev autopoint libtool \ patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ gcc-riscv64-linux-gnu g++-riscv64-linux-gnu @@ -789,7 +814,7 @@ jobs: --libdir=$PREFIX/lib \ --includedir=$PREFIX/include \ --static - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build expat run: | @@ -798,7 +823,7 @@ jobs: --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build sqlite3 run: | @@ -807,27 +832,27 @@ jobs: --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build c-ares run: | tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 ./configure \ - --disable-shared --enable-static --without-random \ + --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ ac_cv_func_if_indextoname=no - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build OpenSSL run: | tar xf openssl-3.4.4.tar.gz && cd openssl-3.4.4 - ./Configure linux-riscv64 no-shared no-module no-tests \ + ./Configure linux64-riscv64 no-shared no-module no-tests \ --cross-compile-prefix=$HOST- \ --prefix=$PREFIX --libdir=lib \ -O2 make -j$(nproc) - sudo make install_sw + make install_sw - name: Build libssh2 run: | @@ -840,21 +865,21 @@ jobs: --with-crypto=openssl --with-libssl-prefix=$PREFIX \ CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build aria2 run: | autoreconf -i ./configure \ --host=$HOST --prefix=$PREFIX \ - --without-included-gettext --disable-nls \ - --with-libcares --without-gnutls --with-openssl \ - --with-sqlite3 --without-libxml2 --with-libexpat \ - --with-libz --with-libssh2 \ - --without-libgcrypt --without-libnettle \ + --without-gnutls --with-openssl \ + --without-libxml2 --with-libexpat \ + --with-libcares --with-libz --with-sqlite3 --with-libssh2 \ + --disable-nls \ ARIA2_STATIC=yes \ + CXXFLAGS="-O2" CFLAGS="-O2" \ + LDFLAGS="-L$PREFIX/lib -static-libgcc -static-libstdc++" \ CPPFLAGS="-I$PREFIX/include" \ - LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG="/usr/bin/pkg-config" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" make -j$(nproc) @@ -875,11 +900,12 @@ jobs: path: aria2-*-linux-riscv64.tar.xz # --------------------------------------------------------------------------- - # Linux loongarch64 (cross-compiled on Ubuntu) + # Linux loongarch64 (cross-compiled in debian:13 container) # --------------------------------------------------------------------------- build-linux-loongarch64: name: Linux loongarch64 - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest + container: debian:13 env: HOST: loongarch64-linux-gnu PREFIX: /usr/local/loongarch64-linux-gnu @@ -888,8 +914,8 @@ jobs: - name: Install cross-compilation toolchain run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ + apt-get update + apt-get install -y --no-install-recommends \ make binutils autoconf automake autotools-dev autopoint libtool \ patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ gcc-loongarch64-linux-gnu g++-loongarch64-linux-gnu @@ -913,7 +939,7 @@ jobs: --libdir=$PREFIX/lib \ --includedir=$PREFIX/include \ --static - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build expat run: | @@ -922,7 +948,7 @@ jobs: --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build sqlite3 run: | @@ -931,27 +957,27 @@ jobs: --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build c-ares run: | tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 ./configure \ - --disable-shared --enable-static --without-random \ + --disable-shared --enable-static \ --prefix=$PREFIX --host=$HOST \ --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ ac_cv_func_if_indextoname=no - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build OpenSSL run: | tar xf openssl-3.4.4.tar.gz && cd openssl-3.4.4 - ./Configure linux-loongarch64 no-shared no-module no-tests \ + ./Configure linux64-loongarch64 no-shared no-module no-tests \ --cross-compile-prefix=$HOST- \ --prefix=$PREFIX --libdir=lib \ -O2 make -j$(nproc) - sudo make install_sw + make install_sw - name: Build libssh2 run: | @@ -964,21 +990,21 @@ jobs: --with-crypto=openssl --with-libssl-prefix=$PREFIX \ CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" - sudo make -j$(nproc) install + make -j$(nproc) install - name: Build aria2 run: | autoreconf -i ./configure \ --host=$HOST --prefix=$PREFIX \ - --without-included-gettext --disable-nls \ - --with-libcares --without-gnutls --with-openssl \ - --with-sqlite3 --without-libxml2 --with-libexpat \ - --with-libz --with-libssh2 \ - --without-libgcrypt --without-libnettle \ + --without-gnutls --with-openssl \ + --without-libxml2 --with-libexpat \ + --with-libcares --with-libz --with-sqlite3 --with-libssh2 \ + --disable-nls \ ARIA2_STATIC=yes \ + CXXFLAGS="-O2" CFLAGS="-O2" \ + LDFLAGS="-L$PREFIX/lib -static-libgcc -static-libstdc++" \ CPPFLAGS="-I$PREFIX/include" \ - LDFLAGS="-L$PREFIX/lib" \ PKG_CONFIG="/usr/bin/pkg-config" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" make -j$(nproc) From cba4eb8fe965ba68a105d0d2c69a767682b5a420 Mon Sep 17 00:00:00 2001 From: miwu04 Date: Mon, 13 Apr 2026 03:40:55 +0800 Subject: [PATCH 3/3] ci: add mip64el support --- .github/workflows/release.yml | 126 ++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e2c45152c..daae891ece 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1024,6 +1024,131 @@ jobs: name: linux-loongarch64 path: aria2-*-linux-loongarch64.tar.xz + # --------------------------------------------------------------------------- + # Linux mips64el (cross-compiled in debian:13 container) + # --------------------------------------------------------------------------- + build-linux-mips64el: + name: Linux mips64el + runs-on: ubuntu-latest + container: debian:13 + env: + HOST: mips64el-linux-gnuabi64 + PREFIX: /usr/local/mips64el-linux-gnuabi64 + steps: + - uses: actions/checkout@v4 + + - name: Install cross-compilation toolchain + run: | + apt-get update + apt-get install -y --no-install-recommends \ + make binutils autoconf automake autotools-dev autopoint libtool \ + patch ca-certificates pkg-config curl dpkg-dev lzip gettext \ + gcc-mips64el-linux-gnuabi64 g++-mips64el-linux-gnuabi64 + + - name: Download dependencies + run: | + curl -L --retry 5 --connect-timeout 15 -O https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://www.sqlite.org/2023/sqlite-autoconf-3430100.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/c-ares/c-ares/releases/download/cares-1_19_1/c-ares-1.19.1.tar.gz + curl -L --retry 5 --connect-timeout 15 -O https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.0/libssh2-1.11.0.tar.bz2 + curl -L --retry 5 --connect-timeout 15 -O https://github.com/openssl/openssl/releases/download/openssl-3.4.4/openssl-3.4.4.tar.gz + + - name: Build zlib + run: | + tar xf zlib-1.3.1.tar.gz && cd zlib-1.3.1 + CC=$HOST-gcc AR=$HOST-ar LD=$HOST-ld \ + RANLIB=$HOST-ranlib STRIP=$HOST-strip \ + ./configure \ + --prefix=$PREFIX \ + --libdir=$PREFIX/lib \ + --includedir=$PREFIX/include \ + --static + make -j$(nproc) install + + - name: Build expat + run: | + tar xf expat-2.5.0.tar.bz2 && cd expat-2.5.0 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + make -j$(nproc) install + + - name: Build sqlite3 + run: | + tar xf sqlite-autoconf-3430100.tar.gz && cd sqlite-autoconf-3430100 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) + make -j$(nproc) install + + - name: Build c-ares + run: | + tar xf c-ares-1.19.1.tar.gz && cd c-ares-1.19.1 + ./configure \ + --disable-shared --enable-static \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + ac_cv_func_if_indextoname=no + make -j$(nproc) install + + - name: Build OpenSSL + run: | + tar xf openssl-3.4.4.tar.gz && cd openssl-3.4.4 + ./Configure linux64-mips64 no-shared no-module no-tests \ + --cross-compile-prefix=$HOST- \ + --prefix=$PREFIX --libdir=lib \ + -O2 + make -j$(nproc) + make install_sw + + - name: Build libssh2 + run: | + tar xf libssh2-1.11.0.tar.bz2 && cd libssh2-1.11.0 + ./configure \ + --disable-shared --enable-static \ + --disable-examples-build \ + --prefix=$PREFIX --host=$HOST \ + --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \ + --with-crypto=openssl --with-libssl-prefix=$PREFIX \ + CPPFLAGS="-I$PREFIX/include" LDFLAGS="-L$PREFIX/lib" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + make -j$(nproc) install + + - name: Build aria2 + run: | + autoreconf -i + ./configure \ + --host=$HOST --prefix=$PREFIX \ + --without-gnutls --with-openssl \ + --without-libxml2 --with-libexpat \ + --with-libcares --with-libz --with-sqlite3 --with-libssh2 \ + --disable-nls \ + ARIA2_STATIC=yes \ + CXXFLAGS="-O2" CFLAGS="-O2" \ + LDFLAGS="-L$PREFIX/lib -static-libgcc -static-libstdc++" \ + CPPFLAGS="-I$PREFIX/include" \ + PKG_CONFIG="/usr/bin/pkg-config" \ + PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" + make -j$(nproc) + $HOST-strip src/aria2c + + - name: Package + run: | + VERSION="${GITHUB_REF_NAME#v}" + DIRNAME="aria2-${VERSION}-linux-mips64el" + mkdir -p "${DIRNAME}" + cp src/aria2c "${DIRNAME}/" + cp COPYING README.rst "${DIRNAME}/" + tar cJf "${DIRNAME}.tar.xz" "${DIRNAME}" + + - uses: actions/upload-artifact@v4 + with: + name: linux-mips64el + path: aria2-*-linux-mips64el.tar.xz + # --------------------------------------------------------------------------- # Windows ARM64 (cross-compiled on Ubuntu with llvm-mingw) # --------------------------------------------------------------------------- @@ -1186,6 +1311,7 @@ jobs: - build-linux-ppc64le - build-linux-riscv64 - build-linux-loongarch64 + - build-linux-mips64el - build-macos-arm64 - build-macos-intel - build-windows-x64