Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program
@ 2014-10-05  9:40 Samuel Martin
  2014-10-05  9:40 ` [Buildroot] [PATCH 2/2] package/libplist: fix python support Samuel Martin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Samuel Martin @ 2014-10-05  9:40 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 package/swig/swig.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/swig/swig.mk b/package/swig/swig.mk
index 9996e95..3ef56d6 100644
--- a/package/swig/swig.mk
+++ b/package/swig/swig.mk
@@ -31,3 +31,5 @@ endef
 HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_SYMLINK
 
 $(eval $(host-autotools-package))
+
+SWIG = $(HOST_DIR)/usr/bin/swig$(SWIG_MAJOR)
-- 
2.1.2

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

* [Buildroot] [PATCH 2/2] package/libplist: fix python support
  2014-10-05  9:40 [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program Samuel Martin
@ 2014-10-05  9:40 ` Samuel Martin
  2014-10-05 10:08   ` Yann E. MORIN
  2014-10-05 12:08   ` Thomas Petazzoni
  2014-10-05 10:09 ` [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program Yann E. MORIN
  2014-10-05 11:46 ` Thomas Petazzoni
  2 siblings, 2 replies; 6+ messages in thread
From: Samuel Martin @ 2014-10-05  9:40 UTC (permalink / raw)
  To: buildroot

This patch:
- fixes the python3 support detection in the libplist CMake code;
- correctly sets the dependencies and configure options in libplist.mk.

Fixes:
  http://autobuild.buildroot.net/results/efb/efba806b9a40a5e9c6bca7e591747ca2102fa1d5/


Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
 ...support-python2-and-python3-when-defining.patch | 27 ++++++++++++++++++++++
 package/libplist/libplist.mk                       | 13 +++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch

diff --git a/package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch b/package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch
new file mode 100644
index 0000000..a5218e8
--- /dev/null
+++ b/package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch
@@ -0,0 +1,27 @@
+From 114d242a3b6b749b404cda80304e621556325d34 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Sun, 5 Oct 2014 10:13:06 +0200
+Subject: [PATCH] cmake: swig: support python2 and python3 when defining
+ DISTUTILS_PYTHON_ILIBRARY_PATH
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+---
+ swig/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
+index 379cb95..ae6f0e7 100644
+--- a/swig/CMakeLists.txt
++++ b/swig/CMakeLists.txt
+@@ -9,7 +9,7 @@ SWIG_ADD_MODULE( plist python plist.i )
+ SWIG_LINK_LIBRARIES( plist plist plist++ ${PYTHON_LIBRARIES} )
+ 
+ EXEC_PROGRAM("${PYTHON_EXECUTABLE}"
+-    ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)\nexcept: pass\n'"
++    ARGS "-c 'from __future__ import print_function\ntry:\n import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(plat_specific=1))\nexcept: pass\n'"
+     OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH
+     )
+ 
+-- 
+2.1.2
+
diff --git a/package/libplist/libplist.mk b/package/libplist/libplist.mk
index 87f09c6..1e44fff 100644
--- a/package/libplist/libplist.mk
+++ b/package/libplist/libplist.mk
@@ -12,4 +12,17 @@ LIBPLIST_MAKE = $(MAKE1)
 LIBPLIST_LICENSE = LGPLv2.1+
 LIBPLIST_LICENSE_FILES = COPYING
 
+ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
+LIBPLIST_DEPENDENCIES += \
+	python$(if $(BR2_PACKAGE_PYTHON3),3) \
+	host-swig
+LIBPLIST_CONF_OPTS += \
+	-DENABLE_PYTHON=ON \
+	-DSWIG_EXECUTABLE=$(SWIG)
+else
+LIBPLIST_CONF_OPTS += \
+	-DENABLE_PYTHON=OFF \
+	-DSWIG_EXECUTABLE=SWIG_EXECUTABLE-NOTFOUND
+endif
+
 $(eval $(cmake-package))
