diff mbox

[1/1] python-django: new package

Message ID 1420244904-23270-1-git-send-email-oli.vogt.pub01@gmail.com
State Accepted
Headers show

Commit Message

Oli Vogt Jan. 3, 2015, 12:28 a.m. UTC
Signed-off-by: oli vogt <oli.vogt.pub01@gmail.com>
---
 package/Config.in                        |  1 +
 package/python-django/Config.in          | 15 +++++++++++++++
 package/python-django/python-django.hash |  2 ++
 package/python-django/python-django.mk   | 14 ++++++++++++++
 4 files changed, 32 insertions(+)
 create mode 100644 package/python-django/Config.in
 create mode 100644 package/python-django/python-django.hash
 create mode 100644 package/python-django/python-django.mk

Comments

Thomas Petazzoni Jan. 4, 2015, 9:08 p.m. UTC | #1
Dear oli vogt,

On Sat,  3 Jan 2015 13:28:24 +1300, oli vogt wrote:

> diff --git a/package/python-django/Config.in b/package/python-django/Config.in
> new file mode 100644
> index 0000000..c48a381
> --- /dev/null
> +++ b/package/python-django/Config.in
> @@ -0,0 +1,15 @@
> +config BR2_PACKAGE_PYTHON_DJANGO
> +	bool "python-django"
> +	depends on BR2_PACKAGE_PYTHON

What about Python 3 ? Django supports both Python 2 and Python 3. I've
changed this to allow Django to be built with Python 3.

> +PYTHON_DJANGO_VERSION = 1.7.1

1.7.2 is out, so I've bumped to this version.

> +PYTHON_DJANGO_SOURCE = Django-$(PYTHON_DJANGO_VERSION).tar.gz
> +PYTHON_DJANGO_SITE = https://www.djangoproject.com/download/$(PYTHON_DJANGO_VERSION)/tarball/

This didn't work, because the URL to download Django is just
https://www.djangoproject.com/download/$(PYTHON_DJANGO_VERSION)/tarball/,
while Buildroot expects $(PYTHON_DJANGO_SITE)/$(PYTHON_DJANGO_SOURCE).
So I've switched to pypi as the source for Django.

Patch applied with those changes, see
http://git.buildroot.net/buildroot/commit/?id=71d6705ef6a3516325891bc117b3253b49ca0f5f.

Thanks!

Thomas
Oli Vogt Jan. 4, 2015, 10:37 p.m. UTC | #2
Dear Thomas.

I should have put this in covering letter:

 Yes it should work with Python3 however I was not able to test it as I use
2.7. This meant I was not sure about core module dependencies. Thanks.
 Also: I only tested it as ARM cross compile.
 Sorry about the download link I 'hand-downloaded' the tarball to get
things started and did not delete it to test. Thanks again.

oli

On 5 January 2015 at 10:08, Thomas Petazzoni <
thomas.petazzoni@free-electrons.com> wrote:

> Dear oli vogt,
>
> On Sat,  3 Jan 2015 13:28:24 +1300, oli vogt wrote:
>
> > diff --git a/package/python-django/Config.in
> b/package/python-django/Config.in
> > new file mode 100644
> > index 0000000..c48a381
> > --- /dev/null
> > +++ b/package/python-django/Config.in
> > @@ -0,0 +1,15 @@
> > +config BR2_PACKAGE_PYTHON_DJANGO
> > +     bool "python-django"
> > +     depends on BR2_PACKAGE_PYTHON
>
> What about Python 3 ? Django supports both Python 2 and Python 3. I've
> changed this to allow Django to be built with Python 3.
>
> > +PYTHON_DJANGO_VERSION = 1.7.1
>
> 1.7.2 is out, so I've bumped to this version.
>
> > +PYTHON_DJANGO_SOURCE = Django-$(PYTHON_DJANGO_VERSION).tar.gz
> > +PYTHON_DJANGO_SITE =
> https://www.djangoproject.com/download/$(PYTHON_DJANGO_VERSION)/tarball/
>
> This didn't work, because the URL to download Django is just
> https://www.djangoproject.com/download/$(PYTHON_DJANGO_VERSION)/tarball/,
> while Buildroot expects $(PYTHON_DJANGO_SITE)/$(PYTHON_DJANGO_SOURCE).
> So I've switched to pypi as the source for Django.
>
> Patch applied with those changes, see
>
> http://git.buildroot.net/buildroot/commit/?id=71d6705ef6a3516325891bc117b3253b49ca0f5f
> .
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
>
Thomas Petazzoni Jan. 5, 2015, 9:32 a.m. UTC | #3
Dear Oli Vogt,

