Skip to content

Instantly share code, notes, and snippets.

@n-epifanov
n-epifanov / uno_bootstrap.py
Created February 27, 2018 09:26
This piece of code is required to get uno running on vanilla LibreOffice 4.4 with Python 2.7. LibreOffice from Ubuntu repo has a patched uno package and doesn't require this bootstrap code.
# XXX: LibreOffice UNO bootstrap.
sys.path.append('/opt/libreofficedev4.4/program')
os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:/opt/libreofficedev4.4/program/fundamentalrc')
import uno
@n-epifanov
n-epifanov / build-install-libreoffice-py2.sh
Last active May 10, 2019 06:12
A script to build and install LibreOffice 4.4.7.2 with Python 2.7 on Ubuntu Trusty 14.04. To import uno package you'll need to bootstrap it, see https://gist.github.com/nicktime/a35ed52a4b04d6da5b867c6907c825f3
#!/bin/bash -xe
sudo apt-get update
sudo apt-get build-dep libreoffice
sudo apt-get install pkg-config
mkdir libreoffice
cd libreoffice
wget https://downloadarchive.documentfoundation.org/libreoffice/old/4.4.7.2/src/libreoffice-4.4.7.2.tar.xz
wget https://downloadarchive.documentfoundation.org/libreoffice/old/4.4.7.2/src/libreoffice-dictionaries-4.4.7.2.tar.xz