ci: refactor ci so common args are picked from one location

Mostly. It is annoying if we want to add some flag/option to all the cis
and then have to do it manually. Things easily get missed that way.
Skipped powershell because of course I'm not going to deal with that.
This commit is contained in:
Dudemanguy 2024-10-16 17:27:13 -05:00
parent 3e499ff3bc
commit 09bbca8770
9 changed files with 68 additions and 70 deletions

6
ci/build-common.sh Executable file
View File

@ -0,0 +1,6 @@
common_args="--werror \
-Dlibmpv=true \
-Dtests=true \
"
export CFLAGS="$CFLAGS -Wno-error=deprecated -Wno-error=deprecated-declarations"

View File

@ -1,29 +1,27 @@
#!/bin/sh
set -e
export CFLAGS="$CFLAGS -isystem/usr/local/include"
. ./ci/build-common.sh
export CFLAGS="$CFLAGS -isystem/usr/local/include -march=native"
export CXXFLAGS="$CXXFLAGS -isystem/usr/local/include"
export LDFLAGS="$LDFLAGS -L/usr/local/lib"
# TODO: readd -Ddvbin=enabled
meson setup build \
--werror \
-Dc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations -march=native" \
meson setup build $common_args \
-Db_sanitize=address,undefined \
-Diconv=disabled \
-Dlibmpv=true \
-Dlua=enabled \
-Degl-drm=enabled \
-Dopenal=enabled \
-Dsndio=enabled \
-Dtests=true \
-Dvdpau=enabled \
-Dvulkan=enabled \
-Doss-audio=enabled \
$(pkg info -q libdvdnav && echo -Ddvdnav=enabled) \
$(pkg info -q libcdio-paranoia && echo -Dcdda=enabled) \
$(pkg info -q pipewire && echo -Dpipewire=enabled) \
$NULL
$(pkg info -q pipewire && echo -Dpipewire=enabled)
meson compile -C build
./build/mpv -v --no-config

View File

@ -1,6 +1,8 @@
#!/bin/sh
set -e
. ./ci/build-common.sh
# clone exactly the oldest libplacebo we want to support
rm -rf subprojects
mkdir -p subprojects
@ -8,12 +10,8 @@ git clone https://code.videolan.org/videolan/libplacebo.git \
--recurse-submodules --shallow-submodules \
--depth=1 --branch v6.338 subprojects/libplacebo \
meson setup build \
--werror \
meson setup build $common_args \
-Dlibplacebo:vulkan=disabled \
-Dlibmpv=true \
-Dlua=enabled \
-Dtests=true
-Dlua=enabled
meson compile -C build
./build/mpv -v --no-config

View File

@ -2,6 +2,8 @@
set -e
. ./ci/build-common.sh
FFMPEG_SYSROOT="${HOME}/deps/sysroot"
MPV_INSTALL_PREFIX="${HOME}/out/mpv"
MPV_VARIANT="${TRAVIS_OS_NAME}"
@ -11,11 +13,9 @@ if [[ -d "./build/${MPV_VARIANT}" ]] ; then
fi
PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" \
meson setup build \
--werror \
meson setup build $common_args \
-Dprefix="${MPV_INSTALL_PREFIX}" \
-D{c_args,objc_args}="-Wno-error=deprecated -Wno-error=deprecated-declarations" \
-D{libmpv,tests}=true \
-Dobjc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \
-D{gl,iconv,lcms2,lua,jpeg,plain-gl,zlib}=enabled \
-D{cocoa,coreaudio,gl-cocoa,videotoolbox-gl,videotoolbox-pl}=enabled \
-D{swift-build,macos-cocoa-cb,macos-media-player,macos-touchbar,vulkan}=enabled

View File

@ -23,6 +23,8 @@ export LDFLAGS="-fstack-protector-strong"
export PKG_CONFIG_SYSROOT_DIR="$prefix_dir"
export PKG_CONFIG_LIBDIR="$PKG_CONFIG_SYSROOT_DIR/lib/pkgconfig"
. ./ci/build-common.sh
if [[ "$TARGET" == "i686-"* ]]; then
export WINEPATH="`$CC -print-file-name=`;/usr/$TARGET/lib"
fi
@ -294,16 +296,13 @@ export CFLAGS LDFLAGS
build=mingw_build
rm -rf $build
meson setup $build --cross-file "$prefix_dir/crossfile" \
--werror \
-Dc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \
meson setup $build --cross-file "$prefix_dir/crossfile" $common_args \
--buildtype debugoptimized \
--force-fallback-for=mujs \
-Dmujs:werror=false \
-Dmujs:default_library=static \
-D{libmpv,tests}=true -Dlua=luajit \
-Dlua=luajit \
-D{shaderc,spirv-cross,d3d11,javascript}=enabled
meson compile -C $build
if [ "$2" = pack ]; then

View File

@ -1,17 +1,16 @@
#!/bin/sh -e
#!/bin/bash -e
. ./ci/build-common.sh
args=(
--werror
-Dc_args='-Wno-error=deprecated -Wno-error=deprecated-declarations'
-D{cdda,d3d-hwaccel,d3d11,dvdnav,jpeg,lcms2,libarchive}=enabled
-D{libbluray,lua,shaderc,spirv-cross,uchardet,vapoursynth}=enabled
-D{libmpv,tests}=true
)
[[ "$SYS" != "mingw32" ]] && args+=(
-D{egl-angle-lib,egl-angle-win32,pdf-build,rubberband,win32-smtc}=enabled
)
meson setup build "${args[@]}"
meson setup build $common_args "${args[@]}"
meson compile -C build
./build/mpv.com -v --no-config

View File

@ -1,6 +1,8 @@
#!/bin/sh
set -e
. ./ci/build-common.sh
# FFmpeg on openBSD (4.4.4) is too old; use a subproject
rm -rf subprojects
mkdir -p subprojects
@ -19,16 +21,14 @@ libswresample = libswresample_dep
libswscale = libswscale_dep
EOF
meson setup build \
meson setup build $common_args \
-Dffmpeg:vulkan=auto \
-Dlibmpv=true \
-Dffmpeg:werror=false \
-Dlua=enabled \
-Dopenal=enabled \
-Dpulse=enabled \
-Dtests=true \
-Dvulkan=enabled \
-Ddvdnav=enabled \
-Dcdda=enabled
meson compile -C build
./build/mpv -v --no-config

View File

@ -1,18 +1,16 @@
#!/bin/sh
set -e
meson setup build \
--werror \
-Dc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \
. ./ci/build-common.sh
meson setup build $common_args \
-Db_sanitize=address,undefined \
-Dcdda=enabled \
-Ddvbin=enabled \
-Ddvdnav=enabled \
-Dlibarchive=enabled \
-Dlibmpv=true \
-Dmanpage-build=enabled \
-Dpipewire=enabled \
-Dtests=true \
-Dvulkan=enabled
meson compile -C build
./build/mpv -v --no-config