Skip to content

Commit

Permalink
CI build pipewire
Browse files Browse the repository at this point in the history
  • Loading branch information
rtbo committed Aug 14, 2024
1 parent 04fe3bb commit 38ef474
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 1 deletion.
95 changes: 94 additions & 1 deletion buildscripts/ci/linux/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,18 @@ apt_packages_ffmpeg=(
libswscale-dev
)

apt_packages_pw_deps=(
libdbus-1-dev
libudev-dev
)

sudo apt-get update
sudo apt-get install -y --no-install-recommends \
"${apt_packages_basic[@]}" \
"${apt_packages_standard[@]}" \
"${apt_packages_runtime[@]}" \
"${apt_packages_ffmpeg[@]}"
"${apt_packages_ffmpeg[@]}" \
"${apt_packages_pw_deps[@]}"

##########################################################################
# GET QT
Expand Down Expand Up @@ -198,9 +204,96 @@ if [[ ! -d "$ninja_dir" ]]; then
chmod +x $ninja_dir/ninja
fi
echo export PATH="${ninja_dir}:\${PATH}" >> ${ENV_FILE}
export PATH="${ninja_dir}:${PATH}" # needed to compile pipewire
echo "ninja version"
$ninja_dir/ninja --version

# MESON
# Get recent version of Meson (to build pipewire)
meson_version="1.1.1"
sudo python3 -m pip install meson==${meson_version}

##########################################################################
# BUILD PIPWIRE
##########################################################################

pw_version="1.0.4"
pw_src_dir="$BUILD_TOOLS/pw-src-${pw_version}"
pw_dist_dir="$BUILD_TOOLS/pw-dist-${pw_version}"
pw_url="https://gitlab.freedesktop.org/pipewire/pipewire/-/archive/${pw_version}/pipewire-${pw_version}.tar.gz"
if [[ ! -d "${pw_src_dir}" ]]; then
mkdir -p "${pw_src_dir}"
wget -q --show-progress -O pw.tar.gz "${pw_url}"
tar -xzf pw.tar.gz -C "${pw_src_dir}" --strip-components=1
rm pw.tar.gz
pushd "${pw_src_dir}"

meson setup builddir \
--buildtype=debug \
--prefix=/usr \
--libdir=/usr/lib \
-Dexamples=disabled \
-Dtests=disabled \
-Dgstreamer=disabled \
-Dgstreamer-device-provider=disabled \
-Dsystemd=disabled \
-Dselinux=disabled \
-Dpipewire-alsa=disabled \
-Dpipewire-jack=disabled \
-Dpipewire-v4l2=disabled \
-Djack-devel=false \
-Dalsa=disabled \
-Daudiomixer=disabled \
-Daudioconvert=enabled \
-Dbluez5=disabled \
-Dcontrol=disabled \
-Daudiotestsrc=disabled \
-Djack=disabled \
-Dsupport=enabled \
-Devl=disabled \
-Dv4l2=disabled \
-Dvideoconvert=disabled \
-Dvideotestsrc=disabled \
-Dpw-cat=disabled \
-Dudev=disabled \
-Dsdl2=disabled \
-Dsndfile=disabled \
-Dlibmysofa=disabled \
-Dlibpulse=disabled \
-Droc=disabled \
-Decho-cancel-webrtc=disabled \
-Dlibusb=disabled \
-Dsession-managers=[] \
-Draop=disabled \
-Dlv2=disabled \
-Dx11=disabled \
-Dlibcanberra=disabled \
-Dlegacy-rtkit=false \
-Davb=disabled \
-Dflatpak=disabled \
-Dreadline=disabled \
-Dgsettings=disabled \
-Dcompress-offload=disabled \
-Drlimits-install=false \
-Dopus=disabled \
-Dlibffado=disabled \

meson compile -C builddir
popd
fi
echo "Built pipewire in ${pw_src_dir}/builddir"
if [[ ! -d "${pw_dist_dir}" ]]; then
pushd ${pw_src_dir}
DESTDIR=${pw_dist_dir} meson install -C builddir
popd
fi
echo "Installed pipewire to ${pw_dist_dir}/usr"

echo export PW_DIST_DIR="${pw_dist_dir}" >> ${ENV_FILE}
echo export LIBRARY_PATH="${pw_dist_dir}/usr/lib:\${LIBRARY_PATH}" >> ${ENV_FILE}
echo export PKG_CONFIG_PATH="${pw_dist_dir}/usr/lib/pkgconfig:\${PKG_CONFIG_PATH}" >> ${ENV_FILE}
echo export LD_LIBRARY_PATH="${pw_dist_dir}/usr/lib:\${LD_LIBRARY_PATH}" >> ${ENV_FILE}

##########################################################################
# OTHER
##########################################################################
Expand Down
16 changes: 16 additions & 0 deletions buildscripts/ci/linux/tools/make_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ additional_qt_components=(
plugins/wayland-shell-integration
)

# Include needed pipewire plugins
# linuxdeploy has no specific support for pipewire, so plugins must be copied manually
pipewire_plugins=(
'spa-0.2/audioconvert/libspa-audioconvert.so'
'spa-0.2/support/libspa-support.so'
)

# ADDITIONAL LIBRARIES
# linuxdeploy may have missed some libraries that we need
# Report new additions at https://github.com/linuxdeploy/linuxdeploy/issues
Expand Down Expand Up @@ -266,6 +273,15 @@ for file in "${additional_qt_components[@]}"; do
cp -Lr "${QT_PATH}/${file}" "${appdir}/${file}"
done

if [[ -d "${PW_DIST_DIR}" ]]; then
for P in ${pipewire_plugins[@]}; do
mkdir -pv "${appdir}/usr/lib/${P%/*}"
cp -rv "${PW_DIST_DIR}/usr/lib/${P}" "${appdir}/usr/lib/${P}"
done
else
echo -e "Pipewire not found, skipping pipewire plugins"
fi

for lib in "${additional_libraries[@]}"; do
full_path="$(find_library "${lib}")"
cp -L "${full_path}" "${appdir}/lib/${lib}"
Expand Down

0 comments on commit 38ef474

Please sign in to comment.