[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/24: gnu: libreoffice: Fix access to python modules.
From: |
guix-commits |
Subject: |
02/24: gnu: libreoffice: Fix access to python modules. |
Date: |
Sun, 18 Jun 2023 17:35:58 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit c0921a394dc218c1852679df0cd4d548eb2bb640
Author: Nicolas Graves <ngraves@ngraves.fr>
AuthorDate: Fri Mar 31 12:09:01 2023 +0200
gnu: libreoffice: Fix access to python modules.
* gnu/packages/libreoffice.scm (libreoffice)[arguments]:
Add #:imported-modules and #:modules.
In 'bin-and-desktop-install' phase, add 'install-python-script' and use
it.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
gnu/packages/libreoffice.scm | 38 ++++++++++++++++++++++++++++++++++++--
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index 667e93db26..bc8b1d9fcf 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2018, 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2020 Marcin Karpezo <sirmacik@wioo.waw.pl>
+;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -913,6 +914,11 @@ commonly called @code{ftoa} or @code{dtoa}.")
(build-system glib-or-gtk-build-system)
(arguments
(list
+ #:imported-modules `((guix build python-build-system)
+ ,@%glib-or-gtk-build-system-modules)
+ #:modules `(((guix build python-build-system) #:select (python-version))
+ (ice-9 textual-ports)
+ ,@%glib-or-gtk-build-system-modules)
#:tests? #f ; Building the tests already fails.
#:phases
#~(modify-phases %standard-phases
@@ -976,7 +982,12 @@ commonly called @code{ftoa} or @code{dtoa}.")
;; Create 'soffice' and 'libreoffice' symlinks to the executable
;; script.
(lambda _
- (let ((out #$output))
+ (let* ((out #$output)
+ (python-libdir
+ (string-append out "/lib/python"
+ (python-version
+ #$(this-package-input "python"))
+ "/site-packages/")))
(define (symlink-output src dst)
(mkdir-p (dirname (string-append out dst)))
(symlink (string-append out src) (string-append out dst)))
@@ -1002,6 +1013,24 @@ commonly called @code{ftoa} or @code{dtoa}.")
"sysui/desktop/appstream-appdata/"
"libreoffice-" app ".appdata.xml")
(string-append out "/share/appdata")))
+ (define (install-python-script name)
+ (with-input-from-file
+ (string-append out "/lib/libreoffice/program/" name
".py")
+ (lambda _
+ (let ((file (get-string-all (current-input-port))))
+ (with-output-to-file
+ (string-append python-libdir name ".py")
+ (lambda _
+ (format (current-output-port) "~a"
+ (string-append
+ "import sys, os\n"
+ "sys.path.append('"
+ out "/lib/libreoffice/program" "')\n"
+ "os.putenv('URE_BOOTSTRAP',
'vnd.sun.star.pathname:"
+ out
"/lib/libreoffice/program/fundamentalrc')\n\n"
+ file)))))))
+ (delete-file
+ (string-append out "/lib/libreoffice/program/" name ".py")))
(symlink-output "/lib/libreoffice/program/soffice"
"/bin/soffice")
(symlink-output "/lib/libreoffice/program/soffice"
@@ -1016,7 +1045,12 @@ commonly called @code{ftoa} or @code{dtoa}.")
'("base" "calc" "draw" "impress" "writer"))
(mkdir-p (string-append out "/share/icons/hicolor"))
(copy-recursively "sysui/desktop/icons/hicolor"
- (string-append out
"/share/icons/hicolor"))))))
+ (string-append out "/share/icons/hicolor"))
+ (mkdir-p python-libdir)
+ (for-each install-python-script
+ '("access2base" "mailmerge" "msgbox" "officehelper"
+ "pythonloader" "pythonscript" "scriptforge"
+ "unohelper" "uno"))))))
#:configure-flags
#~(list
"--enable-release-build"
- branch master updated (726f2a9447 -> 81231bf236), guix-commits, 2023/06/18
- 03/24: services: certbot: Fix nginx crash when certbot is used without domains., guix-commits, 2023/06/18
- 07/24: gnu: font-alias: Update to 1.0.5., guix-commits, 2023/06/18
- 10/24: gnu: font-dec-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 12/24: gnu: font-micro-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 01/24: doc: Fix typo., guix-commits, 2023/06/18
- 04/24: gnu: openmw-openscenegraph: Update to Nov 2022 commit., guix-commits, 2023/06/18
- 05/24: gnu: font-adobe100dpi: Update to 1.0.4., guix-commits, 2023/06/18
- 06/24: gnu: font-adobe75dpi: Update to 1.0.4., guix-commits, 2023/06/18
- 02/24: gnu: libreoffice: Fix access to python modules.,
guix-commits <=
- 09/24: gnu: font-cronyx-cyrillic: Update to 1.0.4., guix-commits, 2023/06/18
- 11/24: gnu: font-isas-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 24/24: gnu: freeipmi: Update to 1.6.11, guix-commits, 2023/06/18
- 14/24: gnu: font-misc-ethiopic: Update to 1.0.5., guix-commits, 2023/06/18
- 17/24: gnu: font-schumacher-misc: Update to 1.1.3., guix-commits, 2023/06/18
- 19/24: gnu: font-sony-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 22/24: gnu: font-xfree86-type1: Update to 1.0.5., guix-commits, 2023/06/18
- 08/24: gnu: font-arabic-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 20/24: gnu: font-sun-misc: Update to 1.0.4., guix-commits, 2023/06/18
- 13/24: gnu: font-misc-cyrillic: Update to 1.0.4., guix-commits, 2023/06/18