Patchwork [1/5] sanity: Make the required utilities more platform specific.

login
register
mail settings
Submitter Martin Ertsaas
Date Jan. 10, 2013, 8:50 a.m.
Message ID <1357807806-31720-1-git-send-email-martiert@gmail.com>
Download mbox | patch
Permalink /patch/42433/
State New
Headers show

Comments

Martin Ertsaas - Jan. 10, 2013, 8:50 a.m.
This might make us able to build on mac os X.

Signed-off-by: Martin Ertsaas <martiert@gmail.com>
---
 meta/classes/sanity.bbclass |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
Richard Purdie - Jan. 15, 2013, 8:14 a.m.
On Thu, 2013-01-10 at 09:50 +0100, Martin Ertsaas wrote:
> This might make us able to build on mac os X.
> 
> Signed-off-by: Martin Ertsaas <martiert@gmail.com>
> ---
>  meta/classes/sanity.bbclass |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 0ffa52d..03651be 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -2,7 +2,9 @@
>  # Sanity check the users setup for common misconfigurations
>  #
>  
> -SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar gzip gawk chrpath wget cpio"
> +SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar gzip gawk wget cpio"
> +SANITY_REQUIRED_UTILITIES_Linux ?= "${SANITY_REQUIRED_UTILITIES} chrpath"
> +SANITY_REQUIRED_UTILITIES_Darwin ?= "${SANITY_REQUIRED_UTILITIES} install_name_tool"

You should be able to make this:

SANITY_REQUIRED_UTILITIES_COMMON ?= "patch diffstat makeinfo git bzip2 tar gzip gawk wget cpio"
SANITY_REQUIRED_UTILITIES ?= "${SANITY_REQUIRED_UTILITIES_COMMON} chrpath"
SANITY_REQUIRED_UTILITIES_build-darwin ?= "${SANITY_REQUIRED_UTILITIES_COMMON} install_name_tool"

which will then simplify the other part of the patch (make it
unnecessary).

Before we go and merge a ton of these type of changes I'd also like to
understand how close we are to making this work?

Cheers,

Richard
Martin Ertsaas - Jan. 15, 2013, 9:07 a.m.
On 01/15/13 09:14, Richard Purdie wrote:
> which will then simplify the other part of the patch (make it
> unnecessary).
That is true, will make it a lot simpler.

What I know is still missing:

1) There are some errors with the paths, seems like stuff is not
correctly transfered to the sysroot, this is next on the agenda.
2) Make a class that does what chrpath does, but for install_name_tool,
going to do this as soon as I get an error on it.
3) Probably some errors after I get past the error I have now.

I agree that we should not merge a ton of these patches.

For my part, I can keep these in my repository until I have stuff
working. When we can compile everything I can do a pull request. If
someone wants to help, they can just pull from me and work against that
repo.

- Martin

Patch

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 0ffa52d..03651be 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -2,7 +2,9 @@ 
 # Sanity check the users setup for common misconfigurations
 #
 
-SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar gzip gawk chrpath wget cpio"
+SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar gzip gawk wget cpio"
+SANITY_REQUIRED_UTILITIES_Linux ?= "${SANITY_REQUIRED_UTILITIES} chrpath"
+SANITY_REQUIRED_UTILITIES_Darwin ?= "${SANITY_REQUIRED_UTILITIES} install_name_tool"
 
 python check_bblayers_conf() {
     bblayers_fn = os.path.join(d.getVar('TOPDIR', True), 'conf/bblayers.conf')
@@ -340,6 +342,10 @@  def check_sanity_validmachine(sanity_data):
 
     return messages
 
+def get_required_utilities(sanity_data):
+    import platform
+    sanity_var = 'SANITY_REQUIRED_UTILITIES_%s' %platform.system()
+    return sanity_data.getVar(sanity_var, True)
 
 def check_sanity(sanity_data):
     import subprocess
@@ -444,7 +450,7 @@  def check_sanity(sanity_data):
     if not check_app_exists('${BUILD_PREFIX}g++', sanity_data):
         missing = missing + "C++ Compiler (%sg++)," % sanity_data.getVar("BUILD_PREFIX", True)
 
-    required_utilities = sanity_data.getVar('SANITY_REQUIRED_UTILITIES', True)
+    required_utilities = get_required_utilities(sanity_data)
 
     if "qemu-native" in assume_provided:
         if not check_app_exists("qemu-arm", sanity_data):