-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blender: implement multiple versions, move to fetchFromGitea #257780
blender: implement multiple versions, move to fetchFromGitea #257780
Conversation
a557861
to
ce3313b
Compare
pkgs/top-level/all-packages.nix
Outdated
|
||
blender-with-packages = callPackage ../applications/misc/blender/wrapper.nix { }; | ||
blenderPackages = callPackage ../applications/misc/blender { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blenderPackages is not the attribute naming scheme for versioning. Look at how it's done in e.g. boost
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to blender3_x
, blender3_x-hip
, and with blender
, blender-lts
, blender-hip
etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see
https://nixos.org/manual/nixpkgs/stable/#sec-versioning for file organization
and last bullet of https://nixos.org/manual/nixpkgs/stable/#sec-package-naming for blender_3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So blender_3_x
, blender-hip_3_x
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _x
is omitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
_x
is omitted.
I don't understand what you mean.
The example in the link you gave me (https://nixos.org/manual/nixpkgs/stable/#sec-package-naming) with their example has json-c_0_9
and json-c_0_11
.
If you mean blender_3x
, personally I think that's confusing, given previously blender has versions like 2.93
, and blender uses these to indicate API breaking changes (major and minor versions).
ce3313b
to
ee9ca8b
Compare
62e050b
to
df7ac2c
Compare
Almost ready. I just need to clean up the nix code. |
df7ac2c
to
6627da0
Compare
Completely forgot Okay, so, currently we have a couple of decisions to make. Version naming conventionsSo far I've gotten three options all on top-levelBased on naming convention of
with
|
blender-with-packages basically do what python.with-packages does. Blender 2.x still uses python 3.9 and 3.x python 3.10 and we had a problem with linking which python packages are supported for each blender version. As far as I remember it takes blender as the first parameter and from a passthru attribute gets which python package set it supports (like python.pkgs). |
6627da0
to
bdaae3c
Compare
@amarshall you wrote the unit test, I don't know much about command-line use in blender, do you think there's an argument change or something I've missed? |
bdaae3c
to
5860841
Compare
Which error? |
I forgot to include the log, sorry
|
Would it be easier to review this PR if it were to be split up to several smaller ones? |
It seems that you need to rebase your commits |
Dear lord- (didn't notice diff size) |
Fixes patching issue. Blender-addons-contrib is not included, as decided upstream.
Git/Github seems to be confused for this rename, so a separate commit is needed.
moved derivation to generic.nix, passthrough `pythonPackages` roughly referenced pkgs/minecraft-servers/default.nix blender_3_3: init 3.3.14 blender_3_6: init 3.6.7 blender_4_0: init 4.0.2
moved derivation to generic.nix, passthrough `pythonPackages` roughly referenced pkgs/minecraft-servers/default.nix blender_3_3: init 3.3.14 blender_3_6: init 3.6.7 blender_4_0: init 4.0.2
ad95bb6
to
ca777ff
Compare
I'll split it up when I get the time to do so. Will set to draft (and maybe eventually close) since
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly formatting and design things
|
||
# TODO Consider following https://vfxplatform.com/ for dependency tracking | ||
# Like "VFX_RefCY": "2024", which outlines python 3.11, qt 6.5+ etc | ||
pythonPackages = python310Packages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pythonPackages = python310Packages; | |
python3Packages = python310Packages; |
lets make it clear that we are not using python2 here
, mesa | ||
, runCommand | ||
, callPackage | ||
, version, hashes, isLTS, pythonPackages, xvfb-run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, version, hashes, isLTS, pythonPackages, xvfb-run | |
, version, hashes, isLTS, python3Packages, xvfb-run |
}: | ||
|
||
let | ||
inherit (pythonPackages) python; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inherit (pythonPackages) python; |
we could avoid this if we would we using python3 instead of python3 pkgs.
nativeBuildInputs = | ||
[ cmake makeWrapper pythonPackages.wrapPython llvmPackages.llvm.dev | ||
] | ||
++ lib.optionals cudaSupport [ | ||
addOpenGLRunpath | ||
cudaPackages.cuda_nvcc | ||
] | ||
++ lib.optionals waylandSupport [ pkg-config ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nativeBuildInputs = | |
[ cmake makeWrapper pythonPackages.wrapPython llvmPackages.llvm.dev | |
] | |
++ lib.optionals cudaSupport [ | |
addOpenGLRunpath | |
cudaPackages.cuda_nvcc | |
] | |
++ lib.optionals waylandSupport [ pkg-config ]; | |
nativeBuildInputs = [ | |
cmake makeWrapper pythonPackages.wrapPython llvmPackages.llvm.dev | |
] ++ lib.optionals cudaSupport [ | |
addOpenGLRunpath | |
cudaPackages.cuda_nvcc | |
] ++ lib.optionals waylandSupport [ pkg-config ]; |
lets make this a bit tidy
buildInputs = | ||
[ boost ffmpeg gettext glew ilmbase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildInputs = | |
[ boost ffmpeg gettext glew ilmbase | |
buildInputs = [ | |
boost ffmpeg gettext glew ilmbase |
++ lib.optionals cudaSupport [ cudaPackages.cuda_cudart ] | ||
++ lib.optional colladaSupport opencollada | ||
++ lib.optional spaceNavSupport libspnav; | ||
pythonPath = with pythonPackages; [ numpy requests zstandard ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are using python3 as an input, we would need to use python3.pkgs here
pythonPath = with pythonPackages; [ numpy requests zstandard ]; | ||
|
||
postPatch = (if stdenv.isDarwin then '' | ||
: > build_files/cmake/platform/platform_apple_xcode.cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: > build_files/cmake/platform/platform_apple_xcode.cmake | |
touch build_files/cmake/platform/platform_apple_xcode.cmake |
touch is a bit more obvious
cmakeFlags = | ||
[ | ||
"-DWITH_ALEMBIC=ON" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmakeFlags = | |
[ | |
"-DWITH_ALEMBIC=ON" | |
cmakeFlags = [ | |
"-DWITH_ALEMBIC=ON" |
''; | ||
|
||
passthru = { | ||
inherit python pythonPackages isLTS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inherit python pythonPackages isLTS; | |
inherit python isLTS; |
we should only inherit python from where you can get pkgs via python.pkgs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: #257780 (review)
This was implemented over python3.pkgs
as per #211340
echo "Rendering with $engine..." | ||
|
||
# Blender doesn't support headless rendering on EEVEE before 3.4 | ||
if [ ${if lib.versionOlder version "3.4" then "0" else "1"} -eq 0 ] && [ $engine == "BLENDER_EEVEE" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [ ${if lib.versionOlder version "3.4" then "0" else "1"} -eq 0 ] && [ $engine == "BLENDER_EEVEE" ] | |
if ${lib.boolToString (lib.versionOlder version "3.4")} && [ $engine == "BLENDER_EEVEE" ] |
Closing, as this got really messy and it could use a bit of a clean up/rewrite continuing with smaller, easier to review PRs |
Work continues on #305727 |
Description of changes
Resolves #256845
I've changed the
fetchurl
tofetchFromGitea
, to find the tagged sources easier (at the cost of download speed, I've found projects.blender.org isn't as fast as downloads.blender.org).I ran into issues with applying the
draco.patch
to the addon repo, so I split it in two, patching each repo seperately.I've roughly referenced
pkgs/minecraft-servers/default.nix
for my json to packages implementation, since I don't have much experience with nixpkgs. If that's not okay, please let me know.I moved a lot of the original code, but I kept it the same for the most part. I'm new to writing for nixpkgs, so I'm only implementing the parts I know and a major refactor of the original code is not within scope.
isLTS
attributeupdate.py
blender-with-packages
CONTRIBUTING.md
blender-with-packages
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)