core: add waf-package infra, convert packages
cover core: add waf-package infra, convert packages
Hello All!
This series introduces the waf-package infrastructure for packages based on the Waf buildsystem.
Then, packages using Waf are converted to use this new infra, except for samba4 which only uses it for configure, not for build.
The converted packages still build fine with this defconfig:
BR2_arm=y
BR2_cortex_a7=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_PACKAGE_GSTREAMER1=y
BR2_PACKAGE_GST1_IMX=y
BR2_PACKAGE_JACK2=y
BR2_PACKAGE_MPV=y
BR2_PACKAGE_GLMARK2=y
BR2_PACKAGE_MESA3D=y
BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4=y
BR2_PACKAGE_MESA3D_OPENGL_EGL=y
BR2_PACKAGE_MESA3D_OPENGL_ES=y
BR2_PACKAGE_FREESCALE_IMX=y
BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q=y
BR2_PACKAGE_LIBIMXVPUAPI=y
BR2_PACKAGE_NORM=yExcept for these platitudes, nothing interesting to state about this new infra; it is pretty straightforward...
Thanks to Romain for early review. ;-)
Regards,
Yann E. MORIN.
The following changes since commit 5f1e0e688bba9b94287302258afdfacd6e6344e2
trinity: fix Config.in depends on logic (2016-10-30 16:42:16 +0100)
are available in the git repository at:
git://git.buildroot.org/~ymorin/git/buildroot.git
for you to fetch changes up to f821d5032f417f98141d6fb30f92c28feb16d2e0
package/norm: make it a waf-package (2016-10-30 17:00:52 +0100)
----------------------------------------------------------------
Yann E. MORIN (10):
package/waf: new host package
core: add waf-package infra
docs/manual: document the waf-package infra
developpers: add myself as pkg-waf devel
package/glmark2: make it a waf-package
package/gst1-imx: make it a waf-package
package/jack2: make it a waf-package
package/libimxvpuapi: make it a waf-package
package/mpv: make it a waf-package
package/norm: make it a waf-package
DEVELOPERS | 1 + docs/manual/adding-packages-waf.txt | 67 ++++++++++++++++++ docs/manual/adding-packages.txt | 2 + package/Makefile.in | 1 + package/glmark2/glmark2.mk | 20 +----- package/gstreamer1/gst1-imx/gst1-imx.mk | 20 +----- package/jack2/jack2.mk | 34 +-------- package/libimxvpuapi/libimxvpuapi.mk | 23 +----- package/mpv/mpv.hash | 1 - package/mpv/mpv.mk | 30 +------- package/norm/norm.mk | 28 +------- package/pkg-waf.mk | 119 ++++++++++++++++++++++++++++++++ package/waf/waf.hash | 3 + package/waf/waf.mk | 28 ++++++++ 14 files changed, 234 insertions(+), 143 deletions(-) create mode 100644 docs/manual/adding-packages-waf.txt create mode 100644 package/pkg-waf.mk create mode 100644 package/waf/waf.hash create mode 100644 package/waf/waf.mk
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 1/10 package/waf: new host package
host-waf will be used by waf-based packages that do not include it in their release tarballs, like mpv.
mpv is currently the only case we have, but with the upcoming waf-package infra, having host-waf available just makes the infra complete from the onset.
--- package/waf/waf.hash | 3 +++ package/waf/waf.mk | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 package/waf/waf.hash create mode 100644 package/waf/waf.mk
package/waf/waf.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally computed +sha1 33d170c738ed8c92dda2945b445272972f558244 waf-1.9.5 +sha256 101f14e0f47a6410c00b8feda094948516cd3989491c56eb8268907fcd164909 waf-1.9.5
package/waf/waf.mk new file +28 -0
@@ -0,0 +1,28 @@ +################################################################################ +# +# waf +# +################################################################################ + +WAF_VERSION = 1.9.5 +WAF_SOURCE = waf-$(WAF_VERSION) +WAF_SITE = https://waf.io/ + +# Waf is a python script, compatible with any python >= 2.6, but some +# packages have wafscripts not compatible with python3. So always use +# python2. +# +# We don't really need host-python to install host-waf, but having this +# dependency here will hide it from packages themselves +HOST_WAF_DEPENDENCIES = host-python + +# Not really needed, but here for consistency with other packages. +define HOST_WAF_EXTRACT_CMDS + $(INSTALL) -D -m 0755 $(DL_DIR)/waf-$(WAF_VERSION) $(@D)/waf +endef + +define HOST_WAF_INSTALL_CMDS + $(INSTALL) -D -m 0755 $(@D)/waf $(HOST_DIR)/usr/bin/waf +endef + +$(eval $(host-generic-package))
Signature · 1 line
2.7.4
PATCH 1/10 package/waf: new host package
Hi Yann,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 9 lines
host-waf will be used by waf-based packages that do not include it in their release tarballs, like mpv.
mpv is currently the only case we have, but with the upcoming waf-package infra, having host-waf available just makes the infra complete from the onset.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Romain Naour <[email protected]>
Best regards,
Romain
Quoted 51 lines
--- package/waf/waf.hash | 3 +++ package/waf/waf.mk | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 package/waf/waf.hash create mode 100644 package/waf/waf.mkpackage/waf/waf.hash new file +3
-0@@ -0,0 +1,3 @@ +# Locally computed +sha1 33d170c738ed8c92dda2945b445272972f558244 waf-1.9.5 +sha256 101f14e0f47a6410c00b8feda094948516cd3989491c56eb8268907fcd164909 waf-1.9.5package/waf/waf.mk new file +28
-0@@ -0,0 +1,28 @@ +################################################################################ +# +# waf +# +################################################################################ + +WAF_VERSION = 1.9.5 +WAF_SOURCE = waf-$(WAF_VERSION) +WAF_SITE = https://waf.io/ + +# Waf is a python script, compatible with any python >= 2.6, but some +# packages have wafscripts not compatible with python3. So always use +# python2. +# +# We don't really need host-python to install host-waf, but having this +# dependency here will hide it from packages themselves +HOST_WAF_DEPENDENCIES = host-python + +# Not really needed, but here for consistency with other packages. +define HOST_WAF_EXTRACT_CMDS + $(INSTALL) -D -m 0755 $(DL_DIR)/waf-$(WAF_VERSION) $(@D)/waf +endef + +define HOST_WAF_INSTALL_CMDS + $(INSTALL) -D -m 0755 $(@D)/waf $(HOST_DIR)/usr/bin/waf +endef + +$(eval $(host-generic-package))
PATCH 1/10 package/waf: new host package
In reply to Yann E. MORINHello,
package/waf/waf.mk line 17
Quoted 11 lines · Yann E. MORIN
package/waf/waf.mk new file +11
-0+WAF_VERSION = 1.9.5 +WAF_SOURCE = waf-$(WAF_VERSION) +WAF_SITE = https://waf.io/ + +# Waf is a python script, compatible with any python >= 2.6, but some +# packages have wafscripts not compatible with python3. So always use +# python2. +# +# We don't really need host-python to install host-waf, but having this +# dependency here will hide it from packages themselves +HOST_WAF_DEPENDENCIES = host-python
As we discussed during the review, and I think as the general consensus was, I've dropped this dependency: the infra is responsible for it.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 2/10 core: add waf-package infra
In reply to Yann E. MORINThis new waf-package infrastructure simplifies writing waf-based packages. It can be used by our six current such packages, plus a later-incoming one by Romain.
--- package/Makefile.in | 1 + package/pkg-waf.mk | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 package/pkg-waf.mk
package/Makefile.in +1 -0
@@ -398,3 +398,4 @@ include package/pkg-generic.mk include package/pkg-kconfig.mk include package/pkg-rebar.mk include package/pkg-kernel-module.mk +include package/pkg-waf.mk
package/pkg-waf.mk new file +119 -0
119 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 2/10 core: add waf-package infra
Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 6 lines
This new waf-package infrastructure simplifies writing waf-based packages. It can be used by our six current such packages, plus a later-incoming one by Romain.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Romain Naour <[email protected]>
Quoted 141 lines
--- package/Makefile.in | 1 + package/pkg-waf.mk | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 package/pkg-waf.mkpackage/Makefile.in +1
-0@@ -398,3 +398,4 @@ include package/pkg-generic.mk include package/pkg-kconfig.mk include package/pkg-rebar.mk include package/pkg-kernel-module.mk +include package/pkg-waf.mkpackage/pkg-waf.mk new file +119
-0@@ -0,0 +1,119 @@ +################################################################################ +# WAF package infrastructure +# +# This file implements an infrastructure that eases development of package +# .mk files for WAF packages. It should be used for all packages that use +# WAF as their build system. +# +# See the Buildroot documentation for details on the usage of this +# infrastructure +# +# In terms of implementation, this WAF infrastructure requires the .mk file +# to only specify metadata information about the package: name, version, +# download URL, etc. +# +# We still allow the package .mk file to override what the different steps +# are doing, if needed. For example, if <PKG>_BUILD_CMDS is already defined, +# it is used as the list of commands to perform to build the package, +# instead of the default WAF behaviour. The package can also define some +# post operation hooks. +# +################################################################################ + +################################################################################ +# inner-waf-package -- defines how the configuration, compilation and +# installation of a waf package should be done, implements a few hooks +# to tune the build process for waf specifities and calls the generic +# package infrastructure to generate the necessary make targets +# +# argument 1 is the lowercase package name +# argument 2 is the uppercase package name, including a HOST_ prefix +# for host packages +# argument 3 is the uppercase package name, without the HOST_ prefix +# for host packages +# argument 4 is the type (target or host) +################################################################################ + +define inner-waf-package + +# If the package does not have its own waf, use our own. +ifeq ($$($(2)_BUNDLED_WAF),NO) +# Dependency on host-python is done by host-waf +$(2)_DEPENDENCIES += host-waf +$(2)_WAF = $(HOST_DIR)/usr/bin/waf +else +# We need host-python to run the package's waf +$(2)_DEPENDENCIES += host-python +$(2)_WAF = ./waf +endif + +ifndef $(2)_MAKE + ifdef $(3)_MAKE + $(2)_MAKE = $$($(3)_MAKE) + else + $(2)_MAKE ?= $$(MAKE) + endif +endif + +# +# Configure step. Only define it if not already defined by the package +# .mk file. +# +ifndef $(2)_CONFIGURE_CMDS +define $(2)_CONFIGURE_CMDS + cd $$(@D) && \ + $$(TARGET_CONFIGURE_OPTS) \ + $$($(2)_CONF_ENV) \ + $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) configure \ + --prefix=/usr \ + --libdir=/usr/lib \ + $$($(2)_CONF_OPTS) +endef +endif + +# +# Build step. Only define it if not already defined by the package .mk +# file. +# +ifndef $(2)_BUILD_CMDS +define $(2)_BUILD_CMDS + cd $$(@D) && \ + $$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) build -j $$(PARALLEL_JOBS) +endef +endif + +# +# Staging installation step. Only define it if not already defined by +# the package .mk file. +# +ifndef $(2)_INSTALL_STAGING_CMDS +define $(2)_INSTALL_STAGING_CMDS + cd $$(@D) && \ + $$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \ + install --destdir=$$(STAGING_DIR) +endef +endif + +# +# Target installation step. Only define it if not already defined by +# the package .mk file. +# +ifndef $(2)_INSTALL_TARGET_CMDS +define $(2)_INSTALL_TARGET_CMDS + cd $$(@D) && \ + $$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \ + install --destdir=$$(TARGET_DIR) +endef +endif + +# Call the generic package infrastructure to generate the necessary +# make targets +$(call inner-generic-package,$(1),$(2),$(3),$(4)) + +endef + +################################################################################ +# waf-package -- the target generator macro for WAF packages +################################################################################ + +waf-package = $(call inner-waf-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
PATCH 2/10 core: add waf-package infra
In reply to Yann E. MORINHello,
Quoted 6 lines · Yann E. MORIN
This new waf-package infrastructure simplifies writing waf-based packages. It can be used by our six current such packages, plus a later-incoming one by Romain.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Romain Naour <[email protected]>
I am generally happy with the whole series, I just have a few comments on this specific patch, which are mainly questions. We discussed them on IRC, but I'd like to raise the questions here as well, in case people have some opinions.
If nobody gives some feedback, then I'm going to apply the series.
package/pkg-waf.mk line 40
Quoted 2 lines
package/pkg-waf.mk new file +2
-0+# If the package does not have its own waf, use our own. +ifeq ($$($(2)_BUNDLED_WAF),NO)
Where is the default value of this variable defined? It seems it's not defined anywhere, while it should be set to "YES".
However, what I dislike a bit is the slightly "negative" logic of this variable. By default, we assume packages have their bundled version of waf, so this variable is by default assumed to be set to "YES" (even though in fact it's empty).
Only packages that do *NOT* have a bundled version of waf can set <pkg>_BUNDLED_WAF = NO, to tell the infrastructure to add a dependency on host-waf.
To me it feels a bit weird to:
1. Have a boolean that defaults to YES and that can be overridden to NO. I generally expects the opposite.
2. Have a boolean that when set to "NO" actually asks the infrastructure to do more things. I generally expects the opposite.
So, ideally, I'd like to invert this variable, but I can't really find a good name for it.
I propose <pkg>_NEEDS_WAF on IRC, but I'm not convinced because all packages need waf, either bundled or external. <pkg>_NEEDS_EXTERNAL_WAF ?
Anyone has some other proposal ?
package/pkg-waf.mk line 48
Quoted 8 lines
package/pkg-waf.mk new file +8
-0+# Dependency on host-python is done by host-waf +$(2)_DEPENDENCIES += host-waf +$(2)_WAF = $(HOST_DIR)/usr/bin/waf +else +# We need host-python to run the package's waf +$(2)_DEPENDENCIES += host-python +$(2)_WAF = ./waf +endif
Here another point where I'm hesitating. host-waf doesn't really need to build-depend on host-python. It's *running* host-waf that requires host-python. So I'm wondering if we shouldn't:
1. Remove the host-python dependency from host-waf
2. In the first case above (no bundled waf), add to the package a dependency on host-waf *and* host-python.
On IRC, you suggested that packages that depend on host-waf should not have to know host-python is needed to run it, which is fair point.
So I'm opening the question to others.
package/pkg-waf.mk line 56
Quoted 7 lines
package/pkg-waf.mk new file +7
-0+ifndef $(2)_MAKE + ifdef $(3)_MAKE + $(2)_MAKE = $$($(3)_MAKE) + else + $(2)_MAKE ?= $$(MAKE) + endif +endif
Is $(2)_MAKE used anywhere in this infrastructure?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 2/10 core: add waf-package infra
Thomas, All,
On 2016-11-17 00:02 +0100, Thomas Petazzoni spake thusly:
Quoted 5 lines · Yann E. MORIN
Quoted 4 lines
This new waf-package infrastructure simplifies writing waf-based packages. It can be used by our six current such packages, plus a later-incoming one by Romain.
Quoted 7 lines
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Romain Naour <[email protected]>I am generally happy with the whole series, I just have a few comments on this specific patch, which are mainly questions. We discussed them on IRC, but I'd like to raise the questions here as well, in case people have some opinions.
My answers below...
Quoted 1 line
If nobody gives some feedback, then I'm going to apply the series.
:-)
Quoted 5 lines
package/pkg-waf.mk line 40
Quoted 2 lines
package/pkg-waf.mk new file +2
-0+# If the package does not have its own waf, use our own. +ifeq ($$($(2)_BUNDLED_WAF),NO)Where is the default value of this variable defined? It seems it's not defined anywhere, while it should be set to "YES".
We don't really need to set a default, because we're not testing the default. We're only testing if it was set by the package.
Quoted 17 lines
However, what I dislike a bit is the slightly "negative" logic of this variable. By default, we assume packages have their bundled version of waf, so this variable is by default assumed to be set to "YES" (even though in fact it's empty).
Only packages that do *NOT* have a bundled version of waf can set <pkg>_BUNDLED_WAF = NO, to tell the infrastructure to add a dependency on host-waf.
To me it feels a bit weird to:
1. Have a boolean that defaults to YES and that can be overridden to NO. I generally expects the opposite.
2. Have a boolean that when set to "NO" actually asks the infrastructure to do more things. I generally expects the opposite.
Quoted 6 lines
So, ideally, I'd like to invert this variable, but I can't really find a good name for it.
I propose <pkg>_NEEDS_WAF on IRC, but I'm not convinced because all packages need waf, either bundled or external. <pkg>_NEEDS_EXTERNAL_WAF ?
That last one is OK for me.
Quoted 15 lines
Anyone has some other proposal ?
package/pkg-waf.mk line 48
Quoted 8 lines
package/pkg-waf.mk new file +8
-0+# Dependency on host-python is done by host-waf +$(2)_DEPENDENCIES += host-waf +$(2)_WAF = $(HOST_DIR)/usr/bin/waf +else +# We need host-python to run the package's waf +$(2)_DEPENDENCIES += host-python +$(2)_WAF = ./waf +endifHere another point where I'm hesitating. host-waf doesn't really need to build-depend on host-python. It's *running* host-waf that requires host-python. So I'm wondering if we shouldn't:
Quoted 7 lines
1. Remove the host-python dependency from host-waf
2. In the first case above (no bundled waf), add to the package a dependency on host-waf *and* host-python.
On IRC, you suggested that packages that depend on host-waf should not have to know host-python is needed to run it, which is fair point.
Yes, I followed the same as we do with AUTORECONF: we automatically add host-automake, host-autoconf, host-libtool and, if needed, host-gettext. Packages need not add them as they are dependencies of their build systems (autotools), not their own dependencies. The only exceptions being packages that do need libtool for themselves (for libltdl).
Same goes for host-python: it is a dependency of the build system, not of the package, so it should go in the infra.
Quoted 11 lines
So I'm opening the question to others.
package/pkg-waf.mk line 56
Quoted 7 lines
package/pkg-waf.mk new file +7
-0+ifndef $(2)_MAKE + ifdef $(3)_MAKE + $(2)_MAKE = $$($(3)_MAKE) + else + $(2)_MAKE ?= $$(MAKE) + endif +endifIs $(2)_MAKE used anywhere in this infrastructure?
Not used. I initially added it because I did contemplate converting samba4 as well, but it does not make sense to have such support for a single package, so I backed off. I just forgot to remove this hunk.
Quoted 5 lines
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 2/10 core: add waf-package infra
Quoted 4 lines · Yann E. MORIN
Thomas, All,
On 2016-11-17 00:02 +0100, Thomas Petazzoni spake thusly:
Quoted 1 line · Yann E. MORIN
[snip]
Quoted 8 lines
Quoted 5 lines
package/pkg-waf.mk line 40
Quoted 2 lines
package/pkg-waf.mk new file +2
-0+# If the package does not have its own waf, use our own. +ifeq ($$($(2)_BUNDLED_WAF),NO)Where is the default value of this variable defined? It seems it's not defined anywhere, while it should be set to "YES".
We don't really need to set a default, because we're not testing the default. We're only testing if it was set by the package.
We do set a default for all other YES/NO variables.
Regards,
Arnout
[snip]
Signature · 6 lines
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
PATCH 2/10 core: add waf-package infra
In reply to Thomas PetazzoniQuoted 3 lines · Thomas Petazzoni
Hello,
On Sun, 30 Oct 2016 17:02:13 +0100, Yann E. MORIN wrote:
[snip]
Quoted 15 lines
package/pkg-waf.mk line 40
Quoted 2 lines
package/pkg-waf.mk new file +2
-0+# If the package does not have its own waf, use our own. +ifeq ($$($(2)_BUNDLED_WAF),NO)Where is the default value of this variable defined? It seems it's not defined anywhere, while it should be set to "YES".
However, what I dislike a bit is the slightly "negative" logic of this variable. By default, we assume packages have their bundled version of waf, so this variable is by default assumed to be set to "YES" (even though in fact it's empty).
Only packages that do *NOT* have a bundled version of waf can set <pkg>_BUNDLED_WAF = NO, to tell the infrastructure to add a dependency on host-waf.
Quoted 7 lines
To me it feels a bit weird to:
1. Have a boolean that defaults to YES and that can be overridden to NO. I generally expects the opposite.
2. Have a boolean that when set to "NO" actually asks the infrastructure to do more things. I generally expects the opposite.
We have a bunch of these already: _INSTALL_TARGET, _LIBTOOL_PATCH,_REDISTRIBUTE, .... Actually, most of them default to YES and are overridden as NO. It's just that the most popular one (_INSTALL_STAGING) defaults to NO so you'd think that that one is the norm.
The only unusual thing here is that the condition checks for NO, while usually
the condition checks for YES. But turning it around we make it an ifneq which is also a negative.
So I'd keep it like this.
Quoted 22 lines
So, ideally, I'd like to invert this variable, but I can't really find a good name for it.
I propose <pkg>_NEEDS_WAF on IRC, but I'm not convinced because all packages need waf, either bundled or external. <pkg>_NEEDS_EXTERNAL_WAF ?
Anyone has some other proposal ?
package/pkg-waf.mk line 48
Quoted 8 lines
package/pkg-waf.mk new file +8
-0+# Dependency on host-python is done by host-waf +$(2)_DEPENDENCIES += host-waf +$(2)_WAF = $(HOST_DIR)/usr/bin/waf +else +# We need host-python to run the package's waf +$(2)_DEPENDENCIES += host-python +$(2)_WAF = ./waf +endifHere another point where I'm hesitating. host-waf doesn't really need to build-depend on host-python. It's *running* host-waf that requires host-python. So I'm wondering if we shouldn't:
Quoted 7 lines
1. Remove the host-python dependency from host-waf
2. In the first case above (no bundled waf), add to the package a dependency on host-waf *and* host-python.
On IRC, you suggested that packages that depend on host-waf should not have to know host-python is needed to run it, which is fair point.
Well, it makes sense to me that a package infra does something like that, but
less so that the waf package itself would do it. And it's just simpler if the dependency is only in the infra.
However, I wonder if we need this dependency at all. We already require a
python (although admittedly we don't check the version). The few packages that don't support python3 can add the dependency themselves. Building host-python really eats into the build time...
Regards,
Arnout
Quoted 15 lines
So I'm opening the question to others.
package/pkg-waf.mk line 56
Quoted 7 lines
package/pkg-waf.mk new file +7
-0+ifndef $(2)_MAKE + ifdef $(3)_MAKE + $(2)_MAKE = $$($(3)_MAKE) + else + $(2)_MAKE ?= $$(MAKE) + endif +endifIs $(2)_MAKE used anywhere in this infrastructure?
Thomas
Signature · 6 lines
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
PATCH 2/10 core: add waf-package infra
Hello,
Quoted 8 lines · Arnout Vandecappelle
Well, it makes sense to me that a package infra does something like that, but
less so that the waf package itself would do it. And it's just simpler if the dependency is only in the infra.However, I wonder if we need this dependency at all. We already require a
python (although admittedly we don't check the version). The few packages that don't support python3 can add the dependency themselves. Building host-python really eats into the build time...
Is waf python2/python3 compliant?
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 2/10 core: add waf-package infra
Hi all,
Quoted 11 lines · Thomas Petazzoni
Hello,
Quoted 1 line · Arnout Vandecappelle
Well, it makes sense to me that a package infra does something like
that, but
Quoted 1 line
less so that the waf package itself would do it. And it's just simpler
if the
Quoted 3 lines
dependency is only in the infra.
However, I wonder if we need this dependency at all. We already require
Quoted 9 lines
a
Quoted 1 line
python (although admittedly we don't check the version). The few
packages that
Quoted 1 line
don't support python3 can add the dependency themselves. Building
host-python
Quoted 1 line
really eats into the build time...
Is waf python2/python3 compliant?
?Yes, see here : https://waf.io/book/#_how_to_run_waf?
AFAIK, there is an internal wrapper to make code compatible with both versions (https://github.com/waf-project/waf/blob/master/waflib/fixpy2.py).
Quoted 11 lines
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
?Kind regards,
Lionel?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20161125/9336784e/attachment.html>
PATCH 2/10 core: add waf-package infra
In reply to Yann E. MORINHello,
package/pkg-waf.mk line 40
Quoted 2 lines · Yann E. MORIN
package/pkg-waf.mk new file +2
-0+# If the package does not have its own waf, use our own. +ifeq ($$($(2)_BUNDLED_WAF),NO)
I've renamed this variable to _NEEDS_EXTERNAL_WAF, which inverts its logic. It's explicitly defined to NO by default, and when set to YES, a dependency on host-waf is needed.
package/pkg-waf.mk line 46
Quoted 6 lines
package/pkg-waf.mk new file +6
-0+# Dependency on host-python is done by host-waf +$(2)_DEPENDENCIES += host-waf +$(2)_WAF = $(HOST_DIR)/usr/bin/waf +else +# We need host-python to run the package's waf +$(2)_DEPENDENCIES += host-python
This line has been moved out of the condition, since it's now needed for both the "bundled waf" and "external waf" cases.
package/pkg-waf.mk line 56
Quoted 7 lines
package/pkg-waf.mk new file +7
-0+ifndef $(2)_MAKE + ifdef $(3)_MAKE + $(2)_MAKE = $$($(3)_MAKE) + else + $(2)_MAKE ?= $$(MAKE) + endif +endif
I've dropped this as it wasn't needed.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 3/10 docs/manual: document the waf-package infra
In reply to Yann E. MORIN--- docs/manual/adding-packages-waf.txt | 67 +++++++++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 ++ 2 files changed, 69 insertions(+) create mode 100644 docs/manual/adding-packages-waf.txt
docs/manual/adding-packages-waf.txt new file +67 -0
@@ -0,0 +1,67 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +=== Infrastructure for Waf-based packages + +[[waf-package-tutorial]] + +==== +waf-package+ tutorial + +First, let's see how to write a +.mk+ file for a Waf-based package, with +an example : + +------------------------ +01: ################################################################################ +02: # +03: # libfoo +04: # +05: ################################################################################ +06: +07: LIBFOO_VERSION = 1.0 +08: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz +09: LIBFOO_SITE = http://www.foosoftware.org/download +10: LIBFOO_CONF_OPTS = --eanble-bar --disable-baz +11: LIBFOO_DEPENDENCIES = bar +12: +13: $(eval $(waf-package)) +------------------------ + +On line 7, we declare the version of the package. + +On line 8 and 9, we declare the name of the tarball (xz-ed tarball +recommended) and the location of the tarball on the Web. Buildroot +will automatically download the tarball from this location. + +On line 10, we tell Buildroot what options to enable for libfoo. + +On line 11, we tell Buildroot the depednencies of libfoo. + +Finally, on line line 13, we invoke the +waf-package+ +macro that generates all the Makefile rules that actually allows the +package to be built. + +[[waf-package-reference]] + +==== +waf-package+ reference + +The main macro of the Waf package infrastructure is +waf-package+. +It is similar to the +generic-package+ macro. + +Just like the generic infrastructure, the Waf infrastructure works +by defining a number of variables before calling the +waf-package+ +macro. + +First, all the package metadata information variables that exist in +the generic infrastructure also exist in the Waf infrastructure: ++LIBFOO_VERSION+, +LIBFOO_SOURCE+, +LIBFOO_PATCH+, +LIBFOO_SITE+, ++LIBFOO_SUBDIR+, +LIBFOO_DEPENDENCIES+, +LIBFOO_INSTALL_STAGING+, ++LIBFOO_INSTALL_TARGET+. + +An additional variable, specific to the Waf infrastructure, can +also be defined. + +* +LIBFOO_BUNDLED_WAF+ can be set to +YES+ or +NO+ to tell Buildroot to + use the bundled +waf+ executable. If set to +YES+, the default, then + Buildroot will use the waf executable in the package source tree; if + set to +NO+, then Buidlroot will download and install waf as a + host-tool.
docs/manual/adding-packages.txt +2 -0
@@ -29,6 +29,8 @@ include::adding-packages-kconfig.txt[] include::adding-packages-rebar.txt[] +include::adding-packages-waf.txt[] + include::adding-packages-kernel-module.txt[] include::adding-packages-asciidoc.txt[]
Signature · 1 line
2.7.4
PATCH 3/10 docs/manual: document the waf-package infra
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Romain Naour <[email protected]>
Best regards,
Romain
Quoted 93 lines
--- docs/manual/adding-packages-waf.txt | 67 +++++++++++++++++++++++++++++++++++++ docs/manual/adding-packages.txt | 2 ++ 2 files changed, 69 insertions(+) create mode 100644 docs/manual/adding-packages-waf.txtdocs/manual/adding-packages-waf.txt new file +67
-0@@ -0,0 +1,67 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +=== Infrastructure for Waf-based packages + +[[waf-package-tutorial]] + +==== +waf-package+ tutorial + +First, let's see how to write a +.mk+ file for a Waf-based package, with +an example : + +------------------------ +01: ################################################################################ +02: # +03: # libfoo +04: # +05: ################################################################################ +06: +07: LIBFOO_VERSION = 1.0 +08: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz +09: LIBFOO_SITE = http://www.foosoftware.org/download +10: LIBFOO_CONF_OPTS = --eanble-bar --disable-baz +11: LIBFOO_DEPENDENCIES = bar +12: +13: $(eval $(waf-package)) +------------------------ + +On line 7, we declare the version of the package. + +On line 8 and 9, we declare the name of the tarball (xz-ed tarball +recommended) and the location of the tarball on the Web. Buildroot +will automatically download the tarball from this location. + +On line 10, we tell Buildroot what options to enable for libfoo. + +On line 11, we tell Buildroot the depednencies of libfoo. + +Finally, on line line 13, we invoke the +waf-package+ +macro that generates all the Makefile rules that actually allows the +package to be built. + +[[waf-package-reference]] + +==== +waf-package+ reference + +The main macro of the Waf package infrastructure is +waf-package+. +It is similar to the +generic-package+ macro. + +Just like the generic infrastructure, the Waf infrastructure works +by defining a number of variables before calling the +waf-package+ +macro. + +First, all the package metadata information variables that exist in +the generic infrastructure also exist in the Waf infrastructure: ++LIBFOO_VERSION+, +LIBFOO_SOURCE+, +LIBFOO_PATCH+, +LIBFOO_SITE+, ++LIBFOO_SUBDIR+, +LIBFOO_DEPENDENCIES+, +LIBFOO_INSTALL_STAGING+, ++LIBFOO_INSTALL_TARGET+. + +An additional variable, specific to the Waf infrastructure, can +also be defined. + +* +LIBFOO_BUNDLED_WAF+ can be set to +YES+ or +NO+ to tell Buildroot to + use the bundled +waf+ executable. If set to +YES+, the default, then + Buildroot will use the waf executable in the package source tree; if + set to +NO+, then Buidlroot will download and install waf as a + host-tool.docs/manual/adding-packages.txt +2
-0@@ -29,6 +29,8 @@ include::adding-packages-kconfig.txt[] include::adding-packages-rebar.txt[] +include::adding-packages-waf.txt[] + include::adding-packages-kernel-module.txt[] include::adding-packages-asciidoc.txt[]
PATCH 3/10 docs/manual: document the waf-package infra
In reply to Yann E. MORINHello,
Quoted 11 lines · Yann E. MORIN
+------------------------
+01: ################################################################################ +02: #
+03: # libfoo
+04: #
+05: ################################################################################ +06:
+07:LIBFOO_VERSION= 1.0
+08:LIBFOO_SOURCE= libfoo-$(LIBFOO_VERSION).tar.gz
+09:LIBFOO_SITE= http://www.foosoftware.org/download
+10:LIBFOO_CONF_OPTS= --eanble-bar --disable-baz
eanble -> enable
docs/manual/adding-packages-waf.txt line 41
Quoted 13 lines
docs/manual/adding-packages-waf.txt new file +13
-0+On line 7, we declare the version of the package. + +On line 8 and 9, we declare the name of the tarball (xz-ed tarball +recommended) and the location of the tarball on the Web. Buildroot +will automatically download the tarball from this location. + +On line 10, we tell Buildroot what options to enable for libfoo. + +On line 11, we tell Buildroot the depednencies of libfoo. + +Finally, on line line 13, we invoke the +waf-package+ +macro that generates all the Makefile rules that actually allows the +package to be built.
To be honest, I'm wondering if we shouldn't refactor the manual. This blurb is duplicated for every package infrastructure, without adding much value.
But clearly that's a separate matter, and your patch is good as-is.
docs/manual/adding-packages-waf.txt line 64
Quoted 2 lines
docs/manual/adding-packages-waf.txt new file +2
-0+* +LIBFOO_BUNDLED_WAF+ can be set to +YES+ or +NO+ to tell Buildroot to + use the bundled +waf+ executable. If set to +YES+, the default, then
YES is in fact not the default :-)
docs/manual/adding-packages-waf.txt line 66
Quoted 2 lines
docs/manual/adding-packages-waf.txt new file +2
-0+ Buildroot will use the waf executable in the package source tree; if + set to +NO+, then Buidlroot will download and install waf as a
Buildroot.
Quoted 1 line
+ host-tool.
host tool (i.e no dash in between).
No need to resend for these issues, I can fixup when applying.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 3/10 docs/manual: document the waf-package infra
Thomas, All,
On 2016-11-17 00:04 +0100, Thomas Petazzoni spake thusly:
Quoted 1 line · Yann E. MORIN
[--SNIP--]
Quoted 3 lines
docs/manual/adding-packages-waf.txt line 64
Quoted 2 lines
docs/manual/adding-packages-waf.txt new file +2
-0+* +LIBFOO_BUNDLED_WAF+ can be set to +YES+ or +NO+ to tell Buildroot to + use the bundled +waf+ executable. If set to +YES+, the default, thenYES is in fact not the default :-)
Well, "! NO" is the default. ;-)
Quoted 3 lines
docs/manual/adding-packages-waf.txt line 66
Quoted 2 lines
docs/manual/adding-packages-waf.txt new file +2
-0+ Buildroot will use the waf executable in the package source tree; if + set to +NO+, then Buidlroot will download and install waf as aBuildroot.
I Like Buidlroot. It sounds like Beetlejuice. ;-]
Quoted 4 lines
Quoted 1 line
+ host-tool.
host tool (i.e no dash in between).
No need to resend for these issues, I can fixup when applying.
Will you address the variable name in the infra at the same time, or do you prefer I respin with the rename (in which case I can fix the manual) ?
Thanks! :-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
PATCH 3/10 docs/manual: document the waf-package infra
Hello,
Quoted 10 lines · Yann E. MORIN
Thomas, All,
On 2016-11-17 00:04 +0100, Thomas Petazzoni spake thusly:
Quoted 1 line · Yann E. MORIN
[--SNIP--]
Quoted 3 lines
docs/manual/adding-packages-waf.txt line 64
Quoted 2 lines
docs/manual/adding-packages-waf.txt new file +2
-0+* +LIBFOO_BUNDLED_WAF+ can be set to +YES+ or +NO+ to tell Buildroot to + use the bundled +waf+ executable. If set to +YES+, the default, thenYES is in fact not the default :-)
Well, "! NO" is the default. ;-)
Nope, I think you're getting it wrong like on IRC. The default is actually empty, which means "YES", i.e "the waf script is bundled and there is no need to add a dependency on host-waf".
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 3/10 docs/manual: document the waf-package infra
In reply to Yann E. MORINHello,
Quoted 2 lines · Yann E. MORIN
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Romain Naour <[email protected]>
Applied with a few tweaks, see below.
Quoted 1 line
+10:
LIBFOO_CONF_OPTS= --eanble-bar --disable-baz
Typo fixed.
docs/manual/adding-packages-waf.txt line 67
Quoted 5 lines
docs/manual/adding-packages-waf.txt new file +5
-0+* +LIBFOO_BUNDLED_WAF+ can be set to +YES+ or +NO+ to tell Buildroot to + use the bundled +waf+ executable. If set to +YES+, the default, then + Buildroot will use the waf executable in the package source tree; if + set to +NO+, then Buidlroot will download and install waf as a + host-tool.
I've obviously reworded this paragraph quite a bit to take into account the new name of the variable, LIBFOO_NEEDS_EXTERNAL_WAF.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 4/10 developpers: add myself as pkg-waf devel
In reply to Yann E. MORIN--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)
DEVELOPERS +1 -0
@@ -1598,6 +1598,7 @@ F: package/nvidia-driver/ F: package/omxplayer/ F: package/python-pyparsing/ F: package/pkg-download.mk +F: package/pkg-waf.mk F: package/slirp/ F: package/snappy/ F: package/spice/
Signature · 1 line
2.7.4
PATCH 4/10 developpers: add myself as pkg-waf devel
Hi Yann,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 1 line
Signed-off-by "Yann E. MORIN" <[email protected]>
Best regards,
Romain
Quoted 17 lines
--- DEVELOPERS | 1 + 1 file changed, 1 insertion(+)DEVELOPERS +1
-0@@ -1598,6 +1598,7 @@ F: package/nvidia-driver/ F: package/omxplayer/ F: package/python-pyparsing/ F: package/pkg-download.mk +F: package/pkg-waf.mk F: package/slirp/ F: package/snappy/ F: package/spice/
PATCH 5/10 package/glmark2: make it a waf-package
In reply to Yann E. MORIN--- package/glmark2/glmark2.mk | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-)
package/glmark2/glmark2.mk +2 -18
@@ -8,7 +8,7 @@ GLMARK2_VERSION = fa71af2dfab711fac87b9504b6fc9862f44bf72a GLMARK2_SITE = $(call github,glmark2,glmark2,$(GLMARK2_VERSION)) GLMARK2_LICENSE = GPLv3+ SGIv1 GLMARK2_LICENSE_FILES = COPYING COPYING.SGI -GLMARK2_DEPENDENCIES = host-pkgconf host-python jpeg libpng \ +GLMARK2_DEPENDENCIES = host-pkgconf jpeg libpng \ $(if $(BR2_PACKAGE_HAS_LIBEGL),libegl) \ $(if $(BR2_PACKAGE_HAS_LIBGLES),libgles) \ $(if $(BR2_PACKAGE_HAS_LIBGL),libgl)
@@ -45,20 +45,4 @@ GLMARK2_CONF_OPTS += \ --prefix=/usr \ --with-flavors=$(subst $(space),$(comma),$(GLMARK2_FLAVORS)) -define GLMARK2_CONFIGURE_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(GLMARK2_CONF_ENV) \ - $(HOST_DIR)/usr/bin/python2 ./waf configure $(GLMARK2_CONF_OPTS) \ - ) -endef - -define GLMARK2_BUILD_CMDS - cd $(@D) && $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/python2 ./waf -endef - -define GLMARK2_INSTALL_TARGET_CMDS - cd $(@D) && $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/python2 ./waf install --destdir=$(TARGET_DIR) -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
Signature · 1 line
2.7.4
PATCH 5/10 package/glmark2: make it a waf-package
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 3 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Bernd Kuhls <[email protected]>Cc Spenser Gilliland <[email protected]>
Best regards,
Romain
Quoted 40 lines
--- package/glmark2/glmark2.mk | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-)package/glmark2/glmark2.mk +2
-18@@ -8,7 +8,7 @@ GLMARK2_VERSION = fa71af2dfab711fac87b9504b6fc9862f44bf72a GLMARK2_SITE = $(call github,glmark2,glmark2,$(GLMARK2_VERSION)) GLMARK2_LICENSE = GPLv3+ SGIv1 GLMARK2_LICENSE_FILES = COPYING COPYING.SGI -GLMARK2_DEPENDENCIES = host-pkgconf host-python jpeg libpng \ +GLMARK2_DEPENDENCIES = host-pkgconf jpeg libpng \ $(if $(BR2_PACKAGE_HAS_LIBEGL),libegl) \ $(if $(BR2_PACKAGE_HAS_LIBGLES),libgles) \ $(if $(BR2_PACKAGE_HAS_LIBGL),libgl)@@ -45,20 +45,4 @@ GLMARK2_CONF_OPTS += \ --prefix=/usr \ --with-flavors=$(subst $(space),$(comma),$(GLMARK2_FLAVORS)) -define GLMARK2_CONFIGURE_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(GLMARK2_CONF_ENV) \ - $(HOST_DIR)/usr/bin/python2 ./waf configure $(GLMARK2_CONF_OPTS) \ - ) -endef - -define GLMARK2_BUILD_CMDS - cd $(@D) && $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/python2 ./waf -endef - -define GLMARK2_INSTALL_TARGET_CMDS - cd $(@D) && $(TARGET_MAKE_ENV) $(HOST_DIR)/usr/bin/python2 ./waf install --destdir=$(TARGET_DIR) -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
PATCH 6/10 package/gst1-imx: make it a waf-package
In reply to Yann E. MORIN--- package/gstreamer1/gst1-imx/gst1-imx.mk | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
package/gstreamer1/gst1-imx/gst1-imx.mk +1 -19
@@ -14,7 +14,6 @@ GST1_IMX_INSTALL_STAGING = YES GST1_IMX_DEPENDENCIES += \ host-pkgconf \ - host-python \ gstreamer1 \ gst1-plugins-base
@@ -53,21 +52,4 @@ endif endif endif -define GST1_IMX_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf configure $(GST1_IMX_CONF_OPTS) -endef - -define GST1_IMX_BUILD_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf build -j $(PARALLEL_JOBS) -endef - -define GST1_IMX_INSTALL_TARGET_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(TARGET_DIR) \ - install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
Signature · 1 line
2.7.4
PATCH 6/10 package/gst1-imx: make it a waf-package
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 3 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Gary Bisson <[email protected]>Cc Gustavo Zacarias <[email protected]>
Best regards,
Romain
Quoted 40 lines
--- package/gstreamer1/gst1-imx/gst1-imx.mk | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)package/gstreamer1/gst1-imx/gst1-imx.mk +1
-19@@ -14,7 +14,6 @@ GST1_IMX_INSTALL_STAGING = YES GST1_IMX_DEPENDENCIES += \ host-pkgconf \ - host-python \ gstreamer1 \ gst1-plugins-base@@ -53,21 +52,4 @@ endif endif endif -define GST1_IMX_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf configure $(GST1_IMX_CONF_OPTS) -endef - -define GST1_IMX_BUILD_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf build -j $(PARALLEL_JOBS) -endef - -define GST1_IMX_INSTALL_TARGET_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(TARGET_DIR) \ - install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
PATCH 6/10 package/gst1-imx: make it a waf-package
Yann, All,
Quoted 8 lines · Romain Naour
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 3 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Gary Bisson <[email protected]>Cc Gustavo Zacarias <[email protected]>Reviewed-by Romain Naour <[email protected]>
Note that if this patch gets in first, my pending patch on this package will need to be updated:
http://patchwork.ozlabs.org/patch/675006/
Regards,
Gary
PATCH 7/10 package/jack2: make it a waf-package
In reply to Yann E. MORIN--- package/jack2/jack2.mk | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-)
package/jack2/jack2.mk +3 -31
@@ -11,6 +11,8 @@ JACK2_DEPENDENCIES = libsamplerate libsndfile alsa-lib host-python JACK2_INSTALL_STAGING = YES JACK2_PATCH = https://github.com/jackaudio/jack2/commit/ff1ed2c4524095055140370c1008a2d9cccc5645.patch +JACK2_CONF_OPTS = --alsa + ifeq ($(BR2_PACKAGE_OPUS),y) JACK2_DEPENDENCIES += opus endif
@@ -42,34 +44,4 @@ endif # gtkiostream, which we do not have, so we don't need to depend on # eigen. -define JACK2_CONFIGURE_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf configure \ - --prefix=/usr \ - --alsa \ - $(JACK2_CONF_OPTS) \ - ) -endef - -define JACK2_BUILD_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf build -j $(PARALLEL_JOBS)) -endef - -define JACK2_INSTALL_TARGET_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(TARGET_DIR) \ - install) -endef - -define JACK2_INSTALL_STAGING_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(STAGING_DIR) \ - install) -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
Signature · 1 line
2.7.4
PATCH 7/10 package/jack2: make it a waf-package
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Wojciech M. Zabolotny <[email protected]>
Best regards,
Romain
Quoted 54 lines
--- package/jack2/jack2.mk | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-)package/jack2/jack2.mk +3
-31@@ -11,6 +11,8 @@ JACK2_DEPENDENCIES = libsamplerate libsndfile alsa-lib host-python JACK2_INSTALL_STAGING = YES JACK2_PATCH = https://github.com/jackaudio/jack2/commit/ff1ed2c4524095055140370c1008a2d9cccc5645.patch +JACK2_CONF_OPTS = --alsa + ifeq ($(BR2_PACKAGE_OPUS),y) JACK2_DEPENDENCIES += opus endif@@ -42,34 +44,4 @@ endif # gtkiostream, which we do not have, so we don't need to depend on # eigen. -define JACK2_CONFIGURE_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf configure \ - --prefix=/usr \ - --alsa \ - $(JACK2_CONF_OPTS) \ - ) -endef - -define JACK2_BUILD_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf build -j $(PARALLEL_JOBS)) -endef - -define JACK2_INSTALL_TARGET_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(TARGET_DIR) \ - install) -endef - -define JACK2_INSTALL_STAGING_CMDS - (cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(STAGING_DIR) \ - install) -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
PATCH 8/10 package/libimxvpuapi: make it a waf-package
In reply to Yann E. MORIN--- package/libimxvpuapi/libimxvpuapi.mk | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-)
package/libimxvpuapi/libimxvpuapi.mk +1 -22
@@ -11,25 +11,4 @@ LIBIMXVPUAPI_LICENSE_FILES = LICENSE LIBIMXVPUAPI_DEPENDENCIES = host-pkgconf host-python imx-vpu LIBIMXVPUAPI_INSTALL_STAGING = YES -define LIBIMXVPUAPI_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python2 ./waf configure \ - --prefix=/usr --libdir=/usr/lib -endef - -define LIBIMXVPUAPI_BUILD_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf build -j $(PARALLEL_JOBS) -endef - -define LIBIMXVPUAPI_INSTALL_STAGING_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(STAGING_DIR) install -endef - -define LIBIMXVPUAPI_INSTALL_TARGET_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(TARGET_DIR) install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
Signature · 1 line
2.7.4
PATCH 8/10 package/libimxvpuapi: make it a waf-package
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Gary Bisson <[email protected]>
Best regards,
Romain
Quoted 36 lines
--- package/libimxvpuapi/libimxvpuapi.mk | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-)package/libimxvpuapi/libimxvpuapi.mk +1
-22@@ -11,25 +11,4 @@ LIBIMXVPUAPI_LICENSE_FILES = LICENSE LIBIMXVPUAPI_DEPENDENCIES = host-pkgconf host-python imx-vpu LIBIMXVPUAPI_INSTALL_STAGING = YES -define LIBIMXVPUAPI_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python2 ./waf configure \ - --prefix=/usr --libdir=/usr/lib -endef - -define LIBIMXVPUAPI_BUILD_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf build -j $(PARALLEL_JOBS) -endef - -define LIBIMXVPUAPI_INSTALL_STAGING_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(STAGING_DIR) install -endef - -define LIBIMXVPUAPI_INSTALL_TARGET_CMDS - cd $(@D); \ - $(HOST_DIR)/usr/bin/python2 ./waf --destdir=$(TARGET_DIR) install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
PATCH 8/10 package/libimxvpuapi: make it a waf-package
Yann, All,
Quoted 7 lines · Romain Naour
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Gary Bisson <[email protected]>Reviewed-by Romain Naour <[email protected]>
Regards,
Gary
PATCH 9/10 package/mpv: make it a waf-package
In reply to Yann E. MORIN--- package/mpv/mpv.hash | 1 - package/mpv/mpv.mk | 30 +++--------------------------- 2 files changed, 3 insertions(+), 28 deletions(-)
package/mpv/mpv.hash +0 -1
@@ -1,3 +1,2 @@ # Locally calculated sha256 fe6ec9d2ded5ce84b963f54b812d579d04f944f4a737f3ae639c4d5d9e842b56 v0.20.0.tar.gz -sha256 01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b waf-1.8.12
package/mpv/mpv.mk +3 -27
@@ -5,16 +5,16 @@ ################################################################################ MPV_VERSION = 0.20.0 -MPV_WAF_VERSION = 1.8.12 MPV_SITE = https://github.com/mpv-player/mpv/archive MPV_SOURCE = v$(MPV_VERSION).tar.gz -MPV_EXTRA_DOWNLOADS = https://waf.io/waf-$(MPV_WAF_VERSION) MPV_DEPENDENCIES = \ host-pkgconf ffmpeg zlib \ $(if $(BR2_PACKAGE_LIBICONV),libiconv) MPV_LICENSE = GPLv2+ MPV_LICENSE_FILES = LICENSE +MPV_BUNDLED_WAF = NO + # Some of these options need testing and/or tweaks MPV_CONF_OPTS = \ --prefix=/usr \
@@ -235,28 +235,4 @@ else MPV_CONF_OPTS += --disable-x11 endif -define MPV_COPY_WAF - $(INSTALL) -m 0755 $(DL_DIR)/waf-$(MPV_WAF_VERSION) $(@D)/waf -endef -MPV_POST_EXTRACT_HOOKS += MPV_COPY_WAF - -define MPV_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - ./waf configure $(MPV_CONF_OPTS) -endef - -define MPV_BUILD_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - ./waf build -endef - -define MPV_INSTALL_TARGET_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - DESTDIR=$(TARGET_DIR) \ - ./waf install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
Signature · 1 line
2.7.4
PATCH 9/10 package/mpv: make it a waf-package
Hi Yann,
I missed this one...
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Gustavo Zacarias <[email protected]>
Best regards,
Romain
Quoted 67 lines
--- package/mpv/mpv.hash | 1 - package/mpv/mpv.mk | 30 +++--------------------------- 2 files changed, 3 insertions(+), 28 deletions(-)package/mpv/mpv.hash +0
-1@@ -1,3 +1,2 @@ # Locally calculated sha256 fe6ec9d2ded5ce84b963f54b812d579d04f944f4a737f3ae639c4d5d9e842b56 v0.20.0.tar.gz -sha256 01bf2beab2106d1558800c8709bc2c8e496d3da4a2ca343fe091f22fca60c98b waf-1.8.12package/mpv/mpv.mk +3
-27@@ -5,16 +5,16 @@ ################################################################################ MPV_VERSION = 0.20.0 -MPV_WAF_VERSION = 1.8.12 MPV_SITE = https://github.com/mpv-player/mpv/archive MPV_SOURCE = v$(MPV_VERSION).tar.gz -MPV_EXTRA_DOWNLOADS = https://waf.io/waf-$(MPV_WAF_VERSION) MPV_DEPENDENCIES = \ host-pkgconf ffmpeg zlib \ $(if $(BR2_PACKAGE_LIBICONV),libiconv) MPV_LICENSE = GPLv2+ MPV_LICENSE_FILES = LICENSE +MPV_BUNDLED_WAF = NO + # Some of these options need testing and/or tweaks MPV_CONF_OPTS = \ --prefix=/usr \@@ -235,28 +235,4 @@ else MPV_CONF_OPTS += --disable-x11 endif -define MPV_COPY_WAF - $(INSTALL) -m 0755 $(DL_DIR)/waf-$(MPV_WAF_VERSION) $(@D)/waf -endef -MPV_POST_EXTRACT_HOOKS += MPV_COPY_WAF - -define MPV_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - ./waf configure $(MPV_CONF_OPTS) -endef - -define MPV_BUILD_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - ./waf build -endef - -define MPV_INSTALL_TARGET_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - DESTDIR=$(TARGET_DIR) \ - ./waf install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
PATCH 9/10 package/mpv: make it a waf-package
In reply to Yann E. MORINHello,
Quoted 1 line · Yann E. MORIN
+MPV_BUNDLED_WAF = NO
Applied with this line changed to MPV_NEEDS_EXTERNAL_WAF = YES.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com
PATCH 10/10 package/norm: make it a waf-package
In reply to Yann E. MORIN--- package/norm/norm.mk | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-)
package/norm/norm.mk +3 -25
@@ -15,32 +15,10 @@ ifeq ($(BR2_PACKAGE_LIBNETFILTER_QUEUE),y) NORM_DEPENDENCIES += libnetfilter_queue endif -define NORM_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - ./waf configure --prefix=/usr -endef - -define NORM_BUILD_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - ./waf build -endef - # install target doesn't install headers unfortunately... -define NORM_INSTALL_STAGING_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - DESTDIR=$(STAGING_DIR) \ - ./waf install +define NORM_INSTALL_HEADERS cp -f $(@D)/include/norm* $(STAGING_DIR)/usr/include endef +NORM_POST_INSTALL_STAGING_HOOKS += NORM_INSTALL_HEADERS -define NORM_INSTALL_TARGET_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - DESTDIR=$(TARGET_DIR) \ - ./waf install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
Signature · 1 line
2.7.4
PATCH 10/10 package/norm: make it a waf-package
Hi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 2 lines
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Gustavo Zacarias <[email protected]>
Best regards,
Romain
Quoted 45 lines
--- package/norm/norm.mk | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-)package/norm/norm.mk +3
-25@@ -15,32 +15,10 @@ ifeq ($(BR2_PACKAGE_LIBNETFILTER_QUEUE),y) NORM_DEPENDENCIES += libnetfilter_queue endif -define NORM_CONFIGURE_CMDS - cd $(@D); \ - $(TARGET_CONFIGURE_OPTS) \ - ./waf configure --prefix=/usr -endef - -define NORM_BUILD_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - ./waf build -endef - # install target doesn't install headers unfortunately... -define NORM_INSTALL_STAGING_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - DESTDIR=$(STAGING_DIR) \ - ./waf install +define NORM_INSTALL_HEADERS cp -f $(@D)/include/norm* $(STAGING_DIR)/usr/include endef +NORM_POST_INSTALL_STAGING_HOOKS += NORM_INSTALL_HEADERS -define NORM_INSTALL_TARGET_CMDS - cd $(@D); \ - $(TARGET_MAKE_ENV) \ - DESTDIR=$(TARGET_DIR) \ - ./waf install -endef - -$(eval $(generic-package)) +$(eval $(waf-package))
cover core: add waf-package infra, convert packages
In reply to Yann E. MORINHi Yann, All,
Le 30/10/2016 ? 17:02, Yann E. MORIN a ?crit :
Quoted 27 lines
Hello All!
This series introduces the waf-package infrastructure for packages based on the Waf buildsystem.
Then, packages using Waf are converted to use this new infra, except for samba4 which only uses it for configure, not for build.
The converted packages still build fine with this defconfig:
BR2_arm=y BR2_cortex_a7=y BR2_TOOLCHAIN_EXTERNAL=y BR2_PACKAGE_GSTREAMER1=y BR2_PACKAGE_GST1_IMX=y BR2_PACKAGE_JACK2=y BR2_PACKAGE_MPV=y BR2_PACKAGE_GLMARK2=y BR2_PACKAGE_MESA3D=y BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_VC4=y BR2_PACKAGE_MESA3D_OPENGL_EGL=y BR2_PACKAGE_MESA3D_OPENGL_ES=y BR2_PACKAGE_FREESCALE_IMX=y BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6Q=y BR2_PACKAGE_LIBIMXVPUAPI=y BR2_PACKAGE_NORM=y
Quoted 4 lines
Except for these platitudes, nothing interesting to state about this new infra; it is pretty straightforward...
Thanks to Romain for early review. ;-)
I'll add a new package (aubio) which use waf as build system and I asked on IRC if it's time for adding the waf-infra. So here it is, thanks Yann :)
Best regards,
Romain
Quoted 6 lines
Regards,
Yann E. MORIN.
cover core: add waf-package infra, convert packages
In reply to Yann E. MORINHello,
Quoted 11 lines · Yann E. MORIN
Yann E. MORIN (10):
package/waf: new host package
core: add waf-package infra
docs/manual: document the waf-package infra
developpers: add myself as pkg-waf devel
package/glmark2: make it a waf-package
package/gst1-imx: make it a waf-package
package/jack2: make it a waf-package
package/libimxvpuapi: make it a waf-package
package/mpv: make it a waf-package
package/norm: make it a waf-package
All applied to master, with a few tweaks on the first three patches. I'll reply to them separately.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com