forked from TypesettingTools/Aegisub
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Archlinux; Debian 11/12/Testing/Sid; Ubuntu 22.04/24.04; Fedora Latest/Rawhide; OpenSUSE Leap Stable/Next; OpenSUSE Tumbleweed
- Loading branch information
Showing
2 changed files
with
320 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,316 @@ | ||
name: Meson CI for Linux Distros | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- feature | ||
- cibuilds | ||
paths-ignore: | ||
- ".github/workflows/ci.yml" | ||
pull_request: | ||
branches: | ||
- master | ||
- feature | ||
paths-ignore: | ||
- ".github/workflows/ci.yml" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.name }}, ${{ matrix.buildtype }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ matrix.container }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
container: | ||
- "archlinux:base-devel" | ||
- "debian:bullseye-backports" | ||
- "debian:bookworm-slim" | ||
- "debian:trixie-slim" | ||
- "debian:unstable-slim" | ||
- "ubuntu:jammy" | ||
- "ubuntu:noble" | ||
- "fedora:latest" | ||
- "fedora:rawhide" | ||
- "opensuse/leap:latest" | ||
- "opensuse/leap:15.6" | ||
- "opensuse/tumbleweed:latest" | ||
buildtype: [release, debug] | ||
include: | ||
- avisynthplus: false | ||
- lua52compat: false | ||
- ffmpeg61: true | ||
- wx31: true | ||
- meson061: true | ||
- name: Archlinux | ||
container: archlinux:base-devel | ||
avisynthplus: true | ||
- group: deb | ||
name: Debian 11 | ||
container: debian:bullseye-backports | ||
wx31: false | ||
meson061: false | ||
- group: deb | ||
name: Debian 12 | ||
container: debian:bookworm-slim | ||
ffmpeg61: false | ||
- group: deb | ||
name: Debian 13 | ||
container: debian:trixie-slim | ||
- group: deb | ||
name: Debian Unstable | ||
container: debian:unstable-slim | ||
- group: deb | ||
name: Ubuntu 22.04 | ||
container: ubuntu:jammy | ||
ffmpeg61: false | ||
wx31: false | ||
meson061: false | ||
- group: deb | ||
name: Ubuntu 24.04 | ||
container: ubuntu:noble | ||
- group: rh | ||
name: Fedora Latest | ||
container: fedora:latest | ||
lua52compat: true | ||
ffmpeg61: false | ||
- group: rh | ||
name: Fedora Rawhide | ||
container: fedora:rawhide | ||
lua52compat: true | ||
- group: suse | ||
name: openSUSE Leap 15.5 | ||
container: opensuse/leap:latest | ||
- group: suse | ||
name: openSUSE Leap 15.6 | ||
container: opensuse/leap:15.6 | ||
- group: suse | ||
name: openSUSE Tumbleweed | ||
container: opensuse/tumbleweed:latest | ||
- args: >- | ||
--prefix=/usr | ||
-Ddefault_audio_output=PulseAudio | ||
-Davisynth=enabled | ||
-Dbestsource=enabled | ||
-Dffms2=enabled | ||
-Dffmpeg:default_library=shared | ||
-Dffmpeg:version3=enabled | ||
-Dvapoursynth=enabled | ||
steps: | ||
- name: Prerequisites (Arch Linux) | ||
if: contains(matrix.container, 'archlinux') | ||
run: pacman --noconfirm -Syu cmake git | ||
|
||
- name: Prerequisites (Debian & Ubuntu) | ||
if: matrix.group == 'deb' | ||
run: | | ||
apt-get update | ||
apt-get install --no-install-recommends -y \ | ||
cmake git curl ca-certificates sudo build-essential \ | ||
autoconf automake libtool gettext libgettextpo-dev | ||
- name: Prerequisites (Fedora) | ||
if: matrix.group == 'rh' | ||
run: | | ||
dnf -y clean all | ||
dnf -y update | ||
dnf -y groupinstall --skip-broken \ | ||
"C Development Tools and Libraries" | ||
dnf -y install cmake git curl sudo libtool gettext | ||
- name: Add Repos (openSUSE Leap 15.5) | ||
if: matrix.container == 'opensuse/leap:latest' | ||
run: | | ||
zypper addrepo -f https://download.opensuse.org/repositories/devel:/libraries:/c_c++/15.5/devel:libraries:c_c++.repo | ||
zypper addrepo -f https://download.opensuse.org/repositories/devel:/tools:/building/15.5/devel:tools:building.repo | ||
zypper addrepo -f https://download.opensuse.org/repositories/multimedia:/libs/15.5/multimedia:libs.repo | ||
- name: Add Repos (openSUSE Leap 15.6) | ||
if: matrix.container == 'opensuse/leap:15.6' | ||
run: | | ||
zypper addrepo -f https://download.opensuse.org/repositories/devel:/libraries:/c_c++/15.6/devel:libraries:c_c++.repo | ||
zypper addrepo -f https://download.opensuse.org/repositories/devel:/tools:/building/15.6/devel:tools:building.repo | ||
zypper addrepo -f https://download.opensuse.org/repositories/multimedia:/libs/15.6/multimedia:libs.repo | ||
- name: Prerequisites (openSUSE) | ||
if: matrix.group == 'suse' | ||
run: | | ||
zypper clean --all | ||
zypper lr -d | ||
zypper --gpg-auto-import-keys refresh | ||
zypper update -y | ||
zypper install -y -t pattern devel_C_C++ | ||
zypper install -y gcc13 gcc13-c++ | ||
zypper install -y cmake git curl sudo libtool gettext-runtime | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Git config add safe directory | ||
run: git config --global --add safe.directory '/__w/Aegisub/Aegisub' | ||
|
||
- name: Install dependencies (Arch Linux) | ||
if: contains(matrix.container, 'archlinux') | ||
run: | | ||
pacman --noconfirm -Syu wireplumber | ||
pacman --noconfirm -Sy pipewire-jack | ||
pacman --noconfirm -Sy avisynthplus boost ffmpeg fftw \ | ||
fontconfig hunspell libass libglvnd meson openal portaudio \ | ||
python pulseaudio uchardet vapoursynth wxwidgets-gtk3 | ||
- name: Install meson (Debian 11) | ||
if: ${{ matrix.group == 'deb' && matrix.meson061 == false }} | ||
run: | | ||
apt-get install -y python3 python3-pip | ||
pip install meson | ||
- name: Install meson (Debian 12+, Ubuntu 22.04+) | ||
if: ${{ matrix.group == 'deb' && matrix.meson061 == true }} | ||
run: apt-get install --no-install-recommends -y meson | ||
|
||
- name: Install some dependencies (Debian & Ubuntu) | ||
if: matrix.group == 'deb' | ||
run: | | ||
apt-get install -y pkg-config | ||
apt-get install --no-install-recommends -y nasm \ | ||
ninja-build libx11-dev libfreetype6-dev libfontconfig1-dev \ | ||
libnotify-dev libass-dev libasound2-dev intltool \ | ||
libboost-all-dev libhunspell-dev libuchardet-dev \ | ||
libpulse-dev libopenal-dev libxxhash-dev libfftw3-dev \ | ||
libopus-dev | ||
- name: Install ffmpeg (Debian 13+, Ubuntu 24.04+) | ||
if: ${{ matrix.group == 'deb' && matrix.ffmpeg61 == true }} | ||
run: | | ||
apt-get install -y \ | ||
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev \ | ||
libavutil-dev libpostproc-dev libswresample-dev libswscale-dev | ||
- name: Install wxWidgets 3.0 (Debian 11, Ubuntu 22.04) | ||
if: ${{ matrix.group == 'deb' && matrix.wx31 == false }} | ||
run: apt-get install -y libwxgtk3.0-gtk3-dev wx3.0-i18n | ||
|
||
- name: Install wxWidgets 3.2 (Debian 12+, Ubuntu 22.10+) | ||
if: ${{ matrix.group == 'deb' && matrix.wx31 == true }} | ||
run: apt-get install -y libwxgtk3.2-dev wx3.2-i18n | ||
|
||
- name: Install dependencies (Fedora) | ||
if: matrix.group == 'rh' | ||
run: | | ||
dnf -y install pkgconf-pkg-config | ||
dnf -y install --skip-broken meson ninja-build libX11 freetype nasm \ | ||
fontconfig-devel libnotify-devel libass-devel intltool zlib-devel \ | ||
boost-devel hunspell-devel uchardet-devel pulseaudio-libs-devel \ | ||
fftw-devel openal-soft xxhash-devel luajit-devel wxGTK-devel \ | ||
ffmpeg-free-devel opus-devel | ||
- name: Install dependencies (openSUSE) | ||
if: matrix.group == 'suse' | ||
run: | | ||
zypper install -y libboost_chrono1_84_0-devel \ | ||
libboost_headers1_84_0-devel \ | ||
libboost_filesystem1_84_0-devel \ | ||
libboost_locale1_84_0-devel \ | ||
libboost_regex1_84_0-devel \ | ||
libboost_program_options1_84_0-devel | ||
zypper install -y meson ninja libX11-6 libfreetype6 nasm \ | ||
libfontconfig1 libnotify-devel libass-devel intltool zlib-devel \ | ||
hunspell-devel libuchardet-devel libpulse-devel \ | ||
fftw3-devel openal-soft-devel xxhash-devel luajit-devel \ | ||
wxGTK3-3_2-devel vapoursynth-devel | ||
zypper install -y ffmpeg-6-libavcodec-devel ffmpeg-6-libavdevice-devel \ | ||
ffmpeg-6-libavfilter-devel ffmpeg-6-libavformat-devel \ | ||
ffmpeg-6-libavutil-devel ffmpeg-6-libpostproc-devel \ | ||
ffmpeg-6-libswresample-devel ffmpeg-6-libswscale-devel | ||
- name: Add non-root user | ||
run: | | ||
cat /etc/passwd | ||
USERNAME=user1 | ||
USER_UID=1001 | ||
USER_GID=$USER_UID | ||
groupadd --gid $USER_GID $USERNAME | ||
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME | ||
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME | ||
chmod 0440 /etc/sudoers.d/$USERNAME | ||
chown -R $USERNAME:$USER_GID /__w/Aegisub/Aegisub | ||
- name: Download gtest | ||
run: | | ||
cd subprojects | ||
sudo -u user1 mkdir packagecache | ||
cd packagecache | ||
sudo -u user1 curl -o gtest-1.14.0.tar.gz -L https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz | ||
sudo -u user1 curl -o gtest_1.14.0-1_patch.zip -L https://wrapdb.mesonbuild.com/v2/gtest_1.14.0-1/get_patch | ||
- name: Download AviSynth+ | ||
if: matrix.avisynthplus == false | ||
run: | | ||
cd subprojects | ||
sudo -u user1 git clone --depth=1 -b 3.7 https://github.com/AviSynth/AviSynthPlus.git | ||
mv AviSynthPlus avisynth | ||
cd .. | ||
sudo -u user1 meson subprojects packagefiles --apply avisynth | ||
- name: Download BestSource and FFMS2 | ||
run: | | ||
cd subprojects | ||
sudo -u user1 git clone --recursive -b R2-RC1 https://github.com/vapoursynth/bestsource.git | ||
cd bestsource | ||
sudo -u user1 git reset --hard 9d7e218 | ||
cd .. | ||
patch --directory=./bestsource --forward --strip=1 < ./packagefiles/bestsource/0001.patch | ||
sudo -u user1 git clone --depth=1 -b 5.0-RC3 https://github.com/FFMS/ffms2.git | ||
cd .. | ||
sudo -u user1 meson subprojects packagefiles --apply bestsource | ||
sudo -u user1 meson subprojects packagefiles --apply ffms2 | ||
- name: Download FFmpeg | ||
if: matrix.ffmpeg61 == false | ||
run: | | ||
cd subprojects | ||
sudo -u user1 git clone --depth=1 -b meson-6.1 https://gitlab.freedesktop.org/gstreamer/meson-ports/ffmpeg.git | ||
patch --directory=./ffmpeg --forward --strip=1 < ./packagefiles/ffmpeg/0001.patch | ||
cd .. | ||
sudo -u user1 meson subprojects packagefiles --apply ffmpeg | ||
- name: Download LuaJIT | ||
if: matrix.lua52compat == false | ||
run: | | ||
cd subprojects | ||
sudo -u user1 git clone --depth=1 https://github.com/LuaJIT/LuaJIT.git | ||
mv LuaJIT luajit | ||
cd .. | ||
sudo -u user1 meson subprojects packagefiles --apply luajit | ||
- name: Configure | ||
if: ${{ ! startsWith(matrix.container, 'opensuse/leap') }} | ||
run: | | ||
C_FLAGS="-Wall -Wextra -Wpedantic" | ||
CXX_FLAGS="-Wall -Wextra -Wpedantic" | ||
sudo -u user1 meson setup build ${{ matrix.args }} -Dcpp_std=c++14 -Dbuildtype=${{ matrix.buildtype }} | ||
- name: Configure (openSUSE Leap) | ||
if: startsWith(matrix.container, 'opensuse/leap') | ||
run: | | ||
C_FLAGS="-Wall -Wextra -Wpedantic" | ||
CXX_FLAGS="-Wall -Wextra -Wpedantic" | ||
sudo -u user1 CC=/usr/bin/gcc-13 CXX=/usr/bin/g++-13 meson setup build ${{ matrix.args }} -Dcpp_std=c++14 -Dbuildtype=${{ matrix.buildtype }} | ||
- name: Build | ||
run: sudo -u user1 meson compile -C build | ||
|
||
- name: Run test | ||
run: sudo -u user1 meson test -C build --verbose "gtest main" | ||
|
||
- name: Generate Package | ||
run: | | ||
mkdir -p pkgdir | ||
meson install -C build --destdir=../pkgdir | ||
ls -Ral pkgdir |