Skip to contentSkip to conversation

boost: make build with python an option

PATCH New Johan Derycke 2 participants 4 messages Mar 10, 2014 – Mar 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 boost: make build with python an option

Add an option to boost to build the Boost.Python library.
http://www.boost.org/doc/libs/1_55_0/libs/python/doc/index.html

---
Changes v3 -> v4:
-Avoid line-wrap using "git send-email" with gmail -Fix builds with python3
Changes v2 -> v3:
-Avoid line-wrap using "git send-email"
Changes v1 -> v2:
-Fixed indentations and blank lines -Removed package/Config.in
-Allow build with python3

 package/boost/Config.in |    4 ++++
 package/boost/boost.mk  |   20 ++++++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)
package/boost/Config.in +4 -0
index 68c3909..a74c2d7 100644
@@ -60,6 +60,10 @@ config BR2_PACKAGE_BOOST_MPI
 config BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
 	bool "boost-program_options"
 
+config BR2_PACKAGE_BOOST_PYTHON
+	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
+	bool "boost-python"
+
 config BR2_PACKAGE_BOOST_RANDOM
 	bool "boost-random"
 
package/boost/boost.mk +18 -2
index 7aab614..47e9c23 100644
@@ -26,7 +26,7 @@ HOST_BOOST_FLAGS = --without-icu \
 # atomic library compile only with upstream version, wait for next release
 # coroutine breaks on some weak toolchains and it's new for 1.54+
 # log breaks with some toolchain combinations and it's new for 1.54+
-BOOST_WITHOUT_FLAGS = atomic coroutine log python
+BOOST_WITHOUT_FLAGS = atomic coroutine log
 
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CHRONO),,chrono)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_CONTEXT),,context)
@@ -40,6 +40,7 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_LOCALE),,locale)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MATH),,math)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_MPI),,mpi)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PROGRAM_OPTIONS),,program_options)
+BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_PYTHON),,python)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_RANDOM),,random)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_REGEX),,regex)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_SERIALIZATION),,serialization)
@@ -50,6 +51,8 @@ BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_THREAD),,thread)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_TIMER),,timer)
 BOOST_WITHOUT_FLAGS += $(if $(BR2_PACKAGE_BOOST_WAVE),,wave)
 
+BOOST_TARGET_CXXFLAGS = $(TARGET_CXXFLAGS)
+
 ifeq ($(BR2_PACKAGE_ICU),y)
 BOOST_FLAGS += --with-icu=$(STAGING_DIR)/usr
 BOOST_DEPENDENCIES += icu
@@ -61,6 +64,19 @@ ifeq ($(BR2_PACKAGE_BOOST_IOSTREAMS),y)
 BOOST_DEPENDENCIES += bzip2 zlib
 endif
 
+ifeq ($(BR2_PACKAGE_BOOST_PYTHON),y)
+BOOST_FLAGS += --with-python-root=$(HOST_DIR)
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+BOOST_FLAGS += --with-python=$(HOST_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR)
+BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m
+BOOST_DEPENDENCIES += python3
+else
+BOOST_FLAGS += --with-python=$(HOST_DIR)/usr/bin/python$(PYTHON_VERSION_MAJOR)
+BOOST_TARGET_CXXFLAGS += -I$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)
+BOOST_DEPENDENCIES += python
+endif
+endif
+
 HOST_BOOST_OPT += toolset=gcc threading=multi variant=release link=shared \
 	runtime-link=shared
 
