blender module build script

Here is a place for your projects which are not officially supported by the Porteus Team. For example: your own kernel patched with extra features; desktops not included in the standard ISO like Gnome; base modules that are different than the standard ISO, etc...
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

blender module build script

Post#31 by Rava » 01 Nov 2022, 00:19

ncmprhnsbl wrote:
31 Oct 2022, 23:42
the only line is setting a variable: PYTHVER=`/usr/bin/python --version | cut -d" " -f2 | awk -F. '{print$1$2}'`
and i would think that our /usr/bin/python --version should output 3.9*
On my system

Code: Select all

guest@porteus:~$ cat /etc/porteus/00*
001-core.xzm:20221006
002-xorg.xzm:20221006
002-xtra.xzm:20220630
003-xfce.xzm:20220925
I get this

Code: Select all

root@porteus:~# /usr/bin/python --version | cut -d" " -f2 | awk -F. '{print$1$2}'
39
and this

Code: Select all

root@porteus:~# /usr/bin/python --version
Python 3.9.14
Should it really read "39" instead of "3.9"?
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3933
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

blender module build script

Post#32 by ncmprhnsbl » 01 Nov 2022, 01:42

Rava wrote:
01 Nov 2022, 00:19
Should it really read "39" instead of "3.9"?
yeah, i think i was having trouble with the test using "-eq", which requires an integer .. seems like i switched to the string test "=" which should be okay with fractionals..
academic at this point, since all that python stuff is currently redundant, in that, whatever the python installed, we're using the python 3.10 shipped with blender..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

raja
Shogun
Shogun
Posts: 434
Joined: 02 May 2017, 09:51
Distribution: v3.2.2-32 and Porteus-Artix-64
Location: Chennai,India

blender module build script

Post#33 by raja » 01 Nov 2022, 09:50

Thanks ncmp..

Your modified script did build the blender module version 3.3.1LTS.
Linux Kernel-4.4.272 -32 bit; Linux Kernel-5.4.185 - 64 bit

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

blender module build script

Post#34 by Rava » 01 Nov 2022, 13:55

ncmprhnsbl wrote:
01 Nov 2022, 01:42
academic at this point, since all that python stuff is currently redundant, in that, whatever the python installed, we're using the python 3.10 shipped with blender..
meaning if I would update my whatever-base module that contains python 3.9 to 3.10 - doing so would not interfere with any python scripts in Port whatsoever, and I could manually remove the python from the created blender module?
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 2092
Joined: 02 Jan 2011, 11:33
Location: italy

blender module build script

Post#35 by beny » 01 Nov 2022, 14:26

hi Rava the python3.10 and blender are located in /opt so the python version is like an appimage with blender, all the deps are in the package i have also the python3.10 installed but in the /usr/lib directory,not /usr/lib64 the python3.9 is into the /usr/lib64,i don't think that the different version may clash,but what i think is... you can't remove python from blender,but you can try..

gnintilgyes
Black ninja
Black ninja
Posts: 73
Joined: 14 Sep 2022, 17:52
Distribution: Debian

blender module build script

Post#36 by gnintilgyes » 01 Nov 2022, 15:52

Rava wrote:
01 Nov 2022, 00:19

Code: Select all

root@porteus:~# /usr/bin/python --version | cut -d" " -f2 | awk -F. '{print$1$2}'
39
Should it really read "39" instead of "3.9"?
It's because you asked awk to leave out the period between "version" and "release", using the period as field separator.
To get "3.10" or alike try:

Code: Select all

'{ print $1 "." $2 }'
as the awk "script".

Maybe have awk check if the "release" is less than ten so it reports a fake integer of "309" for "3.09" and "310" for "3.10", out of Python version.

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

blender module build script

Post#37 by Rava » 02 Nov 2022, 05:04

beny wrote:
01 Nov 2022, 14:26
hi Rava the python3.10 and blender are located in /opt so the python version is like an appimage with blender, all the deps are in the package i have also the python3.10 installed but in the /usr/lib directory,not /usr/lib64 the python3.9 is into the /usr/lib64,i don't think that the different version may clash,but what i think is... you can't remove python from blender,but you can try..
Wow that sounds more complicated that I thought it would be.

