Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update libreoffice version #40

Closed
ssinghi opened this issue Jan 27, 2019 · 13 comments
Closed

update libreoffice version #40

ssinghi opened this issue Jan 27, 2019 · 13 comments

Comments

@ssinghi
Copy link

ssinghi commented Jan 27, 2019

It will be great if the package can be upgraded to LibreOffice version 6.1.4 or something stable currently it is using an alpha build.

@vladholubiev
Copy link
Member

@ssinghi thanks for the reminder. I'll see if I have some time this week to update the LibreOffice

@aaronsturm
Copy link

Sending a quick ping on this as the last comment was in January. I would also appreciate a current version. Thanks!

@aaronsturm
Copy link

Hi @vladgolubev - Is there anything I can do to help this along? Since the Layer is tied to your AWS account, there's not much I can do besides creating my own layer? I'm newer to Lambda Layers so I'm not 100% sure.

@vladholubiev
Copy link
Member

Hey @aaronsturm

What would help is if you try to compile a newer version yourself and open a PR with changes to the compilation script. I’ll merge it and publish as a new layer version.

Last time I tried compiling newer version a month or two ago I ran into OS dependencies problems since LO removed some of the compilation flags.

I hope something changed in the recent 6.3 release but someone need to try.

@aaronsturm
Copy link

@vladgolubev - To confirm, it's this repository vladgolubev/serverless-libreoffice correct? I'll take a try at it and get back to you.

@vladholubiev
Copy link
Member

@aaronsturm yes, that's where compilation script resides in

@aaronsturm
Copy link

aaronsturm commented Sep 11, 2019

@vladgolubev - A quick update on this. It's currently stuck when trying to compile cairo. I've tried the compilation flags it mentions without success. I saw somewhere that you're a NodeJS dev who spent the time to figure out how to compile LibreOffice - I'm basically in the same boat but I will keep at it.

Here's a snippet of the errors.
...
In file included from /usr/include/assert.h:35:0,
from cairoint.h:57,
from cairo-analysis-surface.c:37:
/usr/include/features.h:376:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^~~~~~~
In file included from /usr/include/assert.h:35:0,
from cairoint.h:57,
from cairo-arc.c:37:
/usr/include/features.h:376:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^~~~~~~
In file included from /usr/include/assert.h:35:0,
from cairoint.h:57,
from cairo-array.c:39:
/usr/include/features.h:376:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^~~~~~~
In file included from /usr/include/assert.h:35:0,
from cairoint.h:57,
from cairo-atomic.c:34:
/usr/include/features.h:376:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^~~~~~~
In file included from /usr/include/assert.h:35:0,
from cairoint.h:57,
from cairo-base64-stream.c:39:
/usr/include/features.h:376:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^~~~~~~
CC cairo-base85-stream.lo
CC cairo-bentley-ottmann-rectangular.lo
cairo-base64-stream.c: In function ‘_cairo_base64_stream_write’:
...

@DanHulton
Copy link

I took a swing at this and managed to get it to compile with LibreOffice 6.3.2, but with a bunch of experimental steps. I'm honestly not sure which were strictly necessary to successfully build, and which were a bit of a blind alley. That said, here's my notes:

  • Start with https://github.com/vladgolubev/serverless-libreoffice, specifically the compile.sh shell file.
  • Before running autogen.sh:
    • sudo yum install java-devel
    • sudo yum install cairo-devel libjpeg-turbo-devel giflib-devel
    • Get and install libpng 1.6:
      • wget https://downloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz
      • tar xf libpng-1.6.37.tar.xz
      • cd libpng-1.6.37
      • ./configure --prefix=/usr --disable-static
      • make
      • sudo make install
    • Get and install doxygen 1.8:
      • wget http://doxygen.nl/files/doxygen-1.8.16.linux.bin.tar.gz
      • tar -xzvf doxygen-1.8.16.src.tar.gz
      • sudo mv doxygen-1.8.16/bin/doxygen /usr/bin/doxygen
    • Get and install gperf 3.1:
      • wget http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz
      • tar -xzvf gperf-3.1.tar.gz
      • cd gperf-3.1
      • ./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.1
      • make
      • make -j1 check
      • sudo make install
      • gperf --version
    • Get and install flex 2.6:
      • wget https://github.com/westes/flex/files/981163/flex-2.6.4.tar.gz
      • tar -xzvf flex-2.6.4.tar.gz
      • cd flex-2.6.4
      • ./autogen.sh
      • ./configure
      • make
      • sudo make install
      • flex --version
    • ./configure in libreoffice folder, to confirm.

