File: run-gentoo

package info (click to toggle)
umockdev 0.19.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,360 kB
  • sloc: ansic: 5,405; sh: 276; python: 262; xml: 43; makefile: 10
file content (42 lines) | stat: -rwxr-xr-x 1,314 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
set -eu

# keep container around if $DEBUG is set
[ -n "${DEBUG:-}" ] || OPTS="--rm"

if type podman >/dev/null 2>&1; then
    RUNC=podman
else
    RUNC="sudo docker"
fi

# prepare portage volume
$RUNC run  --rm -v gentooportage:/var/db/repos/gentoo docker.io/gentoo/portage /bin/true

$RUNC run --interactive ${OPTS:-} \
  --security-opt=seccomp=unconfined \
  --volume `pwd`:/source:ro --volume gentooportage:/var/db/repos/gentoo \
  --cap-add=CAP_SYS_ADMIN --cap-add=CAP_NET_ADMIN --cap-add=CAP_SYS_PTRACE \
  docker.io/gentoo/stage3 /bin/sh -eux <<EOF
echo 'FEATURES="\${FEATURES} binpkg-request-signature"' >> /etc/portage/make.conf
# install build dependencies
ACCEPT_KEYWORDS="~*" emerge dev-util/umockdev --with-test-deps --onlydeps --getbinpkg
# HACK: for some reason not part of build deps any more
emerge --getbinpkg dev-lang/vala
# install git, "meson dist" dependency
emerge --getbinpkg dev-vcs/git

git config --global safe.directory /source

cd /source
export VALAC=\$(ls /usr/bin/valac-* |sort | tail -n1)
meson setup /tmp/dbg --buildtype debug --werror

export BRITTLE_TESTS="${BRITTLE_TESTS:-}"
meson test -C /tmp/dbg -v --num-processes=1

# and test once more in the sandbox
sandbox meson test -C /tmp/dbg -v --num-processes=1
EOF

[ -n "${DEBUG:-}" ] || $RUNC volume rm gentooportage