From 3db79f2ec22e344e97258fce9118cb0cbb2c251b Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Mon, 26 Jun 2017 09:36:58 -0500 Subject: [PATCH] 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 --- contrib/PKGBUILD | 7 +------ contrib/ci/Dockerfile-arch | 5 ----- contrib/ci/build_and_install_pkgs.sh | 11 ++++++++--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/contrib/PKGBUILD b/contrib/PKGBUILD index 3f3542ec4..0c0b58f9e 100644 --- a/contrib/PKGBUILD +++ b/contrib/PKGBUILD @@ -2,7 +2,7 @@ # Contributor: Mirco Tischler 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 \ diff --git a/contrib/ci/Dockerfile-arch b/contrib/ci/Dockerfile-arch index f381e344a..55207288c 100644 --- a/contrib/ci/Dockerfile-arch +++ b/contrib/ci/Dockerfile-arch @@ -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 diff --git a/contrib/ci/build_and_install_pkgs.sh b/contrib/ci/build_and_install_pkgs.sh index 03ce71105..d2a34257b 100755 --- a/contrib/ci/build_and_install_pkgs.sh +++ b/contrib/ci/build_and_install_pkgs.sh @@ -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 isn’t available in Arch