Last active
September 28, 2020 21:18
-
-
Save derekschrock/a37ed16ebc94e16424ee51870f6cf9c6 to your computer and use it in GitHub Desktop.
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
#/usr/bin/env bash | |
# Install epel-release for mock | |
sudo yum -y install epel-release | |
# Install mock and | |
sudo yum -y install mock | |
# If non-root add user to mock group otherwise skip | |
# logout/login if already logged in as $USER for mock group | |
# id confirm you're in the mock group | |
[[ "$USER" != "root" ]] && sudo usermod "$USER" -a -G mock | |
# Build deps for xrdp pulseaudio repo | |
sudo yum -y install libtool-ltdl-devel autoconf gcc make libtool git pulseaudio-libs-devel curl yum-utils | |
# Creat working dir for mock results and download files | |
mkdir xrdp-audio | |
cd xrdp-audio | |
# centos8 does not provide rpms for libatomic_ops-static, webrtc-audio-processing-devel, or sbc-devel | |
# centos8's src locations are currently (as of 9/27) broken so you can't use yumdownloader | |
# We can either build them or download from third-party repos see http://pkgs.org | |
# Here we'll build them | |
version_part="$(sed -E 's/.*?8/8/;s/ .*//' < /etc/redhat-release)" | |
appstream_url="http://vault.centos.org/${version_part}/AppStream/Source/SPackages" | |
sbc_srpm="$(repoquery --queryformat "%{sourcerpm}" sbc.$(uname -p))" | |
webrtc_srpm="$(repoquery --queryformat "%{sourcerpm}" webrtc-audio-processing.$(uname -p))" | |
libatomic_srpm="$(repoquery --queryformat "%{sourcerpm}" libatomic_ops.$(uname -p))" | |
srpms=("$sbc_srpm" "$webrtc_srpm" "$libatomic_srpm") | |
for srpm in "${srpms[@]}"; do curl -LO "${appstream_url}/${srpm}"; done | |
# Build missing pulseaudio deps in mock chroot | |
for srpm in "${srpms[@]}"; do mock --resultdir=res --rebuild "$srpm"; done | |
# Download latest or your current version of pulseaudio src via http://vault.centos.org/ | |
pulseaudio_srpm="$(repoquery --queryformat "%{sourcerpm}" pulseaudio.$(uname -p))" | |
curl -LO "${appstream_url}/$pulseaudio_srpm" | |
# Install missing deps in mock chroot and don't clean before/after | |
mock --no-cleanup-after --no-clean --install res/sbc-devel*.rpm --install res/webrtc-audio-processing-devel*.rpm --install res/libatomic_ops-static*.rpm | |
# Build pulseaudio short circuit make to exit after configure | |
# This is expected to fail due to the make_build hack | |
mock --no-cleanup-after --no-clean --resultdir=res --rebuild "$pulseaudio_srpm" -D "make_build exit" | |
# Download, build, and make xrdp pulseaudio plugins | |
# Since we didn't clean the mock chroots we can find the pulseaudio build dir at "$(mock -p)"/builddir/build/BUILD/pulseaudio-*/ | |
git clone https://github.com/neutrinolabs/pulseaudio-module-xrdp.git | |
cd pulseaudio-module-xrdp | |
./bootstrap && ./configure PULSE_DIR="$(mock -p)"/builddir/build/BUILD/pulseaudio-*/ | |
make | |
ls -l src/.libs/ | |
# Clean mock chroot | |
mock --clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment