* [Buildroot] [PATCH 2/3] python: added hidden openssl option to host python
2013-07-20 10:27 [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8 Rohan Fletcher
@ 2013-07-20 10:27 ` Rohan Fletcher
2013-07-20 10:27 ` [Buildroot] [PATCH 3/3] python-pip: new package Rohan Fletcher
2014-02-13 21:12 ` [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8 Thomas Petazzoni
2 siblings, 0 replies; 5+ messages in thread
From: Rohan Fletcher @ 2013-07-20 10:27 UTC (permalink / raw)
To: buildroot
used by python-pip to use https to download packages
Signed-off-by: Rohan Fletcher <rohfledev@gmail.com>
---
package/python/Config.in | 6 ++++++
package/python/python.mk | 11 +++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/package/python/Config.in b/package/python/Config.in
index cfe73db..0740ef0 100644
--- a/package/python/Config.in
+++ b/package/python/Config.in
@@ -101,6 +101,12 @@ config BR2_PACKAGE_PYTHON_HASHLIB
help
hashlib support in Python
+config BR2_HOST_PYTHON_SSL_SUPPORT
+ bool
+ help
+ Includes ssl support in host python build.
+ This is disabled by default to reduce build time.
+
endmenu
endif
diff --git a/package/python/python.mk b/package/python/python.mk
index ecea638..4bd9da1 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -31,8 +31,11 @@ HOST_PYTHON_CONF_OPT += \
--disable-gdbm \
--disable-bsddb \
--disable-test-modules \
- --disable-bz2 \
- --disable-ssl
+ --disable-bz2
+
+ifneq ($(BR2_HOST_PYTHON_SSL_SUPPORT), y)
+HOST_PYTHON_CONF_OPT += --disable-ssl
+endif
HOST_PYTHON_MAKE_ENV = \
PYTHON_MODULES_INCLUDE=$(HOST_DIR)/usr/include \
@@ -51,6 +54,10 @@ HOST_PYTHON_MAKE = $(MAKE1)
PYTHON_DEPENDENCIES = host-python libffi
HOST_PYTHON_DEPENDENCIES = host-expat host-zlib
+
+ifeq ($(BR2_HOST_PYTHON_SSL_SUPPORT), y)
+HOST_PYTHON_DEPENDENCIES += host-openssl
+endif
PYTHON_INSTALL_STAGING = YES
--
1.8.1.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 3/3] python-pip: new package
2013-07-20 10:27 [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8 Rohan Fletcher
2013-07-20 10:27 ` [Buildroot] [PATCH 2/3] python: added hidden openssl option to host python Rohan Fletcher
@ 2013-07-20 10:27 ` Rohan Fletcher
2014-02-13 21:12 ` [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8 Thomas Petazzoni
2 siblings, 0 replies; 5+ messages in thread
From: Rohan Fletcher @ 2013-07-20 10:27 UTC (permalink / raw)
To: buildroot
pip is a package manager for python that downloads packages from https://pypi.python.org/
Signed-off-by: Rohan Fletcher <rohfledev@gmail.com>
---
package/Config.in | 1 +
package/python-pip/Config.in | 22 ++++++++++++++++
package/python-pip/python-pip.mk | 54 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 77 insertions(+)
create mode 100644 package/python-pip/Config.in
create mode 100644 package/python-pip/python-pip.mk
diff --git a/package/Config.in b/package/Config.in
index 286a605..9bc9823 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -360,6 +360,7 @@ source "package/python-pyparsing/Config.in"
source "package/python-serial/Config.in"
source "package/python-setuptools/Config.in"
source "package/python-thrift/Config.in"
+source "package/python-pip/Config.in"
endmenu
endif
source "package/python3/Config.in"
diff --git a/package/python-pip/Config.in b/package/python-pip/Config.in
new file mode 100644
index 0000000..a238deb
--- /dev/null
+++ b/package/python-pip/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_PYTHON_PIP
+ bool "python-pip"
+ select BR2_HOST_PYTHON_SSL_SUPPORT
+ help
+ A tool for installing and managing Python packages.
+
+ http://www.pip-installer.org
+
+if BR2_PACKAGE_PYTHON_PIP
+
+config BR2_PACKAGE_PYTHON_PIP_MODULES_ADDITIONAL
+ string "Additional modules"
+ help
+ List of space-separated python modules to install via pip.
+ See 'pip help install' for available installation methods.
+ For repeatable builds, download and save tgz files or clone
+ git repos for the components you care about.
+
+ Example: module-name module-name==1.3.4 /my/module/mymodule.tgz
+ git://github.com/someuser/somemodule.git#v1.2
+
+endif
diff --git a/package/python-pip/python-pip.mk b/package/python-pip/python-pip.mk
new file mode 100644
index 0000000..6f25759
--- /dev/null
+++ b/package/python-pip/python-pip.mk
@@ -0,0 +1,54 @@
+
+#############################################################
+#
+# python-pip
+#
+#############################################################
+
+PYTHON_PIP_VERSION = 1.3.1
+PYTHON_PIP_SOURCE = pip-$(PYTHON_PIP_VERSION).tar.gz
+PYTHON_PIP_SITE = https://pypi.python.org/packages/source/p/pip
+PYTHON_PIP_DEPENDENCIES = python python-setuptools host-python-setuptools host-python-pip
+PYTHON_PIP_LICENSE = MIT
+
+# README.rst refers to the file "LICENSE" but it's not included
+
+define PYTHON_PIP_BUILD_CMDS
+ (cd $(@D); \
+ PYTHONPATH="$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
+ $(HOST_DIR)/usr/bin/python setup.py build --executable=/usr/bin/python)
+endef
+
+define HOST_PYTHON_PIP_INSTALL_CMDS
+ (cd $(@D); PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+ $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
+endef
+
+PYTHON_PIP_MODULES_LIST=$(call qstrip, $(BR2_PACKAGE_PYTHON_PIP_MODULES_ADDITIONAL))
+
+ifneq ($(PYTHON_PIP_MODULES_LIST),)
+define PYTHON_PIP_INSTALL_MODULES
+ # Explanation of environment variables
+ # PIP_DOWNLOAD_CACHE: all downloads go into the buildroot download folder
+ # PIP_TARGET: this is where the packages end up
+ # PIP_BUILD: where the packages are built - a subdirectory of the pip folder
+ ($(TARGET_CONFIGURE_OPTS) \
+ PIP_DOWNLOAD_CACHE=$(BR2_DL_DIR) \
+ PIP_TARGET=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+ PIP_BUILD=$(BUILD_DIR)/python-pip-$(PYTHON_PIP_VERSION)/packages \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDSHARED="$(TARGET_CC) -shared" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ $(HOST_DIR)/usr/bin/pip install \
+ $(PYTHON_PIP_MODULES_LIST));
+endef
+endif
+
+define PYTHON_PIP_INSTALL_TARGET_CMDS
+ $(PYTHON_PIP_INSTALL_MODULES)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))
+
--
1.8.1.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8
2013-07-20 10:27 [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8 Rohan Fletcher
2013-07-20 10:27 ` [Buildroot] [PATCH 2/3] python: added hidden openssl option to host python Rohan Fletcher
2013-07-20 10:27 ` [Buildroot] [PATCH 3/3] python-pip: new package Rohan Fletcher
@ 2014-02-13 21:12 ` Thomas Petazzoni
2014-02-13 22:18 ` Thomas Petazzoni
2 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2014-02-13 21:12 UTC (permalink / raw)
To: buildroot
Dear Rohan Fletcher,
On Sat, 20 Jul 2013 22:27:12 +1200, Rohan Fletcher wrote:
>
> Signed-off-by: Rohan Fletcher <rohfledev@gmail.com>
> ---
> package/python-setuptools/python-setuptools.mk | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
I have integrated this patch (after adjusting it to bump to the latest
setuptools version) into a patch series that I posted at:
http://patchwork.ozlabs.org/patch/260435/
However, regarding your patches 2/3 and 3/3, we discussed during the
Buildroot Developers Meeting, and the general opinion is that we don't
really like tools such as "pip", because they completely circumvent the
Buildroot logic, which has a number of drawbacks:
* It does not take care of native dependencies, and quite a few Python
modules have such dependencies.
* It does not go through the Buildroot download infrastructure, which
means that "make external-deps", "make source" do not work for the
Python modules downloaded by pip.
* It does not integrate with the Buildroot licensing infrastructure,
which makes it more complicated to maintain an up-to-date list of
the components installed in the generated system.
For Perl, Fran?ois Perrad has written a script that given a Perl CPAN
package creates all the necessary Buildroot packages. Such an approach
was accepted by the Buildroot developers, and maybe we should look at
having something similar for Python modules.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8
2014-02-13 21:12 ` [Buildroot] [PATCH 1/3] python-setuptools: bumped version to 0.8 Thomas Petazzoni
@ 2014-02-13 22:18 ` Thomas Petazzoni
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2014-02-13 22:18 UTC (permalink / raw)
To: buildroot
Rohan, all,
On Thu, 13 Feb 2014 22:12:44 +0100, Thomas Petazzoni wrote:
> For Perl, Fran?ois Perrad has written a script that given a Perl CPAN
> package creates all the necessary Buildroot packages. Such an approach
> was accepted by the Buildroot developers, and maybe we should look at
> having something similar for Python modules.
I just tried this idea, see the attached (ugly) script.
Unfortunately, there are quite a few limitations:
- The script is currently not able to guess the <pkg>_SETUP_TYPE,
i.e whether the package should be built with distutils or
setuptools.
- The Pypi informations seem to very limited. A number of packages
don't even give the URL of their tarball, the licensing
informations are incomplete, there is no reference to the file
containing the license text, etc.
If anyone wants to pursue this experimentation, feel free to pick up
the script and improve it.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pypi-gen-packages
Type: application/octet-stream
Size: 3380 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140213/f94dc71b/attachment.obj>
^ permalink raw reply [flat|nested] 5+ messages in thread