From unknown Tue Jun 17 01:44:15 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#62567] [PATCH] gnu: libreoffice: Fix access to python modules. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 31 Mar 2023 10:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62567 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62567@debbugs.gnu.org Cc: ngraves@ngraves.fr X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16802573542854 (code B ref -1); Fri, 31 Mar 2023 10:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 31 Mar 2023 10:09:14 +0000 Received: from localhost ([127.0.0.1]:60413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piBh3-0000jy-Ic for submit@debbugs.gnu.org; Fri, 31 Mar 2023 06:09:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:33212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piBh0-0000jm-Vx for submit@debbugs.gnu.org; Fri, 31 Mar 2023 06:09:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piBh0-0006NF-Ix for guix-patches@gnu.org; Fri, 31 Mar 2023 06:09:10 -0400 Received: from 2.mo582.mail-out.ovh.net ([46.105.76.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piBgy-0003pb-OE for guix-patches@gnu.org; Fri, 31 Mar 2023 06:09:10 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.1.191]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 3667A262A7 for ; Fri, 31 Mar 2023 10:09:04 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-pz96z (unknown [10.110.208.181]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id C3D4D1FE54; Fri, 31 Mar 2023 10:09:03 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-pz96z with ESMTPSA id GFajLD+xJmQUmQAAoqrwCg (envelope-from ); Fri, 31 Mar 2023 10:09:03 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G002eef9004e-42c7-4c37-8a20-ea167a8cec75, 6EDB0577B4A4070ED54A7D4BC3C99A904D58EC0F) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves Date: Fri, 31 Mar 2023 12:09:01 +0200 Message-Id: <20230331100902.3866-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12772208546386076386 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeiuddgvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeehteeijeejuefgvdfgieffueeftddvhfeltddvuddvvdffiedtkefgiefhvdffudenucffohhmrghinhepshhunhdrshhtrghrnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=46.105.76.65; envelope-from=ngraves@ngraves.fr; helo=2.mo582.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * gnu/packages/libreoffice.scm (libreoffice): Fix access to python modules. --- 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 3d3e6d18dc..48689b9342 100644 --- a/gnu/packages/libreoffice.scm +++ b/gnu/packages/libreoffice.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2018, 2020 Jonathan Brielmaier ;;; Copyright © 2019 Chris Marusich ;;; Copyright © 2020 Marcin Karpezo +;;; Copyright © 2023 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -912,6 +913,11 @@ (define-public libreoffice (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 @@ -975,7 +981,12 @@ (define-public libreoffice ;; 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))) @@ -1001,6 +1012,24 @@ (define (install-appdata app) "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" @@ -1015,7 +1044,12 @@ (define (install-appdata app) '("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" -- 2.39.2 From unknown Tue Jun 17 01:44:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Nicolas Graves Subject: bug#62567: closed (Re: bug#62567: [PATCH] gnu: libreoffice: Fix access to python modules.) Message-ID: References: <87ilbkpjgf.fsf@gnu.org> <20230331100902.3866-1-ngraves@ngraves.fr> X-Gnu-PR-Message: they-closed 62567 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 62567@debbugs.gnu.org Date: Sun, 18 Jun 2023 21:09:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1687122542-30206-1" This is a multi-part message in MIME format... ------------=_1687122542-30206-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #62567: [PATCH] gnu: libreoffice: Fix access to python modules. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 62567@debbugs.gnu.org. --=20 62567: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62567 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1687122542-30206-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 62567-done) by debbugs.gnu.org; 18 Jun 2023 21:08:33 +0000 Received: from localhost ([127.0.0.1]:55081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAzdQ-0007qV-Qx for submit@debbugs.gnu.org; Sun, 18 Jun 2023 17:08:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qAzdO-0007qI-Eh for 62567-done@debbugs.gnu.org; Sun, 18 Jun 2023 17:08:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAzdC-0005Xg-OJ; Sun, 18 Jun 2023 17:08:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=5Hrfex1CRUGyq+X5wP7SdcmNxQ5r2i+oLHGAkTnHy4k=; b=c3es4MSXzrmma1smtFYt Neji6EJYkxQ4nbULvWpUjClVUcko9csKNF1d56ndRGsVaEvfic3sn0i9xuhenOgUudg85ajTBE5BU uEVHvi4vepM3ZoLHphSEA/GAaqoyIxkZFE0DFIYeYVxQETA5RtLToYZgfkY0bLB4EOQciT8tMBPvJ /Eg2MydTioND94mEKF9xdXj5+hk5nvw+S5rjPsySNu9iUa0sPsIyt4b8ILUx8Y+3nywXmY8pbWZge BsdtVLpxEU0CS/a//6I0jUsJxA+ZCzZkclwtxpiFO1VZBuypfCKyVRylmBEjlqT7hr4f+L07ZzISD abjfLkw27VIzdg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qAzdB-0005c4-VG; Sun, 18 Jun 2023 17:08:18 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Nicolas Graves Subject: Re: bug#62567: [PATCH] gnu: libreoffice: Fix access to python modules. References: <20230331100902.3866-1-ngraves@ngraves.fr> Date: Sun, 18 Jun 2023 23:08:16 +0200 In-Reply-To: <20230331100902.3866-1-ngraves@ngraves.fr> (Nicolas Graves's message of "Fri, 31 Mar 2023 12:09:01 +0200") Message-ID: <87ilbkpjgf.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62567-done Cc: 62567-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Nicolas Graves skribis: > * gnu/packages/libreoffice.scm (libreoffice): Fix access to python module= s. Finally applied, thanks! Ludo=E2=80=99. ------------=_1687122542-30206-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 31 Mar 2023 10:09:14 +0000 Received: from localhost ([127.0.0.1]:60413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piBh3-0000jy-Ic for submit@debbugs.gnu.org; Fri, 31 Mar 2023 06:09:13 -0400 Received: from lists.gnu.org ([209.51.188.17]:33212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piBh0-0000jm-Vx for submit@debbugs.gnu.org; Fri, 31 Mar 2023 06:09:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piBh0-0006NF-Ix for guix-patches@gnu.org; Fri, 31 Mar 2023 06:09:10 -0400 Received: from 2.mo582.mail-out.ovh.net ([46.105.76.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piBgy-0003pb-OE for guix-patches@gnu.org; Fri, 31 Mar 2023 06:09:10 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.1.191]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 3667A262A7 for ; Fri, 31 Mar 2023 10:09:04 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-pz96z (unknown [10.110.208.181]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id C3D4D1FE54; Fri, 31 Mar 2023 10:09:03 +0000 (UTC) Received: from ngraves.fr ([37.59.142.97]) by ghost-submission-6684bf9d7b-pz96z with ESMTPSA id GFajLD+xJmQUmQAAoqrwCg (envelope-from ); Fri, 31 Mar 2023 10:09:03 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G002eef9004e-42c7-4c37-8a20-ea167a8cec75, 6EDB0577B4A4070ED54A7D4BC3C99A904D58EC0F) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves To: guix-patches@gnu.org Subject: [PATCH] gnu: libreoffice: Fix access to python modules. Date: Fri, 31 Mar 2023 12:09:01 +0200 Message-Id: <20230331100902.3866-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 12772208546386076386 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeiuddgvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeehteeijeejuefgvdfgieffueeftddvhfeltddvuddvvdffiedtkefgiefhvdffudenucffohhmrghinhepshhunhdrshhtrghrnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrdeljeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdhprghttghhvghssehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=46.105.76.65; envelope-from=ngraves@ngraves.fr; helo=2.mo582.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: ngraves@ngraves.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) * gnu/packages/libreoffice.scm (libreoffice): Fix access to python modules. --- 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 3d3e6d18dc..48689b9342 100644 --- a/gnu/packages/libreoffice.scm +++ b/gnu/packages/libreoffice.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2018, 2020 Jonathan Brielmaier ;;; Copyright © 2019 Chris Marusich ;;; Copyright © 2020 Marcin Karpezo +;;; Copyright © 2023 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -912,6 +913,11 @@ (define-public libreoffice (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 @@ -975,7 +981,12 @@ (define-public libreoffice ;; 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))) @@ -1001,6 +1012,24 @@ (define (install-appdata app) "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" @@ -1015,7 +1044,12 @@ (define (install-appdata app) '("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" -- 2.39.2 ------------=_1687122542-30206-1--