[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - docker/docker-nightly.sh

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Jan 31 09:53:58 UTC 2019


 docker/docker-nightly.sh |  168 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 168 insertions(+)

New commits:
commit 1fbd505c7cabdb32c46fc3fe310e6cde6d64e1a3
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Thu Jan 31 10:53:25 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jan 31 10:53:25 2019 +0100

    docker: build docker from src
    
    Change-Id: I9a60cb7b596a997a1f3be04bfa8165ca064e554f

diff --git a/docker/docker-nightly.sh b/docker/docker-nightly.sh
new file mode 100755
index 000000000..88365b08f
--- /dev/null
+++ b/docker/docker-nightly.sh
@@ -0,0 +1,168 @@
+#! /bin/bash
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# -- Available env vars --
+# * DOCKER_HUB_REPO - which Docker Hub repo to use
+# * DOCKER_HUB_TAG  - which Docker Hub tag to create
+# * LIBREOFFICE_BRANCH  - which core branch to build
+# * ONLINE_BRANCH - which online branch to build
+# * LIBREOFFICE_BUILD_TARGET - which make target to run (in core repo)
+# * ONLINE_EXTRA_BUILD_OPTIONS - extra build options for online
+# * NO_DOCKER_IMAGE - if set, don't build the docker image itself, just do all the preps
+
+LIBREOFFICE_BRANCH=distro/collabora/cp-6.0
+ONLINE_BRANCH=distro/collabora/collabora-online-4
+
+# check we can sudo without asking a pwd
+echo "Trying if sudo works without a password"
+echo
+echo "If you get a password prompt now, break, and fix your setup using 'sudo visudo'; add something like:"
+echo "yourusername ALL=(ALL) NOPASSWD: ALL"
+echo
+sudo echo "works"
+
+# Check env variables
+if [ -z "$DOCKER_HUB_REPO" ]; then
+  DOCKER_HUB_REPO="collabora/code"
+fi;
+if [ -z "$DOCKER_HUB_TAG" ]; then
+  DOCKER_HUB_TAG=""
+fi;
+echo "Using Docker Hub Repository: '$DOCKER_HUB_REPO' with tag '$DOCKER_HUB_TAG'."
+
+if [ -z "$LIBREOFFICE_BRANCH" ]; then
+  LIBREOFFICE_BRANCH="master"
+fi;
+echo "Building branch '$LIBREOFFICE_BRANCH'"
+
+if [ -z "$LIBREOFFICE_BUILD_TARGET" ]; then
+  LIBREOFFICE_BUILD_TARGET=""
+fi;
+echo "LibreOffice build target: '$LIBREOFFICE_BUILD_TARGET'"
+
+# check if we have jake
+which jake || { cat << EOF
+
+jake is not installed, get it like:
+
+  npm install -g jake
+EOF
+exit 1 ; }
+
+# do everything in the builddir
+SRCDIR=$(realpath `dirname $0`)
+INSTDIR="$SRCDIR/instdir"
+BUILDDIR="$SRCDIR/builddir"
+
+mkdir -p "$BUILDDIR"
+cd "$BUILDDIR"
+
+rm -rf "$INSTDIR" || true
+mkdir -p "$INSTDIR"
+
+##### cloning & updating #####
+
+# libreoffice repo
+if test ! -d libreoffice ; then
+    git clone https://git.libreoffice.org/core libreoffice || exit 1
+fi
+
+( cd libreoffice && git checkout $LIBREOFFICE_BRANCH && ./g pull -r ) || exit 1
+
+# online repo
+if test ! -d online ; then
+    git clone https://git.libreoffice.org/online online || exit 1
+    ( cd online && ./autogen.sh ) || exit 1
+fi
+
+( cd online && git checkout -f $LIBREOFFICE_BRANCH && git pull -r ) || exit 1
+
+##### LibreOffice #####
+
+# build LibreOffice
+cat > libreoffice/autogen.input << EOF
+--disable-cups
+--disable-dbus
+--disable-dconf
+--disable-epm
+--disable-evolution2
+--disable-ext-nlpsolver
+--disable-ext-wiki-publisher
+--disable-firebird-sdbc
+--disable-gio
+--disable-gstreamer-0-10
+--disable-gstreamer-1-0
+--disable-gtk
+--disable-gtk3
+--disable-qt5
+--disable-kde5
+--disable-odk
+--disable-online-update
+--disable-pdfimport
+--disable-postgresql-sdbc
+--disable-report-builder
+--disable-scripting-beanshell
+--disable-scripting-javascript
+--disable-sdremote
+--disable-sdremote-bluetooth
+--enable-extension-integration
+--enable-mergelibs
+--enable-python=internal
+--enable-release-build
+--with-external-dict-dir=/usr/share/hunspell
+--with-external-hyph-dir=/usr/share/hyphen
+--with-external-thes-dir=/usr/share/mythes
+--with-fonts
+--with-galleries=no
+--with-lang=ALL
+--with-linker-hash-style=both
+--with-system-dicts
+--with-system-zlib
+--with-theme=colibre
+--without-branding
+--without-help
+--without-java
+--without-junit
+--with-myspell-dicts
+--without-package-format
+--without-system-cairo
+--without-system-jars
+--without-system-jpeg
+--without-system-libpng
+--without-system-libxml
+--without-system-openssl
+--without-system-poppler
+--without-system-postgresql
+EOF
+
+( cd libreoffice && ./autogen.sh ) || exit 1
+( cd libreoffice && make $LIBREOFFICE_BUILD_TARGET ) || exit 1
+
+# copy stuff
+mkdir -p "$INSTDIR"/opt/
+cp -a libreoffice/instdir "$INSTDIR"/opt/libreoffice
+
+# FIXME fix RPATH of libcairo
+chrpath -r '$ORIGIN' "$INSTDIR"/opt/libreoffice/program/libcairo.so.2
+
+##### loolwsd & loleaflet #####
+
+# build
+( cd online && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-silent-rules --with-lokit-path="$BUILDDIR"/libreoffice/include --with-lo-path="$INSTDIR"/opt/libreoffice $ONLINE_EXTRA_BUILD_OPTIONS) || exit 1
+( cd online && make -j 8) || exit 1
+
+# copy stuff
+( cd online && DESTDIR="$INSTDIR" make install ) || exit 1
+
+# Create new docker image
+if [ -z "$NO_DOCKER_IMAGE" ]; then
+  cd "$SRCDIR"
+  docker build --no-cache -t $DOCKER_HUB_REPO:$DOCKER_HUB_TAG . || exit 1
+  docker push $DOCKER_HUB_REPO:$DOCKER_HUB_TAG || exit 1
+else
+  echo "Skipping docker image build"
+fi;


More information about the Libreoffice-commits mailing list