|
4 | 4 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | 5 |
|
6 | 6 | # -- Available env vars -- |
7 | | -# * CORE_ASSETS - which prebuilt assets to build in core |
8 | | -# * CORE_BRANCH - which branch to build in core |
9 | | -# * COLLABORA_ONLINE_REPO - which git repo to clone online from |
10 | | -# * COLLABORA_ONLINE_BRANCH - which branch to build in online |
11 | | -# * CORE_BUILD_TARGET - which make target to run (in core repo) |
| 7 | +# * ENGINE_ASSETS - URL of prebuilt engine assets tarball (skips building engine) |
| 8 | +# * COLLABORA_ONLINE_REPO - which git repo to clone the online monorepo from |
| 9 | +# * COLLABORA_ONLINE_BRANCH - which branch to build |
| 10 | +# * ENGINE_BUILD_TARGET - which make target to run for the engine (when building from source) |
12 | 11 | # * ONLINE_EXTRA_BUILD_OPTIONS - extra build options for online |
13 | 12 |
|
14 | | -if [ -z "$CORE_ASSETS" ]; then |
15 | | - if [ -z "$CORE_BRANCH" ]; then |
16 | | - CORE_BRANCH="main" |
17 | | - fi; |
18 | | - echo "Building core branch '$CORE_BRANCH'" |
19 | | -else |
20 | | - echo "Building from core assets $CORE_ASSETS" |
21 | | -fi; |
22 | | - |
23 | 13 | if [ -z "$COLLABORA_ONLINE_REPO" ]; then |
24 | | - COLLABORA_ONLINE_REPO="https://github.com/CollaboraOnline/online.git" |
| 14 | + COLLABORA_ONLINE_REPO="https://gerrit.collaboraoffice.com/online" |
25 | 15 | fi; |
26 | 16 | if [ -z "$COLLABORA_ONLINE_BRANCH" ]; then |
27 | 17 | COLLABORA_ONLINE_BRANCH="main" |
28 | 18 | fi; |
29 | | -echo "Building online branch '$COLLABORA_ONLINE_BRANCH' from '$COLLABORA_ONLINE_REPO'" |
| 19 | +echo "Building branch '$COLLABORA_ONLINE_BRANCH' from '$COLLABORA_ONLINE_REPO'" |
30 | 20 |
|
31 | | -if [ -z "$CORE_BUILD_TARGET" ]; then |
32 | | - CORE_BUILD_TARGET="" |
| 21 | +if [ -z "$ENGINE_ASSETS" ]; then |
| 22 | + echo "Building engine from source" |
| 23 | +else |
| 24 | + echo "Using prebuilt engine assets from $ENGINE_ASSETS" |
33 | 25 | fi; |
34 | | -echo "COKit (core) build target: '$CORE_BUILD_TARGET'" |
| 26 | + |
| 27 | +if [ -z "$ENGINE_BUILD_TARGET" ]; then |
| 28 | + ENGINE_BUILD_TARGET="" |
| 29 | +fi; |
| 30 | +echo "Engine build target: '$ENGINE_BUILD_TARGET'" |
35 | 31 |
|
36 | 32 | SRCDIR=$(realpath `dirname $0`) |
37 | 33 | INSTDIR="$SRCDIR/instdir" |
|
58 | 54 |
|
59 | 55 | ##### cloning & updating ##### |
60 | 56 |
|
61 | | -# core repo |
62 | | -# only if CORE_ASSETS is not set |
63 | | -if [ -z "$CORE_ASSETS" ]; then |
64 | | - if test ! -d core ; then |
65 | | - git clone https://gerrit.collaboraoffice.com/core || exit 1 |
66 | | - fi |
67 | | - |
68 | | - ( cd core && git fetch --all && git checkout $CORE_BRANCH && ./g pull -r ) || exit 1 |
69 | | -else |
70 | | - mkdir -p core |
71 | | - ( cd core/ && wget "$CORE_ASSETS" -O core-assets.tar.xz && tar -xzf core-assets.tar.xz && rm core-assets.tar.xz) || exit 1 |
72 | | -fi |
73 | | - |
74 | | - |
75 | | -# Clone online repo |
| 57 | +# Clone the online monorepo (engine/ contains the rendering engine) |
76 | 58 | if test ! -d online ; then |
77 | 59 | git clone --depth=1 --branch $COLLABORA_ONLINE_BRANCH "$COLLABORA_ONLINE_REPO" online || exit 1 |
78 | 60 | fi |
79 | 61 |
|
80 | 62 | ( cd online && git fetch --all && git checkout -f $COLLABORA_ONLINE_BRANCH && git clean -f -d && git pull -r ) || exit 1 |
81 | 63 |
|
82 | | -##### COKit (core) ##### |
83 | | - |
84 | | -# only if core assets are not set |
85 | | -if [ -z "$CORE_ASSETS" ]; then |
86 | | - # build |
87 | | - ( cd core && ./autogen.sh --with-distro=CPLinux-LOKit --disable-epm --without-package-format --disable-symbols ) || exit 1 |
88 | | - ( cd core && make $CORE_BUILD_TARGET ) || exit 1 |
| 64 | +##### engine ##### |
89 | 65 |
|
90 | | - # copy stuff |
91 | | - mkdir -p "$INSTDIR"/opt/ |
92 | | - cp -a core/instdir "$INSTDIR"/opt/lokit |
| 66 | +if [ -z "$ENGINE_ASSETS" ]; then |
| 67 | + # build engine from source |
| 68 | + ( cd online/engine && ./autogen.sh --with-distro=CPLinux-LOKit --disable-epm --without-package-format --disable-symbols ) || exit 1 |
| 69 | + ( cd online/engine && make $ENGINE_BUILD_TARGET ) || exit 1 |
93 | 70 | else |
94 | | - echo "Using prebuilt core assets" |
95 | | - mkdir -p "$INSTDIR"/opt/ |
96 | | - cp -a core/instdir "$INSTDIR"/opt/lokit |
| 71 | + # drop in prebuilt engine assets |
| 72 | + ( cd online/engine && wget "$ENGINE_ASSETS" -O engine-assets.tar.xz && tar -xzf engine-assets.tar.xz && rm engine-assets.tar.xz ) || exit 1 |
97 | 73 | fi |
98 | 74 |
|
| 75 | +mkdir -p "$INSTDIR"/opt/ |
| 76 | +cp -a online/engine/instdir "$INSTDIR"/opt/collaboraoffice |
| 77 | + |
99 | 78 | ##### coolwsd & cool ##### |
100 | 79 |
|
101 | 80 | # build |
102 | 81 | ( cd online && ./autogen.sh ) || exit 1 |
103 | | -( cd online && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-silent-rules --disable-tests --with-lokit-path="$BUILDDIR"/core/include --with-lo-path=/opt/lokit --with-poco-includes=$BUILDDIR/poco/include --with-poco-libs=$BUILDDIR/poco/lib $ONLINE_EXTRA_BUILD_OPTIONS) || exit 1 |
| 82 | +( cd online && ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-silent-rules --disable-tests --with-lokit-path="$BUILDDIR"/online/engine/include --with-lo-path=/opt/collaboraoffice --with-poco-includes=$BUILDDIR/poco/include --with-poco-libs=$BUILDDIR/poco/lib $ONLINE_EXTRA_BUILD_OPTIONS) || exit 1 |
104 | 83 | ( cd online && make -j $(nproc)) || exit 1 |
105 | 84 |
|
106 | 85 | # copy stuff |
|
110 | 89 | if test -d online-branding ; then |
111 | 90 | if ! which sass &> /dev/null; then npm install -g sass; fi |
112 | 91 | cd online-branding |
113 | | - ./brand.sh $INSTDIR/opt/lokit $INSTDIR/usr/share/coolwsd/browser/dist CODE # CODE |
114 | | - ./brand.sh $INSTDIR/opt/lokit $INSTDIR/usr/share/coolwsd/browser/dist NC-theme-community # Nextcloud Office |
| 92 | + ./brand.sh $INSTDIR/opt/collaboraoffice $INSTDIR/usr/share/coolwsd/browser/dist CODE # CODE |
| 93 | + ./brand.sh $INSTDIR/opt/collaboraoffice $INSTDIR/usr/share/coolwsd/browser/dist NC-theme-community # Nextcloud Office |
115 | 94 | cd .. |
116 | 95 | fi |
0 commit comments