Add python-cross package for python acceleration 62/46462/1 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/mobile/20150821.053228 accepted/tizen/tv/20150821.053246 accepted/tizen/wearable/20150821.053256 submit/tizen/20150821.043747 submit/tizen_common/20151015.190624 submit/tizen_common/20151023.083358 submit/tizen_common/20151025.112935 submit/tizen_common/20151025.114336 submit/tizen_common/20151026.085049 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
authorYury Usishchev <y.usishchev@samsung.com>
Thu, 20 Aug 2015 14:08:08 +0000 (17:08 +0300)
committerYury Usishchev <y.usishchev@samsung.com>
Thu, 20 Aug 2015 14:08:33 +0000 (17:08 +0300)
Change-Id: I7b5616d773716491413d90fb71ff89203bfce788
Signed-off-by: Yury Usishchev <y.usishchev@samsung.com>
packaging/baselibs.conf
packaging/qemu-accel-aarch64.spec
packaging/qemu-accel-armv7l.spec
packaging/qemu-accel.spec.in

index 4668884..0521acc 100644 (file)
@@ -164,3 +164,18 @@ qemu-accel-aarch64
     postun "    $ACCEL_DIR/usr/lib/gcc/aarch64-tizen-linux/${GCCVER}/liblto_plugin.so"
     +/
     config -/pkg-config$
+
+
+python-accel-armv7l
+  targettype cross-aarch64 block!
+  targettype 32bit block!
+  targettype cross-arm
+  autoreqprov off
+  +/
+
+python-accel-aarch64
+  targettype cross-arm block!
+  targettype 32bit block!
+  targettype cross-aarch64
+  autoreqprov off
+  +/
index eca2b54..13c61bd 100644 (file)
@@ -59,6 +59,8 @@ BuildRequires:  qemu-linux-user
 BuildRequires: elfutils
 BuildRequires: libxslt-tools
 BuildRequires: cmake
+BuildRequires:  python
+BuildRequires:  python-xml
 Requires:       coreutils
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
@@ -89,11 +91,24 @@ This package is used in %{emulated_arch_long} architecture builds using qemu to
 with native binaries.
 This should not be installed on systems, it is just intended for qemu environments.
 
+%package -n python-accel-%{emulated_arch_long}
+Version: %{version}
+Release: %{release}
+Summary: Binaries for python acceleration
+License:        GPL-2.0
+Group:          Development/Cross Compilation
+
+%description -n python-accel-%{emulated_arch_long}
+This package is used in qemu-accel to accelerate python.
+
 %prep
 
 %build
 
 %install
+# just like it is determided in python.spec
+python_version=`python --version |& sed -ne '1s/.* //p' | head -c 3`
+
 binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc
 %ifarch %ix86
   LD="/lib/ld-linux.so.2"
@@ -126,6 +141,8 @@ for executable in $LD \
    /usr/bin/make \
    /usr/bin/m4 \
    /usr/bin/patch \
