Commit graph

65 commits

Author SHA1 Message Date
Hannu Nyman
56688f68fd Merge pull request #2463 from jefferyto/host-python-with-system-ffi
python: use external libffi for host python
2016-03-06 20:25:19 +02:00
Jeffery To
4e3ae81b0c python: use external libffi for host python
This will ensure that ctypes will use the same version of libffi as
other packages, e.g. python-cffi.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2016-03-06 19:09:13 +08:00
Jeffery To
b70b978cc6 python: use default host build prefix, remove cross-compile workarounds for host
The sets host Python's prefix and exec-prefix to the same value
($(STAGING_DIR)/host for packages, as currently defined in
include/host-build.mk), which avoids the case where pyconfig.h is
not in the same location as Python's other header files (see
https://bugs.python.org/issue896330).

This also removes some cross compilation workarounds
(_python_sysroot/prefix/exec_prefix, disabling byte-compilation,
__PYVENV_LAUNCHER__) that are not necessary when compiling packages
for host.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2016-03-05 02:30:12 +08:00
Jeffery To
2140d8f6d2 python: fix HOST_PYTHON_INC_DIR path
Host python moved in c5564133, this updates HOST_PYTHON_INC_DIR to
match.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2016-02-14 01:46:56 +08:00
Felix Fietkau
9f8e5aca34 treewide: use $(STAGING_DIR)/host instead of $(STAGING_DIR_HOST), sync with changes in trunk
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2016-01-20 21:56:03 +01:00
Jeffery To
94578145cd python: fixed _python_sysroot paths
AFAIK sysroot is combined with prefix/exec_prefix, so sysroot shouldn't
include "/usr". (cf. the HostPython function in older versions of
python-package.mk)

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2015-12-31 11:55:12 +08:00
Hannu Nyman
2e3fb832fc python: bump PKG_RELEASE
Bump PKG_RELEASE of python 2.7.11 as there have been several fixes
since the initial release.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-12-13 17:13:19 +02:00
Alexandru Ardelean
015adc9b7a python: fix upgrade 2.7.11 goof
Seems those pkgconfig file paths were revealed to be incorrect
after doing a full clean build.
And I only had to inspiration to do one after doing the initial PR.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-12-11 16:49:45 +02:00
Alexandru Ardelean
a8602a7ccb python: upgrade to version 2.7.11
And split python-dev and python-lib2to3 packages.
Seems for python3 this was done, so we'll sync here.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-12-11 16:07:22 +02:00
Alexandru Ardelean
c55641331e python: unify HostPython and HostHostPython functions
That means basically moving the host Python from $(STAGING_DIR_HOST)
to $(STAGING_DIR_HOST)/usr and making the PYTHONPATH var
as an argument.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-12-11 16:01:27 +02:00
Alexandru Ardelean
8054747a49 python: remove newline function; it's also in OpenWRT core
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-12-11 15:30:32 +02:00
Steven Barth
dbde5d5295 Merge pull request #1984 from jefferyto/host-python-package
python: add capability to install python packages for the host
2015-11-24 15:50:34 +01:00
Jeffery To
b12d7b6db1 python: add capability to install python packages for the host
Some python packages (e.g. cffi) compile one or more shared libraries
as part of their setup process. When these packages are setup
dependencies of other packages (e.g. cryptography), these packages (and
their shared libraries) will need to be loaded on the host system.

This adds a makefile, similar to python-package.mk, to simplify
installing python packages on the host.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2015-11-24 22:43:56 +08:00
Jan Čermák
3ac990447f python: add missing host build dependency on expat/host
Since 94f87dc1, host build of Python depends on expat installed in host
staging directory. However, pyexpat extension fails to build if expat
was not built and installed to staging dir before - adding host build
dependency should fix this.

Signed-off-by: Jan Čermák <jan.cermak@nic.cz>
2015-11-23 21:59:29 +01:00
Jo-Philipp Wich
99484ec990 python: fix two build depend issues
Build depends must refer to the source package name, not the binary one,
therefore we need to use `bzip2` in order to enforce a build of libbz2.so.