@@ -84,7 +100,7 @@ BOOST_FLAGS += $(if $(BOOST_WITHOUT_FLAGS_COMMASEPERATED), --without-libraries=$
 
 define BOOST_CONFIGURE_CMDS
 	(cd $(@D) && ./bootstrap.sh $(BOOST_FLAGS))
-	echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
+	echo "using gcc : $(TARGET_CC_VERSION) : $(TARGET_CXX) : <cxxflags>\"$(BOOST_TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
 	echo "" >> $(@D)/user-config.jam
 endef
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v4 2/2 python-libconfig: new package

Python bindings to the C++ library libconfig
https://github.com/cnangel/python-libconfig

---
Changes v3 -> v4:
-Avoid line-wrap using "git send-email" with gmail -Also builds with python3
-Select BR2_PACKAGE_BOOST
Changes v2 -> v3:
-Avoid line-wrap using "git send-email"
Changes v1 -> v2:
-Fixed indentations and blank lines
-Added package/Config.in

 package/Config.in                            |    1 +
 package/python-libconfig/Config.in           |   20 ++++++++++++++++++++
 package/python-libconfig/python-libconfig.mk |   17 +++++++++++++++++
 3 files changed, 38 insertions(+)
 create mode 100644 package/python-libconfig/Config.in
 create mode 100644 package/python-libconfig/python-libconfig.mk
package/Config.in +1 -0
index 417c9b8..fb29097 100644
@@ -442,6 +442,7 @@ source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
 source "package/python-json-schema-validator/Config.in"
 source "package/python-keyring/Config.in"
+source "package/python-libconfig/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-msgpack/Config.in"
package/python-libconfig/Config.in new file +20 -0
new file mode 100644
index 0000000..35e9804
@@ -0,0 +1,20 @@
+comment "python-libconfig needs a toolchain w/ C++, largefile, threads"
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
+
+
+config BR2_PACKAGE_PYTHON_LIBCONFIG
+	bool "python-libconfig"
+	depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_PYTHON
+	select BR2_PACKAGE_LIBCONFIG
+	help
+	  Python bindings to the C++ library libconfig
+
+	  https://github.com/cnangel/python-libconfig
+
+	  Libconfig is a simple library for manipulating structured
+	  configuration files. The file format is more compact and more
+	  readable than XML. And unlike XML, it is type-aware, so it is
+	  not necessary to do string parsing in application code.
+	  http://www.hyperrealm.com/libconfig/
package/python-libconfig/python-libconfig.mk new file +17 -0
new file mode 100644
index 0000000..3f5984b
@@ -0,0 +1,17 @@
+################################################################################
+#
+# python-libconfig
+#
+################################################################################
+
+PYTHON_LIBCONFIG_VERSION = b271c3d9dac938ad5cd29b67bd08cc5536a5a391
+PYTHON_LIBCONFIG_SITE = $(call github,cnangel,python-libconfig,$(PYTHON_LIBCONFIG_VERSION))
+
+PYTHON_LIBCONFIG_LICENSE = BSD
+PYTHON_LIBCONFIG_LICENSE_FILES = README
+
+PYTHON_LIBCONFIG_SETUP_TYPE = setuptools
+
+PYTHON_LIBCONFIG_DEPENDENCIES = libconfig boost
+
+$(eval $(python-package))
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH v4 2/2 python-libconfig: new package

Dear Johan Derycke,

Quoted 4 lines · Johan Derycke

Python bindings to the C++ library libconfig
https://github.com/cnangel/python-libconfig

Quoted 10 lines

---
Changes v3 -> v4:
-Avoid line-wrap using "git send-email" with gmail -Also builds with python3
-Select BR2_PACKAGE_BOOST
Changes v2 -> v3:
-Avoid line-wrap using "git send-email"
Changes v1 -> v2:
-Fixed indentations and blank lines
-Added package/Config.in

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v4 1/2 boost: make build with python an option

In reply to Johan Derycke

Dear Johan Derycke,

Quoted 15 lines · Johan Derycke

Add an option to boost to build the Boost.Python library.
http://www.boost.org/doc/libs/1_55_0/libs/python/doc/index.html

---
Changes v3 -> v4:
-Avoid line-wrap using "git send-email" with gmail -Fix builds with python3
Changes v2 -> v3:
-Avoid line-wrap using "git send-email"
Changes v1 -> v2:
-Fixed indentations and blank lines -Removed package/Config.in
-Allow build with python3

Quoted 3 lines
 package/boost/Config.in |    4 ++++
 package/boost/boost.mk  |   20 ++++++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

Applied, thanks.

Thomas

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