On Mon, 5 Jan 2015 11:37:34 +1300, Oli Vogt wrote:

>  Yes it should work with Python3 however I was not able to test it as I use
> 2.7. This meant I was not sure about core module dependencies. Thanks.

Ok. I assumed the same core Python 3 dependencies as with Python 2. I
was able to "import django" in Python 3.

However, I noticed that the django-admin tool does not work on the
target, but maybe this is expected.

>  Sorry about the download link I 'hand-downloaded' the tarball to get
> things started and did not delete it to test. Thanks again.

No problem, this was quickly fixed. Thanks for your contribution!

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 424ef12..8d91b04 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -496,6 +496,7 @@  menu "external python modules"
 	source "package/python-crc16/Config.in"
 	source "package/python-daemon/Config.in"
 	source "package/python-dialog/Config.in"
+	source "package/python-django/Config.in"
 	source "package/python-docopt/Config.in"
 	source "package/python-dpkt/Config.in"
 	source "package/python-enum/Config.in"
diff --git a/package/python-django/Config.in b/package/python-django/Config.in
new file mode 100644
index 0000000..c48a381
--- /dev/null
+++ b/package/python-django/Config.in
@@ -0,0 +1,15 @@ 
+config BR2_PACKAGE_PYTHON_DJANGO
+	bool "python-django"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_UNICODEDATA
+	select BR2_PACKAGE_PYTHON_PYEXPAT
+	help
+	  Django is a high-level Python Web framework that encourages
+	  rapid development and clean, pragmatic design. It takes your
+	  Web applications from concept to launch in a matter of hours.
+	  Django takes care of user authentication, content administration,
+	  site maps, RSS feeds, user comments and many more tasks.
+	  Django takes security seriously and helps developers avoid
+	  many common security mistakes
+
+	  https://www.djangoproject.com/
diff --git a/package/python-django/python-django.hash b/package/python-django/python-django.hash
new file mode 100644
index 0000000..313abb4
--- /dev/null
+++ b/package/python-django/python-django.hash
@@ -0,0 +1,2 @@ 
+# sha256 from https://www.djangoproject.com/m/pgp/Django-1.7.1.checksum.txt
+sha256	3de62e71ce2cfbcdecb6e344cad04948506c8410ea5c6eab15c8f3b31b8ac1c0 Django-1.7.1.tar.gz
diff --git a/package/python-django/python-django.mk b/package/python-django/python-django.mk
new file mode 100644
index 0000000..f874ca3
--- /dev/null
+++ b/package/python-django/python-django.mk
@@ -0,0 +1,14 @@ 
+################################################################################
+#
+# python-django
+#
+################################################################################
+
+PYTHON_DJANGO_VERSION = 1.7.1
+PYTHON_DJANGO_SOURCE = Django-$(PYTHON_DJANGO_VERSION).tar.gz
+PYTHON_DJANGO_SITE = https://www.djangoproject.com/download/$(PYTHON_DJANGO_VERSION)/tarball/
+PYTHON_DJANGO_LICENSE = BSD
+PYTHON_DJANGO_LICENSE_FILES = LICENSE
+PYTHON_DJANGO_SETUP_TYPE = setuptools
+
+$(eval $(python-package))