From 31780a6db5d31c6ed5c92a64a5f3bd349950f547 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sun, 7 Nov 2021 13:29:11 -0600 Subject: ci: add meson builds Update the github workflows to also do meson builds for every OS. Additionally, make every workflow execute the built mpv executable (except for windows and FreeBSD's waf executable) to make sure that it runs. As an aside, FreeBSD unfortunately is a bit less elegant since it is in a VM. --- ci/build-freebsd.sh | 18 ++++++++++++++++++ ci/build-macos.sh | 39 ++++++++++++++++++++++++++++----------- ci/build-mingw64.sh | 40 +++++++++++++++++++++++++++++++++++----- ci/build-tumbleweed.sh | 37 +++++++++++++++++++++++++++---------- 4 files changed, 108 insertions(+), 26 deletions(-) (limited to 'ci') diff --git a/ci/build-freebsd.sh b/ci/build-freebsd.sh index a64c03be7e..b0219326ee 100755 --- a/ci/build-freebsd.sh +++ b/ci/build-freebsd.sh @@ -5,6 +5,24 @@ export CFLAGS="$CFLAGS -isystem/usr/local/include" export CXXFLAGS="$CXXFLAGS -isystem/usr/local/include" export LDFLAGS="$LDFLAGS -L/usr/local/lib" +meson build \ + -Dlibmpv=true \ + -Dlua=enabled \ + -Degl-drm=enabled \ + -Dopenal=enabled \ + -Dsdl2=enabled \ + -Dvaapi-wayland=enabled \ + -Dvdpau=enabled \ + -Dvulkan=enabled \ + -Doss-audio=enabled \ + $(pkg info -q v4l_compat && echo -Ddvbin=enabled) \ + $(pkg info -q libdvdnav && echo -Ddvdnav=enabled) \ + $(pkg info -q libcdio-paranoia && echo -Dcdda=enabled) \ + $NULL + +meson compile -C build +./build/mpv + if [ ! -e "./waf" ] ; then python3 ./bootstrap.py fi diff --git a/ci/build-macos.sh b/ci/build-macos.sh index cf3fbb3509..6e6456c154 100755 --- a/ci/build-macos.sh +++ b/ci/build-macos.sh @@ -10,18 +10,35 @@ if [[ -d "./build/${MPV_VARIANT}" ]] ; then rm -rf "./build/${MPV_VARIANT}" fi -if [[ ! -e "./waf" ]] ; then - python3 ./bootstrap.py +if [[ $1 = "meson" ]]; then + PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" \ + meson build \ + -Dprefix="${MPV_INSTALL_PREFIX}" \ + -Dlibmpv=true \ + -D{gl,iconv,lcms2,lua,jpeg,plain-gl,zlib}=enabled \ + -D{cocoa,coreaudio,gl-cocoa,macos-cocoa-cb,macos-touchbar,videotoolbox-gl}=enabled + + meson compile -C build -j4 + + meson install -C build + ./build/mpv fi -PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" python3 \ - ./waf configure \ - --variant="${MPV_VARIANT}" \ - --prefix="${MPV_INSTALL_PREFIX}" \ - --enable-{gl,iconv,lcms2,libmpv-shared,lua,jpeg,plain-gl,zlib} \ - --enable-{cocoa,coreaudio,gl-cocoa,macos-cocoa-cb,macos-touchbar,videotoolbox-gl} \ - --swift-flags="${CI_SWIFT_FLAGS}" +if [[ $1 = "waf" ]]; then + if [[ ! -e "./waf" ]] ; then + python3 ./bootstrap.py + fi -python3 ./waf build --variant="${MPV_VARIANT}" -j4 + PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" python3 \ + ./waf configure \ + --variant="${MPV_VARIANT}" \ + --prefix="${MPV_INSTALL_PREFIX}" \ + --enable-{gl,iconv,lcms2,libmpv-shared,lua,jpeg,plain-gl,zlib} \ + --enable-{cocoa,coreaudio,gl-cocoa,macos-cocoa-cb,macos-touchbar,videotoolbox-gl} \ + --swift-flags="${CI_SWIFT_FLAGS}" -python3 ./waf install --variant="${MPV_VARIANT}" + python3 ./waf build --variant="${MPV_VARIANT}" -j4 + + python3 ./waf install --variant="${MPV_VARIANT}" + ./build/mpv +fi diff --git a/ci/build-mingw64.sh b/ci/build-mingw64.sh index f663345879..5e4e93f119 100755 --- a/ci/build-mingw64.sh +++ b/ci/build-mingw64.sh @@ -154,9 +154,39 @@ if [ ! -e "$prefix_dir/lib/libluajit-5.1.a" ]; then fi ## mpv -PKG_CONFIG=pkg-config CFLAGS="-I'$prefix_dir/include'" LDFLAGS="-L'$prefix_dir/lib'" \ -python3 ./waf configure \ - --enable-libmpv-shared --lua=luajit \ - --enable-{shaderc,spirv-cross,d3d11} -python3 ./waf build --verbose +if [ $1 = "meson" ]; then + CPU="x86_64" + mkdir -p "${TARGET}_mingw_build" && pushd "${TARGET}_mingw_build" + +cat > mingw64_crossfile << EOF +[binaries] +c = '${CC}' +cpp = '${CXX}' +ar = '${AR}' +strip = '${TARGET}-strip' +pkgconfig = 'pkg-config' +exe_wrapper = 'wine64' # A command used to run generated executables. +windres = '${TARGET}-windres' +[host_machine] +system = 'windows' +cpu_family = '${CPU}' +cpu = '${CPU}' +endian = 'little' +EOF + + CFLAGS="-I'$prefix_dir/include'" LDFLAGS="-L'$prefix_dir/lib'" \ + meson .. --cross-file mingw64_crossfile --libdir lib \ + -Dlibmpv=true -Dlua=luajit -D{shaderc,spirv-cross,d3d11}=enabled + + meson compile +fi + +if [ $1 = "waf" ]; then + PKG_CONFIG=pkg-config CFLAGS="-I'$prefix_dir/include'" LDFLAGS="-L'$prefix_dir/lib'" \ + python3 ./waf configure \ + --enable-libmpv-shared --lua=luajit \ + --enable-{shaderc,spirv-cross,d3d11} + + python3 ./waf build --verbose +fi diff --git a/ci/build-tumbleweed.sh b/ci/build-tumbleweed.sh index 9c0c2851a6..1785360f22 100755 --- a/ci/build-tumbleweed.sh +++ b/ci/build-tumbleweed.sh @@ -1,13 +1,30 @@ #!/bin/sh set -e -python3 ./waf configure \ - --enable-cdda \ - --enable-dvbin \ - --enable-dvdnav \ - --enable-libarchive \ - --enable-libmpv-shared \ - --enable-manpage-build \ - --enable-shaderc \ - --enable-vulkan -python3 ./waf build --verbose +if [ "$1" = "meson" ]; then + meson build \ + -Dcdda=enabled \ + -Ddvbin=enabled \ + -Ddvdnav=enabled \ + -Dlibarchive=enabled \ + -Dlibmpv=true \ + -Dmanpage-build=enabled \ + -Dshaderc=enabled \ + -Dvulkan=enabled + meson compile -C build --verbose + ./build/mpv +fi + +if [ "$1" = "waf" ]; then + python3 ./waf configure \ + --enable-cdda \ + --enable-dvbin \ + --enable-dvdnav \ + --enable-libarchive \ + --enable-libmpv-shared \ + --enable-manpage-build \ + --enable-shaderc \ + --enable-vulkan + python3 ./waf build --verbose + ./build/mpv +fi -- cgit v1.2.3