Commit graph

104 commits

Author SHA1 Message Date
Daniel Dickinson
83d992a8a9 lang/python: Make building additional (non-base) python modules easier
This adds code to make it easier to build third-party python
modules such as ones from PyPi.

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2015-12-18 17:15:36 -05:00
Hannu Nyman
298c826361 Merge pull request #2092 from cshore/pull-request-python-system-expat
lang/python: Depend on system expat
2015-12-16 10:23:57 +02: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
65b388adbc python2: fix typo in HostPython function
I call this the curse of the End-Of-The-Year for me.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-12-13 14:56:45 +02:00
Alexandru Ardelean
fdde13be29 python: fix HostPython again
Tested on python-setuptools.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-12-12 14:51:50 +02:00
Alexandru Ardelean
779643e358 python: fix HostPython host/target selection
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-12-11 17:13:21 +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
Daniel Dickinson
9535b642a9 lang/python: Depend on system expat
Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2015-12-09 21:21:47 -05: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
Attila Lendvai
2bb9f6b9c7 python: fix cross-compiling C++ modules.
Signed-off-by: Attila Lendvai <attila@lendvai.name>
2015-09-28 17:42:05 +00: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
1dc9306558 python: do not prefer ncursesw over ncurses
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-04-21 10:19:29 +03:00
Alexandru Ardelean
022fb434cf python: replace with libncursesw with libncurses
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-04-21 10:15:44 +03:00
Jan Čermák
a5d784de0b python: added configure args for distutils path detection
python-package.mk now defines (extends) CONFIGURE_ARGS that are
adjusting PREFIX and EXEC_PREFIX in distutils.sysconfig during
compilation. These variables are sometimes used by autotools to detect
path to Python header files. Adding these variables to python-package.mk
fixes compilation of legacy autotools-configured packages that already
include python-package.mk and do not overwrite CONFIGURE_ARGS.

Signed-off-by: Jan Čermák <jan.cermak@nic.cz>
Cc: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-16 10:41:33 +01:00
Alexandru Ardelean
d69d8ec0b9 python: refine packaging and split more modules into packages
Rule of thumb is: any Python file that is greater than 100kb
(or adds a dependency with which it adds more than 100 kb)
should be a pretty useful/commonly used lib to stay in `python-light`.
An example, is the Python IO lib, which summarized (Python source +
binary module) is over 200kb.

Also moved some files that should have been put into previously
existing packages before, and re-organized the packages a bit.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-13 18:39:08 +02: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
c8c509bdad python: add patches to disable runtime lib dirs
When cross-compiling, we do not need to add runtime lib dirs.
Also, the cross compilers that are used on OpenWRT do not support
the '-R' option, which causes build failures.

These build failures existed before, but were not noticed,
because it fails only on some setups.
This is because Python's `setup.py` does a lot of voo-doo
automagic that needs handling for some cross-compilation cases.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-08 17:57:26 +02:00
Steven Barth
66331c6de2 Merge pull request #992 from commodo/python-patch-updates
python: patch updates
2015-03-06 15:29:30 +01: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
Alexandru Ardelean
bb87de33dd python: add '_python_*' env vars to host python
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-06 14:18:45 +02:00
Alexandru Ardelean
2727b3fda3 python: add patch for distutils to add support for the '_python_sysroot' env var
Patch taken from buildroot:
  http://git.buildroot.net/buildroot/tree/package/python/python-008-distutils-use-python-sysroot.patch

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-06 11:16:48 +02:00
Alexandru Ardelean
8d6b503b4a python: re-number patches
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-03-06 11:11:18 +02:00
Steven Barth
056f0002b1 Merge pull request #962 from sairon/python-fix-distutils-adjusting-path
python: patch distutils adjusting path in scripts' shebang
2015-03-02 07:47:20 +01:00
Jan Čermák
71b696622a python: patch distutils adjusting path in scripts' shebang
When distutils are copying scripts, path to Python interpreter is adjusted.
This does not work well in OpenWrt buildroot, because the path is adjusted
to absolute path to host Python then. This patch simply disables the
adjusting of the path.

Signed-off-by: Jan Čermák <jan.cermak@nic.cz>
2015-02-27 18:11:19 +01:00
Alexandru Ardelean
7c4dac5118 python: reduce size of patch 130
Try to reduce the amount of change in this patch, since it removes
a lot of stuff, when we could just 'ifdef' that stuff out, with 2 lines.

The buildroot project does something similar like this:
http://git.buildroot.net/buildroot/tree/package/python/005-pyc-pyo-conditional.patch

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-02-27 18:11:22 +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
Steven Barth
f4e9c703b3 Revert "python: add patch to abort build on failed module build" 2015-02-20 09:33:41 +01:00
Alexandru Ardelean
999cc6a040 python: add patch to abort build on failed module build
Taken from buildroot:
  http://git.buildroot.net/buildroot/plain/package/python/014-abort-on-failed-modules.patch

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-02-19 16:00:04 +02: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
Alexandru Ardelean
903432c91e python: add patch to remove Debian/Ubuntu multiarch support
Seems when cross compiling on x86_64 Debian (most likely Ubuntu too)
the host's paths will be added too causing build failures for some extensions.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-15 23:24:59 +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
b474e60d6d python: add patch to fix _ctypes build on certain X86_64 hosts
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
f5f8d83dcd python: change _PYTHON_HOST_PLATFORM to linux2
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2015-01-11 20:15:13 +02:00
Steven Barth
99e6f27075 Merge pull request #744 from commodo/python-upg-2.7.9
python: upgrade to version 2.7.9
2015-01-06 15:18:31 +01: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