Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] cmake : bump to version 3.0.2
@ 2014-09-22 11:31 Jérémy Rosen
  2014-09-22 11:31 ` [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0 Jérémy Rosen
  2014-09-22 17:08 ` [Buildroot] [PATCH v2] cmake : bump to version 3.0.2 Thomas Petazzoni
  0 siblings, 2 replies; 7+ messages in thread
From: Jérémy Rosen @ 2014-09-22 11:31 UTC (permalink / raw)
  To: buildroot

Signed-off-by: J?r?my Rosen <jeremy.rosen@openwide.fr>
---
 ...not-prepend-CMake-root-path-when-searchin.patch | 38 ----------------------
 package/cmake/cmake.mk                             |  4 +--
 2 files changed, 2 insertions(+), 40 deletions(-)
 delete mode 100644 package/cmake/cmake-0001-FindQt4-do-not-prepend-CMake-root-path-when-searchin.patch

diff --git a/package/cmake/cmake-0001-FindQt4-do-not-prepend-CMake-root-path-when-searchin.patch b/package/cmake/cmake-0001-FindQt4-do-not-prepend-CMake-root-path-when-searchin.patch
deleted file mode 100644
index 8ab5a23..0000000
--- a/package/cmake/cmake-0001-FindQt4-do-not-prepend-CMake-root-path-when-searchin.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 02a18089402de70188f2cf7b33fcb6edf7506871 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-Date: Sun, 29 Dec 2013 13:35:18 +0100
-Subject: [PATCH] FindQt4: do not prepend CMake root path when searching the
- mkspecs directory
-
-When searching for the mkspecs directory, FindQT4 uses the find_path()
-function, but it doesn't pass the NO_CMAKE_FIND_ROOT_PATH, which means
-that all paths are interpreted relatively to the CMAKE_FIND_ROOT_PATH.
-
-However, both the ${qt_mkspecs_dirs} and ${qt_cross_paths} variable
-that are passed as hints are already absolute paths, and do not need
-to be prepended by the CMAKE_FIND_ROOT_PATH.
-
-Due to this problem, FindQT4 was unable to find qconfig.pri, and
-QT_MKSPECS_DIR was left defined to "NOTFOUND".
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- Modules/FindQt4.cmake | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
-index 28b8454..0b8ce92 100644
---- a/Modules/FindQt4.cmake
-+++ b/Modules/FindQt4.cmake
-@@ -760,7 +760,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
-     endforeach()
-     set(QT_MKSPECS_DIR NOTFOUND)
-     find_path(QT_MKSPECS_DIR NAMES qconfig.pri
--      HINTS ${qt_cross_paths} ${qt_mkspecs_dirs}
-+      HINTS ${qt_cross_paths} ${qt_mkspecs_dirs} NO_CMAKE_FIND_ROOT_PATH
-       DOC "The location of the Qt mkspecs containing qconfig.pri")
-   endif()
- 
--- 
-1.8.3.2
-
diff --git a/package/cmake/cmake.mk b/package/cmake/cmake.mk
index bfeb147..e09fddf 100644
--- a/package/cmake/cmake.mk
+++ b/package/cmake/cmake.mk
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-CMAKE_VERSION_MAJOR = 2.8
-CMAKE_VERSION = $(CMAKE_VERSION_MAJOR).12.2
+CMAKE_VERSION_MAJOR = 3.0
+CMAKE_VERSION = $(CMAKE_VERSION_MAJOR).2
 CMAKE_SITE = http://www.cmake.org/files/v$(CMAKE_VERSION_MAJOR)
 CMAKE_LICENSE = BSD-3c
 CMAKE_LICENSE_FILES = Copyright.txt
-- 
2.1.0

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

