gnu: blender: Use gexps and remove labels.

* gnu/packages/graphics.scm (blender) [arguments]: Use gexps.  Replace the
add-ilmbase-include-path phase by an added -I directive to the CMAKE_CXX_FLAGS
configure flag.
[inputs]: Remove labels.
This commit is contained in:
Maxim Cournoyer 2023-03-31 12:11:24 -04:00
parent ee0de79b1e
commit 893aad00c8
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -490,90 +490,85 @@ (define-public blender
"1jlc26axbhh97d2j6kfg9brgiq8j412mgmw7p41ah34apzq4inia")))) "1jlc26axbhh97d2j6kfg9brgiq8j412mgmw7p41ah34apzq4inia"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
(list
;; Test files are very large and not included in the release tarball.
#:tests? #f
#:configure-flags
(let ((python-version (version-major+minor (package-version python)))) (let ((python-version (version-major+minor (package-version python))))
`(;; Test files are very large and not included in the release tarball. #~(list "-DWITH_CODEC_FFMPEG=ON"
#:tests? #f "-DWITH_CODEC_SNDFILE=ON"
#:configure-flags "-DWITH_CYCLES=ON"
(list "-DWITH_CODEC_FFMPEG=ON" "-DWITH_DOC_MANPAGE=ON"
"-DWITH_CODEC_SNDFILE=ON" "-DWITH_FFTW3=ON"
"-DWITH_CYCLES=ON" "-DWITH_IMAGE_OPENJPEG=ON"
"-DWITH_DOC_MANPAGE=ON" "-DWITH_INPUT_NDOF=ON"
"-DWITH_FFTW3=ON" "-DWITH_INSTALL_PORTABLE=OFF"
"-DWITH_IMAGE_OPENJPEG=ON" "-DWITH_JACK=ON"
"-DWITH_INPUT_NDOF=ON" "-DWITH_MOD_OCEANSIM=ON"
"-DWITH_INSTALL_PORTABLE=OFF" "-DWITH_OPENVDB=ON"
"-DWITH_JACK=ON" "-DWITH_OPENSUBDIV=ON"
"-DWITH_MOD_OCEANSIM=ON" "-DWITH_PYTHON_INSTALL=OFF"
"-DWITH_OPENVDB=ON" (string-append "-DPYTHON_LIBRARY=python" #$python-version)
"-DWITH_OPENSUBDIV=ON" (string-append "-DPYTHON_LIBPATH="
"-DWITH_PYTHON_INSTALL=OFF" (assoc-ref %build-inputs "python")
(string-append "-DPYTHON_LIBRARY=python" ,python-version) "/lib")
(string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python") (string-append "-DPYTHON_INCLUDE_DIR="
"/lib") (assoc-ref %build-inputs "python")
(string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python") "/include/python" #$python-version)
"/include/python" ,python-version) (string-append "-DPYTHON_VERSION=" #$python-version)
(string-append "-DPYTHON_VERSION=" ,python-version) (string-append "-DPYTHON_NUMPY_INCLUDE_DIRS="
(string-append "-DPYTHON_NUMPY_INCLUDE_DIRS=" (assoc-ref %build-inputs "python-numpy")
(assoc-ref %build-inputs "python-numpy") "/lib/python" #$python-version
"/lib/python" ,python-version "/site-packages/numpy/core/include/") "/site-packages/numpy/core/include/")
(string-append "-DPYTHON_NUMPY_PATH=" (string-append "-DPYTHON_NUMPY_PATH="
(assoc-ref %build-inputs "python-numpy") (assoc-ref %build-inputs "python-numpy")
"/lib/python" ,python-version "/site-packages/")) "/lib/python" #$python-version
#:phases "/site-packages/")
(modify-phases %standard-phases ;; OpenEXR propagates ilmbase, but its include files do not
;; XXX This file doesn't exist in the Git sources but will probably ;; appear in the C_INCLUDE_PATH, so we need to add
;; exist in the eventual 2.80 source tarball. ;; "$ilmbase/include/OpenEXR/" to the C_INCLUDE_PATH to
(add-after 'unpack 'fix-broken-import ;; satisfy the dependency on "half.h" and "Iex.h".
(lambda _ (string-append "-DCMAKE_CXX_FLAGS=-I"
(substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py" (search-input-directory %build-inputs
(("import encode_bin") "from . import encode_bin")) "include/OpenEXR"))))
#t)) #:phases
(add-after 'set-paths 'add-ilmbase-include-path #~(modify-phases %standard-phases
(lambda* (#:key inputs #:allow-other-keys) (add-after 'unpack 'fix-broken-import
;; OpenEXR propagates ilmbase, but its include files do not (lambda _
;; appear in the C_INCLUDE_PATH, so we need to add (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py"
;; "$ilmbase/include/OpenEXR/" to the C_INCLUDE_PATH to satisfy (("import encode_bin")
;; the dependency on "half.h" and "Iex.h". "from . import encode_bin")))))))
(let ((headers (string-append
(assoc-ref inputs "ilmbase")
"/include/OpenEXR")))
(setenv "C_INCLUDE_PATH"
(string-append headers ":"
(or (getenv "C_INCLUDE_PATH") "")))
(setenv "CPLUS_INCLUDE_PATH"
(string-append headers ":"
(or (getenv "CPLUS_INCLUDE_PATH") ""))))))))))
(inputs (inputs
`(("boost" ,boost) (list boost
("jemalloc" ,jemalloc) embree
("libx11" ,libx11) ffmpeg
("libxi" ,libxi) fftw
("libxrender" ,libxrender) freetype
("opencolorio" ,opencolorio) glew
("openimageio" ,openimageio) gmp ;needed for boolean operations on meshes
("openexr" ,openexr-2) ilmbase
("opensubdiv" ,opensubdiv) jack-1
("ilmbase" ,ilmbase) jemalloc
("openjpeg" ,openjpeg) libjpeg-turbo
("libjpeg" ,libjpeg-turbo) libpng
("libpng" ,libpng) libsndfile
("libtiff" ,libtiff) libtiff
("ffmpeg" ,ffmpeg) libx11
("fftw" ,fftw) libxi
("gmp" ,gmp) ;; needed for boolean operations on meshes libxrender
("jack" ,jack-1) openal
("libsndfile" ,libsndfile) opencolorio
("freetype" ,freetype) openexr-2
("glew" ,glew) openimageio
("openal" ,openal) openjpeg
("pugixml" ,pugixml) opensubdiv
("python" ,python) openvdb
("python-numpy" ,python-numpy) pugixml
("openvdb" ,openvdb) python
("tbb" ,tbb) python-numpy
("zlib" ,zlib) tbb
("zstd" ,zstd "lib") zlib
("embree" ,embree))) `(,zstd "lib")))
(home-page "https://blender.org/") (home-page "https://blender.org/")
(synopsis "3D graphics creation suite") (synopsis "3D graphics creation suite")
(description (description