-- 
2.1.2

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

* [Buildroot] [PATCH 2/2] package/libplist: fix python support
  2014-10-05  9:40 ` [Buildroot] [PATCH 2/2] package/libplist: fix python support Samuel Martin
@ 2014-10-05 10:08   ` Yann E. MORIN
  2014-10-05 12:08   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-10-05 10:08 UTC (permalink / raw)
  To: buildroot

Samuel, All,

On 2014-10-05 11:40 +0200, Samuel Martin spake thusly:
> This patch:
> - fixes the python3 support detection in the libplist CMake code;
> - correctly sets the dependencies and configure options in libplist.mk.

Rather than trying to fix a 3-year old release (1.6), can't we have a look at
bumping to the latest release, 1.11, which is 'only' 6-month old?

I'll give it a spin.

Regards,
Yann E. MORIN.

> Fixes:
>   http://autobuild.buildroot.net/results/efb/efba806b9a40a5e9c6bca7e591747ca2102fa1d5/
> 
> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> ---
>  ...support-python2-and-python3-when-defining.patch | 27 ++++++++++++++++++++++
>  package/libplist/libplist.mk                       | 13 +++++++++++
>  2 files changed, 40 insertions(+)
>  create mode 100644 package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch
> 
> diff --git a/package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch b/package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch
> new file mode 100644
> index 0000000..a5218e8
> --- /dev/null
> +++ b/package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch
> @@ -0,0 +1,27 @@
> +From 114d242a3b6b749b404cda80304e621556325d34 Mon Sep 17 00:00:00 2001
> +From: Samuel Martin <s.martin49@gmail.com>
> +Date: Sun, 5 Oct 2014 10:13:06 +0200
> +Subject: [PATCH] cmake: swig: support python2 and python3 when defining
> + DISTUTILS_PYTHON_ILIBRARY_PATH
> +
> +Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> +---
> + swig/CMakeLists.txt | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
> +index 379cb95..ae6f0e7 100644
> +--- a/swig/CMakeLists.txt
> ++++ b/swig/CMakeLists.txt
> +@@ -9,7 +9,7 @@ SWIG_ADD_MODULE( plist python plist.i )
> + SWIG_LINK_LIBRARIES( plist plist plist++ ${PYTHON_LIBRARIES} )
> + 
> + EXEC_PROGRAM("${PYTHON_EXECUTABLE}"
> +-    ARGS "-c 'try:\n import distutils.sysconfig; print distutils.sysconfig.get_python_lib(plat_specific=1)\nexcept: pass\n'"
> ++    ARGS "-c 'from __future__ import print_function\ntry:\n import distutils.sysconfig; print(distutils.sysconfig.get_python_lib(plat_specific=1))\nexcept: pass\n'"
> +     OUTPUT_VARIABLE DISTUTILS_PYTHON_ILIBRARY_PATH
> +     )
> + 
> +-- 
> +2.1.2
> +
> diff --git a/package/libplist/libplist.mk b/package/libplist/libplist.mk
> index 87f09c6..1e44fff 100644
> --- a/package/libplist/libplist.mk
> +++ b/package/libplist/libplist.mk
> @@ -12,4 +12,17 @@ LIBPLIST_MAKE = $(MAKE1)
>  LIBPLIST_LICENSE = LGPLv2.1+
>  LIBPLIST_LICENSE_FILES = COPYING
>  
> +ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
> +LIBPLIST_DEPENDENCIES += \
> +	python$(if $(BR2_PACKAGE_PYTHON3),3) \
> +	host-swig
> +LIBPLIST_CONF_OPTS += \
> +	-DENABLE_PYTHON=ON \
> +	-DSWIG_EXECUTABLE=$(SWIG)
> +else
> +LIBPLIST_CONF_OPTS += \
> +	-DENABLE_PYTHON=OFF \
> +	-DSWIG_EXECUTABLE=SWIG_EXECUTABLE-NOTFOUND
> +endif
> +
>  $(eval $(cmake-package))
> -- 
> 2.1.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program
  2014-10-05  9:40 [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program Samuel Martin
  2014-10-05  9:40 ` [Buildroot] [PATCH 2/2] package/libplist: fix python support Samuel Martin
@ 2014-10-05 10:09 ` Yann E. MORIN
  2014-10-05 11:46 ` Thomas Petazzoni
  2 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-10-05 10:09 UTC (permalink / raw)
  To: buildroot

Samuel, All,

On 2014-10-05 11:40 +0200, Samuel Martin spake thusly:
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/swig/swig.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/swig/swig.mk b/package/swig/swig.mk
> index 9996e95..3ef56d6 100644
> --- a/package/swig/swig.mk
> +++ b/package/swig/swig.mk
> @@ -31,3 +31,5 @@ endef
>  HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_SYMLINK
>  
>  $(eval $(host-autotools-package))
> +
> +SWIG = $(HOST_DIR)/usr/bin/swig$(SWIG_MAJOR)
> -- 
> 2.1.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program
  2014-10-05  9:40 [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program Samuel Martin
  2014-10-05  9:40 ` [Buildroot] [PATCH 2/2] package/libplist: fix python support Samuel Martin
  2014-10-05 10:09 ` [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program Yann E. MORIN
@ 2014-10-05 11:46 ` Thomas Petazzoni
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-10-05 11:46 UTC (permalink / raw)
  To: buildroot

Dear Samuel Martin,

On Sun,  5 Oct 2014 11:40:06 +0200, Samuel Martin wrote:
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> ---
>  package/swig/swig.mk | 2 ++
>  1 file changed, 2 insertions(+)

Applied, 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 2/2] package/libplist: fix python support
  2014-10-05  9:40 ` [Buildroot] [PATCH 2/2] package/libplist: fix python support Samuel Martin
  2014-10-05 10:08   ` Yann E. MORIN