Also make the host python build depend on the bzip2 host build in order to
ensure that host python is built with bzip2 support. We don't need a build
dependency for the target python as this already depends on +libbz2 through
python-light. That package dependency in turn implies a build dependency.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-23 14:29:41 +02:00
John Crispin
e461e7dda9 python: add dependency to bz2 host build
Signed-off-by: John Crispin <blogic@openwrt.org>
2015-08-22 01:11:29 +02:00
Steven Barth
94f87dc1e1 python: add correct host expat
Signed-off-by: Steven Barth <steven@midlink.org>
2015-08-03 08:02:59 +02:00
Jan Čermák
73244f09ec python: fix patch removing multiarch support for host python
Patch removing multiarch paths from build should be applied only when
Python is built for target, but not for host. When the paths are removed
during host build, host python throws some ugly errors when importing
some hashlib modules. Also it reports that modules crypt and nis failed
to build (tested on Ubuntu 14.04 host).

Signed-off-by: Jan Čermák <jan.cermak@nic.cz>
2015-07-02 18:19:09 +02:00
Alexandru Ardelean
af89de58f5 python: upgrade to 2.7.10
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-05-27 19:52:49 +03:00
Alexandru Ardelean
01eff3fc59 python: fix conflicts between python-light & python-base
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-12 21:04:45 +02:00
Alexandru Ardelean
9c5af1f29c python: revert previous patch and add a filespec
Seems removing the PyPackage rule and/or adding dummy install rule
causes some issues inside the build-system, where the libpython2.7.so.1.0
is not seen by packages that depend on python.
Even though that libpython2.7.so.1.0 file is installed properly by `python-base`.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-11 11:27:40 +02:00
Alexandru Ardelean
ac311e9801 python: remove PyPackage rules for python package
Calling `PyPackage` will install some default install rules for
python packages that are not required for the `python` package specifically
are not required.
That will lead to some conflicts with `python-light` because the
`/usr/lib/python2.7/site-packages` folder (+contents) will be
available in both packages.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-09 16:52:52 +02:00
Alexandru Ardelean
0d072f2b42 python: packetize some python modules
Packetize some Python modules to reduce size of the overall Python package.
Basically, a new package is introduced, call `python-light`,
and everything that's extra (or big) is put in other packages.

The `python` package becomes a metapackage that installs `python-light`
along with the rest of the packages.

Base work started by Jan Čermák.

Signed-off-by: Jan Čermák <jan.cermak@nic.cz>
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-06 15:19:29 +02:00
Jan Čermák
6f699463da python: removed ensurepip module
This module is not necessary in OpenWrt because the functionality it
provides (i.e. installation of setuptools and PIP) is ensured by
python-pip and python-setuptools packages.

See: https://docs.python.org/2.7/library/ensurepip.html

