Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory
  2015-03-13  8:24 [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Gwenhael Goavec-Merou
@ 2015-03-13  8:20 ` Angelo Compagnucci
  2015-03-13  8:24 ` [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support Gwenhael Goavec-Merou
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Angelo Compagnucci @ 2015-03-13  8:20 UTC (permalink / raw)
  To: buildroot

2015-03-13 9:24 GMT+01:00 Gwenhael Goavec-Merou <gwenj@trabucayre.com>:
> From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
>
> For some cmake based packages, like GNURadio, it's forbidden to do the
> compilation directly in the sources directory. This patch add a new
> variable to specify, if needed, the name of a sub-directory used to compile.
>
> Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
> ---
> Changes v6 -> v7:
>  * move and reformulate LIBFOO_SUPPORTS_IN_SOURCE_BUILD description.
>  * adds default value to YES and test if _SUPPORT_IN_SOURCE_BUILD is equal to
>    YES instead of NO
> Changes v5 -> v6:
>  * s/, no/,NO/
>  * s/$$($(2)_SUPPORTS_IN_SOURCE_BUILD)/$$($(3)_SUPPORTS_IN_SOURCE_BUILD)/
> Changes v4 -> v5:
>  * Instead of overloading BUILDDIR uses a variable to set if package is compiled
>    in-source-tree or not
>  * update again manual
> Changes v2 -> v3:
>  * Update docs to add detail about LIBFOO_BUILDDIR
> Changes v1 -> v2:
>  * Allow to overload $(2)_BUILDDIR instead of adding a new variable and test
> ---
>  docs/manual/adding-packages-cmake.txt |  4 ++++
>  package/pkg-cmake.mk                  | 14 ++++++++++++--
>  2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/docs/manual/adding-packages-cmake.txt b/docs/manual/adding-packages-cmake.txt
> index d92b209..87c51a8 100644
> --- a/docs/manual/adding-packages-cmake.txt
> +++ b/docs/manual/adding-packages-cmake.txt
> @@ -100,6 +100,10 @@ typical packages will therefore only use a few of them.
>    necessary to set them in the package's +*.mk+ file unless you want
>    to override them:
>
> +* +LIBFOO_SUPPORTS_IN_SOURCE_BUILD = NO+ should be set when the package
> +  cannot be built inside the source tree but needs a separate build
> +  directory.
> +
>  ** +CMAKE_BUILD_TYPE+ is driven by +BR2_ENABLE_DEBUG+;
>  ** +CMAKE_INSTALL_PREFIX+;
>  ** +BUILD_SHARED_LIBS+ is driven by +BR2_STATIC_LIBS+;
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 2404c40..2262012 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -61,7 +61,15 @@ $(2)_INSTALL_STAGING_OPTS    ?= DESTDIR=$$(STAGING_DIR) install
>  $(2)_INSTALL_TARGET_OPTS               ?= DESTDIR=$$(TARGET_DIR) install
>
>  $(2)_SRCDIR                    = $$($(2)_DIR)/$$($(2)_SUBDIR)
> +
> +$(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES
> +
> +
> +ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES)
>  $(2)_BUILDDIR                  = $$($(2)_SRCDIR)
> +else
> +$(2)_BUILDDIR                  = $$($(2)_SRCDIR)/buildroot-build
> +endif
>
>  #
>  # Configure step. Only define it if not already defined by the package
> @@ -73,7 +81,8 @@ ifeq ($(4),target)
>
>  # Configure package for target
>  define $(2)_CONFIGURE_CMDS
> -       (cd $$($$(PKG)_BUILDDIR) && \
> +       (mkdir -p $$($$(PKG)_BUILDDIR) && \
> +       cd $$($$(PKG)_BUILDDIR) && \
>         rm -f CMakeCache.txt && \
>         PATH=$$(BR_PATH) \
>         $$($$(PKG)_CONF_ENV) $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> @@ -98,7 +107,8 @@ else
>
>  # Configure package for host
>  define $(2)_CONFIGURE_CMDS
> -       (cd $$($$(PKG)_BUILDDIR) && \
> +       (mkdir -p $$($$(PKG)_BUILDDIR) && \
> +       cd $$($$(PKG)_BUILDDIR) && \
>         rm -f CMakeCache.txt && \
>         PATH=$$(BR_PATH) \
>         $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> --
> 2.0.5

Patch works for me and it's really appreciated cause I have several
packages that doesn't build in source directory.

>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

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

* [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory
@ 2015-03-13  8:24 Gwenhael Goavec-Merou
  2015-03-13  8:20 ` Angelo Compagnucci
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Gwenhael Goavec-Merou @ 2015-03-13  8:24 UTC (permalink / raw)
  To: buildroot

From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>

For some cmake based packages, like GNURadio, it's forbidden to do the
compilation directly in the sources directory. This patch add a new 
variable to specify, if needed, the name of a sub-directory used to compile.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Changes v6 -> v7:
 * move and reformulate LIBFOO_SUPPORTS_IN_SOURCE_BUILD description.
 * adds default value to YES and test if _SUPPORT_IN_SOURCE_BUILD is equal to 
   YES instead of NO
Changes v5 -> v6:
 * s/, no/,NO/
 * s/$$($(2)_SUPPORTS_IN_SOURCE_BUILD)/$$($(3)_SUPPORTS_IN_SOURCE_BUILD)/
Changes v4 -> v5:
 * Instead of overloading BUILDDIR uses a variable to set if package is compiled
   in-source-tree or not
 * update again manual
Changes v2 -> v3:
 * Update docs to add detail about LIBFOO_BUILDDIR
Changes v1 -> v2:
 * Allow to overload $(2)_BUILDDIR instead of adding a new variable and test
---
 docs/manual/adding-packages-cmake.txt |  4 ++++
 package/pkg-cmake.mk                  | 14 ++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/docs/manual/adding-packages-cmake.txt b/docs/manual/adding-packages-cmake.txt
index d92b209..87c51a8 100644
--- a/docs/manual/adding-packages-cmake.txt
+++ b/docs/manual/adding-packages-cmake.txt
@@ -100,6 +100,10 @@ typical packages will therefore only use a few of them.
   necessary to set them in the package's +*.mk+ file unless you want
   to override them:
 
+* +LIBFOO_SUPPORTS_IN_SOURCE_BUILD = NO+ should be set when the package
+  cannot be built inside the source tree but needs a separate build
+  directory.
+
 ** +CMAKE_BUILD_TYPE+ is driven by +BR2_ENABLE_DEBUG+;
 ** +CMAKE_INSTALL_PREFIX+;
 ** +BUILD_SHARED_LIBS+ is driven by +BR2_STATIC_LIBS+;
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 2404c40..2262012 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -61,7 +61,15 @@ $(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install
 $(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install
 
 $(2)_SRCDIR			= $$($(2)_DIR)/$$($(2)_SUBDIR)
+
+$(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES
+
+
+ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES)
 $(2)_BUILDDIR			= $$($(2)_SRCDIR)
+else
+$(2)_BUILDDIR			= $$($(2)_SRCDIR)/buildroot-build
+endif
 
 #
 # Configure step. Only define it if not already defined by the package
@@ -73,7 +81,8 @@ ifeq ($(4),target)
 
 # Configure package for target
 define $(2)_CONFIGURE_CMDS
-	(cd $$($$(PKG)_BUILDDIR) && \
+	(mkdir -p $$($$(PKG)_BUILDDIR) && \
+	cd $$($$(PKG)_BUILDDIR) && \
 	rm -f CMakeCache.txt && \
 	PATH=$$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
@@ -98,7 +107,8 @@ else
 
 # Configure package for host
 define $(2)_CONFIGURE_CMDS
-	(cd $$($$(PKG)_BUILDDIR) && \
+	(mkdir -p $$($$(PKG)_BUILDDIR) && \
+	cd $$($$(PKG)_BUILDDIR) && \
 	rm -f CMakeCache.txt && \
 	PATH=$$(BR_PATH) \
 	$$(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
-- 
2.0.5

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

* [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support
  2015-03-13  8:24 [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Gwenhael Goavec-Merou
  2015-03-13  8:20 ` Angelo Compagnucci
@ 2015-03-13  8:24 ` Gwenhael Goavec-Merou
  2015-03-13 21:51   ` Thomas Petazzoni
  2015-03-15 21:15   ` Thomas Petazzoni
  2015-03-13  8:24 ` [Buildroot] [PATCH v7 3/3] GNURadio: new package Gwenhael Goavec-Merou
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 9+ messages in thread
From: Gwenhael Goavec-Merou @ 2015-03-13  8:24 UTC (permalink / raw)
  To: buildroot

From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>

Some packages, like GNURadio for VOLK, needs cheetah on host at buildtime.

The dependency on host-python-markdown is needed to avoid that setuptools
downloads markdown if it is not installed yet.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Changes v4 -> v7:
 * reformulate commit message.
Changes v3 -> v4:
 * use HOST_PYTHON_CHEETAH_DEPENDENCIES instead of PYTHON_CHEETAH_DEPENDENCIES
 * suppress '+' for dependency definition
---
 package/python-cheetah/python-cheetah.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/python-cheetah/python-cheetah.mk b/package/python-cheetah/python-cheetah.mk
index 08076b5..3155951 100644
--- a/package/python-cheetah/python-cheetah.mk
+++ b/package/python-cheetah/python-cheetah.mk
@@ -9,5 +9,7 @@ PYTHON_CHEETAH_SOURCE = Cheetah-$(PYTHON_CHEETAH_VERSION).tar.gz
 PYTHON_CHEETAH_SITE = http://pypi.python.org/packages/source/C/Cheetah
 PYTHON_CHEETAH_LICENSE = MIT
 PYTHON_CHEETAH_SETUP_TYPE = setuptools
+HOST_PYTHON_CHEETAH_DEPENDENCIES = host-python-markdown
 
 $(eval $(python-package))
+$(eval $(host-python-package))
-- 
2.0.5

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

* [Buildroot] [PATCH v7 3/3] GNURadio: new package
  2015-03-13  8:24 [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Gwenhael Goavec-Merou
  2015-03-13  8:20 ` Angelo Compagnucci
  2015-03-13  8:24 ` [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support Gwenhael Goavec-Merou
@ 2015-03-13  8:24 ` Gwenhael Goavec-Merou
  2015-03-13 21:53   ` Thomas Petazzoni
  2015-03-13  9:49 ` [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Samuel Martin
  2015-03-13 21:49 ` Thomas Petazzoni
  4 siblings, 1 reply; 9+ messages in thread
From: Gwenhael Goavec-Merou @ 2015-03-13  8:24 UTC (permalink / raw)
  To: buildroot

From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
---
Changes v6 -> v7:
* add detection boost unit_test_framework to avoid build failure if
 BUILD_TEST is set and unit_test_framework not available.
* comment indentation.
* Locally calculated sha256.
* suppress redundant comment.
* use hf/neon optimization only if target CPU is an ARMV7A and NEON available.
Changes v5 -> v6:
* GNURADIO_SUPPORTS_IN_SOURCE_BUILD = no -> GNURADIO_SUPPORTS_IN_SOURCE_BUILD = NO
Changes v4 -> v5:
* GNURadio -> gnuradio.
* help for all options.
* rename patch, add signed-off and a comment.
* dependencies comment.
* typo. 
* better workaround to avoid compile fails when neon is enabled.
* indentation.
* better options handlings.
Changes v2 -> v3:
* move comment at the beginning of the file.
* add a patch to suppress boost-test dependency.
* move python dependencies in the specific option.
* use stable archive instead of git.
* add hook specific for ARM for using neon if available (without this hook volk
  fails to build).
Changes v1 -> v2:
* overload _BUILDDIR variable to specify build directory
---
 package/Config.in                                  |  1 +
 .../0001-suppress-boost_unitest-detection.patch    | 40 +++++++++++++++
 package/gnuradio/Config.in                         | 46 +++++++++++++++++
 package/gnuradio/gnuradio.hash                     |  5 ++
 package/gnuradio/gnuradio.mk                       | 58 ++++++++++++++++++++++
 5 files changed, 150 insertions(+)
 create mode 100644 package/gnuradio/0001-suppress-boost_unitest-detection.patch
 create mode 100644 package/gnuradio/Config.in
 create mode 100644 package/gnuradio/gnuradio.hash
 create mode 100644 package/gnuradio/gnuradio.mk

diff --git a/package/Config.in b/package/Config.in
index a37e519..0761111 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1044,6 +1044,7 @@ menu "Miscellaneous"
 	source "package/clamav/Config.in"
 	source "package/collectd/Config.in"
 	source "package/empty/Config.in"
+	source "package/gnuradio/Config.in"
 	source "package/googlefontdirectory/Config.in"
 	source "package/haveged/Config.in"
 	source "package/mcrypt/Config.in"
diff --git a/package/gnuradio/0001-suppress-boost_unitest-detection.patch b/package/gnuradio/0001-suppress-boost_unitest-detection.patch
new file mode 100644
index 0000000..7663881
--- /dev/null
+++ b/package/gnuradio/0001-suppress-boost_unitest-detection.patch
@@ -0,0 +1,40 @@
+By default, the boost test option is mandatory for build environment
+detection. 
+This patch suppress this dependency and allows the test part only if
+build_test is enabled at the Buildroot level.
+
+Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
+---
+Index: gnuradio-3.7.5/volk/cmake/VolkBoost.cmake
+===================================================================
+--- gnuradio-3.7.5.orig/volk/cmake/VolkBoost.cmake
++++ gnuradio-3.7.5/volk/cmake/VolkBoost.cmake
+@@ -29,7 +29,6 @@ set(__INCLUDED_VOLK_BOOST_CMAKE TRUE)
+ set(BOOST_REQUIRED_COMPONENTS
+     filesystem
+     system
+-    unit_test_framework
+     program_options
+ )
+ 
+Index: gnuradio-3.7.5/volk/lib/CMakeLists.txt
+===================================================================
+--- gnuradio-3.7.5.orig/volk/lib/CMakeLists.txt
++++ gnuradio-3.7.5/volk/lib/CMakeLists.txt
+@@ -540,8 +540,9 @@ endif(ENABLE_STATIC_LIBS)
+ # Build the QA test application
+ ########################################################################
+ 
++find_package(Boost "1.35" COMPONENTS "unit_test_framework")
+ 
+-if(Boost_FOUND)
++if(Boost_FOUND AND BUILD_TEST)
+ 
+     set_source_files_properties(
+         ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc PROPERTIES
+@@ -558,4 +559,4 @@ if(Boost_FOUND)
+     target_link_libraries(test_all volk ${Boost_LIBRARIES})
+     add_test(qa_volk_test_all test_all)
+ 
+-endif(Boost_FOUND)
++endif(Boost_FOUND AND BUILD_TEST)
diff --git a/package/gnuradio/Config.in b/package/gnuradio/Config.in
new file mode 100644
index 0000000..e32fc27
--- /dev/null
+++ b/package/gnuradio/Config.in
@@ -0,0 +1,46 @@
+comment "gnuradio needs a toolchain w/ C++, IPV6, threads, largefile, wchar"
+	depends on BR2_USE_MMU
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_LARGEFILE || \
+		!BR2_INET_IPV6
+
+config BR2_PACKAGE_GNURADIO
+	bool "gnuradio"
+	depends on BR2_INET_IPV6 # boost
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_LARGEFILE # boost
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU # use fork()
+	depends on BR2_USE_WCHAR # boost
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_DATE_TIME
+	select BR2_PACKAGE_BOOST_FILESYSTEM
+	select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
+	select BR2_PACKAGE_BOOST_SYSTEM
+	select BR2_PACKAGE_BOOST_THREAD
+	help
+	  GNU Radio is a free & open-source software development toolkit
+	  that provides signal processing blocks to implement software
+	  radios. It can be used with readily-available low-cost external
+	  RF hardware to create software-defined radios, or without
+	  hardware in a simulation-like environment. It is widely used in
+	  hobbyist, academic and commercial environments to support both
+	  wireless communications research and real-world radio systems.
+
+	  http://gnuradio.org/
+
+if BR2_PACKAGE_GNURADIO
+
+config BR2_PACKAGE_GNURADIO_BLOCKS
+	bool "blocks support"
+	help
+	  GNU Radio basic block library
+
+config BR2_PACKAGE_GNURADIO_PYTHON
+	bool "python support"
+	select BR2_PACKAGE_BOOST_PYTHON
+	select BR2_PACKAGE_PYTHON
+	help
+	  Enable python component
+
+endif
diff --git a/package/gnuradio/gnuradio.hash b/package/gnuradio/gnuradio.hash
new file mode 100644
index 0000000..d34dd55
--- /dev/null
+++ b/package/gnuradio/gnuradio.hash
@@ -0,0 +1,5 @@
+# From http://gnuradio.org/redmine/projects/gnuradio/files
+md5	b4a917a548f41ce25c6c88f9bc864bca	gnuradio-3.7.5.tar.gz
+
+# Locally calculated:
+sha256 467f62190687a34f9faa18be8d650e28d7046b94070b1b6d94355c28beb76243  gnuradio-3.7.5.tar.gz
diff --git a/package/gnuradio/gnuradio.mk b/package/gnuradio/gnuradio.mk
new file mode 100644
index 0000000..72b4ff9
--- /dev/null
+++ b/package/gnuradio/gnuradio.mk
@@ -0,0 +1,58 @@
+################################################################################
+#
+# gnuradio
+#
+################################################################################
+
+GNURADIO_VERSION = 3.7.5
+GNURADIO_SITE = http://gnuradio.org/redmine/attachments/download/792
+GNURADIO_LICENSE = GPLv3+
+GNURADIO_LICENSE_FILES = COPYING
+
+GNURADIO_SUPPORTS_IN_SOURCE_BUILD = NO
+
+# host-python-cheetah is needed for volk to compile
+GNURADIO_DEPENDENCIES = \
+		host-python-cheetah \
+		host-swig \
+		boost
+
+GNURADIO_CONF_OPTS = \
+		-DENABLE_DEFAULT=OFF \
+		-DENABLE_VOLK=ON \
+		-DENABLE_GNURADIO_RUNTIME=ON
+
+#For third-party blocks,  the gnuradio libraries are mandatory at 
+# compile time.
+GNURADIO_INSTALL_STAGING = YES
+
+# Yes, this is silly, because -march is already known by the compiler
+# with the internal toolchain, and passed by the external wrapper for
+# external toolchains. Nonetheless, gnuradio does some matching on the
+# CFLAGS to decide whether to build the NEON functions or not, and
+# wants to see the string 'armv7' in the CFLAGS.
+ifeq ($(BR2_ARM_CPU_ARMV7A)$(BR2_ARM_CPU_HAS_NEON),yy)
+GNURADIO_CONF_OPTS += -DCMAKE_C_FLAGS="-march=armv7-a"
+endif
+
+# As soon as -mfpu=neon is supported by the compiler, gnuradio will try
+# to use it. But having NEON support in the compiler doesn't necessarily
+# mean we have NEON support in our CPU.
+ifeq ($(BR2_ARM_CPU_HAS_NEON),)
+GNURADIO_CONF_OPTS += -Dhave_mfpu_neon=0
+endif
+
+ifeq ($(BR2_PACKAGE_GNURADIO_BLOCKS),y)
+GNURADIO_CONF_OPTS += -DENABLE_GR_BLOCKS=ON
+else
+GNURADIO_CONF_OPTS += -DENABLE_GR_BLOCKS=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_GNURADIO_PYTHON),y)
+GNURADIO_DEPENDENCIES += python
+GNURADIO_CONF_OPTS += -DENABLE_PYTHON=ON
+else
+GNURADIO_CONF_OPTS += -DENABLE_PYTHON=OFF
+endif
+
+$(eval $(cmake-package))
-- 
2.0.5

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

* [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory
  2015-03-13  8:24 [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Gwenhael Goavec-Merou
                   ` (2 preceding siblings ...)
  2015-03-13  8:24 ` [Buildroot] [PATCH v7 3/3] GNURadio: new package Gwenhael Goavec-Merou
@ 2015-03-13  9:49 ` Samuel Martin
  2015-03-13 21:49 ` Thomas Petazzoni
  4 siblings, 0 replies; 9+ messages in thread
From: Samuel Martin @ 2015-03-13  9:49 UTC (permalink / raw)
  To: buildroot

Hi Gwenhael, all,

On Fri, Mar 13, 2015 at 9:24 AM, Gwenhael Goavec-Merou
<gwenj@trabucayre.com> wrote:
> From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
>
> For some cmake based packages, like GNURadio, it's forbidden to do the
> compilation directly in the sources directory. This patch add a new
> variable to specify, if needed, the name of a sub-directory used to compile.
>
> Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> Changes v6 -> v7:
>  * move and reformulate LIBFOO_SUPPORTS_IN_SOURCE_BUILD description.
>  * adds default value to YES and test if _SUPPORT_IN_SOURCE_BUILD is equal to
>    YES instead of NO
> Changes v5 -> v6:
>  * s/, no/,NO/
>  * s/$$($(2)_SUPPORTS_IN_SOURCE_BUILD)/$$($(3)_SUPPORTS_IN_SOURCE_BUILD)/
> Changes v4 -> v5:
>  * Instead of overloading BUILDDIR uses a variable to set if package is compiled
>    in-source-tree or not
>  * update again manual
> Changes v2 -> v3:
>  * Update docs to add detail about LIBFOO_BUILDDIR
> Changes v1 -> v2:
>  * Allow to overload $(2)_BUILDDIR instead of adding a new variable and test
> ---
>  docs/manual/adding-packages-cmake.txt |  4 ++++
>  package/pkg-cmake.mk                  | 14 ++++++++++++--
>  2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/docs/manual/adding-packages-cmake.txt b/docs/manual/adding-packages-cmake.txt
> index d92b209..87c51a8 100644
> --- a/docs/manual/adding-packages-cmake.txt
> +++ b/docs/manual/adding-packages-cmake.txt
> @@ -100,6 +100,10 @@ typical packages will therefore only use a few of them.
>    necessary to set them in the package's +*.mk+ file unless you want
>    to override them:
>
> +* +LIBFOO_SUPPORTS_IN_SOURCE_BUILD = NO+ should be set when the package
> +  cannot be built inside the source tree but needs a separate build
> +  directory.

hmm... _SUPPORTS_IN_SOURCE_BUILD semantically tells that the package
can be built in its srctree but does not tell it will be, unlike how
it is used in the Buildroot infra (below).

IMHO, i'd prefer _BUILD_IN_SRCTREE or something similar (e.g.
_BUILD_IN_SRCDIR) that just tells what Buildroot should/must/will do.

> +
>  ** +CMAKE_BUILD_TYPE+ is driven by +BR2_ENABLE_DEBUG+;
>  ** +CMAKE_INSTALL_PREFIX+;
>  ** +BUILD_SHARED_LIBS+ is driven by +BR2_STATIC_LIBS+;
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 2404c40..2262012 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -61,7 +61,15 @@ $(2)_INSTALL_STAGING_OPTS    ?= DESTDIR=$$(STAGING_DIR) install
>  $(2)_INSTALL_TARGET_OPTS               ?= DESTDIR=$$(TARGET_DIR) install
>
>  $(2)_SRCDIR                    = $$($(2)_DIR)/$$($(2)_SUBDIR)
> +
> +$(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES
> +
> +
> +ifeq ($$($(3)_SUPPORTS_IN_SOURCE_BUILD),YES)
>  $(2)_BUILDDIR                  = $$($(2)_SRCDIR)
> +else
> +$(2)_BUILDDIR                  = $$($(2)_SRCDIR)/buildroot-build
> +endif
[...]

I know I'm late on this, and this is already the 7th iteration... so,
except this nitpicking point, you have my:
Reviewed-by: Samuel Martin <s.martin49@gmail.com>

Regards,

-- 
Samuel

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

* [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory
  2015-03-13  8:24 [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Gwenhael Goavec-Merou
                   ` (3 preceding siblings ...)
  2015-03-13  9:49 ` [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Samuel Martin
@ 2015-03-13 21:49 ` Thomas Petazzoni
  4 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2015-03-13 21:49 UTC (permalink / raw)
  To: buildroot

Dear Gwenhael Goavec-Merou,

On Fri, 13 Mar 2015 09:24:08 +0100, Gwenhael Goavec-Merou wrote:

> diff --git a/docs/manual/adding-packages-cmake.txt b/docs/manual/adding-packages-cmake.txt
> index d92b209..87c51a8 100644
> --- a/docs/manual/adding-packages-cmake.txt
> +++ b/docs/manual/adding-packages-cmake.txt
> @@ -100,6 +100,10 @@ typical packages will therefore only use a few of them.
>    necessary to set them in the package's +*.mk+ file unless you want
>    to override them:
>  
> +* +LIBFOO_SUPPORTS_IN_SOURCE_BUILD = NO+ should be set when the package
> +  cannot be built inside the source tree but needs a separate build
> +  directory.

Did you generate the documentation to review what you did? This chunk
was added right in the middle of the documentation of <pkg>_CONF_OPTS.

> +
>  ** +CMAKE_BUILD_TYPE+ is driven by +BR2_ENABLE_DEBUG+;
>  ** +CMAKE_INSTALL_PREFIX+;
>  ** +BUILD_SHARED_LIBS+ is driven by +BR2_STATIC_LIBS+;

I.e, this part must be right after <pkg>_CONF_OPTS.

I've fixed that and applied, thanks!

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

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

* [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support
  2015-03-13  8:24 ` [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support Gwenhael Goavec-Merou
@ 2015-03-13 21:51   ` Thomas Petazzoni
  2015-03-15 21:15   ` Thomas Petazzoni
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2015-03-13 21:51 UTC (permalink / raw)
  To: buildroot

Dear Gwenhael Goavec-Merou,

On Fri, 13 Mar 2015 09:24:09 +0100, Gwenhael Goavec-Merou wrote:

> diff --git a/package/python-cheetah/python-cheetah.mk b/package/python-cheetah/python-cheetah.mk
> index 08076b5..3155951 100644
> --- a/package/python-cheetah/python-cheetah.mk
> +++ b/package/python-cheetah/python-cheetah.mk
> @@ -9,5 +9,7 @@ PYTHON_CHEETAH_SOURCE = Cheetah-$(PYTHON_CHEETAH_VERSION).tar.gz
>  PYTHON_CHEETAH_SITE = http://pypi.python.org/packages/source/C/Cheetah
>  PYTHON_CHEETAH_LICENSE = MIT
>  PYTHON_CHEETAH_SETUP_TYPE = setuptools
> +HOST_PYTHON_CHEETAH_DEPENDENCIES = host-python-markdown

I've added a comment in the .mk file above this line to explain this
dependency (taken from your commit log), and applied, thanks!

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

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

* [Buildroot] [PATCH v7 3/3] GNURadio: new package
  2015-03-13  8:24 ` [Buildroot] [PATCH v7 3/3] GNURadio: new package Gwenhael Goavec-Merou
@ 2015-03-13 21:53   ` Thomas Petazzoni
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2015-03-13 21:53 UTC (permalink / raw)
  To: buildroot

Dear Gwenhael Goavec-Merou,

On Fri, 13 Mar 2015 09:24:10 +0100, Gwenhael Goavec-Merou wrote:

> +Index: gnuradio-3.7.5/volk/cmake/VolkBoost.cmake
> +===================================================================
> +--- gnuradio-3.7.5.orig/volk/cmake/VolkBoost.cmake
> ++++ gnuradio-3.7.5/volk/cmake/VolkBoost.cmake
> +@@ -29,7 +29,6 @@ set(__INCLUDED_VOLK_BOOST_CMAKE TRUE)
> + set(BOOST_REQUIRED_COMPONENTS
> +     filesystem
> +     system
> +-    unit_test_framework

It will probably be needed to re-add this unit_test_framework
dependency, but maybe only if BUILD_TEST is enabled, or something like
that.

> +     program_options
> + )
> + 
> +Index: gnuradio-3.7.5/volk/lib/CMakeLists.txt
> +===================================================================
> +--- gnuradio-3.7.5.orig/volk/lib/CMakeLists.txt
> ++++ gnuradio-3.7.5/volk/lib/CMakeLists.txt
> +@@ -540,8 +540,9 @@ endif(ENABLE_STATIC_LIBS)
> + # Build the QA test application
> + ########################################################################
> + 
> ++find_package(Boost "1.35" COMPONENTS "unit_test_framework")
> + 
> +-if(Boost_FOUND)
> ++if(Boost_FOUND AND BUILD_TEST)
> + 
> +     set_source_files_properties(
> +         ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc PROPERTIES
> +@@ -558,4 +559,4 @@ if(Boost_FOUND)
> +     target_link_libraries(test_all volk ${Boost_LIBRARIES})
> +     add_test(qa_volk_test_all test_all)
> + 
> +-endif(Boost_FOUND)
> ++endif(Boost_FOUND AND BUILD_TEST)

Can you please work with upstream to get this patch merged?


> +# host-python-cheetah is needed for volk to compile
> +GNURADIO_DEPENDENCIES = \
> +		host-python-cheetah \
> +		host-swig \
> +		boost

Indentation should be only one tab.

> +GNURADIO_CONF_OPTS = \
> +		-DENABLE_DEFAULT=OFF \
> +		-DENABLE_VOLK=ON \
> +		-DENABLE_GNURADIO_RUNTIME=ON

Ditto.

Committed with the indentation fixed.

Thanks!

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

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

* [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support
  2015-03-13  8:24 ` [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support Gwenhael Goavec-Merou
  2015-03-13 21:51   ` Thomas Petazzoni
@ 2015-03-15 21:15   ` Thomas Petazzoni
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2015-03-15 21:15 UTC (permalink / raw)
  To: buildroot

Dear Gwenhael Goavec-Merou,

On Fri, 13 Mar 2015 09:24:09 +0100, Gwenhael Goavec-Merou wrote:

> diff --git a/package/python-cheetah/python-cheetah.mk b/package/python-cheetah/python-cheetah.mk
> index 08076b5..3155951 100644
> --- a/package/python-cheetah/python-cheetah.mk
> +++ b/package/python-cheetah/python-cheetah.mk
> @@ -9,5 +9,7 @@ PYTHON_CHEETAH_SOURCE = Cheetah-$(PYTHON_CHEETAH_VERSION).tar.gz
>  PYTHON_CHEETAH_SITE = http://pypi.python.org/packages/source/C/Cheetah
>  PYTHON_CHEETAH_LICENSE = MIT
>  PYTHON_CHEETAH_SETUP_TYPE = setuptools
> +HOST_PYTHON_CHEETAH_DEPENDENCIES = host-python-markdown
>  
>  $(eval $(python-package))
> +$(eval $(host-python-package))

host-python-cheetah is causing some build failures:
http://autobuild.buildroot.org/results/a1f/a1f0666b8c7e390b7edc99ab69af200bde9f5796/build-end.log.

Could you have a look?

Thanks!

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

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

end of thread, other threads:[~2015-03-15 21:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-13  8:24 [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Gwenhael Goavec-Merou
2015-03-13  8:20 ` Angelo Compagnucci
2015-03-13  8:24 ` [Buildroot] [PATCH v7 2/3] python-cheetah: add host-package support Gwenhael Goavec-Merou
2015-03-13 21:51   ` Thomas Petazzoni
2015-03-15 21:15   ` Thomas Petazzoni
2015-03-13  8:24 ` [Buildroot] [PATCH v7 3/3] GNURadio: new package Gwenhael Goavec-Merou
2015-03-13 21:53   ` Thomas Petazzoni
2015-03-13  9:49 ` [Buildroot] [PATCH v7 1/3] pkg-cmake: allow to build package in a subdirectory Samuel Martin
2015-03-13 21:49 ` Thomas Petazzoni

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