Browse Source

gnu: Add LibreOffice.

* gnu/packages/libreoffice.scm (xmlsec-src-libreoffice, libreoffice):
  New variables.

Co-authored-by: John Darrington <>
Andreas Enge 6 years ago
1 changed files with 196 additions and 4 deletions
  1. +196

+ 196
- 4
gnu/packages/libreoffice.scm View File

@ -18,25 +18,51 @@
;;; along with GNU Guix. If not, see <>.
(define-module (gnu packages libreoffice)
#:use-module (guix packages)
#:use-module (guix build-system gnu)
#:use-module (guix download)
#:use-module ((guix licenses)
#:select (gpl2+ lgpl2.1+ mpl1.1 mpl2.0 non-copyleft))
#:use-module (guix build-system gnu)
#:select (gpl2+ lgpl2.1+ mpl1.1 mpl2.0
non-copyleft x11-style))
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages bison)
#:use-module (gnu packages boost)
#:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages cups)
#:use-module (gnu packages curl)
#:use-module (gnu packages cyrus-sasl)
#:use-module (gnu packages databases)
#:use-module (gnu packages doxygen)
#:use-module (gnu packages flex)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages ghostscript)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
#:use-module (gnu packages gperf)
#:use-module (gnu packages gnuzilla)
#:use-module (gnu packages gstreamer)
#:use-module (gnu packages gtk)
#:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages java)
#:use-module (gnu packages linux)
#:use-module (gnu packages maths)
#:use-module (gnu packages openldap)
#:use-module (gnu packages openssl)
#:use-module (gnu packages pdf)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages xml))
#:use-module (gnu packages rdf)
#:use-module (gnu packages scanner)
#:use-module (gnu packages version-control)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (gnu packages zip))
(define-public ixion
@ -632,3 +658,169 @@ data file and an index file with binary search to look up words and phrases
and to return information on pronunciations, meaningss and synonyms.")
(license (non-copyleft "file://COPYING"
"See COPYING in the distribution."))))
;; LibreOffice requires an xmlsec source tarball; it does not even check
;; for the presence of an externally compiled library.
(define xmlsec-src-libreoffice
(method url-fetch)
(sha256 (base32
(define-public libreoffice
(name "libreoffice")
(version "")
(method url-fetch)
(version-prefix version 3) "/libreoffice-" version ".tar.xz"))
(sha256 (base32
(build-system gnu-build-system)
`(;; autoreconf is run by the LibreOffice build system, since after
;; unpacking the external xmlsec tarball, it applies a series of
;; patches to,, config.guess and config.sub.
("autoconf" ,autoconf)
("automake" ,automake)
("bison" ,bison)
("cppunit" ,cppunit)
("flex" ,flex)
("pkg-config" ,pkg-config)
("python" ,python)
("which" ,which)))
`(("bluez" ,bluez)
("boost" ,boost)
("clucene" ,clucene)
("cups" ,cups)
("dbus-glib" ,dbus-glib)
("fontconfig" ,fontconfig)
("gconf" ,gconf)
("glew" ,glew)
("glm" ,glm)
("gperf" ,gperf)
("graphite2" ,graphite2)
("gst-plugins-base" ,gst-plugins-base)
("gtk+" ,gtk+-2)
("harfbuzz" ,harfbuzz)
("hunspell" ,hunspell)
("hyphen" ,hyphen)
("libabw" ,libabw)
("libcdr" ,libcdr)
("libcmis" ,libcmis)
("libjpeg" ,libjpeg)
("libe-book" ,libe-book)
("libetonyek" ,libetonyek)
("libexttextcat" ,libexttextcat)
("libfreehand" ,libfreehand)
("libmspub" ,libmspub)
("libmwaw" ,libmwaw)
("libodfgen" ,libodfgen)
("libpagemaker" ,libpagemaker)
("libvisio" ,libvisio)
("libwpg" ,libwpg)
("libwps" ,libwps)
("libxrandr" ,libxrandr)
("libxrender" ,libxrender)
("libxslt" ,libxslt)
("libxt" ,libxt)
("lpsolve" ,lpsolve)
("mdds" ,mdds)
("mythes" ,mythes)
("neon" ,neon)
("nspr" ,nspr)
("nss" ,nss)
("openldap" ,openldap)
("openssl" ,openssl)
("orcus" ,orcus)
("perl" ,perl)
("perl-zip" ,perl-zip)
("poppler" ,poppler)
("postgresql" ,postgresql)
("python" ,python)
("redland" ,redland)
("sane-backends" ,sane-backends)
("unixodbc" ,unixodbc)
("unzip" ,unzip)
("vigra" ,vigra)
("xmlsec-src" ,xmlsec-src-libreoffice)
("zip" ,zip)))
`(#:parallel-build? #f ; Otherwise the build fails.
#:tests? #f ; Building the tests already fails.
#:make-flags '("build-nocheck") ; Do not build unit tests, which fails.
(modify-phases %standard-phases
(add-before 'configure 'prepare-src
(lambda* (#:key inputs #:allow-other-keys)
(let ((xmlsec (assoc-ref inputs "xmlsec-src")))
(list "sysui/"
(("/bin/sh") (which "bash")))
(mkdir "external/tarballs")
(string-append "external/tarballs/"
;; The following is required for building xmlsec from the
;; unpatched external tarball; since "configure" starts with
;; "/bin/sh", it needs to be executed by a command invoking
;; the shell.
(setenv "SHELL" (which "bash"))
(setenv "CONFIG_SHELL" (which "bash"))
(substitute* "external/libxmlsec/"
(("./configure") "$(CONFIG_SHELL) ./configure" ))
(add-after 'install 'bin-install
;; Create a symlink bin/soffice to the executable script.
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(mkdir bin)
(string-append out "/lib/libreoffice/program/soffice")
(string-append bin "/soffice")))
"--without-parallelism" ; otherwise the build fails
"--disable-fetch-external" ; disable downloads
"--with-system-libs" ; enable all --with-system-* flags
(string-append "--with-boost-libdir="
(assoc-ref %build-inputs "boost") "/lib")
;; Avoid a dependency on ucpp.
;; The fonts require an external tarball (crosextrafonts).
;; They should not be needed when system fonts are available.
;; With java, the build fails since sac.jar is missing.
;; FIXME: Enable once the corresponding inputs are packaged.
"--disable-firebird-sdbc" ; embedded firebird
(home-page "")
(synopsis "Office suite")
(description "LibreOffice is a comprehensive office suite. It contains
a number of components: Writer, a word processor; Calc, a spreadsheet
application; Impress, a presentation engine; Draw, a drawing and
flowcharting application; Base, a database and database frontend;
Math for editing mathematics.")
(license mpl2.0)))