All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR
@ 2018-10-11  9:57 Lionel Orry
  2018-10-11  9:57 ` [Buildroot] [PATCH v2 2/4] pkg-meson: <pkg>_SUBDIR cleanup Lionel Orry
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Lionel Orry @ 2018-10-11  9:57 UTC (permalink / raw)
  To: buildroot

In the Buildroot manual, it is specified that the Waf-based
infrastructure supports the <pkg>_SUBDIR variable, which was not true.

This patch:
* makes use of this variable by changing to the given sub-directory
  before executing waf commands,
* documents the usage of <pkg>_SUBDIR in the waf-specific section of
  the manual.

Signed-off-by: Lionel Orry <lionel.orry@gmail.com>

---
Changes v1 -> v2:
  - remove redundant definition of <pkg>_SRCDIR definition in pkg-waf.mk
  - adds <pkg>_SUBDIR documentation in the waf section of the manual
---
 docs/manual/adding-packages-waf.txt | 6 ++++++
 package/pkg-waf.mk                  | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/docs/manual/adding-packages-waf.txt b/docs/manual/adding-packages-waf.txt
index 43b557c070..208dacc63d 100644
--- a/docs/manual/adding-packages-waf.txt
+++ b/docs/manual/adding-packages-waf.txt
@@ -60,6 +60,12 @@ the generic infrastructure also exist in the Waf infrastructure:
 An additional variable, specific to the Waf infrastructure, can
 also be defined.
 
+* +LIBFOO_SUBDIR+ may contain the name of a subdirectory inside the
+  package that contains the main wscript file. This is useful,
+  if for example, the main wscript file is not at the root of
+  the tree extracted by the tarball. If +HOST_LIBFOO_SUBDIR+ is not
+  specified, it defaults to +LIBFOO_SUBDIR+.
+
 * +LIBFOO_NEEDS_EXTERNAL_WAF+ can be set to +YES+ or +NO+ to tell
   Buildroot to use the bundled +waf+ executable. If set to +NO+, the
   default, then Buildroot will use the waf executable provided in the
diff --git a/package/pkg-waf.mk b/package/pkg-waf.mk
index 3288dd63a0..a32d5dab33 100644
--- a/package/pkg-waf.mk
+++ b/package/pkg-waf.mk
@@ -60,7 +60,7 @@ $(2)_WAF_OPTS				?=
 #
 ifndef $(2)_CONFIGURE_CMDS
 define $(2)_CONFIGURE_CMDS
-	cd $$(@D) && \
+	cd $$($$(PKG)_SRCDIR) && \
 	$$(TARGET_CONFIGURE_OPTS) \
 	$$($(2)_CONF_ENV) \
 	$$(HOST_DIR)/bin/python2 $$($(2)_WAF) configure \
@@ -77,7 +77,7 @@ endif
 #
 ifndef $(2)_BUILD_CMDS
 define $(2)_BUILD_CMDS
-	cd $$(@D) && \
+	cd $$($$(PKG)_SRCDIR) && \
 	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
 		build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS) \
 		$$($(2)_WAF_OPTS)
@@ -90,7 +90,7 @@ endif
 #
 ifndef $(2)_INSTALL_STAGING_CMDS
 define $(2)_INSTALL_STAGING_CMDS
-	cd $$(@D) && \
+	cd $$($$(PKG)_SRCDIR) && \
 	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
 		install --destdir=$$(STAGING_DIR) \
 		$$($(2)_INSTALL_STAGING_OPTS) \
@@ -104,7 +104,7 @@ endif
 #
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
-	cd $$(@D) && \
+	cd $$($$(PKG)_SRCDIR) && \
 	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/bin/python2 $$($(2)_WAF) \
 		install --destdir=$$(TARGET_DIR) \
 		$$($(2)_INSTALL_TARGET_OPTS) \
-- 
2.19.1

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

* [Buildroot] [PATCH v2 2/4] pkg-meson: <pkg>_SUBDIR cleanup
  2018-10-11  9:57 [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Lionel Orry
@ 2018-10-11  9:57 ` Lionel Orry
  2018-10-11  9:57 ` [Buildroot] [PATCH v2 3/4] pkg-python: " Lionel Orry
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Lionel Orry @ 2018-10-11  9:57 UTC (permalink / raw)
  To: buildroot

No functional change is brought by this modification.

This patch:
* removes a redundant <pkg>_SRCDIR declaration (already defined in
  pkg-generic.mk)
* documents the usage of <pkg>_SUBDIR in the meson-specific section of
  the manual.

Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
---
 docs/manual/adding-packages-meson.txt | 6 ++++++
 package/pkg-meson.mk                  | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/manual/adding-packages-meson.txt b/docs/manual/adding-packages-meson.txt
index c52fe10506..a0f64ba09e 100644
--- a/docs/manual/adding-packages-meson.txt
+++ b/docs/manual/adding-packages-meson.txt
@@ -85,6 +85,12 @@ A few additional variables, specific to the Meson infrastructure, can also be
 defined. Many of them are only useful in very specific cases, typical packages
 will therefore only use a few of them.
 
+* +FOO_SUBDIR+ may contain the name of a subdirectory inside the
+  package that contains the main meson.build file. This is useful,
+  if for example, the main meson.build file is not at the root of
+  the tree extracted by the tarball. If +HOST_FOO_SUBDIR+ is not
+  specified, it defaults to +FOO_SUBDIR+.
+
 * +FOO_CONF_ENV+, to specify additional environment variables to pass to
   +meson+ for the configuration step. By default, empty.
 
diff --git a/package/pkg-meson.mk b/package/pkg-meson.mk
index 507e686068..5f2955b460 100644
--- a/package/pkg-meson.mk
+++ b/package/pkg-meson.mk
@@ -48,7 +48,6 @@ define inner-meson-package
 $(2)_CONF_ENV		?=
 $(2)_CONF_OPTS		?=
 $(2)_NINJA_ENV		?=
-$(2)_SRCDIR		= $$($(2)_DIR)/$$($(2)_SUBDIR)
 
 #
 # Configure step. Only define it if not already defined by the package
-- 
2.19.1

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

* [Buildroot] [PATCH v2 3/4] pkg-python: <pkg>_SUBDIR cleanup
  2018-10-11  9:57 [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Lionel Orry
  2018-10-11  9:57 ` [Buildroot] [PATCH v2 2/4] pkg-meson: <pkg>_SUBDIR cleanup Lionel Orry
