Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] Support a list of "cmake" candidates
@ 2017-05-05 20:30 Carlos Santos
  2017-05-05 20:30 ` [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates Carlos Santos
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Carlos Santos @ 2017-05-05 20:30 UTC (permalink / raw)
  To: buildroot

On CentOS 7 the "cmake" package installs cmake 2.8.12, which is too old
for us but the "cmake3" package (from EPEL) provides cmake 3.6.3, which
is good enough.

This series adds support to a list of candidates to be checked instead
of resorting to host-cmake if "cmake" does not exist or is too old.

Patch 1 modifies check-host-cmake.sh to support a list of candidates and
the minimal version, keeping compatibility with the previous syntax.

Patch 2 Introduces the BR2_CMAKE_CANDIDATES in check-host-cmake.mk, still
keeping compatible with the previous behavior.

Patch 3 adds "cmake3" to the list of cmake candidates.

Carlos Santos (3):
  core: allow check-host-cmake.sh to check several candidates
  core: allow having a list of "cmake" candidates
  core: add "cmake3" to the list of cmake candidates

 support/dependencies/check-host-cmake.mk |  7 ++--
 support/dependencies/check-host-cmake.sh | 66 ++++++++++++++++----------------
 2 files changed, 38 insertions(+), 35 deletions(-)

-- 
1.8.3.1

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

* [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates
  2017-05-05 20:30 [Buildroot] [PATCH 0/3] Support a list of "cmake" candidates Carlos Santos
@ 2017-05-05 20:30 ` Carlos Santos
  2017-05-05 21:07   ` Yann E. MORIN
  2017-05-05 20:30 ` [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates Carlos Santos
  2017-05-05 20:30 ` [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates Carlos Santos
  2 siblings, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2017-05-05 20:30 UTC (permalink / raw)
  To: buildroot

On CentOS 7 the "cmake" package installs cmake 2.8.12, which is too old
for us but the "cmake3" package (from EPEL) provides cmake 3.6.3, which
is good enough.

This change allows passing a list of candidates and the minimal version
to check-host-cmake.sh. Examples (on CentOS 7):

    $ sh support/dependencies/check-host-cmake.sh cmake cmake3 2.8
    /usr/bin/cmake

    $ sh support/dependencies/check-host-cmake.sh cmake cmake3 3.1
    /usr/bin/cmake3

    $ sh support/dependencies/check-host-cmake.sh cmake cmake3 3.8

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 support/dependencies/check-host-cmake.sh | 66 ++++++++++++++++----------------
 1 file changed, 34 insertions(+), 32 deletions(-)

diff --git a/support/dependencies/check-host-cmake.sh b/support/dependencies/check-host-cmake.sh
index 9b63b06..09ae8cc 100755
--- a/support/dependencies/check-host-cmake.sh
+++ b/support/dependencies/check-host-cmake.sh
@@ -1,39 +1,41 @@
 #!/bin/sh
 
-candidate="${1}"
-version_min="${2}"
+eval 'version_min="${'${#}'}"'
 
 major_min="${version_min%.*}"
 minor_min="${version_min#*.}"
 
-cmake=`which ${candidate}`
-if [ ! -x "${cmake}" ]; then
-    # echo nothing: no suitable cmake found
-    exit 1
-fi
-
-# Extract version X.Y from versions in the form X.Y or X.Y.Z
-# with X, Y and Z numbers with one or more digits each, e.g.
-#   3.2     -> 3.2
-#   3.2.3   -> 3.2
-#   3.2.42  -> 3.2
-#   3.10    -> 3.10
-#   3.10.4  -> 3.10
-#   3.10.42 -> 3.10
-version="$(${cmake} --version \
-           |sed -r -e '/.* ([[:digit:]]+\.[[:digit:]]+).*$/!d;' \
-                   -e 's//\1/'
-          )"
-major="${version%.*}"
-minor="${version#*.}"
-
-if [ ${major} -gt ${major_min} ]; then
-    echo "${cmake}"
-else
-    if [ ${major} -eq ${major_min} -a ${minor} -ge ${minor_min} ]; then
-        echo "${cmake}"
-    else
-        # echo nothing: no suitable cmake found
-        exit 1
+while [ $# -gt 1 ]; do
+
+    cmake=`which "${1}" 2>/dev/null`
+
+    if [ -x "${cmake}" ]; then
+        # Extract version X.Y from versions in the form X.Y or X.Y.Z
+        # with X, Y and Z numbers with one or more digits each, e.g.
+        #   3.2     -> 3.2
+        #   3.2.3   -> 3.2
+        #   3.2.42  -> 3.2
+        #   3.10    -> 3.10
+        #   3.10.4  -> 3.10
+        #   3.10.42 -> 3.10
+        version="$(${cmake} --version \
+                   |sed -r -e '/.* ([[:digit:]]+\.[[:digit:]]+).*$/!d;' \
+                           -e 's//\1/'
+                  )"
+        major="${version%.*}"
+        minor="${version#*.}"
+
+        if [ ${major} -gt ${major_min} ]; then
+            echo "${cmake}"
+            exit
+        elif [ ${major} -eq ${major_min} -a ${minor} -ge ${minor_min} ]; then
+            echo "${cmake}"
+            exit
+        fi
     fi
-fi
+
+    shift
+done
+
+# echo nothing: no suitable cmake found
+exit 1
-- 
1.8.3.1

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

* [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates
  2017-05-05 20:30 [Buildroot] [PATCH 0/3] Support a list of "cmake" candidates Carlos Santos
  2017-05-05 20:30 ` [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates Carlos Santos
@ 2017-05-05 20:30 ` Carlos Santos
  2017-05-05 21:09   ` Yann E. MORIN
  2017-05-05 20:30 ` [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates Carlos Santos
  2 siblings, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2017-05-05 20:30 UTC (permalink / raw)
  To: buildroot

Add the BR2_CMAKE_CANDIDATES variable, containing a list of candidates
to check and use as BR2_CMAKE, if possible.

This allows using "cmake3" on CentOS 7, whose default cmake corresponds
to version 2.8.12. Example:

    $ make BR2_CMAKE_CANDIDATES="cmake cmake3"

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 support/dependencies/check-host-cmake.mk | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/support/dependencies/check-host-cmake.mk b/support/dependencies/check-host-cmake.mk
index 8002278..42aaee4 100644
--- a/support/dependencies/check-host-cmake.mk
+++ b/support/dependencies/check-host-cmake.mk
@@ -10,9 +10,10 @@
 #
 BR2_CMAKE_VERSION_MIN = 3.1
 
-BR2_CMAKE ?= cmake
-ifeq ($(call suitable-host-package,cmake,\
-	$(BR2_CMAKE) $(BR2_CMAKE_VERSION_MIN)),)
+BR2_CMAKE_CANDIDATES ?= cmake
+BR2_CMAKE ?= $(call suitable-host-package,cmake,\
+	$(BR2_CMAKE_CANDIDATES) $(BR2_CMAKE_VERSION_MIN))
+ifeq ($(BR2_CMAKE),)
 BR2_CMAKE = $(HOST_DIR)/usr/bin/cmake
 BR2_CMAKE_HOST_DEPENDENCY = host-cmake
 endif
-- 
1.8.3.1

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

* [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates
  2017-05-05 20:30 [Buildroot] [PATCH 0/3] Support a list of "cmake" candidates Carlos Santos
  2017-05-05 20:30 ` [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates Carlos Santos
  2017-05-05 20:30 ` [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates Carlos Santos
@ 2017-05-05 20:30 ` Carlos Santos
  2017-05-05 21:10   ` Yann E. MORIN
  2017-05-06  8:18   ` Yann E. MORIN
  2 siblings, 2 replies; 13+ messages in thread
From: Carlos Santos @ 2017-05-05 20:30 UTC (permalink / raw)
  To: buildroot

This is useful on CentOS 7, whose "cmake" utility corresponds to version
2.8.12, which is too old for Buildroot.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 support/dependencies/check-host-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/dependencies/check-host-cmake.mk b/support/dependencies/check-host-cmake.mk
index 42aaee4..f2eef8b 100644
--- a/support/dependencies/check-host-cmake.mk
+++ b/support/dependencies/check-host-cmake.mk
@@ -10,7 +10,7 @@
 #
 BR2_CMAKE_VERSION_MIN = 3.1
 
-BR2_CMAKE_CANDIDATES ?= cmake
+BR2_CMAKE_CANDIDATES ?= cmake cmake3
 BR2_CMAKE ?= $(call suitable-host-package,cmake,\
 	$(BR2_CMAKE_CANDIDATES) $(BR2_CMAKE_VERSION_MIN))
 ifeq ($(BR2_CMAKE),)
-- 
1.8.3.1

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

* [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates
  2017-05-05 20:30 ` [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates Carlos Santos
@ 2017-05-05 21:07   ` Yann E. MORIN
  2017-05-05 22:34     ` Carlos Santos
  0 siblings, 1 reply; 13+ messages in thread
From: Yann E. MORIN @ 2017-05-05 21:07 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2017-05-05 17:30 -0300, Carlos Santos spake thusly:
> On CentOS 7 the "cmake" package installs cmake 2.8.12, which is too old
> for us but the "cmake3" package (from EPEL) provides cmake 3.6.3, which
> is good enough.
> 
> This change allows passing a list of candidates and the minimal version
> to check-host-cmake.sh. Examples (on CentOS 7):
> 
>     $ sh support/dependencies/check-host-cmake.sh cmake cmake3 2.8
>     /usr/bin/cmake
> 
>     $ sh support/dependencies/check-host-cmake.sh cmake cmake3 3.1
>     /usr/bin/cmake3
> 
>     $ sh support/dependencies/check-host-cmake.sh cmake cmake3 3.8
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  support/dependencies/check-host-cmake.sh | 66 ++++++++++++++++----------------
>  1 file changed, 34 insertions(+), 32 deletions(-)
> 
> diff --git a/support/dependencies/check-host-cmake.sh b/support/dependencies/check-host-cmake.sh
> index 9b63b06..09ae8cc 100755
> --- a/support/dependencies/check-host-cmake.sh
> +++ b/support/dependencies/check-host-cmake.sh
> @@ -1,39 +1,41 @@
>  #!/bin/sh
>  
> -candidate="${1}"
> -version_min="${2}"
> +eval 'version_min="${'${#}'}"'

It took me a moment to understand what this was doing (and I am known
for being a shell fanboy!).

Just revert the order options are passed: version first, then
candidates. This will allow you to get rid of this weird construct.

    version_min="${1}"
    shift # Keep only candidates

So that you can do...

>  major_min="${version_min%.*}"
>  minor_min="${version_min#*.}"
[--SNIP--]  
> +while [ $# -gt 1 ]; do
> +    cmake=`which "${1}" 2>/dev/null`

    for cmake; do
        cmake=`which "${cmake}" 2>/dev/null`

> +
> +    if [ -x "${cmake}" ]; then

Please use an early cut:

        [ -x "${cmake}" ] || continue

which allows you to gain a indentation level below.

> +        # Extract version X.Y from versions in the form X.Y or X.Y.Z
> +        # with X, Y and Z numbers with one or more digits each, e.g.
> +        #   3.2     -> 3.2
> +        #   3.2.3   -> 3.2
> +        #   3.2.42  -> 3.2
> +        #   3.10    -> 3.10
> +        #   3.10.4  -> 3.10
> +        #   3.10.42 -> 3.10
> +        version="$(${cmake} --version \
> +                   |sed -r -e '/.* ([[:digit:]]+\.[[:digit:]]+).*$/!d;' \
> +                           -e 's//\1/'
> +                  )"
> +        major="${version%.*}"
> +        minor="${version#*.}"
> +
> +        if [ ${major} -gt ${major_min} ]; then
> +            echo "${cmake}"
> +            exit
> +        elif [ ${major} -eq ${major_min} -a ${minor} -ge ${minor_min} ]; then
> +            echo "${cmake}"
> +            exit
> +        fi
>      fi
> -fi
> +
> +    shift
> +done
> +
> +# echo nothing: no suitable cmake found
> +exit 1

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates
  2017-05-05 20:30 ` [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates Carlos Santos
@ 2017-05-05 21:09   ` Yann E. MORIN
  2017-05-05 22:43     ` Carlos Santos
  0 siblings, 1 reply; 13+ messages in thread
From: Yann E. MORIN @ 2017-05-05 21:09 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2017-05-05 17:30 -0300, Carlos Santos spake thusly:
> Add the BR2_CMAKE_CANDIDATES variable, containing a list of candidates
> to check and use as BR2_CMAKE, if possible.
> 
> This allows using "cmake3" on CentOS 7, whose default cmake corresponds
> to version 2.8.12. Example:
> 
>     $ make BR2_CMAKE_CANDIDATES="cmake cmake3"
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  support/dependencies/check-host-cmake.mk | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/support/dependencies/check-host-cmake.mk b/support/dependencies/check-host-cmake.mk
> index 8002278..42aaee4 100644
> --- a/support/dependencies/check-host-cmake.mk
> +++ b/support/dependencies/check-host-cmake.mk
> @@ -10,9 +10,10 @@
>  #
>  BR2_CMAKE_VERSION_MIN = 3.1
>  
> -BR2_CMAKE ?= cmake
> -ifeq ($(call suitable-host-package,cmake,\
> -	$(BR2_CMAKE) $(BR2_CMAKE_VERSION_MIN)),)
> +BR2_CMAKE_CANDIDATES ?= cmake

Do not rename the variable; keep it named BR2_CMAKE.

It was named as such so that one could do:

    $ make BR2_CMAKE=/path/to/my/cmake3

and we want to keep it as such, so people can override the cmake they
want to use.

By the way, I hope you knew you could do that, didn't you? ;-)

Regards,
Yann E. MORIN.

> +BR2_CMAKE ?= $(call suitable-host-package,cmake,\
> +	$(BR2_CMAKE_CANDIDATES) $(BR2_CMAKE_VERSION_MIN))
> +ifeq ($(BR2_CMAKE),)
>  BR2_CMAKE = $(HOST_DIR)/usr/bin/cmake
>  BR2_CMAKE_HOST_DEPENDENCY = host-cmake
>  endif
> -- 
> 1.8.3.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates
  2017-05-05 20:30 ` [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates Carlos Santos
@ 2017-05-05 21:10   ` Yann E. MORIN
  2017-05-06  8:18   ` Yann E. MORIN
  1 sibling, 0 replies; 13+ messages in thread
From: Yann E. MORIN @ 2017-05-05 21:10 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2017-05-05 17:30 -0300, Carlos Santos spake thusly:
> This is useful on CentOS 7, whose "cmake" utility corresponds to version
> 2.8.12, which is too old for Buildroot.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
>  support/dependencies/check-host-cmake.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/support/dependencies/check-host-cmake.mk b/support/dependencies/check-host-cmake.mk
> index 42aaee4..f2eef8b 100644
> --- a/support/dependencies/check-host-cmake.mk
> +++ b/support/dependencies/check-host-cmake.mk
> @@ -10,7 +10,7 @@
>  #
>  BR2_CMAKE_VERSION_MIN = 3.1
>  
> -BR2_CMAKE_CANDIDATES ?= cmake
> +BR2_CMAKE_CANDIDATES ?= cmake cmake3

I'm fine with adding this. Except for the variable name, that is. ;-)

Regards,
Yann E. MORIN.

>  BR2_CMAKE ?= $(call suitable-host-package,cmake,\
>  	$(BR2_CMAKE_CANDIDATES) $(BR2_CMAKE_VERSION_MIN))
>  ifeq ($(BR2_CMAKE),)
> -- 
> 1.8.3.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates
  2017-05-05 21:07   ` Yann E. MORIN
@ 2017-05-05 22:34     ` Carlos Santos
  2017-05-05 23:19       ` Carlos Santos
  0 siblings, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2017-05-05 22:34 UTC (permalink / raw)
  To: buildroot

> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org
> Sent: Friday, May 5, 2017 6:07:03 PM
> Subject: Re: [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates
>> --- a/support/dependencies/check-host-cmake.sh
>> +++ b/support/dependencies/check-host-cmake.sh
>> @@ -1,39 +1,41 @@
>>  #!/bin/sh
>>  
>> -candidate="${1}"
>> -version_min="${2}"
>> +eval 'version_min="${'${#}'}"'
> 
> It took me a moment to understand what this was doing (and I am known
> for being a shell fanboy!).
> 
> Just revert the order options are passed: version first, then
> candidates. This will allow you to get rid of this weird construct.
> 
>    version_min="${1}"
>    shift # Keep only candidates

I did it that way because all invocations of the "suitable-host-package"
macro pass the candidate name as the first argument to the script but I
must admit that the script lost some readability. 

> 
> So that you can do...
> 
>>  major_min="${version_min%.*}"
>>  minor_min="${version_min#*.}"
> [--SNIP--]
>> +while [ $# -gt 1 ]; do
>> +    cmake=`which "${1}" 2>/dev/null`
> 
>    for cmake; do
>        cmake=`which "${cmake}" 2>/dev/null`
> 
>> +
>> +    if [ -x "${cmake}" ]; then
> 
> Please use an early cut:
> 
>        [ -x "${cmake}" ] || continue
> 
> which allows you to gain a indentation level below.

Ok.

-- 
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens

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

* [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates
  2017-05-05 21:09   ` Yann E. MORIN
@ 2017-05-05 22:43     ` Carlos Santos
  2017-05-06  8:17       ` Yann E. MORIN
  0 siblings, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2017-05-05 22:43 UTC (permalink / raw)
  To: buildroot

> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: buildroot at buildroot.org
> Sent: Friday, May 5, 2017 6:09:28 PM
> Subject: Re: [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates
>> @@ -10,9 +10,10 @@
>>  #
>>  BR2_CMAKE_VERSION_MIN = 3.1
>>  
>> -BR2_CMAKE ?= cmake
>> -ifeq ($(call suitable-host-package,cmake,\
>> -	$(BR2_CMAKE) $(BR2_CMAKE_VERSION_MIN)),)
>> +BR2_CMAKE_CANDIDATES ?= cmake
> 
> Do not rename the variable; keep it named BR2_CMAKE.
> 
> It was named as such so that one could do:
> 
>    $ make BR2_CMAKE=/path/to/my/cmake3
> 
> and we want to keep it as such, so people can override the cmake they
> want to use.
> 
> By the way, I hope you knew you could do that, didn't you? ;-)

I did not rename the variable. It is still BR2_CMAKE and you still can
pass it in the command line (yes, I knew).

>> +BR2_CMAKE ?= $(call suitable-host-package,cmake,\
    ^^^^^^^^^^^^^

>> +	$(BR2_CMAKE_CANDIDATES) $(BR2_CMAKE_VERSION_MIN))
>> +ifeq ($(BR2_CMAKE),)
>>  BR2_CMAKE = $(HOST_DIR)/usr/bin/cmake
>>  BR2_CMAKE_HOST_DEPENDENCY = host-cmake
>>  endif
>> --
>> 1.8.3.1

-- 
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens

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

* [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates
  2017-05-05 22:34     ` Carlos Santos
@ 2017-05-05 23:19       ` Carlos Santos
  2017-05-06  8:16         ` Yann E. MORIN
  0 siblings, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2017-05-05 23:19 UTC (permalink / raw)
  To: buildroot

> From: "Carlos Santos" <casantos@datacom.ind.br>
> To: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: buildroot at buildroot.org
> Sent: Friday, May 5, 2017 7:34:46 PM
> Subject: Re: [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates

>> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> To: "Carlos Santos" <casantos@datacom.ind.br>
>> Cc: buildroot at buildroot.org
>> Sent: Friday, May 5, 2017 6:07:03 PM
>> Subject: Re: [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check
>> several candidates
>>> --- a/support/dependencies/check-host-cmake.sh
>>> +++ b/support/dependencies/check-host-cmake.sh
>>> @@ -1,39 +1,41 @@
>>>  #!/bin/sh
>>>  
>>> -candidate="${1}"
>>> -version_min="${2}"
>>> +eval 'version_min="${'${#}'}"'
>> 
>> It took me a moment to understand what this was doing (and I am known
>> for being a shell fanboy!).
>> 
>> Just revert the order options are passed: version first, then
>> candidates. This will allow you to get rid of this weird construct.
>> 
>>    version_min="${1}"
>>    shift # Keep only candidates
> 
> I did it that way because all invocations of the "suitable-host-package"
> macro pass the candidate name as the first argument to the script but I
> must admit that the script lost some readability.

Also, doing it as you suggest requires modifying check-host-cmake.mk
in the same patch to change the argument order, which I'd prefer to
avoid.

-- 
Carlos Santos (Casantos) - DATACOM, P&D
?The greatest triumph that modern PR can offer is the transcendent 
success of having your words and actions judged by your reputation, 
rather than the other way about.? ? Christopher Hitchens

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

* [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates
  2017-05-05 23:19       ` Carlos Santos
@ 2017-05-06  8:16         ` Yann E. MORIN
  0 siblings, 0 replies; 13+ messages in thread
From: Yann E. MORIN @ 2017-05-06  8:16 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2017-05-05 20:19 -0300, Carlos Santos spake thusly:
> > From: "Carlos Santos" <casantos@datacom.ind.br>
> > To: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: buildroot at buildroot.org
> > Sent: Friday, May 5, 2017 7:34:46 PM
> > Subject: Re: [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates
> 
> >> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> >> To: "Carlos Santos" <casantos@datacom.ind.br>
> >> Cc: buildroot at buildroot.org
> >> Sent: Friday, May 5, 2017 6:07:03 PM
> >> Subject: Re: [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check
> >> several candidates
> >>> --- a/support/dependencies/check-host-cmake.sh
> >>> +++ b/support/dependencies/check-host-cmake.sh
> >>> @@ -1,39 +1,41 @@
> >>>  #!/bin/sh
> >>>  
> >>> -candidate="${1}"
> >>> -version_min="${2}"
> >>> +eval 'version_min="${'${#}'}"'
> >> 
> >> It took me a moment to understand what this was doing (and I am known
> >> for being a shell fanboy!).
> >> 
> >> Just revert the order options are passed: version first, then
> >> candidates. This will allow you to get rid of this weird construct.
> >> 
> >>    version_min="${1}"
> >>    shift # Keep only candidates
> > 
> > I did it that way because all invocations of the "suitable-host-package"
> > macro pass the candidate name as the first argument to the script but I
> > must admit that the script lost some readability.
> 
> Also, doing it as you suggest requires modifying check-host-cmake.mk
> in the same patch to change the argument order, which I'd prefer to
> avoid.

Well, yes you'd have to do that, and I think it is totally aceptable
that you change the order of arguments.

And not all checkers already behave the same anyway. The asciidoc one
just ignores its first argument and is passed none; the lzip one only
takes a candidate and no version; ditto the tar one or the xzcat one. So
in fact, the cmake one is the only one to expect a version on its
command line.

So yes, re-ordering the arguments is totally acceptable, and, as I
wrote, make for a simpler code.

Regards,
Yann E. MORIN.

> -- 
> Carlos Santos (Casantos) - DATACOM, P&D
> ?The greatest triumph that modern PR can offer is the transcendent 
> success of having your words and actions judged by your reputation, 
> rather than the other way about.? ? Christopher Hitchens

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates
  2017-05-05 22:43     ` Carlos Santos
@ 2017-05-06  8:17       ` Yann E. MORIN
  0 siblings, 0 replies; 13+ messages in thread
From: Yann E. MORIN @ 2017-05-06  8:17 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2017-05-05 19:43 -0300, Carlos Santos spake thusly:
> > From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > To: "Carlos Santos" <casantos@datacom.ind.br>
> > Cc: buildroot at buildroot.org
> > Sent: Friday, May 5, 2017 6:09:28 PM
> > Subject: Re: [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates
> >> @@ -10,9 +10,10 @@
> >>  #
> >>  BR2_CMAKE_VERSION_MIN = 3.1
> >>  
> >> -BR2_CMAKE ?= cmake
> >> -ifeq ($(call suitable-host-package,cmake,\
> >> -	$(BR2_CMAKE) $(BR2_CMAKE_VERSION_MIN)),)
> >> +BR2_CMAKE_CANDIDATES ?= cmake
> > 
> > Do not rename the variable; keep it named BR2_CMAKE.
> > 
> > It was named as such so that one could do:
> > 
> >    $ make BR2_CMAKE=/path/to/my/cmake3
> > 
> > and we want to keep it as such, so people can override the cmake they
> > want to use.
> > 
> > By the way, I hope you knew you could do that, didn't you? ;-)
> 
> I did not rename the variable. It is still BR2_CMAKE and you still can
> pass it in the command line (yes, I knew).
> 
> >> +BR2_CMAKE ?= $(call suitable-host-package,cmake,\
>     ^^^^^^^^^^^^^

Right, I missed the conditional assignment here.

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> >> +	$(BR2_CMAKE_CANDIDATES) $(BR2_CMAKE_VERSION_MIN))
> >> +ifeq ($(BR2_CMAKE),)
> >>  BR2_CMAKE = $(HOST_DIR)/usr/bin/cmake
> >>  BR2_CMAKE_HOST_DEPENDENCY = host-cmake
> >>  endif
> >> --
> >> 1.8.3.1
> 
> -- 
> Carlos Santos (Casantos) - DATACOM, P&D
> ?The greatest triumph that modern PR can offer is the transcendent 
> success of having your words and actions judged by your reputation, 
> rather than the other way about.? ? Christopher Hitchens

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates
  2017-05-05 20:30 ` [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates Carlos Santos
  2017-05-05 21:10   ` Yann E. MORIN
@ 2017-05-06  8:18   ` Yann E. MORIN
  1 sibling, 0 replies; 13+ messages in thread
From: Yann E. MORIN @ 2017-05-06  8:18 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2017-05-05 17:30 -0300, Carlos Santos spake thusly:
> This is useful on CentOS 7, whose "cmake" utility corresponds to version
> 2.8.12, which is too old for Buildroot.
> 
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  support/dependencies/check-host-cmake.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/support/dependencies/check-host-cmake.mk b/support/dependencies/check-host-cmake.mk
> index 42aaee4..f2eef8b 100644
> --- a/support/dependencies/check-host-cmake.mk
> +++ b/support/dependencies/check-host-cmake.mk
> @@ -10,7 +10,7 @@
>  #
>  BR2_CMAKE_VERSION_MIN = 3.1
>  
> -BR2_CMAKE_CANDIDATES ?= cmake
> +BR2_CMAKE_CANDIDATES ?= cmake cmake3
>  BR2_CMAKE ?= $(call suitable-host-package,cmake,\
>  	$(BR2_CMAKE_CANDIDATES) $(BR2_CMAKE_VERSION_MIN))
>  ifeq ($(BR2_CMAKE),)
> -- 
> 1.8.3.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2017-05-06  8:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-05 20:30 [Buildroot] [PATCH 0/3] Support a list of "cmake" candidates Carlos Santos
2017-05-05 20:30 ` [Buildroot] [PATCH 1/3] core: allow check-host-cmake.sh to check several candidates Carlos Santos
2017-05-05 21:07   ` Yann E. MORIN
2017-05-05 22:34     ` Carlos Santos
2017-05-05 23:19       ` Carlos Santos
2017-05-06  8:16         ` Yann E. MORIN
2017-05-05 20:30 ` [Buildroot] [PATCH 2/3] core: allow having a list of "cmake" candidates Carlos Santos
2017-05-05 21:09   ` Yann E. MORIN
2017-05-05 22:43     ` Carlos Santos
2017-05-06  8:17       ` Yann E. MORIN
2017-05-05 20:30 ` [Buildroot] [PATCH 3/3] core: add "cmake3" to the list of cmake candidates Carlos Santos
2017-05-05 21:10   ` Yann E. MORIN
2017-05-06  8:18   ` Yann E. MORIN

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