* [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0
  2014-09-22 11:31 [Buildroot] [PATCH v2] cmake : bump to version 3.0.2 Jérémy Rosen
@ 2014-09-22 11:31 ` Jérémy Rosen
  2014-09-22 12:23   ` Thomas Petazzoni
  2014-09-22 17:29   ` Thomas Petazzoni
  2014-09-22 17:08 ` [Buildroot] [PATCH v2] cmake : bump to version 3.0.2 Thomas Petazzoni
  1 sibling, 2 replies; 7+ messages in thread
From: Jérémy Rosen @ 2014-09-22 11:31 UTC (permalink / raw)
  To: buildroot

the cmake detection script provided with cmake will first look for a
binary called swig2.0 then for a binary called swig

swig-host only installs a binary called swig and gets overridden by the
version installed by the host distro. This symlink prevents that from
happening


Signed-off-by: J?r?my Rosen <jeremy.rosen@openwide.fr>

---

v1 => v2 :
* fix definition of SWIG
* add missing SOB
* rename SWIG_INSTALL_SYMLINK to HOST_SWIG_INSTALL_SYMLINK

After discussing with smartin on IRC, adding a symlink seems like
the best approch
* adding a -DSWIG_EXECUTABLE needs to be done in all dependent packages
* changing to swig2.0 breaks compilation (at least xbmc)
* patching FindSwig.mk is a BR specific patch that probably can't be
  upstreamed
---
 package/swig/swig.mk | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/package/swig/swig.mk b/package/swig/swig.mk
index e9ef521..07f0548 100644
--- a/package/swig/swig.mk
+++ b/package/swig/swig.mk
@@ -4,7 +4,8 @@
 #
 ################################################################################
 
-SWIG_VERSION = 2.0.12
+SWIG_MAJOR = 2.0
+SWIG_VERSION = $(SWIG_MAJOR).12
 SWIG_SITE = http://downloads.sourceforge.net/project/swig/swig/swig-$(SWIG_VERSION)
 SWIG_DEPENDENCIES = host-bison
 HOST_SWIG_CONF_OPT = \
@@ -14,4 +15,10 @@ HOST_SWIG_CONF_OPT = \
 SWIG_LICENSE = GPLv3+ BSD-2c BSD-3c
 SWIG_LICENSE_FILES = LICENSE LICENSE-GPL LICENSE-UNIVERSITIES
 
+define HOST_SWIG_INSTALL_SYMLINK
+	ln -fs $(HOST_DIR)/usr/bin/swig $(HOST_DIR)/usr/bin/swig$(SWIG_MAJOR)
+endef
+
+HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_SYMLINK
+
 $(eval $(host-autotools-package))
-- 
2.1.0

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

* [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0
  2014-09-22 11:31 ` [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0 Jérémy Rosen
@ 2014-09-22 12:23   ` Thomas Petazzoni
  2014-09-22 14:12     ` Samuel Martin
  2014-09-22 17:29   ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2014-09-22 12:23 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 22 Sep 2014 13:31:08 +0200, J?r?my Rosen wrote:

> diff --git a/package/swig/swig.mk b/package/swig/swig.mk
> index e9ef521..07f0548 100644
> --- a/package/swig/swig.mk
> +++ b/package/swig/swig.mk
> @@ -4,7 +4,8 @@
>  #
>  ################################################################################
>  
> -SWIG_VERSION = 2.0.12
> +SWIG_MAJOR = 2.0
> +SWIG_VERSION = $(SWIG_MAJOR).12
>  SWIG_SITE = http://downloads.sourceforge.net/project/swig/swig/swig-$(SWIG_VERSION)
>  SWIG_DEPENDENCIES = host-bison
>  HOST_SWIG_CONF_OPT = \
> @@ -14,4 +15,10 @@ HOST_SWIG_CONF_OPT = \
>  SWIG_LICENSE = GPLv3+ BSD-2c BSD-3c
>  SWIG_LICENSE_FILES = LICENSE LICENSE-GPL LICENSE-UNIVERSITIES
>  
> +define HOST_SWIG_INSTALL_SYMLINK
> +	ln -fs $(HOST_DIR)/usr/bin/swig $(HOST_DIR)/usr/bin/swig$(SWIG_MAJOR)
> +endef
> +
> +HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_SYMLINK

Samuel, can you tell us if we can explicitly tell to CMake the path to
Swig, knowing that it is detected by CMake using find_program() ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0
  2014-09-22 12:23   ` Thomas Petazzoni
@ 2014-09-22 14:12     ` Samuel Martin
  0 siblings, 0 replies; 7+ messages in thread
From: Samuel Martin @ 2014-09-22 14:12 UTC (permalink / raw)
  To: buildroot

Hi all,

On Mon, Sep 22, 2014 at 2:23 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Mon, 22 Sep 2014 13:31:08 +0200, J?r?my Rosen wrote:
>
>> diff --git a/package/swig/swig.mk b/package/swig/swig.mk
>> index e9ef521..07f0548 100644
>> --- a/package/swig/swig.mk
>> +++ b/package/swig/swig.mk
>> @@ -4,7 +4,8 @@
>>  #
>>  ################################################################################
>>
>> -SWIG_VERSION = 2.0.12
>> +SWIG_MAJOR = 2.0
>> +SWIG_VERSION = $(SWIG_MAJOR).12
>>  SWIG_SITE = http://downloads.sourceforge.net/project/swig/swig/swig-$(SWIG_VERSION)
>>  SWIG_DEPENDENCIES = host-bison
>>  HOST_SWIG_CONF_OPT = \
>> @@ -14,4 +15,10 @@ HOST_SWIG_CONF_OPT = \
>>  SWIG_LICENSE = GPLv3+ BSD-2c BSD-3c
>>  SWIG_LICENSE_FILES = LICENSE LICENSE-GPL LICENSE-UNIVERSITIES
>>
>> +define HOST_SWIG_INSTALL_SYMLINK
>> +     ln -fs $(HOST_DIR)/usr/bin/swig $(HOST_DIR)/usr/bin/swig$(SWIG_MAJOR)
>> +endef
>> +
>> +HOST_SWIG_POST_INSTALL_HOOKS += HOST_SWIG_INSTALL_SYMLINK
>
> Samuel, can you tell us if we can explicitly tell to CMake the path to
> Swig, knowing that it is detected by CMake using find_program() ?
>

Swig package can add a program suffix to the swig program; that's what
debian does. So, a "swig2.0" program is installed on debian, whereas
it is just "swig" in Buildroot with no suffix).
When looking for swig program, CMake (via
<prefix>/share/cmake-<version>/Modules/FindSWIG.cmake) first looks for
something named "swig2.0" then "swig".
We can extend the location list where CMake will search with
CMAKE_PROGRAM_PATH, but CMake does not search in these location in
priority, it just scans all directories with the name given first,
then all with the second and so on.
So, if the host system has a swig2.0 program, it will always be found
instead of the swig one from the Buildroot host dir.

It is still possible to force the SWIG_EXECUTABLE variable through the
_CONF_OPTS, but doing this will require patching all cmake-package
using swig.

We could also adopt the same suffix as debian does, but it may not
play very well with autotools-package or handwritten
buils-system/makefiles.

We could also patch the FindSWIG.cmake file to reverse the order of
the swig program name list; but this implies carrying a patch for
CMake.

So, IMHO, the safest way of handling this is having both swig2.0 and
swig programs in the Buildroot host dir. This can easily be done at
the Buildroot level using a symlink, like this patch does.


Hope it's clear enough.

Regards,

-- 
Samuel

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

* [Buildroot] [PATCH v2] cmake : bump to version 3.0.2
  2014-09-22 11:31 [Buildroot] [PATCH v2] cmake : bump to version 3.0.2 Jérémy Rosen
  2014-09-22 11:31 ` [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0 Jérémy Rosen
@ 2014-09-22 17:08 ` Thomas Petazzoni
  2014-09-23  6:51   ` Jeremy Rosen
  1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2014-09-22 17:08 UTC (permalink / raw)
  To: buildroot

Dear J?r?my Rosen,

On Mon, 22 Sep 2014 13:31:07 +0200, J?r?my Rosen wrote:
> Signed-off-by: J?r?my Rosen <jeremy.rosen@openwide.fr>
> ---
>  ...not-prepend-CMake-root-path-when-searchin.patch | 38 ----------------------
>  package/cmake/cmake.mk                             |  4 +--
>  2 files changed, 2 insertions(+), 40 deletions(-)
>  delete mode 100644 package/cmake/cmake-0001-FindQt4-do-not-prepend-CMake-root-path-when-searchin.patch

Patch applied, thanks. However, there was one missing information: the
explanation of why the
cmake-0001-FindQt4-do-not-prepend-CMake-root-path-when-searchin.patch
gets removed. So I had to go check the upstream CMake Git repository to
verify that indeed a similar change had been merged. I've edited the
commit log to mention this.

See
http://git.buildroot.net/buildroot/commit/?id=4aef37b683a637c8755a8b197a46aa30674c2074.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0
  2014-09-22 11:31 ` [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0 Jérémy Rosen
  2014-09-22 12:23   ` Thomas Petazzoni
@ 2014-09-22 17:29   ` Thomas Petazzoni
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2014-09-22 17:29 UTC (permalink / raw)
  To: buildroot

Dear J?r?my Rosen,

On Mon, 22 Sep 2014 13:31:08 +0200, J?r?my Rosen wrote:
> the cmake detection script provided with cmake will first look for a
> binary called swig2.0 then for a binary called swig
> 
> swig-host only installs a binary called swig and gets overridden by the
> version installed by the host distro. This symlink prevents that from
> happening
> 
> 
> Signed-off-by: J?r?my Rosen <jeremy.rosen@openwide.fr>

Ok, I've applied the patch now. However, I did some significant
improvements to the commit log, and also added a big comment in the
code to explain why we do this.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v2] cmake : bump to version 3.0.2
  2014-09-22 17:08 ` [Buildroot] [PATCH v2] cmake : bump to version 3.0.2 Thomas Petazzoni
@ 2014-09-23  6:51   ` Jeremy Rosen
  0 siblings, 0 replies; 7+ messages in thread
From: Jeremy Rosen @ 2014-09-23  6:51 UTC (permalink / raw)
  To: buildroot

> 
> Patch applied, thanks. However, there was one missing information:
> the
> explanation of why the
> cmake-0001-FindQt4-do-not-prepend-CMake-root-path-when-searchin.patch
> gets removed. So I had to go check the upstream CMake Git repository
> to
> verify that indeed a similar change had been merged. I've edited the
> commit log to mention this.
> 

my bad, I'm pretty certain I wrote it at some point, I must have lost it in a rebase

sorry about that

> See
> http://git.buildroot.net/buildroot/commit/?id=4aef37b683a637c8755a8b197a46aa30674c2074.
> 
> Thanks,
> 
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> 

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

end of thread, other threads:[~2014-09-23  6:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 11:31 [Buildroot] [PATCH v2] cmake : bump to version 3.0.2 Jérémy Rosen
2014-09-22 11:31 ` [Buildroot] [PATCH v2] swig: add symlink to /usr/bin/swig2.0 Jérémy Rosen
2014-09-22 12:23   ` Thomas Petazzoni
2014-09-22 14:12     ` Samuel Martin
2014-09-22 17:29   ` Thomas Petazzoni
2014-09-22 17:08 ` [Buildroot] [PATCH v2] cmake : bump to version 3.0.2 Thomas Petazzoni
2014-09-23  6:51   ` Jeremy Rosen

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