Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support
@ 2014-11-20 13:53 Peter Korsgaard
  2014-11-20 13:53 ` [Buildroot] [PATCH next 1/3] dbus-python: cleanup package Peter Korsgaard
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-11-20 13:53 UTC (permalink / raw)
  To: buildroot

Hi,

This series cleans up the dbus-python package and adds python3 support. 
Doing this, I noticed that python3-config currently outputs wrong data for
--includes / --ldflags, so this gets patched as well.

There's currently (to my knowledge atleast) no other packages using this
output, so we don't need to apply it to master as well.

 package/dbus-python/Config.in                 |  5 +-
 ...thon-0001-fix-python-configure-check.patch | 27 ---------
 package/dbus-python/dbus-python.mk            | 26 +++++---
 ...on3-017-python-config-include-libdir.patch | 60 +++++++++++++++++++
 4 files changed, 80 insertions(+), 38 deletions(-)

Peter Korsgaard (3):
      dbus-python: cleanup package
      python3: add patch to fix --includes / --ldflags output of python3-config
      dbus-python: add python3 support

--
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH next 1/3] dbus-python: cleanup package
  2014-11-20 13:53 [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support Peter Korsgaard
@ 2014-11-20 13:53 ` Peter Korsgaard
  2014-11-20 13:53 ` [Buildroot] [PATCH next 2/3] python3: add patch to fix --includes / --ldflags output of python3-config Peter Korsgaard
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-11-20 13:53 UTC (permalink / raw)
  To: buildroot

The patch is not needed anymore as the proper includes can be specified
using PYTHON_INCLUDES, and version/pythondir/pyexecdir is correctly detected
using host-python.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 ...us-python-0001-fix-python-configure-check.patch | 27 ----------------------
 package/dbus-python/dbus-python.mk                 | 11 ++++-----
 2 files changed, 4 insertions(+), 34 deletions(-)

diff --git a/package/dbus-python/dbus-python-0001-fix-python-configure-check.patch b/package/dbus-python/dbus-python-0001-fix-python-configure-check.patch
deleted file mode 100644
index 2df4da8..0000000
--- a/package/dbus-python/dbus-python-0001-fix-python-configure-check.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Python: add am_cv_python_includes to override runtime python-config check
-[Gustavo: update for dbus-python 1.2.0]
-
-diff -Nura dbus-python-1.2.0.orig/configure dbus-python-1.2.0/configure
---- dbus-python-1.2.0.orig/configure	2013-05-08 04:48:42.000000000 -0300
-+++ dbus-python-1.2.0/configure	2014-07-03 16:54:25.922727033 -0300
-@@ -11762,6 +11762,12 @@
- else
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python headers using $PYTHON-config --includes" >&5
- $as_echo_n "checking for Python headers using $PYTHON-config --includes... " >&6; }
-+if test "${am_cv_python_includes+set}" = set; then
-+  $as_echo_n "(cached) $ECHO_C" >&6
-+  PYTHON_INCLUDES=${am_cv_python_includes}
-+  { $as_echo "$as_me:$LINENO: result: $PYTHON_INCLUDES" >&5
-+$as_echo_t "${ECHO_T}$PYTHON_INCLUDES" >&6; }
-+else
-   PYTHON_INCLUDES=`$PYTHON-config --includes`
-   if test $? = 0; then
-     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_INCLUDES" >&5
-@@ -11781,6 +11787,7 @@
- $as_echo "$PYTHON_INCLUDES" >&6; }
-   fi
- fi
-+fi
- 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether those headers are sufficient" >&5
- $as_echo_n "checking whether those headers are sufficient... " >&6; }
diff --git a/package/dbus-python/dbus-python.mk b/package/dbus-python/dbus-python.mk
index d4fdfa1..bc57689 100644
--- a/package/dbus-python/dbus-python.mk
+++ b/package/dbus-python/dbus-python.mk
@@ -10,13 +10,10 @@ DBUS_PYTHON_INSTALL_STAGING = YES
 DBUS_PYTHON_LICENSE = MIT
 DBUS_PYTHON_LICENSE_FILES = COPYING
 
-DBUS_PYTHON_CONF_ENV = am_cv_pathless_PYTHON=python \
-		ac_cv_path_PYTHON=$(HOST_DIR)/usr/bin/python \
-		am_cv_python_version=$(PYTHON_VERSION) \
-		am_cv_python_platform=linux2 \
-		am_cv_python_pythondir=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
-		am_cv_python_pyexecdir=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
-		am_cv_python_includes=-I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)
+DBUS_PYTHON_CONF_ENV = \
+	PYTHON=$(HOST_DIR)/usr/bin/python2 \
+	PYTHON_INCLUDES="$(shell $(STAGING_DIR)/usr/bin/python2-config --includes)" \
+	PYTHON_LIBS="$(shell $(STAGING_DIR)/usr/bin/python2-config --ldflags)"
 
 DBUS_PYTHON_CONF_OPTS = --disable-html-docs --disable-api-docs
 
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH next 2/3] python3: add patch to fix --includes / --ldflags output of python3-config
  2014-11-20 13:53 [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support Peter Korsgaard
  2014-11-20 13:53 ` [Buildroot] [PATCH next 1/3] dbus-python: cleanup package Peter Korsgaard