+   %{_bindir}/python${python_version} \
+   %{_libdir}/python${python_version}/lib-dynload/*.so \
    /usr/bin/%{emulated_arch_triple_short}-{%{binaries_binutils_comma}} \
    /usr/bin/eu-{addr2line,ar,elfcmp,elflint,findtextrel,ld,nm,objdump,ranlib,readelf,size,stack,strings,strip,unstrip} \
    /usr/bin/xsltproc \
@@ -184,6 +201,23 @@ mkdir -p "%{buildroot}%{our_path}/usr/bin/"
 ln -sf ../usr/bin/bash "%{buildroot}%{our_path}/bin/sh"
 ln -sf ../../bin/bash "%{buildroot}%{our_path}/usr/bin/sh"
 
+# create symlinks for python
+mv %{buildroot}%{our_path}%{_bindir}/python${python_version} %{buildroot}%{our_path}%{_bindir}/python${python_version}.orig
+cat > %{buildroot}%{our_path}%{_bindir}/python${python_version} << EOF
+#!/bin/bash
+if [ -z "\$PYTHONPATH" ]; then
+  export PYTHONPATH="%{_libdir}/python${python_version}"
+else
+  export PYTHONPATH+=":%{_libdir}/python${python_version}"
+fi
+export PYTHONHOME="%{our_path}%{_prefix}"
+%{our_path}%{_bindir}/python${python_version}.orig "\$@"
+EOF
+chmod +x %{buildroot}%{our_path}%{_bindir}/python${python_version}
+
+ln -s python${python_version} %{buildroot}%{our_path}%{_bindir}/python
+ln -s python${python_version} %{buildroot}%{our_path}%{_libdir}/python
+
 # binutils needs to be exposed in /usr/bin
 if [ ! -d %{buildroot}%{our_path}/usr/%{emulated_arch_triple_short}/bin ] ; then
   mkdir -p %{buildroot}%{our_path}/usr/%{emulated_arch_triple_short}/bin
@@ -316,6 +350,13 @@ ldconfig
 /usr/%{emulated_arch_triple_long}/include
 /emul
 /qemu
+%exclude %{our_path}%{_bindir}/python*
+%exclude %{our_path}%{_libdir}/python*/lib-dynload/*.so
 %ghost %{bfd_plugin_lto}
 
+%files -n python-accel-%{emulated_arch_long}
+%defattr(-,root,root)
+%{our_path}%{_bindir}/python*
+%{our_path}%{_libdir}/python*/lib-dynload/*.so
+
 %changelog
index f2aa79f..a9945c7 100644 (file)
@@ -59,6 +59,8 @@ BuildRequires:  qemu-linux-user
 BuildRequires: elfutils
 BuildRequires: libxslt-tools
 BuildRequires: cmake
+BuildRequires:  python
+BuildRequires:  python-xml
 Requires:       coreutils
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
@@ -89,11 +91,24 @@ This package is used in %{emulated_arch_long} architecture builds using qemu to
 with native binaries.
 This should not be installed on systems, it is just intended for qemu environments.
 
+%package -n python-accel-%{emulated_arch_long}
+Version: %{version}
+Release: %{release}
+Summary: Binaries for python acceleration
+License:        GPL-2.0
+Group:          Development/Cross Compilation
+
+%description -n python-accel-%{emulated_arch_long}
+This package is used in qemu-accel to accelerate python.
+
 %prep
 
 %build
 
 %install
+# just like it is determided in python.spec
+python_version=`python --version |& sed -ne '1s/.* //p' | head -c 3`
+
 binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc
 %ifarch %ix86
   LD="/lib/ld-linux.so.2"
@@ -126,6 +141,8 @@ for executable in $LD \
    /usr/bin/make \
    /usr/bin/m4 \
    /usr/bin/patch \
+   %{_bindir}/python${python_version} \
+   %{_libdir}/python${python_version}/lib-dynload/*.so \
    /usr/bin/%{emulated_arch_triple_short}-{%{binaries_binutils_comma}} \
    /usr/bin/eu-{addr2line,ar,elfcmp,elflint,findtextrel,ld,nm,objdump,ranlib,readelf,size,stack,strings,strip,unstrip} \
    /usr/bin/xsltproc \
@@ -184,6 +201,23 @@ mkdir -p "%{buildroot}%{our_path}/usr/bin/"
 ln -sf ../usr/bin/bash "%{buildroot}%{our_path}/bin/sh"
 ln -sf ../../bin/bash "%{buildroot}%{our_path}/usr/bin/sh"
 
+# create symlinks for python
+mv %{buildroot}%{our_path}%{_bindir}/python${python_version} %{buildroot}%{our_path}%{_bindir}/python${python_version}.orig
+cat > %{buildroot}%{our_path}%{_bindir}/python${python_version} << EOF
+#!/bin/bash
+if [ -z "\$PYTHONPATH" ]; then
+  export PYTHONPATH="%{_libdir}/python${python_version}"
+else
+  export PYTHONPATH+=":%{_libdir}/python${python_version}"
+fi
+export PYTHONHOME="%{our_path}%{_prefix}"
+%{our_path}%{_bindir}/python${python_version}.orig "\$@"
+EOF
+chmod +x %{buildroot}%{our_path}%{_bindir}/python${python_version}
+
+ln -s python${python_version} %{buildroot}%{our_path}%{_bindir}/python
+ln -s python${python_version} %{buildroot}%{our_path}%{_libdir}/python
+
 # binutils needs to be exposed in /usr/bin
 if [ ! -d %{buildroot}%{our_path}/usr/%{emulated_arch_triple_short}/bin ] ; then
   mkdir -p %{buildroot}%{our_path}/usr/%{emulated_arch_triple_short}/bin
@@ -316,6 +350,13 @@ ldconfig
 /usr/%{emulated_arch_triple_long}/include
 /emul
 /qemu
+%exclude %{our_path}%{_bindir}/python*
+%exclude %{our_path}%{_libdir}/python*/lib-dynload/*.so
 %ghost %{bfd_plugin_lto}
 
+%files -n python-accel-%{emulated_arch_long}
+%defattr(-,root,root)
+%{our_path}%{_bindir}/python*
+%{our_path}%{_libdir}/python*/lib-dynload/*.so
+
 %changelog
index 860c366..c957ee4 100644 (file)
@@ -59,6 +59,8 @@ BuildRequires:  qemu-linux-user
 BuildRequires: elfutils
 BuildRequires: libxslt-tools
 BuildRequires: cmake
+BuildRequires:  python
+BuildRequires:  python-xml
 Requires:       coreutils
 Requires(post): update-alternatives
 Requires(postun): update-alternatives
@@ -89,11 +91,24 @@ This package is used in %{emulated_arch_long} architecture builds using qemu to
 with native binaries.
 This should not be installed on systems, it is just intended for qemu environments.
 
+%package -n python-accel-%{emulated_arch_long}
+Version: %{version}
+Release: %{release}
+Summary: Binaries for python acceleration
+License:        GPL-2.0
+Group:          Development/Cross Compilation
+
+%description -n python-accel-%{emulated_arch_long}
+This package is used in qemu-accel to accelerate python.
+
 %prep
 
 %build
 
 %install
+# just like it is determided in python.spec
+python_version=`python --version |& sed -ne '1s/.* //p' | head -c 3`
+
 binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc
 %ifarch %ix86
   LD="/lib/ld-linux.so.2"
@@ -126,6 +141,8 @@ for executable in $LD \
    /usr/bin/make \
    /usr/bin/m4 \
    /usr/bin/patch \
+   %{_bindir}/python${python_version} \
+   %{_libdir}/python${python_version}/lib-dynload/*.so \
    /usr/bin/%{emulated_arch_triple_short}-{%{binaries_binutils_comma}} \
    /usr/bin/eu-{addr2line,ar,elfcmp,elflint,findtextrel,ld,nm,objdump,ranlib,readelf,size,stack,strings,strip,unstrip} \
    /usr/bin/xsltproc \
@@ -184,6 +201,23 @@ mkdir -p "%{buildroot}%{our_path}/usr/bin/"
 ln -sf ../usr/bin/bash "%{buildroot}%{our_path}/bin/sh"
 ln -sf ../../bin/bash "%{buildroot}%{our_path}/usr/bin/sh"
 
+# create symlinks for python
+mv %{buildroot}%{our_path}%{_bindir}/python${python_version} %{buildroot}%{our_path}%{_bindir}/python${python_version}.orig
+cat > %{buildroot}%{our_path}%{_bindir}/python${python_version} << EOF
+#!/bin/bash
+if [ -z "\$PYTHONPATH" ]; then
+  export PYTHONPATH="%{_libdir}/python${python_version}"
+else
+  export PYTHONPATH+=":%{_libdir}/python${python_version}"
+fi
+export PYTHONHOME="%{our_path}%{_prefix}"
+%{our_path}%{_bindir}/python${python_version}.orig "\$@"
+EOF
+chmod +x %{buildroot}%{our_path}%{_bindir}/python${python_version}
+
+ln -s python${python_version} %{buildroot}%{our_path}%{_bindir}/python
+ln -s python${python_version} %{buildroot}%{our_path}%{_libdir}/python
+
 # binutils needs to be exposed in /usr/bin
 if [ ! -d %{buildroot}%{our_path}/usr/%{emulated_arch_triple_short}/bin ] ; then
   mkdir -p %{buildroot}%{our_path}/usr/%{emulated_arch_triple_short}/bin
@@ -316,6 +350,13 @@ ldconfig
 /usr/%{emulated_arch_triple_long}/include
 /emul
 /qemu
+%exclude %{our_path}%{_bindir}/python*
+%exclude %{our_path}%{_libdir}/python*/lib-dynload/*.so
 %ghost %{bfd_plugin_lto}
 
+%files -n python-accel-%{emulated_arch_long}
+%defattr(-,root,root)
+%{our_path}%{_bindir}/python*
+%{our_path}%{_libdir}/python*/lib-dynload/*.so
+
 %changelog