From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Enge Subject: PATCH: LibreOffice Date: Sun, 31 May 2015 11:08:31 +0200 Message-ID: <20150531090831.GA4344@debian> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="envbJBWh7q8WU6mo" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyzEW-0002oe-O8 for guix-devel@gnu.org; Sun, 31 May 2015 05:08:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyzES-0006bR-KW for guix-devel@gnu.org; Sun, 31 May 2015 05:08:40 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:63822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyzES-0006b9-5X for guix-devel@gnu.org; Sun, 31 May 2015 05:08:36 -0400 Content-Disposition: inline List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Patch attached. The binary "soffice" ends up in a subdirectory of "lib", so I added a symbolic link. Andreas --envbJBWh7q8WU6mo Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-gnu-Add-LibreOffice.patch" >From c8d4f0269b6494e9d2e84816cb4a149641afc047 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Fri, 29 May 2015 23:49:19 +0200 Subject: [PATCH] gnu: Add LibreOffice. * gnu/packages/libreoffice.scm (xmlsec-src-libreoffice, libreoffice): New variables. Co-authored-by: John Darrington --- gnu/packages/libreoffice.scm | 230 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 228 insertions(+), 2 deletions(-) diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm index 70f0e8e..a8a745e 100644 --- a/gnu/packages/libreoffice.scm +++ b/gnu/packages/libreoffice.scm @@ -21,22 +21,50 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module ((guix licenses) - #:select (gpl2+ lgpl2.1+ mpl1.1 mpl2.0 non-copyleft)) + #:select (gpl2+ lgpl2.1+ mpl1.1 mpl2.0 + non-copyleft x11-style)) + #:use-module (guix build utils) #:use-module (guix build-system gnu) + #:use-module (gnu packages autotools) + #: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 gdb) #: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 which) + #:renamer (symbol-prefix-proc 'gnu:)) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (gnu packages zip)) (define-public ixion (package @@ -632,3 +660,201 @@ 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 + (package (inherit xmlsec) + (name "xmlsec-src-libreoffice") + (version "1.2.14") + (source + (origin + (method url-fetch) + (uri + (string-append + "http://dev-www.libreoffice.org/src/" + "1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz")) + (sha256 (base32 + "0jnxxygg6z5zi6za94dvxmg1bfar1wh8p5xa2bzbha0qcn2m02ir")))) + (build-system gnu-build-system) + (inputs + `(("perl" ,perl))) + (arguments + `(#:phases + ;; Patch shebangs, tar again and copy to store. + (modify-phases %standard-phases + (replace 'configure + (lambda _ + (substitute* "config.guess" + ((" /bin/sh") (string-append " " (which "sh")))) + #t)) + (replace 'build + (lambda _ + (chdir "..") + #t)) + (delete 'check) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (mkdir out) + (zero? + (system* "tar" "czvf" + (string-append out "/xmlsec1-1.2.14.tar.gz") + "xmlsec1-1.2.14")))))))))) + +(define-public libreoffice + (package + (name "libreoffice") + (version "4.4.3.2") + (source + (origin + (method url-fetch) + (uri + (string-append + "http://download.documentfoundation.org/libreoffice/src/" + (string-take version 5) "/libreoffice-" version ".tar.xz")) + (sha256 (base32 + "0rl9x01ngxwnqwzxkrqy4vks4rb024m75z0w4zidwyp0az0m8qdd")))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) ; for the patched xmlsec tarball + ("automake" ,automake) ; ditto + ("bison" ,bison) + ("cppunit" ,cppunit) + ("flex" ,flex) + ("pkg-config" ,pkg-config) + ("python" ,python) + ("which" ,gnu:which))) + (inputs + `(("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))) + (arguments + `(#: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. + #:phases + (modify-phases %standard-phases + (add-before 'configure 'prepare-src + (lambda* (#:key inputs #:allow-other-keys) + (let ((xmlsec (assoc-ref inputs "xmlsec-src"))) + (substitute* + (list "sysui/CustomTarget_share.mk" + "solenv/gbuild/gbuild.mk" + "solenv/gbuild/platform/unxgcc.mk" + "external/libxmlsec/xmlsec1-oldlibtool.patch") + (("/bin/sh") (which "bash"))) + ;; Adapt patch to patch-shebanged originals. + (substitute* + "external/libxmlsec/xmlsec1-update-config.guess.patch.1" + (("#! /bin/sh") (string-append "#!" (which "sh"))) + (("s /bin/sh") (string-append "s " (which "sh")))) + (mkdir "external/tarballs") + (symlink + (string-append xmlsec "/xmlsec1-1.2.14.tar.gz") + (string-append "external/tarballs/" + "1f24ab1d39f4a51faf22244c94a6203f-" + "xmlsec1-1.2.14.tar.gz")) + ;; The following is required for building xmlsec from the + ;; external tarball. Since "autoreconf" is called after + ;; applying the patches shipped with libreoffice, "configure" + ;; again starts with "/bin/sh" and needs to be executed with + ;; a command invoking the shell. + (setenv "SHELL" (which "bash")) + (setenv "CONFIG_SHELL" (which "bash")) + (substitute* "external/libxmlsec/ExternalProject_xmlsec.mk" + (("./configure") "$(CONFIG_SHELL) ./configure" )) + #t))) + (add-after 'install 'bin-install + ;; Create a symlink bin/libreoffice to the executable script. + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (mkdir bin) + (symlink + (string-append out "/lib/libreoffice/program/soffice") + (string-append bin "/libreoffice"))) + #t))) + #:configure-flags + (list + "--enable-release-build" + "--enable-verbose" + "--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. + "--with-idlc-cpp=cpp" + ;; The fonts require an external tarball (crosextrafonts). + ;; They should not be needed when system fonts are available. + "--without-fonts" + ;; FIXME: Enable once the corresponding inputs are packaged. + "--without-system-npapi-headers" + ;; With java, the build fails since sac.jar is missing. + "--without-java" + "--disable-coinmp" + "--disable-firebird-sdbc" ; embedded firebird + "--disable-gltf" + "--disable-liblangtag"))) + (home-page "https://www.libreoffice.org/") + (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))) -- 2.2.1 --envbJBWh7q8WU6mo--