diff options
author | Adam Bujalski <a.bujalski@samsung.com> | 2022-04-12 15:56:45 +0200 |
---|---|---|
committer | Adam Bujalski <a.bujalski@samsung.com> | 2022-04-14 12:37:11 +0200 |
commit | d46c72bcce17c875c371680c76e64cba33ce479f (patch) | |
tree | 4b151a7d4948db9f589ffb8a3b675dfcb7412dd1 | |
parent | 8f6857b2f090110f46fb07fe6a9a98cc014e6851 (diff) | |
download | qemu-accel-accepted/tizen_7.0_base_tool_hotfix.tar.gz qemu-accel-accepted/tizen_7.0_base_tool_hotfix.tar.bz2 qemu-accel-accepted/tizen_7.0_base_tool_hotfix.zip |
Adding python3 to python-acceltizen_7.0_m2_releasesubmit/tizen_base/20220419.004944submit/tizen_7.0_base_hotfix/20221115.161701submit/tizen_7.0_base/20221028.201301accepted/tizen/base/tool/20220419.033519accepted/tizen/7.0/base/tool/hotfix/20221115.084326accepted/tizen/7.0/base/tool/20221028.120309accepted/tizen/7.0/base/hotfix/20230714.003920accepted/tizen/7.0/base/20230714.003110tizen_7.0_base_hotfixaccepted/tizen_7.0_base_tool_hotfixaccepted/tizen_7.0_base_toolaccepted/tizen_7.0_base_hotfix
Due to python2 deprecation https://www.python.org/doc/sunset-python-2/
more software starts to use python3 instead of python2.
This happen to chromium somewhere between versions M85 (used on
Tizen6.5) and M95 (adapted for Tizen7.0). As chromium used a lot of
build scripts written in python using accelerated version causes
significant speed-up of the build process.
Change-Id: I25b3790e0a75f32b7c530cba89d2b11957de7793
Signed-off-by: Adam Bujalski <a.bujalski@samsung.com>
-rw-r--r-- | packaging/qemu-accel-aarch64.spec | 34 | ||||
-rw-r--r-- | packaging/qemu-accel-armv7hl.spec | 34 | ||||
-rw-r--r-- | packaging/qemu-accel-armv7l.spec | 34 | ||||
-rw-r--r-- | packaging/qemu-accel.spec.in | 34 |
4 files changed, 136 insertions, 0 deletions
diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index 2d0ebd6..7dc2b77 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -69,6 +69,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -179,6 +181,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -280,6 +283,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -435,6 +443,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -463,6 +489,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -571,6 +599,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list diff --git a/packaging/qemu-accel-armv7hl.spec b/packaging/qemu-accel-armv7hl.spec index 17a5b44..878df60 100644 --- a/packaging/qemu-accel-armv7hl.spec +++ b/packaging/qemu-accel-armv7hl.spec @@ -69,6 +69,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -179,6 +181,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -280,6 +283,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -435,6 +443,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -463,6 +489,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -571,6 +599,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index eee28f1..3262d21 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -69,6 +69,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -179,6 +181,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -280,6 +283,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -435,6 +443,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -463,6 +489,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -571,6 +599,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 2d9bec4..7aadd20 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -66,6 +66,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -176,6 +178,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -277,6 +280,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -432,6 +440,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -460,6 +486,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -568,6 +596,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list |