Subject: Re: Blender graphical interface broken since core-updates merge

From: Leo Famulari <[email-masked]>
Date: Wed, 26 Dec 2018 23:58:32 -0500

I haven't investigated this bug any more, although another bug was filed
on the subject at <https://bugs.gnu.org/33882>, with some more info.

I built a package of Blender 2.80 beta, and the patch is attached. The
program runs and looks okay, but I didn't actually try to do any work
with it yet, and the package may or may not need some tweaking. Help
wanted :)

To quote the Blender project's statement about 2.80 beta [0], "Blender 2.80
is under development. We do not recommend using Beta versions in
production, there are still many bugs and data loss is not likely but
still possible. Always backup your files."

[0] https://www.blender.org/2-8/#try-it-yourself
From 13731e529f012ad70a2276c1da572e76f3ab52bd Mon Sep 17 00:00:00 2001
From: Leo Famulari <[email-masked]>
Date: Tue, 25 Dec 2018 01:58:35 -0500
Subject: [PATCH] WIP: Blender: Update to a beta release of 2.80.

* gnu/packages/graphics.scm (blender): Update to 2.80-0.6d89337.
---
 gnu/packages/graphics.scm | 38 +++++++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index 6e184d333..9c29d2326 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -76,17 +76,20 @@
   #:use-module (guix utils))
 
 (define-public blender
+  (let ((revision "0")
+        (commit "6d89337257b6f3ec0b300e13c1322f5171d966af"))
   (package
     (name "blender")
-    (version "2.79b")
+    (version (git-version "2.80" revision commit))
     (source (origin
-              (method url-fetch)
-              (uri (string-append "https://download.blender.org/source/"
-                                  "blender-" version ".tar.gz"))
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://git.blender.org/blender.git")
+                     (commit commit)))
+              (file-name (git-file-name name version))
               (sha256
                (base32
-                "1g4kcdqmf67srzhi3hkdnr4z1ph4h9sza1pahz38mrj998q4r52c"))
-              (patches (search-patches "blender-newer-ffmpeg.patch"))))
+                "0hx2s8jwsh6a65sx8qbg5gdslpl2sh24cwbqbr5l1s50kfl6dmiz"))))
     (build-system cmake-build-system)
     (arguments
       (let ((python-version (version-major+minor (package-version python))))
@@ -113,14 +116,22 @@
                               "/lib")
                (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python")
                               "/include/python" ,python-version "m")
-               (string-append "-DPYTHON_VERSION=" ,python-version))
+               (string-append "-DPYTHON_VERSION=" ,python-version)
+               ;; XXX Why does it require Numpy now?
+               (string-append "-DPYTHON_NUMPY_PATH="
+                              (assoc-ref %build-inputs "python-numpy")
+                              "/lib/python" ,python-version "/site-packages/"))
          #:phases
          (modify-phases %standard-phases
-           (add-after 'unpack 'fix-broken-import
-             (lambda _
-               (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
-                 (("import encode_bin") "from . import encode_bin"))
-               #t))
+            ;; XXX These files don't exist in the Git source. Were they removed
+            ;; from Blender 2.80, or are they generated for the release
+            ;; tarballs, or perhaps later in the build process than "after
+            ;; unpack"?
+;           (add-after 'unpack 'fix-broken-import
+;             (lambda _
+;               (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
+;                 (("import encode_bin") "from . import encode_bin"))
+;               #t))
            (add-after 'set-paths 'add-ilmbase-include-path
              (lambda* (#:key inputs #:allow-other-keys)
                ;; OpenEXR propagates ilmbase, but its include files do not appear
@@ -150,6 +161,7 @@
        ("glew" ,glew)
        ("openal" ,openal)
        ("python" ,python)
+       ("python-numpy" ,python-numpy)
        ("zlib" ,zlib)))
     (home-page "https://blender.org/")
     (synopsis "3D graphics creation suite")
@@ -158,7 +170,7 @@
 the 3D pipeline—modeling, rigging, animation, simulation, rendering,
 compositing and motion tracking, even video editing and game creation.  The
 application can be customized via its API for Python scripting.")
-    (license license:gpl2+)))
+    (license license:gpl2+))))
 
 (define-public assimp
   (package
-- 
2.20.1