fwupd/contrib/ci/ubuntu.sh
Mario Limonciello cc8eb5ca8c trivial: Merge python steps from contrib/setup into helper script
This avoids having to hardcode profile targets in multiple places
and also fixes the confusing entry points into scripts both by
arguments and environment variables.

It also makes the setup script a lot more debuggable and scalable.

OS detection is a lot more robust, where it will try to use pip to
set up the distro python package, and if pip is missing try to install
it.

If OS detection fails now, a user can use --os on contrib/setup for
specifying it.
2021-09-17 10:59:35 -05:00

30 lines
938 B
Bash
Executable File

#!/bin/sh
set -e
set -x
#clone test firmware if necessary
. ./contrib/ci/get_test_firmware.sh
#check for and install missing dependencies
./contrib/ci/fwupd_setup_helpers.py install-dependencies --yes -o ubuntu
#evaluate using Ubuntu's buildflags
#evaluate using Debian/Ubuntu's buildflags
#disable link time optimization, Ubuntu currently only sets it for GCC
export DEB_BUILD_MAINT_OPTIONS="optimize=-lto"
eval "$(dpkg-buildflags --export=sh)"
#filter out -Bsymbolic-functions
LDFLAGS=$(dpkg-buildflags --get LDFLAGS | sed "s/-Wl,-Bsymbolic-functions\s//")
export LDFLAGS
root=$(pwd)
rm -rf ${root}/build
mkdir -p ${root}/build
chown nobody build ${root}/subprojects
sudo -u nobody meson build -Dman=false -Ddocs=docgen -Dgusb:tests=false -Dplugin_platform_integrity=true --prefix=${root}/dist
#build with clang
sudo -u nobody ninja -C ${root}/build test -v
#make docs available outside of docker
ninja -C ${root}/build install -v