Build Linux dependencies #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Linux dependencies | |
on: | |
workflow_dispatch: # Allows manual execution | |
jobs: | |
build_klarity_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies (Linux) | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y nasm yasm cmake autoconf automake libtool make pkg-config g++ make wget | |
sudo apt-get install -y libmfx1 libmfx-tools intel-media-va-driver-non-free libmfx-dev | |
sudo apt-get install -y build-essential git | |
- name: Install ffnvcodec (NVDEC/CUVID Headers) | |
run: | | |
git clone https://github.com/FFmpeg/nv-codec-headers.git | |
cd nv-codec-headers | |
sudo make install | |
cd .. | |
sudo ldconfig | |
- name: Clone and Build FFmpeg 7.1 | |
run: | | |
git clone --branch n7.1 --depth 1 https://github.com/FFmpeg/FFmpeg.git | |
cd FFmpeg | |
./configure --enable-shared --disable-static --disable-autodetect \ | |
--enable-nvdec --enable-vaapi --enable-libmfx --enable-vulkan \ | |
--extra-cflags=-I/usr/local/include \ | |
--extra-ldflags=-L/usr/local/lib \ | |
--prefix=$GITHUB_WORKSPACE/deps | |
make -j$(nproc) | |
make install | |
- name: Build PortAudio v19.7.0 | |
run: | | |
git clone --branch v19.7.0 --depth 1 https://github.com/PortAudio/portaudio.git | |
cd portaudio | |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/deps | |
cmake --build build --config Release --target install | |
- name: Organize Required Files | |
run: | | |
mkdir -p $GITHUB_WORKSPACE/deps/bin | |
cp -a $GITHUB_WORKSPACE/deps/lib/*.so* $GITHUB_WORKSPACE/deps/bin/ | |
cp -a $GITHUB_WORKSPACE/deps/lib/libportaudio.so* $GITHUB_WORKSPACE/deps/bin/ | |
- name: Upload FFmpeg & PortAudio | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ffmpeg-portaudio-linux | |
path: deps/ | |
- name: Build Klarity Library (Linux) | |
run: | | |
cd core/src/main/cpp | |
cmake -DBIN_FOLDER=$GITHUB_WORKSPACE/deps/bin -B build -S . | |
cmake --build build --config Release | |
- name: Upload Klarity Library | |
uses: actions/upload-artifact@v4 | |
with: | |
name: klarity-linux | |
path: core/src/main/cpp/build/ |