2017-04-28 16:32:35 +03:00
#!/bin/bash
# Build and run flatpak's unit tests using the just-built ostree for this PR.
set -xeuo pipefail
2018-06-29 20:53:54 +03:00
# Keep this pinned to avoid arbitrary change for now; it's also
# good to test building older code against newer ostree as it helps
# us notice any API breaks.
2019-06-20 01:22:11 +03:00
FLATPAK_TAG = 1.4.1
2018-01-09 21:01:47 +03:00
2017-09-06 19:42:51 +03:00
dn = $( dirname $0 )
2020-06-17 22:48:31 +03:00
. ${ dn } /libbuild.sh
2017-09-06 19:42:51 +03:00
2017-04-28 16:32:35 +03:00
codedir = $( pwd )
2018-06-29 20:53:54 +03:00
# Build ostree, but we don't install it yet
2017-05-02 01:02:27 +03:00
cd ${ codedir }
2018-05-30 05:09:07 +03:00
ci/build.sh
# Build flatpak
2018-01-09 21:01:47 +03:00
tmpd = $( mktemp -d)
cd ${ tmpd }
git clone --recursive --depth= 1 -b ${ FLATPAK_TAG } https://github.com/flatpak/flatpak
2017-05-02 01:02:27 +03:00
cd ${ tmpd } /flatpak
2020-01-22 01:47:01 +03:00
# Some of flatpak's tests assert GPG error strings from ostree, but
# those have been changed. Patch the test assertions until this can get
# into a tagged flatpak.
git apply ${ codedir } /ci/flatpak-1.4.1-ostree-gpg-errors.patch
2018-06-29 20:53:54 +03:00
# This is a copy of flatpak/ci/build.sh, but we can't use that as we want to install
# our built ostree over it.
pkg_install sudo which attr fuse bison \
libubsan libasan libtsan clang python2 \
elfutils git gettext-devel libappstream-glib-devel hicolor-icon-theme \
/usr/bin/{ update-mime-database,update-desktop-database,gtk-update-icon-cache}
pkg_builddep flatpak
# Now install ostree over the package version
cd ${ codedir }
make install
cd -
# And build flatpak
build
2017-04-28 16:32:35 +03:00
# We want to capture automake results from flatpak
cleanup( ) {
mv test-suite.log ${ codedir } || true
}
trap cleanup EXIT
make -j 8 check