[PATCH] gnu: blender: Add wrap-bin phase.

  • Done
  • quality assurance status badge
Details
2 participants
  • Thompson, David
  • Zheng Junjie
Owner
unassigned
Submitted by
Thompson, David
Severity
normal

Debbugs page

T
T
Thompson, David wrote on 17 Apr 16:49 -0700
(name . Ryan Prior via Guix-patches)(address . guix-patches@gnu.org)
CAJ=RwfaMLCF-8NN_r5AqUHpXY-VQQpb3=86rD2TkhhDJTBN+7w@mail.gmail.com
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
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(-)

Toggle diff (29 lines)
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
Z
Z
Zheng Junjie wrote on 21 Apr 09:30 -0700
(address . 70445-done@debbugs.gnu.org)
87il0alluq.fsf@iscas.ac.cn
"Thompson, David" <dthompson2@worcester.edu> writes:

Toggle quote (14 lines)
> 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
>
> [2. text/x-patch; 0001-gnu-blender-Add-wrap-bin-phase.patch]...
thanks, work for me.
I adjust to use gexp for #:phases.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEfr6klGDOXiwIdX/bO1qpk+Gi3/AFAmYlPx0ACgkQO1qpk+Gi
3/B4FA/+NwpmvDZSIdL73r1FPzC95xaUhkcxFIxDhyNADCPE2LnFM8ocg+QV+Uvn
DAFj9iwzEtf/fCKIPrXdMhLMBkXSUgnpLqTlB6+ykw8WSeNz8zQGPQ2cmG1jzP3E
jiPJ57lnegWe7NpdXtLKWie7RXJpIGrilWUP7QJOHZAqgvKK3VcxO9Ql3mFJtHez
I0OAXMznXdURJxLV6Vlgf2SHJMvJu/PrTaabHcCtsKxjoO8dKNvfLKq9VZdU6zT8
M5z8z63gQa6HRnLYHgK+Seg2wzrHaY5Q6Q8ZbhKTFlXS9vbrVY2cwvno0TcS+Gno
CM9gOfrBZzReNFKgIGdW5JdOxRDYIp13Z1+A6trAD/F6iMc3MMorxJNqlYcsJqIx
OkC2v0ppK8hO1HpbwMz4U9HAZyT8te5OD1hRZDoUvRw5RrETRBAmtr+okhD8gCjX
AH19j7K/H/gOramZli2O+dP1ZdV+9ujtqrRYXxTfumNWs2GYMEeJk0t/9A6wZnve
0BiRUGjf5Hnt20arNcPEHos+TwwpMGEjEd09RlzIOmabgpu/pqIMXQCTIRaYEAGg
9tGXFA62iACVoyQqK4Ri0GPjz0YjYMgQM0Pq0n72bVEotkq8ppjcQy1Rzls40OHv
w8Jd3hKqrywkzYpuSP4FhEtONLLCIdqpJDxjeZcD+wLTRsDIhWc=
=tGSx
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 70445@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70445
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch