Skip to contentSkip to conversation

core: waf-package infra: add missing additional variables for each install step

PATCH New Romain Naour 1 participant 4 messages Dec 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/4 core: waf-package infra: add missing additional variables for each install step

Some waf packages may want to pass additional variables to waf script in install step. Add the possibility to do so by defining the following variables:
<pkg>_INSTALL_STAGING_OPTS for the install to staging directory <pkg>_INSTALL_TARGET_OPTS for the install to target directory

Cc "Yann E. MORIN" <[email protected]>

---
v3: revert to v1
v2: override <pkg>_INSTALL_*_OPTS (Yann)

---
 package/pkg-waf.mk | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
package/pkg-waf.mk +7 -2
index 908ac03..a82f45c 100644
@@ -49,6 +49,9 @@ else
 $(2)_WAF = ./waf
 endif
 
+$(2)_INSTALL_STAGING_OPTS 		?=
+$(2)_INSTALL_TARGET_OPTS 		?=
+
 #
 # Configure step. Only define it if not already defined by the package
 # .mk file.
@@ -84,7 +87,8 @@ 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)
+		install --destdir=$$(STAGING_DIR) \
+		$$($(2)_INSTALL_STAGING_OPTS)
 endef
 endif
 
@@ -96,7 +100,8 @@ 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)
+		install --destdir=$$(TARGET_DIR) \
+		$$($(2)_INSTALL_TARGET_OPTS)
 endef
 endif
 
Signature · 1 line
2.5.5
#1 lore raw

PATCH v3 2/4 core: waf-package infra: add missing additional variables for build step

Some waf packages may want to pass additional variables to waf script in build step. Add the possibility to do so by defining <pkg>_BUILD_OPTS.

---
 package/pkg-waf.mk | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
package/pkg-waf.mk +3 -1
index a82f45c..f9d435e 100644
@@ -49,6 +49,7 @@ else
 $(2)_WAF = ./waf
 endif
 
+$(2)_BUILD_OPTS 			?=
 $(2)_INSTALL_STAGING_OPTS 		?=
 $(2)_INSTALL_TARGET_OPTS 		?=
 
@@ -75,7 +76,8 @@ endif
 ifndef $(2)_BUILD_CMDS
 define $(2)_BUILD_CMDS
 	cd $$(@D) && \
-	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) build -j $$(PARALLEL_JOBS)
+	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
+		build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS)
 endef
 endif
 
Signature · 1 line
2.5.5
#2 lore raw

PATCH v3 3/4 core: waf-package infra: add a commun variable for each step

In reply to Romain Naour

Some waf packages may want to pass additional variables to waf script for each build step. Add the possibility to do so by defining <pkg>_WAF_OPTS.

---
 package/pkg-waf.mk | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
package/pkg-waf.mk +9 -4
index f9d435e..2cdd654 100644
@@ -52,6 +52,7 @@ endif
 $(2)_BUILD_OPTS 			?=
 $(2)_INSTALL_STAGING_OPTS 		?=
 $(2)_INSTALL_TARGET_OPTS 		?=
+$(2)_WAF_OPTS				?=
 
 #
 # Configure step. Only define it if not already defined by the package
@@ -65,7 +66,8 @@ define $(2)_CONFIGURE_CMDS
 	$$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) configure \
 		--prefix=/usr \
 		--libdir=/usr/lib \
-		$$($(2)_CONF_OPTS)
+		$$($(2)_CONF_OPTS) \
+		$$($(2)_WAF_OPTS)
 endef
 endif
 
@@ -77,7 +79,8 @@ ifndef $(2)_BUILD_CMDS
 define $(2)_BUILD_CMDS
 	cd $$(@D) && \
 	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
-		build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS)
+		build -j $$(PARALLEL_JOBS) $$($(2)_BUILD_OPTS) \
+		$$($(2)_WAF_OPTS)
 endef
 endif
 
@@ -90,7 +93,8 @@ define $(2)_INSTALL_STAGING_CMDS
 	cd $$(@D) && \
 	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
 		install --destdir=$$(STAGING_DIR) \
-		$$($(2)_INSTALL_STAGING_OPTS)
+		$$($(2)_INSTALL_STAGING_OPTS) \
+		$$($(2)_WAF_OPTS)
 endef
 endif
 
