Docker: setup a Lumiera build environment in a Debian/Ubuntu container

some scripting to help creating a clean build environment for testing and bugfixes

 * build_lumiera-build-dependencies.sh
   All necessary steps to prepare a pristine Debian/Ubuntu/xx distro
   for building Lumiera from source.
   + install the GPG pub key to trust
   + install a Lumiera DEP Repository to get the sources from
   + install build-essential
   + prepare, build and install NoBug
   + prepare, build and install libGDLmm
   + install the Lumiera build-dependencies from the DEB package
   At that point, you should be able to start the build just with `scons`

 * docker_open-lumiera-buildenv.sh
   Additional bash magic to launch a docker container and inject the
   build_lumiera-build-dependencies.sh script into an interactive shell
This commit is contained in:
Fischlurch 2019-06-22 19:14:54 +02:00
parent 223113ee44
commit 4b29885d51
4 changed files with 110 additions and 0 deletions

View file

@ -0,0 +1,5 @@
This is the Public Key of the Package signing GPG key
used for building of Debian DEB packages on Lumiera.org
Fingerprint: D0333C21252B66D54A4CC1D265B66B07A1DE94B2
UID: Hermann Vosseler <deb@ichthyostega.de>

View file

@ -0,0 +1,61 @@
#!/bin/sh
#
# build_lumiera-build-dependencies.sh - prepare/build on a pristine Debian/Ubuntu system (Docker)
#
#
#------------------------------------------------------Setup
# The Debian DEB Depot to retrieve the source packages
DEBIAN_REPO="http://lumiera.org/debian/"
SRC_DISTRO="stretch"
REPO_SECTION="experimental"
#
# GPG pubkey to trust for signed packages
TRUSTED_GPG=$(dirname $0)/deb.lumiera.org.PUB.gpg
#
# Directory for building DEB packages
PACK_DIR=./pack
#
#------------------------------------------------------Setup(End)
#
fail() {
echo "\nFAIL: $1\n\n"
exit 1
}
# Sanity-Checks
[ -f $TRUSTED_GPG ] || fail "GPG Key not found: $TRUSTED_GPG"
mkdir -p $PACK_DIR
[ -w $PACK_DIR ] || fail "Unable to build. Can not write to $PACK_DIR"
# prepare the host system with Lumiera package sources
cp $TRUSTED_GPG /etc/apt/trusted.gpg.d/
chmod a+r-x /etc/apt/trusted.gpg.d/$(basename $TRUSTED_GPG)
echo "deb-src $DEBIAN_REPO $SRC_DISTRO $REPO_SECTION" > /etc/apt/sources.list.d/55-lumiera.list
apt update
apt install -y build-essential ca-certificates
apt update
# build some special build dependencies from source
WORKDIR=$(pwd -P)
cd $PACK_DIR
echo "\n\n======= building NoBug =======\n"
apt-get -y build-dep nobug
apt-get source --compile nobug
dpkg -i nobug-dev*deb libnobug*deb || fail "installing NoBug"
echo "\n\n======= building GDLmm =======\n"
apt-get -y build-dep libgdlmm-3-dev
apt-get source --compile libgdlmm-3-dev || fail "installing GDLmm"
dpkg -i libgdlmm-3*deb
# install the build dependencies of Lumiera from DEB
echo "\n\nInstalling Lumiera build dependencies...\n"
apt-get -y build-dep lumiera
# return to the working directory
cd $WORKDIR
echo "Build-Dependencies of Lumiera successfully installed.\n\n"

Binary file not shown.

View file

@ -0,0 +1,44 @@
#!/bin/sh
#
# docker_open-lumiera-buildenv.sh - launch Docker container with interactive build shell
#
#
#------------------------------------------------------Setup
#
# Working directory path on the host
WORKDIR_HOST="/home/$USER/devel/lumi"
#
# bind-mount of the working dir in the container
WORKDIR_GUEST="/lumi"
#
# Docker image-ID to launch
DOCKER_IMAGE="ubuntu:bionic"
#
# Script code to inject into interactive shell
COMMANDS=$(cat) <<RUN_IN_CONTAINER
. /etc/bash.bashrc
. ~/.bashrc
alias la='ls -latr'
$WORKDIR_GUEST/admin/build_lumiera-build-dependencies.sh
RUN_IN_CONTAINER
#
#------------------------------------------------------Setup(End)
#
# Launch...
# (1) launch the docker container
# (2) start a bash there to process a bash commandline
# (3) this commandline in turn launches an interactive bash
# (4) and this interactive bash gets a startup-Shellscript to perform
# (5) and this shellscript is read from an temporary named pipe to another shellscript
# (6) which in turn prints the script code from the setup-variable $COMMANDS
#
# bash magic thanks to Jonathan Potter; see https://serverfault.com/a/586272
#
#
docker run -v $WORKDIR_HOST:$WORKDIR_GUEST -it $DOCKER_IMAGE bash -c "bash --rcfile <(echo \"${COMMANDS}\" )"