diff mbox

eigen: (optionally) install unsupported modules

Message ID 1395173894-4811-2-git-send-email-zinosat@tiscali.it
State Superseded
Headers show

Commit Message

Davide Viti March 18, 2014, 8:18 p.m. UTC
From: Davide Viti <d.viti@infosolution.it>


Signed-off-by: Davide Viti <zinosat@tiscali.it>
---
 package/eigen/Config.in |    8 ++++++++
 package/eigen/eigen.mk  |    8 ++++++++
 2 files changed, 16 insertions(+)

Comments

Thomas Petazzoni March 18, 2014, 10:55 p.m. UTC | #1
Dear Davide Viti,

On Tue, 18 Mar 2014 21:18:14 +0100, Davide Viti wrote:
> From: Davide Viti <d.viti@infosolution.it>
> 
> 
> Signed-off-by: Davide Viti <zinosat@tiscali.it>

We probably want the title of the patch to be:

	eigen: add an option to install unsupported modules

>  
> +if BR2_PACKAGE_EIGEN
> +
> +config BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES
> +        bool "unsupported modules"

Indentation is wrong here: there should be one tab before the "bool"
statement.

> +	help
> +	  Install eigen unsupported modules
> +endif
> +
>  comment "eigen needs a toolchain w/ C++"
>  	depends on !BR2_INSTALL_LIBSTDCPP
> diff --git a/package/eigen/eigen.mk b/package/eigen/eigen.mk
> index 5abd464..388dd63 100644
> --- a/package/eigen/eigen.mk
> +++ b/package/eigen/eigen.mk
> @@ -13,6 +13,14 @@ EIGEN_LICENSE_FILES = COPYING.MPL2 COPYING.BSD COPYING.LGPL COPYING.README
>  EIGEN_INSTALL_STAGING = YES
>  EIGEN_INSTALL_TARGET = NO
>  
> +define EIGEN_INSTALL_UNSUPPORTED_MODULES
> +	cp -a $(@D)/unsupported $(STAGING_DIR)/usr/include/

I'm a bit worried about having a directory called
$(STAGING_DIR)/usr/include/unsupported. Shouldn't this directory be
installed *below* the $(STAGING_DIR)/usr/include/Eigen directory
created by the normal installation of Eigen?

> +endef
> +
> +ifeq ($(BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES),y)
> +	EIGEN_POST_INSTALL_STAGING_HOOKS += EIGEN_INSTALL_UNSUPPORTED_MODULES
> +endif

I believe we normally don't really use post install hooks when there is
a definition of the staging install commands. Instead, we use the
following idiom:

ifeq ($(BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES),y)
define EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS
	cp -a ...
endef
endif

define EIGEN_INSTALL_STAGING_CMDS
	... existing installation steps ...
	$(EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS)
endef

Thomas
Samuel Martin March 19, 2014, 7:25 a.m. UTC | #2
Thomas, Davide, all,

On Tue, Mar 18, 2014 at 11:55 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Davide Viti,
>
> On Tue, 18 Mar 2014 21:18:14 +0100, Davide Viti wrote:
>> From: Davide Viti <d.viti@infosolution.it>
[...]
>>
>> +define EIGEN_INSTALL_UNSUPPORTED_MODULES
>> +     cp -a $(@D)/unsupported $(STAGING_DIR)/usr/include/
>
> I'm a bit worried about having a directory called
> $(STAGING_DIR)/usr/include/unsupported. Shouldn't this directory be
> installed *below* the $(STAGING_DIR)/usr/include/Eigen directory
> created by the normal installation of Eigen?

This goes a bit against what eigen's build-system (cmake) does by default.
The "Eigen" and "unsupported" directories are installed in the same
include directory
(defaults: /usr/include/eigen3).

I agree such a change may break some code in Buildroot users' code,
but I'm also worried about not following default install scheme done
by upstream projects.


Regards,
Davide Viti March 19, 2014, 8:07 a.m. UTC | #3
Hi Samuel and Thomas,
I can provide a patch that installs the files under
/usr/include/eigen3 and modify my latest patch to install unsupported
under that directory too.

I guess separate patches are preferred.

I can do it later on today.

Regards,
Davide

> Il giorno 19/mar/2014, alle ore 08:25, Samuel Martin <s.martin49@gmail.com> ha scritto:
>
> Thomas, Davide, all,
>
> On Tue, Mar 18, 2014 at 11:55 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Dear Davide Viti,
>>
>>> On Tue, 18 Mar 2014 21:18:14 +0100, Davide Viti wrote:
>>> From: Davide Viti <d.viti@infosolution.it>
> [...]
>>>
>>> +define EIGEN_INSTALL_UNSUPPORTED_MODULES
>>> +     cp -a $(@D)/unsupported $(STAGING_DIR)/usr/include/
>>
>> I'm a bit worried about having a directory called
>> $(STAGING_DIR)/usr/include/unsupported. Shouldn't this directory be
>> installed *below* the $(STAGING_DIR)/usr/include/Eigen directory
>> created by the normal installation of Eigen?
>
> This goes a bit against what eigen's build-system (cmake) does by default.
> The "Eigen" and "unsupported" directories are installed in the same
> include directory
> (defaults: /usr/include/eigen3).
>
> I agree such a change may break some code in Buildroot users' code,
> but I'm also worried about not following default install scheme done
> by upstream projects.
>
>
> Regards,
>
> --
> Samuel
Thomas Petazzoni March 19, 2014, 5:11 p.m. UTC | #4
Dear Davide Viti,

On Wed, 19 Mar 2014 09:07:10 +0100, Davide Viti wrote:

> I can provide a patch that installs the files under
> /usr/include/eigen3 and modify my latest patch to install unsupported
> under that directory too.

Seems like a good choice to me.

> I guess separate patches are preferred.

Great, thanks!

Thomas
diff mbox

Patch

diff --git a/package/eigen/Config.in b/package/eigen/Config.in
index e94f9a3..a653e37 100644
--- a/package/eigen/Config.in
+++ b/package/eigen/Config.in
@@ -13,5 +13,13 @@  config BR2_PACKAGE_EIGEN
 
 	  http://eigen.tuxfamily.org/
 
+if BR2_PACKAGE_EIGEN
+
+config BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES
+        bool "unsupported modules"
+	help
+	  Install eigen unsupported modules
+endif
+
 comment "eigen needs a toolchain w/ C++"
 	depends on !BR2_INSTALL_LIBSTDCPP
diff --git a/package/eigen/eigen.mk b/package/eigen/eigen.mk
index 5abd464..388dd63 100644
--- a/package/eigen/eigen.mk
+++ b/package/eigen/eigen.mk
@@ -13,6 +13,14 @@  EIGEN_LICENSE_FILES = COPYING.MPL2 COPYING.BSD COPYING.LGPL COPYING.README
 EIGEN_INSTALL_STAGING = YES
 EIGEN_INSTALL_TARGET = NO
 
+define EIGEN_INSTALL_UNSUPPORTED_MODULES
+	cp -a $(@D)/unsupported $(STAGING_DIR)/usr/include/
+endef
+
+ifeq ($(BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES),y)
+	EIGEN_POST_INSTALL_STAGING_HOOKS += EIGEN_INSTALL_UNSUPPORTED_MODULES
+endif
+
 # This package only consists of headers that need to be
 # copied over to the sysroot for compile time use
 define EIGEN_INSTALL_STAGING_CMDS