@@ -103,7 +107,8 @@ define $(2)_INSTALL_TARGET_CMDS
 	cd $$(@D) && \
 	$$(TARGET_MAKE_ENV) $$(HOST_DIR)/usr/bin/python2 $$($(2)_WAF) \
 		install --destdir=$$(TARGET_DIR) \
-		$$($(2)_INSTALL_TARGET_OPTS)
+		$$($(2)_INSTALL_TARGET_OPTS) \
+		$$($(2)_WAF_OPTS)
 endef
 endif
 
Signature · 1 line
2.5.5
#3 lore raw

PATCH v3 4/4 package/aubio: disable unit tests with --notests

In reply to Romain Naour

For each build step, --notests needs to be passed to waf script to avoid runing the unit tests.
This allow to remove the patch removing the unit tests from wscript.

---
v3: use AUBIO_WAF_OPTS
v2: rebase after pkg-waf rework (Yann)

---
 package/aubio/0001-remove-unit-test.patch | 63 -------------------------------
 package/aubio/aubio.mk                    |  4 ++
 2 files changed, 4 insertions(+), 63 deletions(-)
 delete mode 100644 package/aubio/0001-remove-unit-test.patch
package/aubio/0001-remove-unit-test.patch deleted +0 -63
deleted file mode 100644
index 947fc8e..0000000
@@ -1,63 +0,0 @@
-From c71d72262568907ae8c3b988d42e575a8bd3a207 Mon Sep 17 00:00:00 2001
-From: Romain Naour <[email protected]>
-Date: Sat, 29 Oct 2016 20:14:02 +0200
-Subject: [PATCH] remove unit test
-
-Unit tests fail to build on some system.
-
-Waf: Entering directory `output/build/aubio-0.4.3/build'
-[170/217] Processing build/tests/test-sink
-[170/217] Processing build/tests/test-sink_apple_audio-multi
-[172/217] Processing build/tests/test-sink_sndfile-multi
-[172/217] Processing build/tests/test-source_apple_audio
-[174/217] Processing build/tests/test-source_avcodec
-[174/217] Processing build/tests/test-source_multi
-[174/217] Processing build/tests/test-source_seek
-[176/217] Processing build/tests/test-source_sndfile
-Waf: Leaving directory `output/build/aubio-0.4.3/build'
-Build failed
-Traceback (most recent call last):
-  File "output/build/aubio-0.4.3/waflib/Task.py", line 110, in process
-    ret=self.run()
-  File "output/build/aubio-0.4.3/waflib/Tools/waf_unit_test.py", line 66, in run
-    proc=Utils.subprocess.Popen(self.ut_exec,cwd=cwd,env=self.get_test_env(),stderr=Utils.subprocess.PIPE,stdout=Utils.subprocess.PIPE)
-  File "/usr/lib64/python2.7/subprocess.py", line 710, in __init__
-    errread, errwrite)
-  File "/usr/lib64/python2.7/subprocess.py", line 1335, in _execute_child
-    raise child_exception
-OSError: [Errno 2] No such file or directory
-
-Signed-off-by: Romain Naour <[email protected]>
----
- wscript | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/wscript b/wscript
-index c665ff5..c8fae6c 100644
---- a/wscript
-+++ b/wscript
-@@ -95,13 +95,11 @@ def options(ctx):
-             help='set target platform for cross-compilation', dest='target_platform')
- 
-     ctx.load('compiler_c')
--    ctx.load('waf_unit_test')
-     ctx.load('gnu_dirs')
- 
- def configure(ctx):
-     from waflib import Options
-     ctx.load('compiler_c')
--    ctx.load('waf_unit_test')
-     ctx.load('gnu_dirs')
- 
-     # check for common headers
-@@ -334,7 +332,6 @@ def build(bld):
-     bld.recurse('src')
-     if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
-         bld.recurse('examples')
--        bld.recurse('tests')
- 
-     bld( source = 'aubio.pc.in' )
- 
--- 
-2.5.5
-
package/aubio/aubio.mk +4 -0
index cfa233f..cb38d5a 100644
@@ -15,6 +15,10 @@ AUBIO_CONF_OPTS = \
 	--disable-docs \
 	--disable-atlas
 
+# Add --notests for each build step to avoid runing unit tests on the
+# build machine.
+AUBIO_WAF_OPTS = --notests
+
 ifeq ($(BR2_PACKAGE_LIBSNDFILE),y)
 AUBIO_DEPENDENCIES += libsndfile
 AUBIO_CONF_OPTS += --enable-sndfile
Signature · 1 line
2.5.5