@ 2014-11-20 13:53 ` Peter Korsgaard
  2014-11-20 13:53 ` [Buildroot] [PATCH next 3/3] dbus-python: add python3 support Peter Korsgaard
  2014-11-22 18:24 ` [Buildroot] [PATCH next 0/3] dbus-python cleanup and " Thomas Petazzoni
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-11-20 13:53 UTC (permalink / raw)
  To: buildroot

The build/real prefix handling using sed breaks if build != real and the
standard include / lib directories are used ($prefix/include and $prefix/lib).

E.G.

prefix_build="/usr", libdir="$prefix/lib", includedir="$prefix/include".

If this gets installed with make DESTDIR="/foo" install, then we end up with
prefix_real = prefix = "/foo/usr" as expected, but
includedir="/foo/foo/usr/include" and libdir="/foo/foo/usr/lib" because of
the double sed invocation (prefix is already expanded).  Work around it by
ensuring we only match the beginning of the string.

Submitted upstream: http://bugs.python.org/issue22907

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 .../python3-017-python-config-include-libdir.patch | 60 ++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/package/python3/python3-017-python-config-include-libdir.patch b/package/python3/python3-017-python-config-include-libdir.patch
new file mode 100644
index 0000000..50a856d
--- /dev/null
+++ b/package/python3/python3-017-python-config-include-libdir.patch
@@ -0,0 +1,60 @@
+From 50f34d2cac63b6bf0935294a7d63d9451714f4c4 Mon Sep 17 00:00:00 2001
+From: Peter Korsgaard <peter@korsgaard.com>
+Date: Thu, 20 Nov 2014 13:24:59 +0100
+Subject: [PATCH] Misc/python-config.sh.in: ensure sed invocations only match
+ beginning of strings
+
+The build/real prefix handling using sed breaks if build != real and the
+standard include / lib directories are used ($prefix/include and $prefix/lib).
+
+E.G.
+
+prefix_build="/usr", libdir="$prefix/lib", includedir="$prefix/include".
+
+If this gets installed with make DESTDIR="/foo" install, then we end up with
+prefix_real = prefix = "/foo/usr" as expected, but
+includedir="/foo/foo/usr/include" and libdir="/foo/foo/usr/lib" because of
+the double sed invocation (prefix is already expanded).  Work around it by
+ensuring we only match the beginning of the string.
+
+Submitted upstream: http://bugs.python.org/issue22907
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ Misc/python-config.sh.in | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
+index 64c81e5..f75eec5 100644
+--- a/Misc/python-config.sh.in
++++ b/Misc/python-config.sh.in
+@@ -29,12 +29,12 @@ prefix_real=$(installed_prefix "$0")
+ 
+ # Use sed to fix paths from their built-to locations to their installed-to
+ # locations.
+-prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
++prefix=$(echo "$prefix_build" | sed "s#^$prefix_build#$prefix_real#")
+ exec_prefix_build="@exec_prefix@"
+-exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")
+-includedir=$(echo "@includedir@" | sed "s#$prefix_build#$prefix_real#")
+-libdir=$(echo "@libdir@" | sed "s#$prefix_build#$prefix_real#")
+-CFLAGS=$(echo "@CFLAGS@" | sed "s#$prefix_build#$prefix_real#")
++exec_prefix=$(echo "$exec_prefix_build" | sed "s#^$exec_prefix_build#$prefix_real#")
++includedir=$(echo "@includedir@" | sed "s#^$prefix_build#$prefix_real#")
++libdir=$(echo "@libdir@" | sed "s#^$prefix_build#$prefix_real#")
++CFLAGS=$(echo "@CFLAGS@" | sed "s#^$prefix_build#$prefix_real#")
+ VERSION="@VERSION@"
+ LIBM="@LIBM@"
+ LIBC="@LIBC@"
+@@ -48,7 +48,7 @@ OPT="@OPT@"
+ PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
+ LDVERSION="@LDVERSION@"
+ LIBDEST=${prefix}/lib/python${VERSION}
+-LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
++LIBPL=$(echo "@LIBPL@" | sed "s#^$prefix_build#$prefix_real#")
+ SO="@SO@"
+ PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
+ INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
+-- 
+2.1.3
+
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH next 3/3] dbus-python: add python3 support
  2014-11-20 13:53 [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support Peter Korsgaard
  2014-11-20 13:53 ` [Buildroot] [PATCH next 1/3] dbus-python: cleanup package Peter Korsgaard
  2014-11-20 13:53 ` [Buildroot] [PATCH next 2/3] python3: add patch to fix --includes / --ldflags output of python3-config Peter Korsgaard
@ 2014-11-20 13:53 ` Peter Korsgaard
  2014-11-22 18:24 ` [Buildroot] [PATCH next 0/3] dbus-python cleanup and " Thomas Petazzoni
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-11-20 13:53 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/dbus-python/Config.in      |  5 +++--
 package/dbus-python/dbus-python.mk | 17 ++++++++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/package/dbus-python/Config.in b/package/dbus-python/Config.in
index a38d277..4b302ef 100644
--- a/package/dbus-python/Config.in
+++ b/package/dbus-python/Config.in
@@ -3,10 +3,11 @@ config BR2_PACKAGE_DBUS_PYTHON
 	depends on BR2_USE_WCHAR # glib2
 	depends on BR2_TOOLCHAIN_HAS_THREADS # glib2
 	depends on BR2_PACKAGE_DBUS
-	depends on BR2_PACKAGE_PYTHON
+	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
 	select BR2_PACKAGE_DBUS_GLIB
 	# pyexpat: runtime dependency only
-	select BR2_PACKAGE_PYTHON_PYEXPAT
+	select BR2_PACKAGE_PYTHON_PYEXPAT if BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON3_PYEXPAT if BR2_PACKAGE_PYTHON3
 	help
 	  Python bindings for D-Bus
 
diff --git a/package/dbus-python/dbus-python.mk b/package/dbus-python/dbus-python.mk
index bc57689..1637406 100644
--- a/package/dbus-python/dbus-python.mk
+++ b/package/dbus-python/dbus-python.mk
@@ -9,14 +9,25 @@ DBUS_PYTHON_SITE = http://dbus.freedesktop.org/releases/dbus-python
 DBUS_PYTHON_INSTALL_STAGING = YES
 DBUS_PYTHON_LICENSE = MIT
 DBUS_PYTHON_LICENSE_FILES = COPYING
+DBUS_PYTHON_DEPENDENCIES = dbus-glib
+DBUS_PYTHON_CONF_OPTS = --disable-html-docs --disable-api-docs
+
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+DBUS_PYTHON_DEPENDENCIES += python host-python
 
-DBUS_PYTHON_CONF_ENV = \
+DBUS_PYTHON_CONF_ENV += \
 	PYTHON=$(HOST_DIR)/usr/bin/python2 \
 	PYTHON_INCLUDES="$(shell $(STAGING_DIR)/usr/bin/python2-config --includes)" \
 	PYTHON_LIBS="$(shell $(STAGING_DIR)/usr/bin/python2-config --ldflags)"
+else
+DBUS_PYTHON_DEPENDENCIES += python3 host-python3
+
+DBUS_PYTHON_CONF_ENV += \
+	PYTHON=$(HOST_DIR)/usr/bin/python3 \
+	PYTHON_INCLUDES="$(shell $(STAGING_DIR)/usr/bin/python3-config --includes)" \
+	PYTHON_LIBS="$(shell $(STAGING_DIR)/usr/bin/python3-config --ldflags)"
+endif
 
-DBUS_PYTHON_CONF_OPTS = --disable-html-docs --disable-api-docs
 
-DBUS_PYTHON_DEPENDENCIES = dbus-glib python host-python
 
 $(eval $(autotools-package))
-- 
2.1.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support
  2014-11-20 13:53 [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support Peter Korsgaard
                   ` (2 preceding siblings ...)
  2014-11-20 13:53 ` [Buildroot] [PATCH next 3/3] dbus-python: add python3 support Peter Korsgaard
@ 2014-11-22 18:24 ` Thomas Petazzoni
  2014-11-22 18:37   ` Peter Korsgaard
  3 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2014-11-22 18:24 UTC (permalink / raw)
  To: buildroot

Dear Peter Korsgaard,

On Thu, 20 Nov 2014 14:53:28 +0100, Peter Korsgaard wrote:

> Peter Korsgaard (3):
>       dbus-python: cleanup package
>       python3: add patch to fix --includes / --ldflags output of python3-config
>       dbus-python: add python3 support

Thanks, series applied to next. Probably the first time that I apply
some patches from you :-)

I found one minor issue: on the last patch, you forgot to update the
dependencies of the comment, so I added the following change to your
patch:

 comment "dbus-python needs a toolchain w/ wchar, threads"
-       depends on BR2_PACKAGE_DBUS && BR2_PACKAGE_PYTHON
+       depends on BR2_PACKAGE_DBUS && (BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3)

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support
  2014-11-22 18:24 ` [Buildroot] [PATCH next 0/3] dbus-python cleanup and " Thomas Petazzoni
