xfce-build 964 Bytes
Newer Older
1 2 3
#!/bin/bash

# Just a small script that runs the same build that we have on gitlab-ci locally.
4 5 6
# Possible arguments:
#  - the version of the xfce-build container (if you want to build with a special version)
#  - 'pull' to simply update the container and exit
7 8 9 10 11 12 13

CONTAINER="xfce/xfce-build"
VERSION="latest"
CFLAGS="-Wall -Wno-deprecated-declarations -Werror=implicit-function-declaration -Werror=return-type"
VOLUME=$(pwd)
BUILD_CMD='cd /tmp; ./autogen.sh && make distcheck'

14 15 16 17
docker_pull () {
	docker pull xfce/xfce-build:$VERSION
}

18 19
if [ -z "$1" ]; then
	VERSION="latest"
20 21 22
elif [[ "$1" == "pull" ]]; then
	docker_pull
	exit 0
23 24 25 26 27
else
	VERSION=$1
fi

# Make sure we're running the latest version
28
docker_pull
29

30
# Run the build in the docker container
31 32 33
docker run --rm -u $(id -u ${USER}):$(id -g ${USER}) --volume $VOLUME:/tmp --env CFLAGS="${CFLAGS}" $CONTAINER:$VERSION /bin/bash -c "${BUILD_CMD}"

printf "\n---\nBuilt using container $CONTAINER:$VERSION on $VOLUME\n"