trivial: Fixup the arch build to work on Travis

* Use sed to adjust package version while running script rather than `makepkg`
* Run script as root so it can modify `/build`
* Run `makepkg` as nobody rather than "build"
* Separate build/install steps
This commit is contained in:
Mario Limonciello 2017-06-26 09:36:58 -05:00
parent 1cc7d8d271
commit 3db79f2ec2
3 changed files with 9 additions and 14 deletions

View File

@ -2,7 +2,7 @@
# Contributor: Mirco Tischler <mt-ml at gmx dot de>
pkgname=fwupd
pkgver=0.9.4.r53.ge90542f
pkgver=#VERSION#
pkgrel=1
pkgdesc='A simple daemon to allow session software to update firmware'
arch=('i686' 'x86_64')
@ -13,11 +13,6 @@ makedepends=('meson' 'valgrind' 'docbook-utils' 'docbook-sgml' 'perl-sgmls'
'gobject-introspection' 'gtk-doc' 'python-pillow' 'python-cairo'
'ttf-dejavu' 'adobe-source-han-sans-cn-fonts' 'python-gobject' 'git')
pkgver() {
cd ${pkgname}
git describe | sed 's/-/.r/;s/-/./'
}
build() {
cd ${pkgname}
meson --prefix=/usr \

View File

@ -28,11 +28,6 @@ RUN pacman -S --noconfirm \
valgrind
# CI dep
RUN pacman -S --noconfirm git
# add an user to build the package with
RUN useradd -s /bin/bash build
RUN echo 'build ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# prepare the build environment
RUN mkdir /build
RUN chown build /build
USER build
WORKDIR /build

View File

@ -1,18 +1,23 @@
#!/bin/bash -e
VERSION=`git describe | sed 's/-/.r/;s/-/./'`
[ -z $VERSION ] && VERSION=`head meson.build | grep ' version :' | cut -d \' -f2`
# prepare the build tree
rm -rf build
mkdir build && pushd build
cp ../contrib/PKGBUILD .
sed -i "s,#VERSION#,$VERSION," PKGBUILD
mkdir -p src/fwupd && pushd src/fwupd
ln -s ../../../* .
ln -s ../../../.git .
popd
chown nobody . -R
# build the package and install it
makepkg -ei --noconfirm
sudo -u nobody makepkg -e --noconfirm
pacman -U --noconfirm *.pkg.tar.xz
# move the package to working dir
cp *.pkg.tar.xz ../
mv *.pkg.tar.xz ../
# no testing here because gnome-desktop-testing isnt available in Arch