Next, I used a modified autogen.sh:

./autogen.sh \
    --disable-avahi \
	--with-system-cairo \
    --disable-cairo-canvas \
    --disable-coinmp \
    --disable-cups \
    --disable-cve-tests \
    --disable-dbus \
    --disable-dconf \
    --disable-dependency-tracking \
    --disable-evolution2 \
    --disable-dbgutil \
    --disable-extension-integration \
    --disable-extension-update \
    --disable-firebird-sdbc \
    --disable-gio \
    --disable-gstreamer-0-10 \
    --disable-gstreamer-1-0 \
    --disable-gtk \
    --disable-gtk3 \
    --disable-introspection \
    --disable-largefile \
    --disable-lotuswordpro \
    --disable-lpsolve \
    --disable-odk \
    --disable-ooenv \
    --disable-pch \
    --disable-postgresql-sdbc \
    --disable-python \
    --disable-randr \
    --disable-report-builder \
    --disable-scripting-beanshell \
    --disable-scripting-javascript \
    --disable-sdremote \
    --disable-sdremote-bluetooth \
    --enable-mergelibs \
    --with-galleries="no" \
    --with-system-curl \
    --with-system-expat \
    --with-system-libxml \
    --with-system-nss \
    --with-system-openssl \
    --with-theme="no" \
    --without-export-validation \
    --without-helppack-integration \
    --without-java \
    --without-junit \
    --without-krb5 \
    --without-myspell-dicts \
    --without-system-dicts

Specifically, I removed the --without-fonts \ and --disable-kde4 \ lines.

The build will now run to "completion", though the unit tests at the end will fail. The test step works just fine, but you'll run into one last problem - the binary you've built won't run on Lambda. Make sure to follow vladholubiev/serverless-libreoffice#16 and copy libstdc++.so from your build machine into your instdir/program folder, and symlink it to libstdc++.so.6 in the same folder, then rebuild your lo.tar archive.

I hope some of this is helpful for rebuilding using Amazon Linux 2, as well, since we're closing in on the EOL of Node 8 on AWS Lambda.

@mrvisser
Copy link

@DanHulton This is great stuff, thanks for this. For what it's worth, I was plugging away on this in the last week and came up with mostly the same conclusions you did, though didn't package it up and run it on Lambda as I couldn't get around unit test failures that seem to be be related to freetype2.

In addition to compiling gperf-3.1 and flex-2.6.4, I also compiled and installed freetype-2.10.1 but maybe that's where I went wrong.

I wonder how you feel this will work on Amazon Linux 2 potentially running against older versions of these dependencies, or if the runtime doesn't have them at all? Or do these upgraded dependencies get included into the LO build itself and its not dependent on OS versions of these?

Thanks again!

@mrvisser
Copy link

I tried --without-fonts and it seemed to work fine. --without-fonts keeps the package size at 85M/350M. By removing the --without-fonts flags we're at 100M/410M, which is cutting even closer to the 500M /tmp volume limit

@vladholubiev
Copy link
Member

vladholubiev commented Jan 5, 2020

Good news: I was able to compile & run LibreOffice in the Node.js 12.x environment.
Bad news: its size is ~400 MB

The goal is to make it <250 MB when unzipped, which is what I'm working on right now

@tupini07
Copy link

tupini07 commented Jan 7, 2020

@vladgolubev That's great news! Is there any way we could help? Now that AWS deprecated NodeJS 8 it would be great to get this working again on one of the supported versions

@vladholubiev
Copy link
Member

Hey there, we've just released a new version which works with the new LibreOffice version 6.4.0.1

See https://github.com/shelfio/aws-lambda-libreoffice/releases/tag/v3.0.0 and https://github.com/vladgolubev/serverless-libreoffice/releases/tag/v6.4.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants