gnu: Simplify package inputs.
[jackhill/guix/guix.git] / gnu / packages / libreoffice.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2016, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2017 Alex Griffin <a@ajgrf.com>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2017 Andy Wingo <wingo@igalia.com>
9 ;;; Copyright © 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
10 ;;; Copyright © 2017, 2018, 2019 Marius Bakke <mbakke@fastmail.com>
11 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
12 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
13 ;;; Copyright © 2018, 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
14 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
15 ;;; Copyright © 2020 Marcin Karpezo <sirmacik@wioo.waw.pl>
16 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages libreoffice)
33 #:use-module (guix build-system glib-or-gtk)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system python)
36 #:use-module (guix build-system trivial)
37 #:use-module (guix download)
38 #:use-module (guix git-download)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix packages)
41 #:use-module (guix utils)
42 #:use-module (ice-9 match)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages aidc)
45 #:use-module (gnu packages aspell)
46 #:use-module (gnu packages autotools)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages bison)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages cups)
53 #:use-module (gnu packages curl)
54 #:use-module (gnu packages cyrus-sasl)
55 #:use-module (gnu packages databases)
56 #:use-module (gnu packages documentation)
57 #:use-module (gnu packages flex)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages game-development)
61 #:use-module (gnu packages ghostscript)
62 #:use-module (gnu packages gl)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages gperf)
66 #:use-module (gnu packages gnupg)
67 #:use-module (gnu packages gstreamer)
68 #:use-module (gnu packages gtk)
69 #:use-module (gnu packages icu4c)
70 #:use-module (gnu packages image)
71 #:use-module (gnu packages java)
72 #:use-module (gnu packages linux)
73 #:use-module (gnu packages logging)
74 #:use-module (gnu packages maths)
75 #:use-module (gnu packages nss)
76 #:use-module (gnu packages openldap)
77 #:use-module (gnu packages pdf)
78 #:use-module (gnu packages perl)
79 #:use-module (gnu packages perl-compression)
80 #:use-module (gnu packages pkg-config)
81 #:use-module (gnu packages python)
82 #:use-module (gnu packages rdf)
83 #:use-module (gnu packages scanner)
84 #:use-module (gnu packages tls)
85 #:use-module (gnu packages version-control)
86 #:use-module (gnu packages xml)
87 #:use-module (gnu packages xorg))
88
89 (define-public ixion
90 (package
91 (name "ixion")
92 (version "0.16.1")
93 (source
94 (origin
95 (method url-fetch)
96 (uri (string-append "http://kohei.us/files/ixion/src/libixion-"
97 version ".tar.xz"))
98 (sha256
99 (base32
100 "17q84mhy4rb3masvjw24x549irdjmccnc8n04xh58v9l7hxn8v22"))))
101 (build-system gnu-build-system)
102 (native-inputs
103 (list pkg-config))
104 (inputs
105 (list mdds python spdlog))
106 (home-page "https://gitlab.com/ixion/ixion")
107 (synopsis "General purpose formula parser and interpreter")
108 (description "Ixion is a library for calculating the results of formula
109 expressions stored in multiple named targets, or \"cells\". The cells can
110 be referenced from each other, and the library takes care of resolving
111 their dependencies automatically upon calculation.")
112 (license license:mpl2.0)))
113
114 (define-public orcus
115 (package
116 (name "orcus")
117 (version "0.16.1")
118 (source
119 (origin
120 (method url-fetch)
121 (uri (string-append "http://kohei.us/files/orcus/src/lib"
122 "orcus-" version ".tar.xz"))
123 (sha256
124 (base32
125 "1bps34sqz7wlrl01ssywjd5fbmssplifs0rskivgrg801lr6pcm4"))))
126 (build-system gnu-build-system)
127 (arguments
128 `(#:configure-flags '("--disable-static")))
129 (native-inputs
130 (list pkg-config))
131 (inputs
132 (list ixion mdds python zlib))
133 (home-page "https://gitlab.com/orcus/orcus")
134 (synopsis "File import filter library for spreadsheet documents")
135 (description "Orcus is a library that provides a collection of standalone
136 file processing filters. It is currently focused on providing filters for
137 spreadsheet documents. The library includes import filters for
138 Microsoft Excel 2007 XML, Microsoft Excel 2003 XML, Open Document Spreadsheet,
139 Plain Text, Gnumeric XML, Generic XML. It also includes low-level parsers for
140 CSV, CSS and XML.")
141 (license license:mpl2.0)))
142
143 (define-public unoconv
144 (package
145 (name "unoconv")
146 (version "0.9.0")
147 (source
148 (origin
149 (method url-fetch)
150 (uri (pypi-uri "unoconv" version))
151 (sha256
152 (base32 "0cb0bvyxib3xrj0jdgizhp6p057lr8kqnd3n921rin37ivcvz3ih"))))
153 (build-system python-build-system)
154 (arguments
155 `(#:phases
156 (modify-phases %standard-phases
157 (add-after 'unpack 'stop-hash-sniffing
158 ;; Fixes <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=39647#11>.
159 ;; Submitted upsteam: <https://github.com/unoconv/unoconv/pull/531>.
160 (lambda _
161 (substitute* "unoconv"
162 (("sys.argv\\[0\\]\\.split\\('2'\\)")
163 "os.path.basename(sys.argv[0]).split('2')"))
164 #t))
165 (add-after 'unpack 'patch-find_offices
166 ;; find_offices is a convoluted cross-platform treasure hunt.
167 ;; Keep things simple and return the correct paths immediately.
168 (lambda* (#:key inputs #:allow-other-keys)
169 (let* ((libreoffice (assoc-ref inputs "libreoffice")))
170 (substitute* "unoconv"
171 (("def find_offices\\(\\):" match)
172 (string-append
173 match "\n"
174 " return [Office("
175 "'" libreoffice "/lib/libreoffice', "
176 "'" libreoffice "/lib/libreoffice/program', "
177 "'" libreoffice "/lib/libreoffice/program', "
178 "'" libreoffice "/lib/libreoffice/program/pyuno.so', "
179 "'" libreoffice "/bin/soffice', "
180 "sys.executable, "
181 "None)]\n")))
182 #t))))))
183 (inputs
184 (list libreoffice))
185 (home-page "http://dag.wiee.rs/home-made/unoconv/")
186 (synopsis "Convert between any document format supported by LibreOffice")
187 (description
188 "Unoconv is a command-line utility to convert documents from any format
189 that LibreOffice can import, to any format it can export. It can be used for
190 batch processing and can apply custom style templates and filters.
191
192 Unoconv converts between over a hundred formats, including Open Document
193 Format (@file{.odt}, @file{.ods}, @file{.odp})), Portable Document Format
194 (@file{.pdf}), HTML and XHTML, RTF, DocBook (@file{.xml}), @file{.doc} and
195 @file{.docx}), @file{.xls} and @file{.xlsx}).
196
197 All required fonts must be installed on the converting system.")
198 (license license:gpl2)))
199
200 (define-public librevenge
201 (package
202 (name "librevenge")
203 (version "0.0.4")
204 (source
205 (origin
206 (method url-fetch)
207 (uri (string-append "mirror://sourceforge/libwpd/librevenge/librevenge-"
208 version "/librevenge-" version ".tar.xz"))
209 (sha256 (base32
210 "1cj76cz4mqcy2mgv9l5xlc95bypyk8zbq0ls9cswqrs2y0lhfgwk"))))
211 (build-system gnu-build-system)
212 (native-inputs
213 (list cppunit doxygen pkg-config))
214 (inputs
215 (list zlib))
216 (propagated-inputs ; Referenced by .la files
217 (list boost))
218 (arguments
219 ;; avoid triggering configure errors by simple inclusion of boost headers
220 `(#:configure-flags '("--disable-werror"
221 ;; Avoid undefined library references
222 "LDFLAGS=-lboost_system")))
223 (home-page "https://sourceforge.net/p/libwpd/wiki/librevenge/")
224 (synopsis "Document importer for office suites")
225 (description "Librevenge is a base library for writing document import
226 filters. It has interfaces for text documents, vector graphics,
227 spreadsheets and presentations.")
228 (license (list license:mpl2.0 license:lgpl2.1+)))) ; dual-licensed
229
230 (define-public libwpd
231 (package
232 (name "libwpd")
233 (version "0.10.3")
234 (source
235 (origin
236 (method url-fetch)
237 (uri (string-append "mirror://sourceforge/libwpd/libwpd/"
238 "libwpd-" version "/libwpd-" version ".tar.xz"))
239 (sha256 (base32
240 "02fx8bngslcj7i5g1gx2kiign4vp09wrmp5wpvix9igxcavb0r94"))))
241 (build-system gnu-build-system)
242 (arguments
243 `(#:configure-flags '("--disable-werror")))
244 (native-inputs
245 (list doxygen pkg-config))
246 (propagated-inputs
247 (list librevenge)) ; in Requires field of .pkg
248 (inputs
249 (list zlib))
250 (home-page "http://libwpd.sourceforge.net/")
251 (synopsis "Library for importing WordPerfect documents")
252 (description "Libwpd is a C++ library designed to help process
253 WordPerfect documents. It is most commonly used to import such documents
254 into other word processors.")
255 (license (list license:mpl2.0 license:lgpl2.1+)))) ; dual-licensed
256
257 (define-public libe-book
258 (package
259 (name "libe-book")
260 (version "0.1.3")
261 (source
262 (origin
263 (method url-fetch)
264 (uri (string-append "mirror://sourceforge/libebook/libe-book-"
265 version "/libe-book-" version ".tar.xz"))
266 (sha256
267 (base32
268 "1yg1vws1wggzhjw672bpgh2x541g5i9wryf67g51m0r79zrqz3by"))
269 (modules '((guix build utils)))
270 (snippet
271 '(begin
272 ;; This can be removed with the next release.
273 ;; Needed for icu4c compatibility >= 68.0.
274 (substitute* "src/lib/EBOOKCharsetConverter.cpp"
275 (("TRUE, TRUE, &status")
276 "true, true, &status"))))))
277 (build-system gnu-build-system)
278 (native-inputs
279 (list cppunit gperf pkg-config))
280 (propagated-inputs ; in Requires or Requires.private field of .pkg
281 (list icu4c liblangtag librevenge libxml2))
282 (inputs
283 (list boost))
284 (arguments
285 ;; avoid triggering configure errors by simple inclusion of boost headers
286 `(#:configure-flags '("--disable-werror")))
287 (home-page "http://libebook.sourceforge.net")
288 (synopsis "Library for import of reflowable e-book formats")
289 (description "Libe-book is a library and a set of tools for reading and
290 converting various reflowable e-book formats. Currently supported are:
291 Broad Band eBook, eReader .pdb, FictionBook v. 2 (including zipped files),
292 PalmDoc Ebook, Plucker .pdb, QiOO (mobile format, for java-enabled
293 cellphones), TCR (simple compressed text format), TealDoc, zTXT,
294 ZVR (simple compressed text format).")
295 (license license:mpl2.0)))
296
297 (define-public libepubgen
298 (package
299 (name "libepubgen")
300 (version "0.1.1")
301 (source
302 (origin
303 (method url-fetch)
304 (uri (string-append "mirror://sourceforge/libepubgen/libepubgen-"
305 version "/libepubgen-" version ".tar.xz"))
306 (sha256
307 (base32
308 "1b8mc9zzrqypj1v9zdy3ybc48pw0rfr06cyi7n6grvybjjwq9q03"))))
309 (build-system gnu-build-system)
310 (native-inputs
311 (list cppunit pkg-config))
312 (inputs
313 (list libxml2 boost))
314 (propagated-inputs ; in Requires field of .pkg
315 (list librevenge))
316 (home-page "https://sourceforge.net/projects/libepubgen/")
317 (synopsis "EPUB generator library for librevenge")
318 (description "libepubgen is an EPUB generator for librevenge. It supports
319 librevenge's text document interface and--currently in a very limited
320 way--presentation and vector drawing interfaces.")
321 (license license:mpl2.0)))
322
323 (define-public libwpg
324 (package
325 (name "libwpg")
326 (version "0.3.3")
327 (source
328 (origin
329 (method url-fetch)
330 (uri (string-append "mirror://sourceforge/libwpg/libwpg/"
331 "libwpg-" version "/libwpg-" version ".tar.xz"))
332 (sha256 (base32
333 "074x159immf139szkswv2zapnq75p7xk10dbha2p9193hgwggcwr"))))
334 (build-system gnu-build-system)
335 (native-inputs
336 (list doxygen pkg-config))
337 (propagated-inputs
338 (list libwpd)) ; in Requires field of .pkg
339 (inputs
340 (list perl zlib))
341 (home-page "http://libwpg.sourceforge.net/")
342 (synopsis "Library and tools for the WordPerfect Graphics format")
343 (description "The libwpg project provides a library and tools for
344 working with graphics in the WPG (WordPerfect Graphics) format.")
345 (license (list license:mpl2.0 license:lgpl2.1+)))) ; dual-licensed
346
347 (define-public libcmis
348 (package
349 (name "libcmis")
350 (version "0.5.2")
351 (source
352 (origin
353 (method url-fetch)
354 (uri (string-append "https://github.com/tdf/libcmis/releases/download/v"
355 version "/libcmis-" version ".tar.xz"))
356 (sha256
357 (base32
358 "18h0a2gsfxvlv03nlcfvw9bzsflq5sin9agq6za103hr0ab8vcfp"))))
359 (build-system gnu-build-system)
360 (native-inputs
361 (list cppunit pkg-config))
362 (propagated-inputs ; in Requires field of .pkg
363 (list curl libxml2))
364 (inputs
365 (list boost cyrus-sasl openssl))
366 (arguments
367 `(#:configure-flags
368 (list
369 ;; FIXME: Man pages generation requires docbook-to-man; reenable
370 ;; it once this is available.
371 "--without-man"
372 ;; XXX: A configure test fails with GCC7 when including Boost headers.
373 "--disable-werror"
374 ;; During configure, the boost headers are found, but linking
375 ;; fails without the following flag.
376 (string-append "--with-boost="
377 (assoc-ref %build-inputs "boost")))))
378 (home-page "https://github.com/tdf/libcmis")
379 (synopsis "CMIS client library")
380 (description "LibCMIS is a C++ client library for the CMIS interface. It
381 allows C++ applications to connect to any ECM behaving as a CMIS server such
382 as Alfresco or Nuxeo.")
383 (license
384 (list license:mpl1.1 license:gpl2+ license:lgpl2.1+)))) ; triple license
385
386 (define-public libabw
387 (package
388 (name "libabw")
389 (version "0.1.3")
390 (source
391 (origin
392 (method url-fetch)
393 (uri (string-append "https://dev-www.libreoffice.org/src/libabw/"
394 "libabw-" version ".tar.xz"))
395 (sha256 (base32
396 "1vbfrmnvib3cym0yyyabnd8xpx4f7wp20vnn09s6dln347fajqz7"))))
397 (build-system gnu-build-system)
398 (native-inputs
399 (list doxygen gperf perl pkg-config))
400 (propagated-inputs ; in Requires or Requires.private field of .pkg
401 (list librevenge libxml2))
402 (inputs
403 (list boost))
404 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libabw")
405 (synopsis "Library for parsing the AbiWord format")
406 (description "Libabw is a library that parses the file format of
407 AbiWord documents.")
408 (license license:mpl2.0)))
409
410 (define-public libcdr
411 (package
412 (name "libcdr")
413 (version "0.1.7")
414 (source
415 (origin
416 (method url-fetch)
417 (uri (string-append "https://dev-www.libreoffice.org/src/" name "/"
418 name "-" version ".tar.xz"))
419 (sha256 (base32
420 "1m6dirmyhqwnrpv80z97x5k5hdh4kh8a8zlq3smbjrilc6fj8rjn"))))
421 (build-system gnu-build-system)
422 (native-inputs
423 (list cppunit doxygen pkg-config))
424 (propagated-inputs ; in Requires or Requires.private field of .pkg
425 (list icu4c lcms librevenge zlib))
426 (inputs
427 (list boost))
428 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libcdr")
429 (synopsis "Library for parsing the CorelDRAW format")
430 (description "Libcdr is a library that parses the file format of
431 CorelDRAW documents of all versions.")
432 (license license:mpl2.0)))
433
434 (define-public libetonyek
435 (package
436 (name "libetonyek")
437 (version "0.1.10")
438 (source
439 (origin
440 (method url-fetch)
441 (uri (string-append "http://dev-www.libreoffice.org/src/" name "/"
442 name "-" version ".tar.xz"))
443 (sha256 (base32
444 "16hy60ws29pb4pz3z5l4920yn9hnk2vlij0xfs5qi1w4drd46c5l"))))
445 (build-system gnu-build-system)
446 (arguments
447 `(#:configure-flags '("--with-mdds=1.5")))
448 (native-inputs
449 (list cppunit doxygen gperf pkg-config))
450 (propagated-inputs ; in Requires or Requires.private field of .pkg
451 (list liblangtag librevenge libxml2 zlib))
452 (inputs
453 (list boost glm mdds))
454 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libetonyek")
455 (synopsis "Library for parsing the Apple Keynote format")
456 (description "Libetonyek is a library that parses the file format of
457 Apple Keynote documents. It currently supports Keynote versions 2 to 5.")
458 (license license:mpl2.0)))
459
460 (define-public liblangtag
461 (package
462 (name "liblangtag")
463 (version "0.6.3")
464 (source
465 (origin
466 (method url-fetch)
467 (uri (string-append "https://bitbucket.org/tagoh/liblangtag/downloads/"
468 "liblangtag-" version ".tar.bz2"))
469 (sha256
470 (base32 "1g9kwxx60q0hpwvs66ys1cb9qg54hfvbivadwli8sfpc085a44hz"))))
471 (build-system gnu-build-system)
472 (native-inputs
473 (list libtool pkg-config))
474 (inputs
475 (list libxml2))
476 (home-page "https://bitbucket.org/tagoh/liblangtag")
477 (synopsis "Library to access tags for identifying languages")
478 (description "Liblangtag implements an interface to work with tags
479 for identifying languages as described in RFC 5646. It supports the
480 extensions described in RFC6067 and RFC6497, and Extension T for
481 language/locale identifiers as described in the Unicode CLDR
482 standard 21.0.2.")
483 (license (list license:lgpl3+ license:mpl2.0)))) ; dual license
484
485 (define-public libexttextcat
486 (package
487 (name "libexttextcat")
488 (version "3.4.5")
489 (source
490 (origin
491 (method url-fetch)
492 (uri (string-append "http://dev-www.libreoffice.org/src/" name "/"
493 name "-" version ".tar.xz"))
494 (sha256 (base32
495 "1j6sjwkyhqvsgyw938bxxfwkzzi1mahk66g5342lv6j89jfvrz8k"))))
496 (build-system gnu-build-system)
497 (home-page "https://www.freedesktop.org/wiki/Software/libexttextcat/")
498 (synopsis "Text Categorization library")
499 (description "Libexttextcat is an N-Gram-Based Text Categorization
500 library primarily intended for language guessing.")
501 (license (license:non-copyleft "file://LICENSE"
502 "See LICENSE in the distribution."))))
503
504 (define-public libfreehand
505 (package
506 (name "libfreehand")
507 (version "0.1.2")
508 (source
509 (origin
510 (method url-fetch)
511 (uri (string-append "http://dev-www.libreoffice.org/src/" name "/"
512 name "-" version ".tar.xz"))
513 (sha256 (base32
514 "1b1lvqh68rwij1yvmxy02hsmh7i74ma5767mk8mg5nx6chajshhf"))))
515 (build-system gnu-build-system)
516 (arguments
517 '(#:configure-flags '("--disable-werror")
518 #:phases (modify-phases %standard-phases
519 (add-before 'build 'adjust-for-ICU-65
520 (lambda _
521 ;; Fix build with ICU 65 and later. Taken from this
522 ;; upstream commit, remove for libfreehand > 0.1.2:
523 ;; https://gerrit.libreoffice.org/#/c/80224/
524 (substitute* "src/lib/libfreehand_utils.cpp"
525 (("U16_NEXT.*" all)
526 (string-append all ";\n")))
527 #t)))))
528 (native-inputs
529 (list cppunit doxygen gperf perl pkg-config))
530 (inputs
531 (list icu4c lcms))
532 (propagated-inputs ; in Requires or Requires.private field of .pkg
533 (list librevenge zlib))
534 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libfreehand")
535 (synopsis "Library for parsing the FreeHand format")
536 (description "Libfreehand is a library that parses the file format of
537 Aldus/Macromedia/Adobe FreeHand documents.")
538 (license license:mpl2.0)))
539
540 (define-public libmspub
541 (package
542 (name "libmspub")
543 (version "0.1.4")
544 (source
545 (origin
546 (method url-fetch)
547 (uri (string-append "https://dev-www.libreoffice.org/src/" name "/"
548 name "-" version ".tar.xz"))
549 (sha256 (base32
550 "1fhkn013gzg59f4z7rldpbi0nj7lgdqzxanspsqa6axvmahw2dpg"))
551 (modules '((guix build utils)))
552 (snippet
553 '(begin
554 ;; This can be removed with the next release.
555 ;; https://gerrit.libreoffice.org/c/libmspub/+/73814
556 (substitute* "src/lib/MSPUBMetaData.h"
557 (("include <vector>" all)
558 (string-append all "\n#include <cstdint>")))))))
559 (build-system gnu-build-system)
560 (native-inputs
561 (list doxygen pkg-config))
562 (propagated-inputs ; in Requires or Requires.private field of .pkg
563 (list icu4c librevenge zlib))
564 (inputs
565 (list boost))
566 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libmspub")
567 (synopsis "Library for parsing the Microsoft Publisher format")
568 (description "Libmspub is a library that parses the file format of
569 Microsoft Publisher documents of all versions.")
570 (license license:mpl2.0)))
571
572 (define-public libnumbertext
573 (package
574 (name "libnumbertext")
575 (version "1.0.7")
576 (source
577 (origin
578 (method url-fetch)
579 (uri (string-append "https://github.com/Numbertext/libnumbertext/"
580 "releases/download/" version
581 "/libnumbertext-" version ".tar.xz"))
582 (sha256
583 (base32 "1z31idnmd9iv6ra5dcsn7q70wv32clk2sqc5bbhimqcsp2f29f0p"))))
584 (build-system gnu-build-system)
585 (arguments
586 `(#:configure-flags '("--disable-static")))
587 (home-page "https://github.com/Numbertext/libnumbertext")
588 (synopsis "Language-neutral @code{NUMBERTEXT} and @code{MONEYTEXT} functions")
589 (description
590 "The libnumbertext library provides language-neutral @code{NUMBERTEXT}
591 and @code{MONEYTEXT} functions for LibreOffice Calc, available for C++ and
592 Java.")
593 (license (list license:lgpl3+ license:bsd-3))))
594
595 (define-public libpagemaker
596 (package
597 (name "libpagemaker")
598 (version "0.0.4")
599 (source
600 (origin
601 (method url-fetch)
602 (uri (string-append "https://dev-www.libreoffice.org/src/libpagemaker/"
603 "libpagemaker-" version ".tar.xz"))
604 (sha256 (base32
605 "17ai8ajffr0ixxmmcv3k5vgjlcsix38ldb4fw2arild70pbsrbb6"))))
606 (build-system gnu-build-system)
607 (arguments
608 `(#:configure-flags '("--disable-werror")))
609 (native-inputs
610 (list doxygen pkg-config))
611 (propagated-inputs ; in Requires field of .pkg
612 (list librevenge))
613 (inputs
614 (list boost zlib))
615 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libpagemaker")
616 (synopsis "Library for parsing the PageMaker format")
617 (description "Libpagemaker is a library that parses the file format of
618 Aldus/Adobe PageMaker documents. Currently it only understands documents
619 created by PageMaker version 6.x and 7.")
620 (license license:mpl2.0)))
621
622 (define-public libvisio
623 (package
624 (name "libvisio")
625 (version "0.1.7")
626 (source
627 (origin
628 (method url-fetch)
629 (uri (string-append "http://dev-www.libreoffice.org/src/libvisio/"
630 "libvisio-" version ".tar.xz"))
631 (sha256 (base32
632 "0k7adcbbf27l7n453cca1m6s9yj6qvb5j6bsg2db09ybf3w8vbwg"))))
633 (build-system gnu-build-system)
634 (native-inputs
635 (list cppunit doxygen gperf perl pkg-config))
636 (propagated-inputs ; in Requires or Requires.private field of .pkg
637 (list icu4c librevenge libxml2))
638 (inputs
639 (list boost))
640 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libvisio")
641 (synopsis "Library for parsing the Microsoft Visio format")
642 (description "Libvisio is a library that parses the file format of
643 Microsoft Visio documents of all versions.")
644 (license license:mpl2.0)))
645
646 (define-public libodfgen
647 (package
648 (name "libodfgen")
649 (version "0.1.8")
650 (source
651 (origin
652 (method url-fetch)
653 (uri (string-append "mirror://sourceforge/libwpd/libodfgen/"
654 "libodfgen-" version "/libodfgen-" version ".tar.xz"))
655 (sha256 (base32
656 "0986c5gw4vdfz7bcmpdfz07inba5wxsx4f6xvndknqj6zlkh082m"))))
657 (build-system gnu-build-system)
658 (native-inputs
659 (list doxygen pkg-config))
660 (propagated-inputs ; in Requires field of .pkg
661 (list librevenge))
662 (inputs
663 (list boost libxml2 zlib))
664 (arguments
665 ;; Avoid triggering configure errors by simple inclusion of Boost headers.
666 `(#:configure-flags '("--disable-werror")))
667 (home-page "https://sourceforge.net/p/libwpd/wiki/libodfgen/")
668 (synopsis "ODF (Open Document Format) library")
669 (description "Libodfgen is a library for generating documents in the
670 Open Document Format (ODF). It provides generator implementations for all
671 document interfaces supported by librevenge:
672 text documents, vector drawings, presentations and spreadsheets.")
673 (license (list license:mpl2.0 license:lgpl2.1+)))) ; dual license
674
675 (define-public libmwaw
676 (package
677 (name "libmwaw")
678 (version "0.3.19")
679 (source
680 (origin
681 (method url-fetch)
682 (uri (string-append "mirror://sourceforge/libmwaw/libmwaw/libmwaw-"
683 version "/libmwaw-" version ".tar.xz"))
684 (sha256
685 (base32 "1bx5xnw8sk5h26x2z7hfac7hfbm68zqg0jilp15qr0pwxqsf4wmj"))))
686 (build-system gnu-build-system)
687 (native-inputs
688 (list doxygen pkg-config))
689 (propagated-inputs ; in Requires field of .pc file
690 (list librevenge))
691 (inputs
692 (list boost zlib))
693 (home-page "https://sourceforge.net/p/libmwaw/wiki/Home/")
694 (synopsis "Import library for some old Macintosh text documents")
695 (description "Libmwaw contains some import filters for old Macintosh
696 text documents (MacWrite, ClarisWorks, ... ) and for some graphics and
697 spreadsheet documents.")
698 (license (list license:mpl2.0 license:lgpl2.1+)))) ; dual license
699
700 (define-public libstaroffice
701 (package
702 (name "libstaroffice")
703 (version "0.0.7")
704 (source
705 (origin
706 (method url-fetch)
707 (uri (string-append "https://github.com/fosnola/libstaroffice/releases/download/"
708 version "/libstaroffice-" version ".tar.xz"))
709 (sha256 (base32
710 "1ny8411273k2bq7mnpmcvri3rd46b2j67wfypqkp3y8nhanv0kzr"))))
711 (build-system gnu-build-system)
712 (inputs
713 (list librevenge zlib))
714 (native-inputs
715 (list pkg-config))
716 (home-page "https://github.com/fosnola/libstaroffice")
717 (synopsis "Provides LibreOffice support for old StarOffice documents")
718 (description "@code{libstaroffice} is an import filter for the document formats
719 from the old StarOffice (.sdc, .sdw, ...).")
720 (license (list license:mpl2.0 license:lgpl2.1+)))) ; dual license
721
722 (define-public libwps
723 (package
724 (name "libwps")
725 (version "0.4.12")
726 (source
727 (origin
728 (method url-fetch)
729 (uri (string-append "mirror://sourceforge/" name "/" name "/"
730 name "-" version "/" name "-" version ".tar.xz"))
731 (sha256 (base32
732 "1nsfacqp5sfkyayw7q0wp68lidksd1wjdix8qmsbf0vdl19gn6p2"))))
733 (build-system gnu-build-system)
734 (native-inputs
735 (list doxygen pkg-config))
736 (propagated-inputs ; in Requires field of .pkg
737 (list librevenge))
738 (inputs
739 (list boost zlib))
740 (home-page "http://libwps.sourceforge.net/")
741 (synopsis "Import library for Microsoft Works text documents")
742 (description "Libwps is a library for importing files in the Microsoft
743 Works word processor file format.")
744 (license (list license:mpl2.0 license:lgpl2.1+)))) ; dual license
745
746 (define-public libzmf
747 (package
748 (name "libzmf")
749 (version "0.0.2")
750 (source
751 (origin
752 (method url-fetch)
753 (uri (string-append "http://dev-www.libreoffice.org/src/libzmf/libzmf-"
754 version ".tar.xz"))
755 (sha256 (base32
756 "08mg5kmkjrmqrd8j5rkzw9vdqlvibhb1ynp6bmfxnzq5rcq1l197"))))
757 (build-system gnu-build-system)
758 (arguments
759 ;; A harmless 'sign-compare' error pops up on i686 so disable '-Werror'.
760 '(#:configure-flags '("--disable-werror")))
761 (inputs
762 (list boost icu4c libpng librevenge zlib))
763 (native-inputs
764 (list cppunit doxygen pkg-config))
765 (home-page "https://wiki.documentfoundation.org/DLP/Libraries/libzmf")
766 (synopsis "Parses file format of Zoner Callisto/Draw documents")
767 (description "Libzmf is a library that parses the file format of Zoner
768 Callisto/Draw documents. Currently it only understands documents created by
769 Zoner Draw version 4 and 5.")
770 (license license:mpl2.0)))
771
772 (define-public hunspell
773 (package
774 (name "hunspell")
775 (version "1.7.0")
776 (source
777 (origin
778 (method git-fetch)
779 (uri (git-reference
780 (url "https://github.com/hunspell/hunspell")
781 (commit (string-append "v" version))))
782 (file-name (git-file-name name version))
783 (sha256
784 (base32
785 "0qxlkd012r45ppd21kldbq9k5ac5nmxz290z6m2kch9l56v768k1"))))
786 (build-system gnu-build-system)
787 (native-inputs
788 (list autoconf automake libtool))
789 (inputs
790 (list perl))
791 (native-search-paths (list (search-path-specification
792 (variable "DICPATH")
793 (files '("share/hunspell")))))
794 (home-page "https://hunspell.github.io/")
795 (synopsis "Spell checker")
796 (description "Hunspell is a spell checker and morphological analyzer
797 library and program designed for languages with rich morphology and complex
798 word compounding or character encoding.")
799 ;; Triple license, including "mpl1.1 or later".
800 (license (list license:mpl1.1 license:gpl2+ license:lgpl2.1+))))
801
802 (define (dicollecte-french-dictionary variant synopsis)
803 ;; Return a French dictionary package from dicollecte.org, for the given
804 ;; VARIANT.
805 (package
806 (name (match variant
807 ("classique" "hunspell-dict-fr")
808 (_ (string-append "hunspell-dict-fr-" variant))))
809 (version "6.2")
810 (source (origin
811 (uri (string-append
812 "http://www.dicollecte.org/download/fr/hunspell-french-dictionaries-v"
813 version ".zip"))
814 (method url-fetch)
815 (sha256
816 (base32
817 "139hfrn5p87sl8hqmgkf6sgvnxrk2mm8vd8xsm8sm98qjnwlg0f9"))))
818 (build-system trivial-build-system)
819 (native-inputs (list unzip))
820 (arguments
821 `(#:modules ((guix build utils))
822 #:builder (begin
823 (use-modules (guix build utils)
824 (srfi srfi-26))
825
826 (let* ((out (assoc-ref %outputs "out"))
827 (hunspell (string-append out "/share/hunspell"))
828 (myspell (string-append out "/share/myspell"))
829 (doc (string-append out "/share/doc/"
830 ,name))
831 (unzip (assoc-ref %build-inputs "unzip")))
832 (invoke (string-append unzip "/bin/unzip")
833 (assoc-ref %build-inputs "source"))
834 (for-each (cut install-file <> hunspell)
835 (find-files "."
836 ,(string-append variant
837 "\\.(dic|aff)$")))
838 (mkdir-p myspell)
839 (symlink hunspell (string-append myspell "/dicts"))
840 (for-each (cut install-file <> doc)
841 (find-files "." "\\.(txt|org|md)$"))
842 #t))))
843 (synopsis synopsis)
844 (description
845 "This package provides a dictionary for the Hunspell spell-checking
846 library.")
847 (home-page "https://www.dicollecte.org/home.php?prj=fr")
848 (license license:mpl2.0)))
849
850 (define-syntax define-french-dictionary
851 (syntax-rules (synopsis)
852 ((_ name variant (synopsis text))
853 (define-public name
854 (dicollecte-french-dictionary variant text)))))
855
856 (define-french-dictionary hunspell-dict-fr-classique
857 "classique"
858 ;; TRANSLATORS: In French, this is "Français classique".
859 (synopsis "Hunspell dictionary for ``classic'' French (recommended)"))
860
861 (define-french-dictionary hunspell-dict-fr-moderne
862 "moderne"
863 ;; TRANSLATORS: In French, this is "Français moderne".
864 (synopsis "Hunspell dictionary for ``modern'' French"))
865
866 (define-french-dictionary hunspell-dict-fr-réforme-1990
867 "reforme1990"
868 (synopsis "Hunspell dictionary for the post @dfn{1990 réforme} French"))
869
870 (define-french-dictionary hunspell-dict-fr-toutes-variantes
871 "toutesvariantes"
872 (synopsis "Hunspell dictionary for all variants of French"))
873
874 (define-public hunspell-dict-pl
875 (package
876 (name "hunspell-dict-pl")
877 (version "20200327")
878 (source
879 (origin
880 (method url-fetch)
881 ;; Since creators of dictionary host only the latest daily release,
882 ;; we're using version mirrored by Arch Linux, which seems good
883 ;; enough. They're mirroring hunspell-pl releases since 2011.
884 (uri (string-append "https://sources.archlinux.org/other/community/"
885 "hunspell-pl/sjp-myspell-pl-"
886 version ".zip"))
887 (sha256 (base32
888 "14mzf8glxkp2775dcqisb1zv6r8ncm3bvzl46q352rwyl2dg1c59"))))
889
890 (build-system trivial-build-system)
891 (native-inputs (list unzip))
892 (arguments
893 `(#:modules ((guix build utils))
894 #:builder (begin
895 (use-modules (guix build utils)
896 (srfi srfi-26))
897
898 (let* ((out (assoc-ref %outputs "out"))
899 (hunspell (string-append out "/share/hunspell"))
900 (myspell (string-append out "/share/myspell"))
901 (doc (string-append out "/share/doc/"
902 ,name))
903 (unzip (search-input-file %build-inputs
904 "/bin/unzip")))
905 (invoke unzip "-j" "-o" (assoc-ref %build-inputs "source"))
906 (invoke unzip "-j" "-o" "pl_PL.zip")
907 (for-each (cut install-file <> hunspell)
908 (find-files "."
909 ,(string-append "pl_PL"
910 "\\.(dic|aff)$")))
911 (mkdir-p myspell)
912 (symlink hunspell (string-append myspell "/dicts"))
913 (for-each (cut install-file <> doc)
914 (find-files "." "\\.(txt|org|md)$"))
915 #t))))
916 (synopsis "Hunspell dictionary for Polish")
917 (description
918 "This package provides a dictionary for the Hunspell spell-checking
919 library.")
920 (home-page "https://sjp.pl/slownik/ort/")
921 (license
922 (list license:gpl2 license:mpl1.1 license:cc-by4.0 license:lgpl2.1 license:asl2.0))))
923
924 (define-public hunspell-dict-de
925 (package
926 (name "hunspell-dict-de")
927 (version "20161207")
928 (source
929 (origin
930 (method url-fetch)
931 (uri (string-append "https://www.j3e.de/ispell/igerman98/dict/"
932 "igerman98-" version ".tar.bz2"))
933 (sha256
934 (base32 "1a3055hp2bc4q4nlg3gmg0147p3a1zlfnc65xiv2v9pyql1nya8p"))))
935 (build-system gnu-build-system)
936 (arguments
937 `(#:make-flags '("hunspell/de_DE.dic")
938 #:phases
939 (modify-phases %standard-phases
940 (delete 'configure)
941 (replace 'install ;no install target
942 (lambda* (#:key outputs #:allow-other-keys)
943 (let* ((out (assoc-ref outputs "out"))
944 (share (string-append out "/share/hunspell/")))
945 (install-file "hunspell/de_DE.aff" share)
946 (install-file "hunspell/de_DE.dic" share)
947 #t))))
948 #:tests? #f)) ; no tests
949 (native-inputs
950 (list hunspell ispell perl))
951 (synopsis "Hunspell dictionary for German (de_DE)")
952 (description "This package provides a dictionary for the Hunspell
953 spell-checking library.")
954 (home-page "https://www.j3e.de/ispell/igerman98/")
955 (license (list license:gpl2 license:gpl3))))
956
957 (define-public hyphen
958 (package
959 (name "hyphen")
960 (version "2.8.8")
961 (source
962 (origin
963 (method url-fetch)
964 (uri (string-append "mirror://sourceforge/hunspell/Hyphen/"
965 (version-major+minor version) "/"
966 name "-" version ".tar.gz"))
967 (sha256 (base32
968 "01ap9pr6zzzbp4ky0vy7i1983fwyqy27pl0ld55s30fdxka3ciih"))))
969 (build-system gnu-build-system)
970 (inputs
971 (list perl))
972 (home-page "http://hunspell.sourceforge.net/")
973 (synopsis "Hyphenation library")
974 (description "Hyphen is a hyphenation library using TeX hyphenation
975 patterns, which are pre-processed by a perl script.")
976 ;; Triple license, including "mpl1.1 or later".
977 (license
978 (list license:mpl1.1 license:mpl2.0 license:gpl2+ license:lgpl2.1+))))
979
980 (define-public mythes
981 (package
982 (name "mythes")
983 (version "1.2.4")
984 (source
985 (origin
986 (method url-fetch)
987 (uri (string-append "mirror://sourceforge/hunspell/MyThes/" version "/"
988 name "-" version ".tar.gz"))
989 (sha256 (base32
990 "0prh19wy1c74kmzkkavm9qslk99gz8h8wmjvwzjc6lf8v2az708y"))))
991 (build-system gnu-build-system)
992 (native-inputs
993 (list pkg-config))
994 (inputs
995 (list hunspell perl))
996 (home-page "http://hunspell.sourceforge.net/")
997 (synopsis "Thesaurus")
998 (description "MyThes is a simple thesaurus that uses a structured text
999 data file and an index file with binary search to look up words and phrases
1000 and to return information on pronunciations, meanings and synonyms.")
1001 (license (license:non-copyleft "file://COPYING"
1002 "See COPYING in the distribution."))))
1003
1004 (define-public libqxp
1005 (package
1006 (name "libqxp")
1007 (version "0.0.2")
1008 (source (origin
1009 (method url-fetch)
1010 (uri (string-append "https://dev-www.libreoffice.org/src/libqxp/"
1011 "libqxp-" version ".tar.xz"))
1012 (sha256
1013 (base32
1014 "0p4lb84m05wqd8qr8ni9sp80ivlm83ffn0nxiv4m42hj22qvcdz1"))))
1015 (build-system gnu-build-system)
1016 (inputs
1017 (list boost icu4c zlib))
1018 (native-inputs
1019 (list cppunit pkg-config))
1020 (propagated-inputs
1021 (list librevenge)) ; mentioned in Requires field
1022 (home-page "https://www.libreoffice.org")
1023 (synopsis "Library and tools for the QuarkXPress file format")
1024 (description "libqxp is a library and a set of tools for reading and
1025 converting QuarkXPress file format. It supports versions 3.1 to 4.1.")
1026 (license license:mpl2.0)))
1027
1028 ;; When updating libreoffice, also make sure to update the
1029 ;; hunspell dictionaries! They use the libreoffice version.
1030 (define-public libreoffice
1031 (package
1032 (name "libreoffice")
1033 (version "7.1.4.2")
1034 (source
1035 (origin
1036 (method url-fetch)
1037 (uri
1038 (string-append
1039 "https://download.documentfoundation.org/libreoffice/src/"
1040 (version-prefix version 3) "/libreoffice-" version ".tar.xz"))
1041 (sha256
1042 (base32 "1jsskhnlyra7q6d12kkc8dxq5fgrnd8grl32bdck7j9hkwv6d13m"))))
1043 (build-system glib-or-gtk-build-system)
1044 (native-inputs
1045 `(("bison" ,bison)
1046 ("cppunit" ,cppunit)
1047 ("flex" ,flex)
1048 ("pkg-config" ,pkg-config)
1049 ("python" ,python-wrapper)
1050 ("which" ,which)
1051 ("ziptime" ,ziptime)))
1052 (inputs
1053 `(("bluez" ,bluez)
1054 ("boost" ,boost)
1055 ("box2d" ,box2d)
1056 ("clucene" ,clucene)
1057 ("cups" ,cups)
1058 ("dbus-glib" ,dbus-glib)
1059 ("firebird" ,firebird)
1060 ("fontconfig" ,fontconfig)
1061 ("fontforge" ,fontforge)
1062 ("gconf" ,gconf)
1063 ("glew" ,glew)
1064 ("glm" ,glm)
1065 ("gnupg" ,gnupg)
1066 ("gobject-introspection" ,gobject-introspection)
1067 ("gperf" ,gperf)
1068 ("gpgme" ,gpgme)
1069 ("graphite2" ,graphite2)
1070 ("gst-plugins-base" ,gst-plugins-base)
1071 ("gtk+" ,gtk+)
1072 ("harfbuzz" ,harfbuzz)
1073 ("hunspell" ,hunspell)
1074 ("hyphen" ,hyphen)
1075 ("libabw" ,libabw)
1076 ("libcdr" ,libcdr)
1077 ("libcmis" ,libcmis)
1078 ("libjpeg-turbo" ,libjpeg-turbo)
1079 ("libe-book" ,libe-book)
1080 ("libepubgen" ,libepubgen)
1081 ("libetonyek" ,libetonyek)
1082 ("libexttextcat" ,libexttextcat)
1083 ("libfreehand" ,libfreehand)
1084 ("liblangtag" ,liblangtag)
1085 ;; XXX: Perhaps this should be propagated from xmlsec.
1086 ("libltdl" ,libltdl)
1087 ("libmspub" ,libmspub)
1088 ("libmwaw" ,libmwaw)
1089 ("libnumbertext" ,libnumbertext)
1090 ("libodfgen" ,libodfgen)
1091 ("libpagemaker" ,libpagemaker)
1092 ("libqxp" ,libqxp)
1093 ("libstaroffice" ,libstaroffice)
1094 ("libvisio" ,libvisio)
1095 ("libwpg" ,libwpg)
1096 ("libwps" ,libwps)
1097 ("libxrandr" ,libxrandr)
1098 ("libxrender" ,libxrender)
1099 ("libxslt" ,libxslt)
1100 ("libxt" ,libxt)
1101 ("libzmf" ,libzmf)
1102 ("lpsolve" ,lpsolve)
1103 ("mariadb" ,mariadb "dev")
1104 ("mdds" ,mdds)
1105 ("mythes" ,mythes)
1106 ("neon" ,neon)
1107 ("nspr" ,nspr)
1108 ("nss" ,nss)
1109 ("openldap" ,openldap)
1110 ("openssl" ,openssl)
1111 ("orcus" ,orcus)
1112 ("perl" ,perl)
1113 ("perl-archive-zip" ,perl-archive-zip)
1114 ("poppler" ,poppler)
1115 ("postgresql" ,postgresql)
1116 ("python" ,python)
1117 ("python-lxml" ,python-lxml)
1118 ("qrcodegen-cpp" ,qrcodegen-cpp)
1119 ("redland" ,redland)
1120 ("sane-backends" ,sane-backends)
1121 ("unixodbc" ,unixodbc)
1122 ("unzip" ,unzip)
1123 ("vigra" ,vigra)
1124 ("xdg-utils" ,xdg-utils)
1125 ("xmlsec" ,xmlsec-nss)
1126 ("zip" ,zip)
1127 ("dtoa" ; needed after version 6.4.7.2.
1128 ,(origin
1129 (method url-fetch)
1130 (uri "https://dev-www.libreoffice.org/src/dtoa-20180411.tgz")
1131 (sha256
1132 (base32 "1d0iwy0q5sjznv23d3nbwmy0r7m1mdzlnv5pc4izddkx9xld10h0"))))))
1133 (arguments
1134 `(#:tests? #f ; Building the tests already fails.
1135 #:phases
1136 (modify-phases %standard-phases
1137 (add-after 'unpack 'insert-external-tarballs
1138 (lambda* (#:key inputs #:allow-other-keys)
1139 (mkdir-p "external/tarballs")
1140 (copy-file (assoc-ref inputs "dtoa")
1141 "external/tarballs/dtoa-20180411.tgz")
1142 #t))
1143 (add-before 'configure 'prepare-src
1144 (lambda* (#:key inputs #:allow-other-keys)
1145 (substitute*
1146 (list "sysui/CustomTarget_share.mk"
1147 "solenv/gbuild/gbuild.mk"
1148 "solenv/gbuild/platform/unxgcc.mk")
1149 (("/bin/sh") (which "sh")))
1150
1151 ;; Use store references for strictly necessary commands,
1152 ;; but not for optional tools like ‘gdb’ and ‘valgrind’.
1153 (for-each (lambda (command)
1154 (substitute* "desktop/scripts/soffice.sh"
1155 (((format #f"~a " command))
1156 (format #f "~a " (which command)))))
1157 (list "dirname" "grep" "uname"))
1158
1159 ;; GPGME++ headers are installed in a gpgme++ subdirectory, but
1160 ;; configure is hardcoded to use FHS directories.
1161 (substitute* "configure"
1162 (("GPGMEPP_CFLAGS=-I/usr")
1163 (string-append "GPGMEPP_CFLAGS=-I"
1164 (assoc-ref inputs "gpgme"))))
1165
1166 ;; /usr/bin/xdg-open doesn't exist on Guix System.
1167 (substitute* '("shell/source/unix/exec/shellexec.cxx"
1168 "shell/source/unix/misc/senddoc.sh")
1169 (("/usr/bin/xdg-open")
1170 (search-input-file inputs "/bin/xdg-open")))))
1171 (add-after 'install 'reset-zip-timestamps
1172 (lambda* (#:key outputs #:allow-other-keys)
1173 (let ((out (assoc-ref outputs "out")))
1174 (for-each (lambda (file)
1175 (invoke "ziptime" file))
1176 ;; So many different extensions for .zip files.
1177 (find-files out "\\.(bau|dat|otp|ott|zip)$")))))
1178 (add-after 'install 'bin-and-desktop-install
1179 ;; Create 'soffice' and 'libreoffice' symlinks to the executable
1180 ;; script.
1181 (lambda* (#:key outputs #:allow-other-keys)
1182 (let ((out (assoc-ref outputs "out")))
1183 (define (symlink-output src dst)
1184 (mkdir-p (dirname (string-append out dst)))
1185 (symlink (string-append out src) (string-append out dst)))
1186 (define (install src dst)
1187 (let ((dst (string-append out dst)))
1188 (mkdir-p (dirname dst))
1189 (copy-file src dst)))
1190 (define (install-desktop-file app)
1191 (let ((src (string-append "/lib/libreoffice/share/xdg/"
1192 app ".desktop"))
1193 (dst (string-append "/share/applications/libreoffice-"
1194 app ".desktop")))
1195 (substitute* (string-append out src)
1196 (("Exec=libreoffice[0-9]+\\.[0-9]+ ")
1197 (string-append "Exec=" out "/bin/libreoffice "))
1198 (("Icon=libreoffice.*")
1199 (string-append "Icon=" app "\n"))
1200 (("LibreOffice [0-9]+\\.[0-9]+")
1201 "LibreOffice"))
1202 (symlink-output src dst)))
1203 (define (install-appdata app)
1204 (install-file (string-append
1205 "sysui/desktop/appstream-appdata/"
1206 "libreoffice-" app ".appdata.xml")
1207 (string-append out "/share/appdata")))
1208 (symlink-output "/lib/libreoffice/program/soffice"
1209 "/bin/soffice")
1210 (symlink-output "/lib/libreoffice/program/soffice"
1211 "/bin/libreoffice")
1212 (install
1213 "workdir/CustomTarget/sysui/share/libreoffice/openoffice.org.xml"
1214 "/share/mime/packages/libreoffice.xml")
1215 (for-each install-desktop-file
1216 '("base" "calc" "draw" "impress" "writer"
1217 "math" "startcenter"))
1218 (for-each install-appdata
1219 '("base" "calc" "draw" "impress" "writer"))
1220 (mkdir-p (string-append out "/share/icons/hicolor"))
1221 (copy-recursively "sysui/desktop/icons/hicolor"
1222 (string-append out "/share/icons/hicolor")))
1223 #t)))
1224 #:configure-flags
1225 (list
1226 "--enable-release-build"
1227 "--with-vendor=GNU Guix"
1228 ;; Avoid using all cpu cores by default
1229 (format #f "--with-parallelism=~d" (parallel-job-count))
1230 "--disable-fetch-external" ; disable downloads
1231 "--with-system-libs" ; enable all --with-system-* flags
1232 (string-append "--with-boost-libdir="
1233 (assoc-ref %build-inputs "boost") "/lib")
1234 ;; Avoid undefined symbols required by boost::spirit
1235 "LDFLAGS=-lboost_system"
1236 ;; Avoid a dependency on ucpp.
1237 "--with-idlc-cpp=cpp"
1238 ;; The fonts require an external tarball (crosextrafonts).
1239 ;; They should not be needed when system fonts are available.
1240 "--without-fonts"
1241 ;; With java, the build fails since sac.jar is missing.
1242 "--without-java"
1243 ;; FIXME: Enable once the corresponding inputs are packaged.
1244 "--disable-coinmp"
1245 "--disable-skia"
1246 ;; This could (Debian does this) be a separate output containing only
1247 ;; program/libfirebird_sdbclo.so, if there's a way to point to it.
1248 "--enable-firebird-sdbc"
1249 ;; XXX: PDFium support requires fetching an external tarball and
1250 ;; patching the build scripts to work with GCC5. Try enabling this
1251 ;; when our default compiler is >=GCC 6.
1252 "--disable-pdfium"
1253 "--without-doxygen"
1254 "--enable-build-opensymbol")))
1255 (home-page "https://www.libreoffice.org/")
1256 (synopsis "Office suite")
1257 (description "LibreOffice is a comprehensive office suite. It contains
1258 a number of components: Writer, a word processor; Calc, a spreadsheet
1259 application; Impress, a presentation engine; Draw, a drawing and
1260 flowcharting application; Base, a database and database frontend;
1261 Math for editing mathematics.")
1262 (license license:mpl2.0)))