From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oC0gCpKxJmQzBgEASxT56A (envelope-from ) for ; Fri, 31 Mar 2023 12:10:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +BhKCZKxJmRzSAEA9RJhRA (envelope-from ) for ; Fri, 31 Mar 2023 12:10:26 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B1FF0417E6 for ; Fri, 31 Mar 2023 12:10:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piBhr-0006bM-Rw; Fri, 31 Mar 2023 06:10:04 -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 1piBhq-0006aw-GE for guix-patches@gnu.org; Fri, 31 Mar 2023 06:10:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piBhq-0003w1-7b for guix-patches@gnu.org; Fri, 31 Mar 2023 06:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piBhp-0000m0-KQ for guix-patches@gnu.org; Fri, 31 Mar 2023 06:10:01 -0400 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 X-OVh-ClientIp: 81.67.140.142 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680257426; a=rsa-sha256; cv=none; b=cGN+E5J58J97rB42JFOHGa356LWXbSQkZ+tWTZ4hSIkTDZQOiW37g7YYmAVKhHVbCtcNQH E5YT8bT3nquutvSav6PjUI3TgB/0QcUqVT/H6XRjp6k7pVlN0wvdAPh2BMlJp4xk5aCZPQ c+iIPDBo00e9E3tBBuraYFl+RUE76Utgnlp6sCQ1jTONunb4y6VzxE/mnTgLg8lGEXB0vN AiHV8CCXlhkSyVkblmzqIZKKHIvmsL3+dHIRM014nAx8kTo6FzUvOKmRUz89kqAP1D1c/d lFDNoPkzaBpyZbNaJT8yWp3kSXIIsuLdkUKHw26Q4optYrWtM5yqzsmrTjPGAg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680257426; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=HVoNN8pW41dAVXKRV18dNOeoyEvxE3u2V8AyZ8ZMxQE=; b=J76ItyquBwsCk9cHJ/7jb4fjqZdJNTMUaEGNwBlNr5Fs1GUEV2pYx8N9n76lnKj4iMW+k+ sobOOXTfxJjMBi8YcbozdN8fzC7ujj7RNm1ab1Vhg5z2/0iEAoCo2iJ37AZ45/V+Rp2Mqo fGpwlmpJRYi70+dv0xh6JGZtP/3YV2bVmaAf6vDjgcy6UxIKnsWbWBUJZLg5od+18TYbu/ yUZ1nUp/Ayy2uhkJEarMbn/QSpuQD/CAUZ4Np5KWQeZzyuxuS7JeILwyEHRHmkrccLXxDZ 9ZrseuyuZk7gUdMaiPQ8BVBKSwlLfDwlMVTnln0WU27/k2QgheUFNrCK+/Dl3Q== Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.02 X-Spam-Score: -5.02 X-Migadu-Queue-Id: B1FF0417E6 X-TUID: 0aJRyR3IjTjk * 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