@ 2014-10-05 12:08   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-10-05 12:08 UTC (permalink / raw)
  To: buildroot

Dear Samuel Martin,

On Sun,  5 Oct 2014 11:40:07 +0200, Samuel Martin wrote:
> This patch:
> - fixes the python3 support detection in the libplist CMake code;
> - correctly sets the dependencies and configure options in libplist.mk.
> 
> Fixes:
>   http://autobuild.buildroot.net/results/efb/efba806b9a40a5e9c6bca7e591747ca2102fa1d5/
> 
> 
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> ---
>  ...support-python2-and-python3-when-defining.patch | 27 ++++++++++++++++++++++
>  package/libplist/libplist.mk                       | 13 +++++++++++
>  2 files changed, 40 insertions(+)
>  create mode 100644 package/libplist/libplist-0003-cmake-swig-support-python2-and-python3-when-defining.patch

Patch applied, thanks. Of course, if libplist can be bumped, it would
be good.

Another note: in this case, the Python binding requires an additional
dependency (host-swig), so I'm wondering if we shouldn't have an
explicit option to enable/disable the libplist Python binding. Right
now, as soon as you have Python and libplist enabled, you're going to
build the Python binding, which requires building host-swig, even if
you don't care at all about libplist Python binding.

Best regards,

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

end of thread, other threads:[~2014-10-05 12:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-05  9:40 [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program Samuel Martin
2014-10-05  9:40 ` [Buildroot] [PATCH 2/2] package/libplist: fix python support Samuel Martin
2014-10-05 10:08   ` Yann E. MORIN
2014-10-05 12:08   ` Thomas Petazzoni
2014-10-05 10:09 ` [Buildroot] [PATCH 1/2] package/swig: define SWIG pointing to the host swig program Yann E. MORIN
2014-10-05 11:46 ` Thomas Petazzoni

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