Signed-off-by: Jan Čermák <jan.cermak@nic.cz>
2015-02-24 18:33:29 +01:00
Alexandru Ardelean
705b381b5b python: add ncurses(w) include folders for host python
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-02-11 20:20:14 +02:00
Alexandru Ardelean
677ed22b3e python: fix goof
This should have gone in python3.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-20 10:45:09 +02:00
Alexandru Ardelean
8c057f39d8 python3: update using python updates as template
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-19 20:22:41 +02:00
Szilárd Pfeiffer
0394a1e286 python: Install .pc files from Python package.
Signed-off-by: Szilárd Pfeiffer <coroner@pfeifferszilard.hu>
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-11 20:15:13 +02:00
Alexandru Ardelean
11fba7e6bd python: remove libffi/host; we're not using it
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-11 20:15:13 +02:00
Alexandru Ardelean
7123d31a0b python: enable pip installation of pip on the host-side
Python packs some pip installation script during the build,
which looks like a better idea to use for the python-pip
and/or python-setuptools packages.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-11 20:15:13 +02:00
Alexandru Ardelean
87c4cbff5c python: upgrade to version 2.7.9
Release notes here:
   https://www.python.org/downloads/release/python-279/

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-06 15:10:59 +02:00
Gergely Kiss
fabb55271d python: fix file conflict between python and python-base packages
Signed-off-by: Gergely Kiss <mail.gery@gmail.com>
Tested-by: Gergely Kiss <mail.gery@gmail.com>
2014-12-15 15:26:41 +01:00
Alexandru Ardelean
94b090cb9c python: use Build/Prepare rule for the config.site file
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-26 11:51:40 +02:00
Alexandru Ardelean
ad9c57beae python: add distutils back (selectively)
This patch reduces distutils from 1.7 MB to 0.7 MB.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-12 23:45:39 +02:00
Alexandru Ardelean
8623c2942a python: update MAKE_FLAGS
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-12 23:24:30 +02:00
Alexandru Ardelean
a9ba2161bd python: remove readline.so for now
Some symbols are not found (tgetnum and BC).
Looks like the termcap lib, which should be in libncurses(w)
but maybe some build param would be required.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-09 20:16:25 +02:00
Alexandru Ardelean
4f0f05f92b python: add some Build/InstallDev rules back
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-09 17:56:45 +02:00
Alexandru Ardelean
dd4cca5d26 python: add OPT and CONFIG_SITE vars to HOST_CONFIGURE_ARGS
Fixes some build issues.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-09 17:32:23 +02:00
Alexandru Ardelean
efcfca9631 python: add lib deps
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-09 17:32:17 +02:00
Alexandru Ardelean
cbc39a176f python: final switch
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-09 11:09:10 +02:00
Alexandru Ardelean
c3cd970570 python: exclude pdb.doc and webbrowser.py
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-07 16:50:30 +02:00
Alexandru Ardelean
3cd31a4633 python: remove +libcrypto dep; that's a openssl lib
Signed-off-by: Alexandru Ardelean <ardeleanalex.com>
2014-11-07 15:37:18 +02:00
Alexandru Ardelean
38a72bab1f python: cleanup Build/InstallDev rule
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-07 15:37:17 +02:00
Alexandru Ardelean
7a689890eb python: remove --without-ensurepip; not needed anymore
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-07 15:37:17 +02:00
Alexandru Ardelean
0ea587ad24 python: remove explicit rules in favor of using make/configure vars
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-07 15:37:17 +02:00
Alexandru Ardelean
7be9485564 python: reboot all python packages
Redefine python-full as all-pages-minus-a-few-that-don't make sense.
Remove all other packages.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-11-07 15:37:12 +02:00
Alexandru Ardelean
ab0232eebe python: add _sysconfigdata.py to python base package
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-10-25 15:01:49 +03:00
Alexandru Ardelean
f699a1f8f9 python: fix source folder for libpython
This fix is quite critical since it fixes copying the libpython shared lib.
The previous source folder we've used is ok, it has the shared lib,
but libpython2.7.so is not a symlink of libpython2.7.so.1.0, but
rather a copy of it.
Which means that libpython2.7.so takes twice as much space
on the target's flash.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-10-20 19:07:28 +03:00
Alexandru Ardelean
820278a0c8 python: use libncursesw instead of libncurses
Python's build scripts prefer ncursesw, and if it is detected
it will be used.
The problem will occur when linking, since ncursesw libs may not be
installed if not added as deps, but the sources will be compiled
against ncursesw.

Reference from Python's HISTORY file:
  Patch #1428494: Prefer linking against ncursesw over ncurses library.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-10-19 22:41:57 +03:00
Alexandru Ardelean
a1f86a6870 python: enable shared python lib; make this the norm
This will reduce the bloat when users will want to compile in their
Python C extensions.
There will be a initial bloat (several kb) if just Python
is installed, but that will be compensated when users will add more
C extensions.

During the build we also have to add Python's PKG_BUILD_DIR
so that the shared lib is found when compiling Python's
built-in C extensions.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-10-19 22:33:08 +03:00