@ 2014-11-22 18:37   ` Peter Korsgaard
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2014-11-22 18:37 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 > Dear Peter Korsgaard,
 > On Thu, 20 Nov 2014 14:53:28 +0100, Peter Korsgaard wrote:

 >> Peter Korsgaard (3):
 >> dbus-python: cleanup package
 >> python3: add patch to fix --includes / --ldflags output of python3-config
 >> dbus-python: add python3 support

 > Thanks, series applied to next. Probably the first time that I apply
 > some patches from you :-)

;)

 > I found one minor issue: on the last patch, you forgot to update the
 > dependencies of the comment, so I added the following change to your
 > patch:

 >  comment "dbus-python needs a toolchain w/ wchar, threads"
 > -       depends on BR2_PACKAGE_DBUS && BR2_PACKAGE_PYTHON
 > +       depends on BR2_PACKAGE_DBUS && (BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3)

Ahh yes, thanks

-- 
Bye, Peter Korsgaard 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-22 18:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-20 13:53 [Buildroot] [PATCH next 0/3] dbus-python cleanup and python3 support Peter Korsgaard
2014-11-20 13:53 ` [Buildroot] [PATCH next 1/3] dbus-python: cleanup package Peter Korsgaard
2014-11-20 13:53 ` [Buildroot] [PATCH next 2/3] python3: add patch to fix --includes / --ldflags output of python3-config Peter Korsgaard
2014-11-20 13:53 ` [Buildroot] [PATCH next 3/3] dbus-python: add python3 support Peter Korsgaard
2014-11-22 18:24 ` [Buildroot] [PATCH next 0/3] dbus-python cleanup and " Thomas Petazzoni
2014-11-22 18:37   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox