Skip to content

Merge pull request #78 from gasbytes/install-dir-destdir #299

Merge pull request #78 from gasbytes/install-dir-destdir

Merge pull request #78 from gasbytes/install-dir-destdir #299

Workflow file for this run

name: gst-libav1.0 Build and Test
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: Build & Test gst-libav1.0
runs-on: ubuntu-latest
container:
image: debian:bookworm
options: --user root
timeout-minutes: 60
strategy:
matrix:
gst_ref: [ 'master', 'debian/1.26.2-1', 'debian/1.26.3-1' ]
fail-fast: false
steps:
- name: Checkout gnutls-wolfssl repository
uses: actions/checkout@v4
- name: Install Meson and ninja
run: |
apt-get update
apt-get install -y sudo meson ninja-build
- name: Install GStreamer ≥1.26 dev-packages
run: |
apt-get update
apt-get install -y \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
gstreamer1.0-tools
- name: Install build tools & dependencies
run: |
apt-get install -y \
build-essential autoconf automake pkg-config yasm git \
meson ninja-build cmake \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libavcodec-dev libavformat-dev libavutil-dev libavfilter-dev \
gstreamer1.0-tools \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
gnulib autopoint gperf gtk-doc-tools nettle-dev \
clang libtasn1-bin libtasn1-6-dev libunistring-dev \
libp11-kit-dev libunbound-dev wget gtk-doc-tools libswscale-dev libswresample-dev nasm \
python3-pip flex bison libgirepository1.0-dev python3-dev
pip3 install --break-system-packages --upgrade meson
- name: Restore cached gnutls-wolfssl
id: cache-gnutls
uses: actions/cache@v4
with:
path: |
/opt/gnutls
/opt/wolfssl
/opt/wolfssl-gnutls-wrapper
key: gnutls-wolfssl-${{ runner.os }}-${{ hashFiles('setup.sh', 'wolfssl-gnutls-wrapper/**', 'wolfssl/**', 'gnutls/**') }}
restore-keys: |
gnutls-wolfssl-${{ runner.os }}-
- name: Build GnuTLS with wolfSSL provider
if: steps.cache-gnutls.outputs.cache-hit != 'true'
run: |
GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh
- name: Verify GnuTLS install
run: |
test -d /opt/gnutls/lib || (echo "/opt/gnutls/lib missing" && exit 1)
- name: Restore cached GStreamer
id: cache-gstreamer
uses: actions/cache@v4
with:
path: /opt/gstreamer
key: gstreamer-1.26.2-${{ runner.os }}-bookworm
restore-keys: |
gstreamer-1.26.2-${{ runner.os }}-
- name: Build GStreamer 1.26.2 from source
if: steps.cache-gstreamer.outputs.cache-hit != 'true'
run: |
pip3 install --break-system-packages meson ninja
git clone https://github.com/GStreamer/gstreamer.git gstreamer-source
cd gstreamer-source
git checkout 1.26.2
meson setup build \
--prefix=/opt/gstreamer \
--libdir=lib \
-Dgood=enabled \
-Dbad=enabled \
-Dugly=enabled \
-Dlibav=disabled \
-Ddevtools=disabled \
-Dsharp=disabled \
-Dpython=disabled \
-Drs=disabled \
-Dgst-plugins-bad:vulkan=disabled \
-Dgst-plugins-bad:nvcodec=disabled \
-Dgst-plugins-bad:qsv=disabled
ninja -C build
ninja -C build install
cd ..
rm -rf gstreamer-source
- name: Build FFmpeg with GnuTLS & MPEG-4 encoder
run: |
cd $RUNNER_WORKSPACE
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg-gnutls
cd ffmpeg-gnutls
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/gstreamer/include"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/gstreamer/lib -Wl,-rpath,/opt/gnutls/lib -Wl,-rpath,/opt/gstreamer/lib"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
./configure \
--prefix=/opt/ffmpeg-gnutls \
--disable-openssl \
--enable-gnutls \
--enable-encoder=mpeg4 \
--enable-shared
make -j"$(nproc)" && make install
- name: Verify libav* link against custom GnuTLS
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
for lib in libavformat.so.62 libavfilter.so.11; do
echo ">>> ldd for $lib:"
ldd /opt/ffmpeg-gnutls/lib/$lib
if ! ldd /opt/ffmpeg-gnutls/lib/$lib \
| grep -q '/opt/gnutls/lib/libgnutls.so.30'; then
echo "✖ $lib is NOT using custom GnuTLS"
exit 1
fi
echo "✔ $lib is using custom GnuTLS"
done
- name: Clone & checkout gst-libav1.0 @ ${{ matrix.gst_ref }}
run: |
git clone https://salsa.debian.org/gstreamer-team/gst-libav1.0.git gst-libav
cd gst-libav
git fetch --tags
git checkout ${{ matrix.gst_ref }}
- name: Build gst-libav1.0 (${{ matrix.gst_ref }})
working-directory: gst-libav
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
rm -rf build
meson setup build --prefix=/usr -Ddoc=disabled -Dtests=enabled
ninja -C build
- name: Smoke-test plugin with gst-inspect & playbin
working-directory: gst-libav
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
PAGER=cat \
GST_PLUGIN_PATH=$(pwd)/build \
GST_PLUGIN_SYSTEM_PATH_1_0=/opt/gstreamer/lib/gstreamer-1.0 \
/opt/gstreamer/bin/gst-inspect-1.0 libav
timeout 30s env \
GST_PLUGIN_PATH=$(pwd)/build \
GST_PLUGIN_SYSTEM_PATH_1_0=/opt/gstreamer/lib/gstreamer-1.0 \
/opt/gstreamer/bin/gst-launch-1.0 -v playbin \
uri=https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8 || test $? -eq 124
- name: Run upstream gst-libav tests
working-directory: gst-libav
run: |
export PKG_CONFIG_PATH="/opt/gnutls/lib/pkgconfig:/opt/ffmpeg-gnutls/lib/pkgconfig:/opt/gstreamer/lib/pkgconfig:$PKG_CONFIG_PATH"
export CPPFLAGS="-I/opt/gnutls/include -I/opt/ffmpeg-gnutls/include -I/opt/gstreamer/include $CPPFLAGS"
export LDFLAGS="-L/opt/gnutls/lib -L/opt/ffmpeg-gnutls/lib -L/opt/gstreamer/lib \
-Wl,-rpath,/opt/gnutls/lib -Wl,-rpath=/opt/ffmpeg-gnutls/lib -Wl,-rpath,/opt/gstreamer/lib $LDFLAGS"
export LD_LIBRARY_PATH="/opt/gnutls/lib:/opt/ffmpeg-gnutls/lib:/opt/gstreamer/lib:$LD_LIBRARY_PATH"
meson test -C build --print-errorlogs