What happens in your system to regular python scripts when you have python3.10 installed in /usr/lib and python3.9 in /usr/lib64?
Usually python scripts look for its binary not its libraries, right?

The only python script in /usr/local/bin to test on I found is obamenu.py

Code: Select all

root@porteus:/usr/local/bin# file obamenu.py
obamenu.py: Python script, ASCII text executable
root@porteus:/usr/local/bin# head -n 2 obamenu.py
#!/usr/bin/env python3
#
root@porteus:/usr/local/bin# file `which python3`
/usr/bin/python3: symbolic link to python3.9
root@porteus:/usr/local/bin# file `which python3.9`
/usr/bin/python3.9: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
What would python scripts do in your setup?
What does a

Code: Select all

file `which python3`
or a

Code: Select all

file `which python`
report on your system when you have both 3.9 and 3.10 installed?

In my case, the python's script would use /usr/bin/python3.9 as python interpreter since that is what /usr/bin/env python3 will execute - as you can see, /usr/bin/python3 is a symlink to the binary of /usr/bin/python3.9
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 2092
Joined: 02 Jan 2011, 11:33
Location: italy

blender module build script

Post#38 by beny » 02 Nov 2022, 08:44

Code: Select all

root@porteus:~# file `which python3.9`
/usr/bin/python3.9: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, stripped
root@porteus:~# file `which python3.10`
/usr/bin/python3.10: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=d98be67281de551fbc0a44f93c9395b3e99dd0ee, stripped
root@porteus:~# 
Rava the python 3.10 that i have isn't inside the stock porteus most of the libs system are of a current and i like to test it into an aufs system.
Last edited by Rava on 02 Nov 2022, 08:48, edited 1 time in total.
Reason: added [code]

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

blender module build script

Post#39 by Rava » 02 Nov 2022, 08:48

What does

Code: Select all

file `which python3`
report?
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 2092
Joined: 02 Jan 2011, 11:33
Location: italy

blender module build script

Post#40 by beny » 02 Nov 2022, 08:58

root@porteus:~# `which python3`
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

root@porteus:~# file `which python3`
/usr/bin/python3: symbolic link to python3.10
root@porteus:~#

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

blender module build script

Post#41 by Rava » 02 Nov 2022, 09:02

beny wrote:
02 Nov 2022, 08:58

Code: Select all

root@porteus:~#  `which python3`
Python 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
I presume that translate into something like this:

Code: Select all

root@porteus:/tmp# file `which python3`
/usr/bin/python3: symbolic link to python3.10.4
or this

Code: Select all

root@porteus:/tmp# file `which python3`
/usr/bin/python3: symbolic link to python3.10
Added in 3 minutes 10 seconds:
In case someone wonders why

Code: Select all

`which python3`
starts python, which just tells us which program with full path "python3" is:

Code: Select all

root@porteus:/tmp# which python3
/usr/bin/python3
therefore typing

Code: Select all

python3
or

Code: Select all

`which python3`
is equivalent here.
Cheers!
Yours Rava

beny
Full of knowledge
Full of knowledge
Posts: 2092
Joined: 02 Jan 2011, 11:33
Location: italy

blender module build script

Post#42 by beny » 23 Dec 2022, 18:36

hi ncmprhnsbl, the update-blender script that i have used today left the lib directory out of the package, blender do not run, maybe is my system,the version that i have choose is the 3.4.1

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3933
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

blender module build script

Post#43 by ncmprhnsbl » 16 Jan 2023, 02:18

beny wrote:
23 Dec 2022, 18:36
left the lib directory out of the package
thanks beny,
have updated the script (see first post)
just changed the line:

Code: Select all

if [ `echo $SRC | grep "alpha"` ]; then
to

Code: Select all

if [ -e $TMPDIR/$SRC/lib/libcycles_kernel_oneapi_aot.so ]; then
since previously, those cycles related libs were only in what was the 'alpha' (3.4) branch at the time..
i havn't tested this myself, but it should work now.
if in doubt, download the tarball from blender.org, place it in /tmp, run the script and it'll work on that tarball..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

beny
Full of knowledge
Full of knowledge
Posts: 2092
Joined: 02 Jan 2011, 11:33
Location: italy

blender module build script

Post#44 by beny » 16 Jan 2023, 11:02

hi ncmprhnsbl thanks for the fix

Post Reply