Building python packages for glued

22 views
Skip to first unread message

Kristoffer Gryte

unread,
Nov 29, 2017, 8:54:39 AM11/29/17
to LSTS Toolchain
Hi,
We would like to include the python package pyserial to glued, so I've looked into how this can be done. Has anyone done any similar work on this, from which I can get inspiration? I suspect that there is a very elegant way that I'm not seeing at the moment....

What I've understood this far is that I need to make a folder "pyserial" in rules, containing download information and build rules, something along the lines of this: http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/

I will continue to look further into this myself, but I appreciate any hints :)

Regards,
Kristoffer

Kristoffer Gryte

unread,
Dec 1, 2017, 4:27:16 AM12/1/17
to LSTS Toolchain
I ended up with the following:
requires=\
(
    'python'
)

version=\
(
    "3.4"
)

git=\
(
)

git_hash=\
(
    92d101613be41ecb2f2054c3f43a006fbe6f9966
)

maintainer=\
(
    ' '
)

post_unpack()
{    
    echo "Checking out correct version"
    cd "${cfg_dir_builds}/$pkg/$pkg.git-git"
    git reset --hard #"${git_hash}"
}

build()
{
    cd "${cfg_dir_builds}/$pkg/$pkg.git-git"
    python setup.py bdist_egg
}

target_install()
{
    echo "unzipping"
    unzip -o "${cfg_dir_builds}/$pkg/$pkg.git-git"/dist/pyserial-${version}-py2.7.egg -d "${cfg_dir_rootfs}/lib/python2.7/site-packages/"
}

Which works.
Reply all
Reply to author
Forward
0 new messages