@ 2018-10-11  9:57 ` Lionel Orry
  2018-10-11  9:57 ` [Buildroot] [PATCH v2 4/4] pkg-cmake: " Lionel Orry
  2018-10-11 12:49 ` [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Arnout Vandecappelle
  3 siblings, 0 replies; 6+ messages in thread
From: Lionel Orry @ 2018-10-11  9:57 UTC (permalink / raw)
  To: buildroot

No functional change is brought by this modification.

This patch:
* removes redundant <pkg>_SRCDIR and <pkg>_BUILDDIR declarations
  (already defined in pkg-generic.mk)
* documents the usage of <pkg>_SUBDIR in the python-specific section of
  the manual.

Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
---
 docs/manual/adding-packages-python.txt | 6 ++++++
 package/pkg-python.mk                  | 3 ---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/docs/manual/adding-packages-python.txt b/docs/manual/adding-packages-python.txt
index 5eb6ba51b1..15137cfd6d 100644
--- a/docs/manual/adding-packages-python.txt
+++ b/docs/manual/adding-packages-python.txt
@@ -113,6 +113,12 @@ optionally be defined, depending on the package's needs. Many of them
 are only useful in very specific cases, typical packages will
 therefore only use a few of them, or none.
 
+* +PYTHON_FOO_SUBDIR+ may contain the name of a subdirectory inside the
+  package that contains the main +setup.py+ file. This is useful,
+  if for example, the main +setup.py+ file is not at the root of
+  the tree extracted by the tarball. If +HOST_PYTHON_FOO_SUBDIR+ is not
+  specified, it defaults to +PYTHON_FOO_SUBDIR+.
+
 * +PYTHON_FOO_ENV+, to specify additional environment variables to
   pass to the Python +setup.py+ script (for both the build and install
   steps). Note that the infrastructure is automatically passing
diff --git a/package/pkg-python.mk b/package/pkg-python.mk
index f57e486dad..831bcacfad 100644
--- a/package/pkg-python.mk
+++ b/package/pkg-python.mk
@@ -101,9 +101,6 @@ HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
 
 define inner-python-package
 
-$(2)_SRCDIR	= $$($(2)_DIR)/$$($(2)_SUBDIR)
-$(2)_BUILDDIR	= $$($(2)_SRCDIR)
-
 $(2)_ENV         ?=
 $(2)_BUILD_OPTS   ?=
 $(2)_INSTALL_OPTS ?=
-- 
2.19.1

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

* [Buildroot] [PATCH v2 4/4] pkg-cmake: <pkg>_SUBDIR cleanup
  2018-10-11  9:57 [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Lionel Orry
  2018-10-11  9:57 ` [Buildroot] [PATCH v2 2/4] pkg-meson: <pkg>_SUBDIR cleanup Lionel Orry
  2018-10-11  9:57 ` [Buildroot] [PATCH v2 3/4] pkg-python: " Lionel Orry
@ 2018-10-11  9:57 ` Lionel Orry
  2018-10-11 12:49 ` [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Arnout Vandecappelle
  3 siblings, 0 replies; 6+ messages in thread
From: Lionel Orry @ 2018-10-11  9:57 UTC (permalink / raw)
  To: buildroot

No functional change is brought by this modification.

This patch removes redundant <pkg>_SRCDIR declaration
  (already defined in pkg-generic.mk)

Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
---
 package/pkg-cmake.mk | 2 --
 1 file changed, 2 deletions(-)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 51a1929ebb..b9ce8ff622 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -60,8 +60,6 @@ $(2)_INSTALL_OPTS		?= install
 $(2)_INSTALL_STAGING_OPTS	?= DESTDIR=$$(STAGING_DIR) install/fast
 $(2)_INSTALL_TARGET_OPTS		?= DESTDIR=$$(TARGET_DIR) install/fast
 
-$(2)_SRCDIR			= $$($(2)_DIR)/$$($(2)_SUBDIR)
-
 $(3)_SUPPORTS_IN_SOURCE_BUILD ?= YES
 
 
-- 
2.19.1

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

* [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR
  2018-10-11  9:57 [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Lionel Orry
                   ` (2 preceding siblings ...)
  2018-10-11  9:57 ` [Buildroot] [PATCH v2 4/4] pkg-cmake: " Lionel Orry
@ 2018-10-11 12:49 ` Arnout Vandecappelle
  2018-10-11 12:58   ` Lionel Orry
  3 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle @ 2018-10-11 12:49 UTC (permalink / raw)
  To: buildroot



On 11/10/18 11:57, Lionel Orry wrote:
> diff --git a/package/pkg-waf.mk b/package/pkg-waf.mk
> index 3288dd63a0..a32d5dab33 100644
> --- a/package/pkg-waf.mk
> +++ b/package/pkg-waf.mk
> @@ -60,7 +60,7 @@ $(2)_WAF_OPTS				?=
>  #
>  ifndef $(2)_CONFIGURE_CMDS
>  define $(2)_CONFIGURE_CMDS
> -	cd $$(@D) && \
> +	cd $$($$(PKG)_SRCDIR) && \

 A little mistake on Thomas's part: this should be $$($$(PKG)_BUILDDIR), not
$$($$(PKG)_SRCDIR). They are currently the same, but the idea is to introduce
the possibility to do out-of-tree builds and to reuse the same source directory
for host and target, and also for packages that share their source trees.


 Regards,
 Arnout

>  	$$(TARGET_CONFIGURE_OPTS) \
>  	$$($(2)_CONF_ENV) \
>  	$$(HOST_DIR)/bin/python2 $$($(2)_WAF) configure \

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

* [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR
  2018-10-11 12:49 ` [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Arnout Vandecappelle
@ 2018-10-11 12:58   ` Lionel Orry
  0 siblings, 0 replies; 6+ messages in thread
From: Lionel Orry @ 2018-10-11 12:58 UTC (permalink / raw)
  To: buildroot

Hi Arnout,
On Thu, Oct 11, 2018 at 2:49 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 11/10/18 11:57, Lionel Orry wrote:
> > diff --git a/package/pkg-waf.mk b/package/pkg-waf.mk
> > index 3288dd63a0..a32d5dab33 100644
> > --- a/package/pkg-waf.mk
> > +++ b/package/pkg-waf.mk
> > @@ -60,7 +60,7 @@ $(2)_WAF_OPTS                               ?=
> >  #
> >  ifndef $(2)_CONFIGURE_CMDS
> >  define $(2)_CONFIGURE_CMDS
> > -     cd $$(@D) && \
> > +     cd $$($$(PKG)_SRCDIR) && \
>
>  A little mistake on Thomas's part: this should be $$($$(PKG)_BUILDDIR), not
> $$($$(PKG)_SRCDIR). They are currently the same, but the idea is to introduce
> the possibility to do out-of-tree builds and to reuse the same source directory
> for host and target, and also for packages that share their source trees.

Actually in the case of waf, one needs to change to the directory
where the 'wscript' file is located, not in the directory where the
build output files are going to be generated.
By default, waf generates its output in a 'build/' subfolder relative
to the wscript, but this can be overriden in the wscript file and
using a command-line option as well.
So I believe we really want to change into $$($$(PKG)_SRCDIR). Do you agree?

>
>
>  Regards,
>  Arnout
>
> >       $$(TARGET_CONFIGURE_OPTS) \
> >       $$($(2)_CONF_ENV) \
> >       $$(HOST_DIR)/bin/python2 $$($(2)_WAF) configure \
>
> --
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

end of thread, other threads:[~2018-10-11 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-11  9:57 [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Lionel Orry
2018-10-11  9:57 ` [Buildroot] [PATCH v2 2/4] pkg-meson: <pkg>_SUBDIR cleanup Lionel Orry
2018-10-11  9:57 ` [Buildroot] [PATCH v2 3/4] pkg-python: " Lionel Orry
2018-10-11  9:57 ` [Buildroot] [PATCH v2 4/4] pkg-cmake: " Lionel Orry
2018-10-11 12:49 ` [Buildroot] [PATCH v2 1/4] pkg-waf: add support for <pkg>_SUBDIR Arnout Vandecappelle
2018-10-11 12:58   ` Lionel Orry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.