gnu: libreoffice: Remove input labels.

* gnu/packages/libreoffice.scm (dtoa): New private variable.
(libreoffice)[native-inputs, inputs]: Remove labels.
[arguments]: Use G-expression and SEARCH-INPUT-FILE & co where appropriate.
Remove trailing #t's.
This commit is contained in:
Marius Bakke 2022-08-10 22:54:31 +02:00
parent 8bdc95ecae
commit a66b9063d1
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -1044,6 +1044,13 @@ and to return information on pronunciations, meanings and synonyms.")
converting QuarkXPress file format. It supports versions 3.1 to 4.1.") converting QuarkXPress file format. It supports versions 3.1 to 4.1.")
(license license:mpl2.0))) (license license:mpl2.0)))
(define dtoa
(origin
(method url-fetch)
(uri "https://dev-www.libreoffice.org/src/dtoa-20180411.tgz")
(sha256
(base32 "1d0iwy0q5sjznv23d3nbwmy0r7m1mdzlnv5pc4izddkx9xld10h0"))))
;; When updating libreoffice, also make sure to update the ;; When updating libreoffice, also make sure to update the
;; hunspell dictionaries! They use the libreoffice version. ;; hunspell dictionaries! They use the libreoffice version.
(define-public libreoffice (define-public libreoffice
@ -1061,189 +1068,181 @@ converting QuarkXPress file format. It supports versions 3.1 to 4.1.")
(base32 "14g9873x8m5yakpq7v9f7lhc5fkxh6yhjhgh0pm30cqmxsqhsglv")))) (base32 "14g9873x8m5yakpq7v9f7lhc5fkxh6yhjhgh0pm30cqmxsqhsglv"))))
(build-system glib-or-gtk-build-system) (build-system glib-or-gtk-build-system)
(native-inputs (native-inputs
`(("bison" ,bison) (list bison
("cppunit" ,cppunit) cppunit
("flex" ,flex) flex
("pkg-config" ,pkg-config) pkg-config
("python" ,python-wrapper) python-wrapper
("which" ,which) which
("ziptime" ,ziptime))) ziptime))
(inputs (inputs
`(("bluez" ,bluez) (list bluez
("boost" ,boost) boost
("box2d" ,box2d) box2d
("clucene" ,clucene) clucene
("cups" ,cups) cups
("dbus-glib" ,dbus-glib) dbus-glib
("firebird" ,firebird) firebird
("fontconfig" ,fontconfig) fontconfig
("fontforge" ,fontforge) fontforge
("gconf" ,gconf) gconf
("glew" ,glew) glew
("glm" ,glm) glm
("gnupg" ,gnupg) gnupg
("gobject-introspection" ,gobject-introspection) gobject-introspection
("gperf" ,gperf) gperf
("gpgme" ,gpgme) gpgme
("graphite2" ,graphite2) graphite2
("gst-plugins-base" ,gst-plugins-base) gst-plugins-base
("gtk+" ,gtk+) gtk+
("harfbuzz" ,harfbuzz) harfbuzz
("hunspell" ,hunspell) hunspell
("hyphen" ,hyphen) hyphen
("libabw" ,libabw) libabw
("libcdr" ,libcdr) libcdr
("libcmis" ,libcmis) libcmis
("libcuckoo" ,libcuckoo) libcuckoo
("libjpeg-turbo" ,libjpeg-turbo) libjpeg-turbo
("libe-book" ,libe-book) libe-book
("libepubgen" ,libepubgen) libepubgen
("libetonyek" ,libetonyek) libetonyek
("libexttextcat" ,libexttextcat) libexttextcat
("libfreehand" ,libfreehand) libfreehand
("liblangtag" ,liblangtag) liblangtag
;; XXX: Perhaps this should be propagated from xmlsec. ;; XXX: Perhaps this should be propagated from xmlsec.
("libltdl" ,libltdl) libltdl
("libmspub" ,libmspub) libmspub
("libmwaw" ,libmwaw) libmwaw
("libnumbertext" ,libnumbertext) libnumbertext
("libodfgen" ,libodfgen) libodfgen
("libpagemaker" ,libpagemaker) libpagemaker
("libqxp" ,libqxp) libqxp
("libstaroffice" ,libstaroffice) libstaroffice
("libvisio" ,libvisio) libvisio
("libwpg" ,libwpg) libwpg
("libwps" ,libwps) libwps
("libxrandr" ,libxrandr) libxrandr
("libxrender" ,libxrender) libxrender
("libxslt" ,libxslt) libxslt
("libxt" ,libxt) libxt
("libzmf" ,libzmf) libzmf
("lpsolve" ,lpsolve) lpsolve
("mariadb" ,mariadb "dev") `(,mariadb "dev")
("mdds" ,mdds) mdds
("mythes" ,mythes) mythes
("neon" ,neon) neon
("nspr" ,nspr) nspr
("nss" ,nss) nss
("openldap" ,openldap) openldap
("openssl" ,openssl) openssl
("orcus" ,orcus) orcus
("perl" ,perl) perl
("perl-archive-zip" ,perl-archive-zip) perl-archive-zip
("poppler" ,poppler) poppler
("postgresql" ,postgresql) postgresql
("python" ,python) python
("python-lxml" ,python-lxml) python-lxml
("qrcodegen-cpp" ,qrcodegen-cpp) qrcodegen-cpp
("redland" ,redland) redland
("sane-backends" ,sane-backends) sane-backends
("unixodbc" ,unixodbc) unixodbc
("unzip" ,unzip) unzip
("vigra" ,vigra) vigra
("xdg-utils" ,xdg-utils) xdg-utils
("xmlsec" ,xmlsec-nss) xmlsec-nss
("zip" ,zip) zip
("zxing-cpp" ,zxing-cpp) zxing-cpp))
("dtoa" ; needed after version 6.4.7.2.
,(origin
(method url-fetch)
(uri "https://dev-www.libreoffice.org/src/dtoa-20180411.tgz")
(sha256
(base32 "1d0iwy0q5sjznv23d3nbwmy0r7m1mdzlnv5pc4izddkx9xld10h0"))))))
(arguments (arguments
`(#:tests? #f ; Building the tests already fails. (list
#:phases #:tests? #f ; Building the tests already fails.
(modify-phases %standard-phases #:phases
(add-after 'unpack 'insert-external-tarballs #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'insert-external-tarballs
(mkdir-p "external/tarballs") (lambda _
(copy-file (assoc-ref inputs "dtoa") (mkdir-p "external/tarballs")
"external/tarballs/dtoa-20180411.tgz") (copy-file #$dtoa "external/tarballs/dtoa-20180411.tgz")))
#t)) (add-before 'configure 'prepare-src
(add-before 'configure 'prepare-src (lambda* (#:key inputs #:allow-other-keys)
(lambda* (#:key inputs #:allow-other-keys) (substitute*
(substitute* (list "sysui/CustomTarget_share.mk"
(list "sysui/CustomTarget_share.mk" "solenv/gbuild/gbuild.mk"
"solenv/gbuild/gbuild.mk" "solenv/gbuild/platform/unxgcc.mk")
"solenv/gbuild/platform/unxgcc.mk") (("/bin/sh") (which "sh")))
(("/bin/sh") (which "sh")))
;; Use store references for strictly necessary commands, ;; Use store references for strictly necessary commands,
;; but not for optional tools like gdb and valgrind. ;; but not for optional tools like gdb and valgrind.
(for-each (lambda (command) (for-each (lambda (command)
(substitute* "desktop/scripts/soffice.sh" (substitute* "desktop/scripts/soffice.sh"
(((format #f"~a " command)) (((format #f "~a " command))
(format #f "~a " (which command))))) (format #f "~a " (which command)))))
(list "dirname" "grep" "uname")) (list "dirname" "grep" "uname"))
;; GPGME++ headers are installed in a gpgme++ subdirectory, but ;; GPGME++ headers are installed in a gpgme++ subdirectory, but
;; configure is hardcoded to use FHS directories. ;; configure is hardcoded to use FHS directories.
(substitute* "configure" (substitute* "configure"
(("GPGMEPP_CFLAGS=-I/usr") (("GPGMEPP_CFLAGS=-I/usr/include/gpgme\\+\\+")
(string-append "GPGMEPP_CFLAGS=-I" (string-append "GPGMEPP_CFLAGS=-I"
(assoc-ref inputs "gpgme")))) (search-input-directory inputs
"include/gpgme++"))))
;; /usr/bin/xdg-open doesn't exist on Guix System. ;; /usr/bin/xdg-open doesn't exist on Guix System.
(substitute* '("shell/source/unix/exec/shellexec.cxx" (substitute* '("shell/source/unix/exec/shellexec.cxx"
"shell/source/unix/misc/senddoc.sh") "shell/source/unix/misc/senddoc.sh")
(("/usr/bin/xdg-open") (("/usr/bin/xdg-open")
(search-input-file inputs "/bin/xdg-open"))))) (search-input-file inputs "/bin/xdg-open")))))
(add-after 'install 'reset-zip-timestamps (add-after 'install 'reset-zip-timestamps
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((out (assoc-ref outputs "out"))) (for-each (lambda (file)
(for-each (lambda (file) (invoke "ziptime" file))
(invoke "ziptime" file)) ;; So many different extensions for .zip files.
;; So many different extensions for .zip files. (find-files #$output "\\.(bau|dat|otp|ott|zip)$"))))
(find-files out "\\.(bau|dat|otp|ott|zip)$"))))) (add-after 'install 'bin-and-desktop-install
(add-after 'install 'bin-and-desktop-install ;; Create 'soffice' and 'libreoffice' symlinks to the executable
;; Create 'soffice' and 'libreoffice' symlinks to the executable ;; script.
;; script. (lambda _
(lambda* (#:key outputs #:allow-other-keys) (let ((out #$output))
(let ((out (assoc-ref outputs "out"))) (define (symlink-output src dst)
(define (symlink-output src dst) (mkdir-p (dirname (string-append out dst)))
(mkdir-p (dirname (string-append out dst))) (symlink (string-append out src) (string-append out dst)))
(symlink (string-append out src) (string-append out dst))) (define (install src dst)
(define (install src dst) (let ((dst (string-append out dst)))
(let ((dst (string-append out dst))) (mkdir-p (dirname dst))
(mkdir-p (dirname dst)) (copy-file src dst)))
(copy-file src dst))) (define (install-desktop-file app)
(define (install-desktop-file app) (let ((src (string-append "/lib/libreoffice/share/xdg/"
(let ((src (string-append "/lib/libreoffice/share/xdg/" app ".desktop"))
app ".desktop")) (dst (string-append "/share/applications/libreoffice-"
(dst (string-append "/share/applications/libreoffice-" app ".desktop")))
app ".desktop"))) (substitute* (string-append out src)
(substitute* (string-append out src) (("Exec=libreoffice[0-9]+\\.[0-9]+ ")
(("Exec=libreoffice[0-9]+\\.[0-9]+ ") (string-append "Exec=" out "/bin/libreoffice "))
(string-append "Exec=" out "/bin/libreoffice ")) (("Icon=libreoffice.*")
(("Icon=libreoffice.*") (string-append "Icon=" app "\n"))
(string-append "Icon=" app "\n")) (("LibreOffice [0-9]+\\.[0-9]+")
(("LibreOffice [0-9]+\\.[0-9]+") "LibreOffice"))
"LibreOffice")) (symlink-output src dst)))
(symlink-output src dst))) (define (install-appdata app)
(define (install-appdata app) (install-file (string-append
(install-file (string-append "sysui/desktop/appstream-appdata/"
"sysui/desktop/appstream-appdata/" "libreoffice-" app ".appdata.xml")
"libreoffice-" app ".appdata.xml") (string-append out "/share/appdata")))
(string-append out "/share/appdata"))) (symlink-output "/lib/libreoffice/program/soffice"
(symlink-output "/lib/libreoffice/program/soffice" "/bin/soffice")
"/bin/soffice") (symlink-output "/lib/libreoffice/program/soffice"
(symlink-output "/lib/libreoffice/program/soffice" "/bin/libreoffice")
"/bin/libreoffice") (install
(install "workdir/CustomTarget/sysui/share/libreoffice/openoffice.org.xml"
"workdir/CustomTarget/sysui/share/libreoffice/openoffice.org.xml" "/share/mime/packages/libreoffice.xml")
"/share/mime/packages/libreoffice.xml") (for-each install-desktop-file
(for-each install-desktop-file '("base" "calc" "draw" "impress" "writer"
'("base" "calc" "draw" "impress" "writer" "math" "startcenter"))
"math" "startcenter")) (for-each install-appdata
(for-each install-appdata '("base" "calc" "draw" "impress" "writer"))
'("base" "calc" "draw" "impress" "writer")) (mkdir-p (string-append out "/share/icons/hicolor"))
(mkdir-p (string-append out "/share/icons/hicolor")) (copy-recursively "sysui/desktop/icons/hicolor"
(copy-recursively "sysui/desktop/icons/hicolor" (string-append out "/share/icons/hicolor"))))))
(string-append out "/share/icons/hicolor"))) #:configure-flags
#t))) #~(list
#:configure-flags
(list
"--enable-release-build" "--enable-release-build"
"--with-vendor=GNU Guix" "--with-vendor=GNU Guix"
;; Avoid using all cpu cores by default ;; Avoid using all cpu cores by default
@ -1251,7 +1250,9 @@ converting QuarkXPress file format. It supports versions 3.1 to 4.1.")
"--disable-fetch-external" ; disable downloads "--disable-fetch-external" ; disable downloads
"--with-system-libs" ; enable all --with-system-* flags "--with-system-libs" ; enable all --with-system-* flags
(string-append "--with-boost-libdir=" (string-append "--with-boost-libdir="
(assoc-ref %build-inputs "boost") "/lib") (dirname
(search-input-file %build-inputs
"lib/libboost_system.so")))
;; Avoid undefined symbols required by boost::spirit ;; Avoid undefined symbols required by boost::spirit
"LDFLAGS=-lboost_system" "LDFLAGS=-lboost_system"
;; Avoid a dependency on ucpp. ;; Avoid a dependency on ucpp.
@ -1273,11 +1274,11 @@ converting QuarkXPress file format. It supports versions 3.1 to 4.1.")
"--disable-pdfium" "--disable-pdfium"
"--without-doxygen" "--without-doxygen"
"--enable-build-opensymbol"))) "--enable-build-opensymbol")))
(home-page "https://www.libreoffice.org/") (home-page "https://www.libreoffice.org/")
(synopsis "Office suite") (synopsis "Office suite")
(description "LibreOffice is a comprehensive office suite. It contains (description "LibreOffice is a comprehensive office suite. It contains
a number of components: Writer, a word processor; Calc, a spreadsheet a number of components: Writer, a word processor; Calc, a spreadsheet
application; Impress, a presentation engine; Draw, a drawing and application; Impress, a presentation engine; Draw, a drawing and
flowcharting application; Base, a database and database frontend; flowcharting application; Base, a database and database frontend;
Math for editing mathematics.") Math for editing mathematics.")
(license license:mpl2.0))) (license license:mpl2.0)))