unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: 70445@debbugs.gnu.org
Subject: [bug#70445] [PATCH] gnu: blender: Add wrap-bin phase.
Date: Wed, 17 Apr 2024 19:49:39 -0400	[thread overview]
Message-ID: <CAJ=RwfaMLCF-8NN_r5AqUHpXY-VQQpb3=86rD2TkhhDJTBN+7w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

Hi all,

I started learning Blender this past week and when I tried to export a
model to glTF I was shown an error console saying that the numpy
module couldn't be found. We already had python-numpy in the inputs
list, but the blender binary was not being wrapped to add it to
Python's load path. This patch fixes this and presumably fixes other
extensions that use Python modules.

Thanks,

- Dave

[-- Attachment #2: 0001-gnu-blender-Add-wrap-bin-phase.patch --]
[-- Type: text/x-patch, Size: 1715 bytes --]

From 66305eda88e2d1967b6c241b34e79dcdee837f63 Mon Sep 17 00:00:00 2001
Message-ID: <66305eda88e2d1967b6c241b34e79dcdee837f63.1713394687.git.dthompson2@worcester.edu>
From: David Thompson <dthompson2@worcester.edu>
Date: Wed, 17 Apr 2024 18:50:49 -0400
Subject: [PATCH] gnu: blender: Add wrap-bin phase.

* gnu/packages/graphics.scm (blender)[arguments]: Add wrap-bin phase to set proper
GUIX_PYTHONPATH.
[inputs]: Add bash-minimal per 'guix lint'.

Change-Id: I435957baf181ef7f92d4160529439357e16714f6
---
 gnu/packages/graphics.scm | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 85e4eed3b1..5a8c907ccd 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -543,9 +543,18 @@ (define-public blender
                 (string-append "-DPYTHON_NUMPY_PATH="
                                (assoc-ref %build-inputs "python-numpy")
                                "/lib/python" #$python-version
-                               "/site-packages/")))))
+                               "/site-packages/")))
+      #:phases
+      '(modify-phases %standard-phases
+         (add-after 'install 'wrap-bin
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (python-path (getenv "GUIX_PYTHONPATH")))
+               (wrap-program (string-append out "/bin/blender")
+                 `("GUIX_PYTHONPATH" ":" prefix (,python-path)))))))))
     (inputs
-     (list boost
+     (list bash-minimal
+           boost
            bullet
            eigen
            embree

base-commit: dbfb691c5b4bc66682657ebf124815f5b93fcdbd
-- 
2.41.0


             reply	other threads:[~2024-04-17 23:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 23:49 Thompson, David [this message]
2024-04-21 16:30 ` bug#70445: [PATCH] gnu: blender: Add wrap-bin phase Zheng Junjie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ=RwfaMLCF-8NN_r5AqUHpXY-VQQpb3=86rD2TkhhDJTBN+7w@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=70445@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).