* Building pjproject with python module
@ 2014-05-22 15:00 Jens Lucius
2014-05-22 15:11 ` Gary Thomas
0 siblings, 1 reply; 5+ messages in thread
From: Jens Lucius @ 2014-05-22 15:00 UTC (permalink / raw)
To: yocto@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]
Hi
I already asked this question before (got no answer) and thought I had it running,
but since I had to re-setup my yocto installation it runs into errors again.
Maybe somebody can help me with this issue?
I am trying to bitbake pjproject including the python module. I manged
to write a working .bb recipe for the latest pjproject, which compiles
and installes correctly. But I also want to build the python module.
The documentation of pjproject says about building the python module:
1. Build the PJSIP libraries first with the usual "./configure && make
dep && make" commands.
2. Go to pjsip-apps/src/python directory.
3. Run *'sudo python ./setup.py install'* or just *'sudo make'*
So I guess with the working recipe I got part 1. I tried to do stepts 2
and 3 by adding the following:
do_compile_append() {
export BUILD_SYS
export HOST_SYS
export STAGING_INCDIR
export STAGING_LIBDIR
cd ${S}/pjsip-apps/src/python
oe_runmake
}
which starts the building process but then terminates with:
|/ cc1: warning: include location "/usr/include/python2.7" is unsafe for
/cross-compilation [-Wpoison-system-directories]
|/ In file included from _pjsua.c:20:0:
/|/ _pjsua.h:25:20: fatal error: Python.h: No such file or directory
/
So can I build them both in one recipe and how? And if built correctly
how to install the modules? I also tried to split the build into two .bb files.
Thanks for your help.
(Here is the pjproject bb)
--------
DESCRIPTION = "Open source SIP stack and media stack for presence, im/instant \
messaging, and multimedia communication"
SECTION = "libs"
HOMEPAGE = "http://www.pjsip.org/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
DEPENDS = "alsa-lib openssl python"
PARALLEL_MAKE = ""
SRC_URI = "http://www.pjsip.org/release/${PV}/pjproject-${PV}.tar.bz2 "
SRC_URI[md5sum] = "6ed4bb7750c827dc1d881e209a3b62db"
SRC_URI[sha256sum] = "da1933336b38b65ff2254bed05ea1076531b16915777a252ea999cf7f3284cb3"
S = "${WORKDIR}/pjproject-${PV}"
inherit autotools pkgconfig
EXTRA_OECONF += "STAGING_DIR=${STAGING_DIR_NATIVE}"
do_configure_prepend () {
export LD="${CC}"
}
do_compile_prepend() {
oe_runmake dep
}
do_install_prepend() {
install -d ${D}/usr/bin
install -m 755 ${S}/pjsip-apps/bin/pj* ${D}/usr/bin
}
[-- Attachment #2: Type: text/html, Size: 2903 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Building pjproject with python module 2014-05-22 15:00 Building pjproject with python module Jens Lucius @ 2014-05-22 15:11 ` Gary Thomas 2014-05-22 19:07 ` Jens Lucius 0 siblings, 1 reply; 5+ messages in thread From: Gary Thomas @ 2014-05-22 15:11 UTC (permalink / raw) To: yocto On 2014-05-22 09:00, Jens Lucius wrote: > Hi > > I already asked this question before (got no answer) and thought I had it running, > but since I had to re-setup my yocto installation it runs into errors again. > Maybe somebody can help me with this issue? > > I am trying to bitbake pjproject including the python module. I manged > to write a working .bb recipe for the latest pjproject, which compiles > and installes correctly. But I also want to build the python module. > > The documentation of pjproject says about building the python module: > > 1. Build the PJSIP libraries first with the usual "./configure && make > dep && make" commands. > 2. Go to pjsip-apps/src/python directory. > 3. Run *'sudo python ./setup.py install'* or just *'sudo make'* > > So I guess with the working recipe I got part 1. I tried to do stepts 2 > and 3 by adding the following: > > do_compile_append() { > export BUILD_SYS > export HOST_SYS > export STAGING_INCDIR > export STAGING_LIBDIR > > cd ${S}/pjsip-apps/src/python > oe_runmake > } > > which starts the building process but then terminates with: > > |/ cc1: warning: include location "/usr/include/python2.7" is unsafe for > /cross-compilation [-Wpoison-system-directories] > |/ In file included from _pjsua.c:20:0: > /|/ _pjsua.h:25:20: fatal error: Python.h: No such file or directory > / > So can I build them both in one recipe and how? And if built correctly > how to install the modules? I also tried to split the build into two .bb files. > > Thanks for your help. Try adding 'inherit pythonnative' to your recipe > > (Here is the pjproject bb) > -------- > DESCRIPTION = "Open source SIP stack and media stack for presence, im/instant \ > messaging, and multimedia communication" > SECTION = "libs" > HOMEPAGE ="http://www.pjsip.org/" > LICENSE = "GPLv2" > LIC_FILES_CHKSUM ="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" > DEPENDS = "alsa-lib openssl python" > > PARALLEL_MAKE = "" > > SRC_URI ="http://www.pjsip.org/release/${PV}/pjproject-${PV}.tar.bz2" > SRC_URI[md5sum] = "6ed4bb7750c827dc1d881e209a3b62db" > SRC_URI[sha256sum] = "da1933336b38b65ff2254bed05ea1076531b16915777a252ea999cf7f3284cb3" > S = "${WORKDIR}/pjproject-${PV}" > > inherit autotools pkgconfig > > EXTRA_OECONF += "STAGING_DIR=${STAGING_DIR_NATIVE}" > > do_configure_prepend () { > export LD="${CC}" > } > > do_compile_prepend() { > oe_runmake dep > } > > > do_install_prepend() { > install -d ${D}/usr/bin > install -m 755 ${S}/pjsip-apps/bin/pj* ${D}/usr/bin > } > > > > -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Building pjproject with python module 2014-05-22 15:11 ` Gary Thomas @ 2014-05-22 19:07 ` Jens Lucius 2014-05-22 20:01 ` Gary Thomas 0 siblings, 1 reply; 5+ messages in thread From: Jens Lucius @ 2014-05-22 19:07 UTC (permalink / raw) To: yocto Now I am getting this error: | Traceback (most recent call last): | File "setup.py", line 111, in <module> | py_modules=["pjsua"] | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/core.py", line 152, in setup | dist.run_commands() | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands | self.run_command(cmd) | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command | cmd_obj.run() | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/command/build.py", line 127, in run | self.run_command(cmd_name) | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command | self.distribution.run_command(command) | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 970, in run_command | cmd_obj = self.get_command_obj(command) | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 845, in get_command_obj | klass = self.get_command_class(command) | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 815, in get_command_class | __import__ (module_name) | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/command/build_ext.py", line 16, in <module> | from distutils.sysconfig import customize_compiler, get_python_version | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/sysconfig.py", line 22, in <module> | PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | TypeError: expected a character buffer object | make: *** [all] Error 1 | ERROR: oe_runmake failed Am 22.05.2014 17:11, schrieb Gary Thomas: > On 2014-05-22 09:00, Jens Lucius wrote: >> Hi >> >> I already asked this question before (got no answer) and thought I >> had it running, >> but since I had to re-setup my yocto installation it runs into errors >> again. >> Maybe somebody can help me with this issue? >> >> I am trying to bitbake pjproject including the python module. I manged >> to write a working .bb recipe for the latest pjproject, which compiles >> and installes correctly. But I also want to build the python module. >> >> The documentation of pjproject says about building the python module: >> >> 1. Build the PJSIP libraries first with the usual "./configure && make >> dep && make" commands. >> 2. Go to pjsip-apps/src/python directory. >> 3. Run *'sudo python ./setup.py install'* or just *'sudo make'* >> >> So I guess with the working recipe I got part 1. I tried to do stepts 2 >> and 3 by adding the following: >> >> do_compile_append() { >> export BUILD_SYS >> export HOST_SYS >> export STAGING_INCDIR >> export STAGING_LIBDIR >> >> cd ${S}/pjsip-apps/src/python >> oe_runmake >> } >> >> which starts the building process but then terminates with: >> >> |/ cc1: warning: include location "/usr/include/python2.7" is unsafe >> for >> /cross-compilation [-Wpoison-system-directories] >> |/ In file included from _pjsua.c:20:0: >> /|/ _pjsua.h:25:20: fatal error: Python.h: No such file or directory >> / >> So can I build them both in one recipe and how? And if built correctly >> how to install the modules? I also tried to split the build into two >> .bb files. >> >> Thanks for your help. > > Try adding 'inherit pythonnative' to your recipe > >> >> (Here is the pjproject bb) >> -------- >> DESCRIPTION = "Open source SIP stack and media stack for presence, >> im/instant \ >> messaging, and multimedia communication" >> SECTION = "libs" >> HOMEPAGE ="http://www.pjsip.org/" >> LICENSE = "GPLv2" >> LIC_FILES_CHKSUM ="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" >> DEPENDS = "alsa-lib openssl python" >> >> PARALLEL_MAKE = "" >> >> SRC_URI ="http://www.pjsip.org/release/${PV}/pjproject-${PV}.tar.bz2" >> SRC_URI[md5sum] = "6ed4bb7750c827dc1d881e209a3b62db" >> SRC_URI[sha256sum] = >> "da1933336b38b65ff2254bed05ea1076531b16915777a252ea999cf7f3284cb3" >> S = "${WORKDIR}/pjproject-${PV}" >> >> inherit autotools pkgconfig >> >> EXTRA_OECONF += "STAGING_DIR=${STAGING_DIR_NATIVE}" >> >> do_configure_prepend () { >> export LD="${CC}" >> } >> >> do_compile_prepend() { >> oe_runmake dep >> } >> >> >> do_install_prepend() { >> install -d ${D}/usr/bin >> install -m 755 ${S}/pjsip-apps/bin/pj* ${D}/usr/bin >> } >> >> >> >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Building pjproject with python module 2014-05-22 19:07 ` Jens Lucius @ 2014-05-22 20:01 ` Gary Thomas 2014-05-24 21:57 ` Jens Lucius 0 siblings, 1 reply; 5+ messages in thread From: Gary Thomas @ 2014-05-22 20:01 UTC (permalink / raw) To: yocto On 2014-05-22 13:07, Jens Lucius wrote: > Now I am getting this error: > > | Traceback (most recent call last): > | File "setup.py", line 111, in <module> > | py_modules=["pjsua"] > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/core.py", line 152, in setup > | dist.run_commands() > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands > | self.run_command(cmd) > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > | cmd_obj.run() > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/command/build.py", line 127, in run > | self.run_command(cmd_name) > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command > | self.distribution.run_command(command) > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 970, in run_command > | cmd_obj = self.get_command_obj(command) > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 845, in get_command_obj > | klass = self.get_command_class(command) > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/dist.py", line 815, in get_command_class > | __import__ (module_name) > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/command/build_ext.py", line 16, in <module> > | from distutils.sysconfig import customize_compiler, get_python_version > | File "/home/server/poky-daisy-11.0.0/build/tmp/sysroots/i686-linux/usr/lib/python2.7/distutils/sysconfig.py", line 22, in <module> > | PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) > | TypeError: expected a character buffer object > | make: *** [all] Error 1 > | ERROR: oe_runmake failed > > Am 22.05.2014 17:11, schrieb Gary Thomas: >> On 2014-05-22 09:00, Jens Lucius wrote: >>> Hi >>> >>> I already asked this question before (got no answer) and thought I had it running, >>> but since I had to re-setup my yocto installation it runs into errors again. >>> Maybe somebody can help me with this issue? >>> >>> I am trying to bitbake pjproject including the python module. I manged >>> to write a working .bb recipe for the latest pjproject, which compiles >>> and installes correctly. But I also want to build the python module. >>> >>> The documentation of pjproject says about building the python module: >>> >>> 1. Build the PJSIP libraries first with the usual "./configure && make >>> dep && make" commands. >>> 2. Go to pjsip-apps/src/python directory. >>> 3. Run *'sudo python ./setup.py install'* or just *'sudo make'* >>> >>> So I guess with the working recipe I got part 1. I tried to do stepts 2 >>> and 3 by adding the following: >>> >>> do_compile_append() { >>> export BUILD_SYS >>> export HOST_SYS >>> export STAGING_INCDIR >>> export STAGING_LIBDIR Put these exports at the outermost level of your recipe, not inside any function, i.e. like this: EXTRA_OECONF += "STAGING_DIR=${STAGING_DIR_NATIVE}" export BUILD_SYS export HOST_SYS export STAGING_INCDIR export STAGING_LIBDIR >>> >>> cd ${S}/pjsip-apps/src/python >>> oe_runmake >>> } >>> >>> which starts the building process but then terminates with: >>> >>> |/ cc1: warning: include location "/usr/include/python2.7" is unsafe for >>> /cross-compilation [-Wpoison-system-directories] >>> |/ In file included from _pjsua.c:20:0: >>> /|/ _pjsua.h:25:20: fatal error: Python.h: No such file or directory >>> / >>> So can I build them both in one recipe and how? And if built correctly >>> how to install the modules? I also tried to split the build into two .bb files. >>> >>> Thanks for your help. >> >> Try adding 'inherit pythonnative' to your recipe >> >>> >>> (Here is the pjproject bb) >>> -------- >>> DESCRIPTION = "Open source SIP stack and media stack for presence, im/instant \ >>> messaging, and multimedia communication" >>> SECTION = "libs" >>> HOMEPAGE ="http://www.pjsip.org/" >>> LICENSE = "GPLv2" >>> LIC_FILES_CHKSUM ="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" >>> DEPENDS = "alsa-lib openssl python" >>> >>> PARALLEL_MAKE = "" >>> >>> SRC_URI ="http://www.pjsip.org/release/${PV}/pjproject-${PV}.tar.bz2" >>> SRC_URI[md5sum] = "6ed4bb7750c827dc1d881e209a3b62db" >>> SRC_URI[sha256sum] = "da1933336b38b65ff2254bed05ea1076531b16915777a252ea999cf7f3284cb3" >>> S = "${WORKDIR}/pjproject-${PV}" >>> >>> inherit autotools pkgconfig >>> >>> EXTRA_OECONF += "STAGING_DIR=${STAGING_DIR_NATIVE}" >>> >>> do_configure_prepend () { >>> export LD="${CC}" >>> } >>> >>> do_compile_prepend() { >>> oe_runmake dep >>> } >>> >>> >>> do_install_prepend() { >>> install -d ${D}/usr/bin >>> install -m 755 ${S}/pjsip-apps/bin/pj* ${D}/usr/bin >>> } >>> >>> >>> >>> >> > -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Building pjproject with python module 2014-05-22 20:01 ` Gary Thomas @ 2014-05-24 21:57 ` Jens Lucius 0 siblings, 0 replies; 5+ messages in thread From: Jens Lucius @ 2014-05-24 21:57 UTC (permalink / raw) To: yocto > Put these exports at the outermost level of your recipe, not inside > any function, > i.e. like this: > EXTRA_OECONF += "STAGING_DIR=${STAGING_DIR_NATIVE}" > export BUILD_SYS > export HOST_SYS > export STAGING_INCDIR > export STAGING_LIBDIR > >>>> >>>> cd ${S}/pjsip-apps/src/python >>>> oe_runmake >>>> } >>>> >>>> which starts the building process but then terminates with: >>>> >>>> |/ cc1: warning: include location "/usr/include/python2.7" is >>>> unsafe for >>>> /cross-compilation [-Wpoison-system-directories] >>>> |/ In file included from _pjsua.c:20:0: >>>> /|/ _pjsua.h:25:20: fatal error: Python.h: No such file or directory >>>> / >>>> So can I build them both in one recipe and how? And if built correctly >>>> how to install the modules? I also tried to split the build into >>>> two .bb files. >>>> >>>> Thanks for your help. >>> >>> Try adding 'inherit pythonnative' to your recipe >>> >>>> >>>> (Here is the pjproject bb) >>>> -------- >>>> DESCRIPTION = "Open source SIP stack and media stack for presence, >>>> im/instant \ >>>> messaging, and multimedia communication" >>>> SECTION = "libs" >>>> HOMEPAGE ="http://www.pjsip.org/" >>>> LICENSE = "GPLv2" >>>> LIC_FILES_CHKSUM >>>> ="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" >>>> DEPENDS = "alsa-lib openssl python" >>>> >>>> PARALLEL_MAKE = "" >>>> >>>> SRC_URI ="http://www.pjsip.org/release/${PV}/pjproject-${PV}.tar.bz2" >>>> SRC_URI[md5sum] = "6ed4bb7750c827dc1d881e209a3b62db" >>>> SRC_URI[sha256sum] = >>>> "da1933336b38b65ff2254bed05ea1076531b16915777a252ea999cf7f3284cb3" >>>> S = "${WORKDIR}/pjproject-${PV}" >>>> >>>> inherit autotools pkgconfig >>>> >>>> EXTRA_OECONF += "STAGING_DIR=${STAGING_DIR_NATIVE}" >>>> >>>> do_configure_prepend () { >>>> export LD="${CC}" >>>> } >>>> >>>> do_compile_prepend() { >>>> oe_runmake dep >>>> } >>>> >>>> >>>> do_install_prepend() { >>>> install -d ${D}/usr/bin >>>> install -m 755 ${S}/pjsip-apps/bin/pj* ${D}/usr/bin >>>> } >>>> >>>> >>>> >>>> >>> >> > Still did not quite work. After a little bit of searching, I added --enable-shared to EXTRA_OECONF and now it works (just had to ship the files manually as they are not installed automatically. Thanks for your help. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-24 21:58 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-05-22 15:00 Building pjproject with python module Jens Lucius 2014-05-22 15:11 ` Gary Thomas 2014-05-22 19:07 ` Jens Lucius 2014-05-22 20:01 ` Gary Thomas 2014-05-24 21:57 ` Jens Lucius
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.