Skip to content

Update pc.yml

Update pc.yml #14

Workflow file for this run

name: pc
on:
push:
branches: [master]
paths-ignore:
- "README.md"
- "LICENSE"
# pull_request:
# branches: [master]
# paths-ignore:
# - "README.md"
# - "LICENSE"
# workflow_dispatch:
# schedule:
# - cron: "0 22 * * *" # Runs at 22:00 UTC every day
env:
ARIA2_REF: pc
PREFIX: /opt/aria2/build_libs
jobs:
w-build:
name: build_windows
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Setup
run: |
sudo git apply patch/*.patch
sudo apt update
# # fix:
# # The following packages have unmet dependencies:...
sudo apt-get install aptitude
export packages=$packages"autopoint automake autotools-dev libtool gettext "
export packages=$packages"build-essential libelf-dev binutils-dev libdwarf-dev gcc g++ git "
export packages=$packages$(apt-cache search -n libc6-dev-amd64 | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n libssl dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n libxml2 dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n zlib | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n mingw-w64 | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n dpkg-dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n pkg-config | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n openssl dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n nettle dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n gcrypt dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n gnutls dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n gmp dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n glibc | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n unistring dev | cut -d " " -f 1 | tr "\n" " ")
export packages=$packages$(apt-cache search -n p11-kit | cut -d " " -f 1 | tr "\n" " ")
# export packages=$packages$(apt-cache search -n libssh2 dev | cut -d " " -f 1 | tr "\n" " ")
# export packages=$packages$(apt-cache search -n libsqlite3 dev | cut -d " " -f 1 | tr "\n" " ")
# export packages=$packages$(apt-cache search -n expat | cut -d " " -f 1 | tr "\n" " ")
# export packages=$packages$(apt-cache search -n c-ares | cut -d " " -f 1 | tr "\n" " ")
# export packages=$packages$(apt-cache search -n libcppunit dev | cut -d " " -f 1 | tr "\n" " ")
sudo aptitude -y install $packages
export HOST=x86_64-w64-mingw32
export PREFIX=/usr/$HOST
export pwd=$(pwd)
git clone --depth=1 --branch cares-1_17_2 https://github.com/c-ares/c-ares.git tmp
cd tmp
autoreconf -fi
CC=$HOST-gcc CXX=$HOST-g++ ./configure --host=$HOST --prefix=$PREFIX --enable-shared=no
make
sudo make install
cd $pwd
rm -rf tmp
git clone --depth=1 --branch R_2_4_9 https://github.com/libexpat/libexpat.git tmp
cd tmp/expat
./buildconf.sh
CC=$HOST-gcc CXX=$HOST-g++ ./configure --host=$HOST --prefix=$PREFIX --enable-shared=no
make
sudo make install
cd $pwd
rm -rf tmp
git clone --depth=1 --branch version-3.41.2 https://github.com/sqlite/sqlite.git tmp
cd tmp
./configure
make amalgamation-tarball
cd mkpkg_tmp_dir/sqlite-autoconf*
CC=$HOST-gcc CXX=$HOST-g++ ./configure --host=$HOST --prefix=$PREFIX --enable-shared=no
make
sudo make install
cd $pwd
rm -rf tmp
curl -o tmp.tar.gz -L "https://downloads.sourceforge.net/project/cppunit/cppunit/1.12.1/cppunit-1.12.1.tar.gz?ts=1616748686&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fcppunit%2Ffiles%2Fcppunit%2F1.12.1%2Fcppunit-1.12.1.tar.gz%2Fdownload"
tar -zxvf tmp.tar.gz
cd cppunit-1.12.1/
CC=$HOST-gcc CXX=$HOST-g++ ./configure --host=$HOST --prefix=$PREFIX --enable-shared=no
make
sudo make install
cd $pwd
rm -rf tmp.tar.gz cppunit-1.12.1
- name: Build
run: |
export HOST=x86_64-w64-mingw32
export PREFIX=/usr/$HOST
autoreconf -i
# https://github.com/c-ares/c-ares/blob/master/INSTALL.md#important-static-c-ares-usage-note
./configure \
--host=$HOST \
--prefix=$PREFIX \
ARIA2_STATIC=yes \
CFLAGS="-DCARES_STATICLIB" \
CPPFLAGS="-I$PREFIX/include" \
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
sudo make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" && \
sudo $HOST-strip src/aria2c.exe
- name: Upload Asset
uses: actions/upload-artifact@v4
with:
name: aria2c-windows-x86_64.exe
path: src/aria2c.exe
build:
strategy:
matrix:
os: [ubuntu-22.04, macos-12, macos-14]
# os: [macos-11]
# compiler: [gcc, clang]
compiler: [gcc]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Apply patch
run: |
sudo git apply patch/*.patch
- name: Linux setup
if: runner.os == 'Linux'
run: |
sudo apt-get install \
g++-11 \
clang-12 \
autoconf \
automake \
autotools-dev \
autopoint \
libtool \
pkg-config \
libcppunit-dev \
libssl-dev \
dpkg-dev \
lzip \
curl
- name: MacOS setup
if: runner.os == 'macOS'
run: |
brew install cppunit autoconf automake pkg-config \
libtool curl lzip dpkg
- name: Setup clang (Linux)
if: runner.os == 'Linux' && matrix.compiler == 'clang'
run: |
echo 'CC=clang-12' >> $GITHUB_ENV
echo 'CXX=clang++-12' >> $GITHUB_ENV
- name: Setup clang (MacOS)
if: runner.os == 'macOS' && matrix.compiler == 'clang'
run: |
echo 'CC=clang' >> $GITHUB_ENV
echo 'CXX=clang++' >> $GITHUB_ENV
- name: Setup gcc (Linux)
if: runner.os == 'Linux' && matrix.compiler == 'gcc'
run: |
echo 'CC=gcc-11' >> $GITHUB_ENV
echo 'CXX=g++-11' >> $GITHUB_ENV
- name: Setup gcc (MacOS)
if: runner.os == 'macOS' && matrix.compiler == 'gcc'
run: |
echo 'CC=gcc' >> $GITHUB_ENV
echo 'CXX=g++' >> $GITHUB_ENV
- name: Setup download
run: |
curl -L -O https://www.openssl.org/source/openssl-3.1.1.tar.gz && \
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 && \
curl -L -O https://zlib.net/fossils/zlib-1.2.11.tar.gz && \
curl -L -O https://github.com/c-ares/c-ares/releases/download/cares-1_17_2/c-ares-1.17.2.tar.gz && \
curl -L -O https://www.libssh2.org/download/libssh2-1.11.0.tar.gz
- name: Build expat
run: |
tar xf expat-2.4.1.tar.bz2 && \
cd expat-2.4.1 && \
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ ./configure \
--disable-shared \
--enable-static \
--prefix=$PREFIX \
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
sudo make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" install
- name: Build sqlite
run: |
tar xzvf sqlite-autoconf-3360000.tar.gz && \
cd sqlite-autoconf-3360000 && \
./configure \
--disable-shared \
--enable-static \
--prefix=$PREFIX \
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
sudo make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" install
- name: Build zlib
run: |
tar xf zlib-1.2.11.tar.gz && \
cd zlib-1.2.11 && \
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ ./configure \
--static --prefix=$PREFIX && \
sudo make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" install
- name: Build c-ares
run: |
tar xf c-ares-1.17.2.tar.gz && \
cd c-ares-1.17.2 && \
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ ./configure \
--disable-shared \
--enable-static \
--without-random \
--prefix=$PREFIX \
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \
sudo make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" install
- name: Build openssl (macOS)
if: runner.os == 'macOS'
run: |
tar xf openssl-3.1.1.tar.gz && \
cd openssl-3.1.1 && \
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ ./config --prefix=$PREFIX no-shared no-module zlib \
CFLAGS="-mtune=generic -O2 -g0" && \
sudo make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" && sudo make install
- name: Build libssh
run: |
tar xf libssh2-1.11.0.tar.gz && \
cd libssh2-1.11.0 && \
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ ./configure \
--disable-shared \
--enable-static \
--prefix=$PREFIX \
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
--with-crypto=openssl \
--with-wincng && \
sudo make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" install
- name: Configure autotools (Linux)
if: runner.os == 'Linux'
run: |
autoreconf -i && \
./configure \
ARIA2_STATIC=yes
- name: Configure autotools (macOS)
if: runner.os == 'macOS'
run: | # --without-included-gettext --without-openssl
autoreconf -i && \
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ ./configure \
--without-gnutls \
--without-appletls \
--with-openssl \
--disable-nls \
--without-libgcrypt \
--without-libxml2 \
--without-libgmp \
--prefix=$PREFIX \
ARIA2_STATIC=yes \
--enable-shared=no \
LDFLAGS="-framework Security -framework CoreFoundation"
- name: Build aria2
run: |
make -j"$(nproc 2> /dev/null || sysctl -n hw.ncpu)" && \
strip src/aria2c
- name: Upload Asset
uses: actions/upload-artifact@v4
with:
name: aria2c-${{ matrix.os }}-${{ matrix.compiler }}
path: src/aria2c