diff mbox series

[1/1] package/eigen: fix package detection with CMake

Message ID 20200613161643.609929-1-juju@cotds.org
State Superseded
Headers show
Series [1/1] package/eigen: fix package detection with CMake | expand

Commit Message

Julien Olivain June 13, 2020, 4:16 p.m. UTC
Eigen3 library normally installs a signature file named
"signature_of_eigen3_matrix_library" to help library detection:
https://gitlab.com/libeigen/eigen/-/blob/3.3.7/CMakeLists.txt#L423

This Buildroot package does not use CMake for installing files, as only
the headers are needed in the STAGING_DIR. A generic-package is used
instead with simple copies.

The library also provide a CMake macro that use this file to
detect it:
https://gitlab.com/libeigen/eigen/-/blob/3.3.7/cmake/FindEigen3.cmake#L76

Without the signature file installed, packages searching for this
library with this method will fail. Other packages usings pkg-config are
not affected by this issue.

This patch install the signature file at the expected path, to fix
detections.

Signed-off-by: Julien Olivain <juju@cotds.org>
---
 package/eigen/eigen.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Yann E. MORIN June 14, 2020, 7:28 a.m. UTC | #1
Julien, Matt, all,

On 2020-06-13 18:16 +0200, Julien Olivain spake thusly:
> Eigen3 library normally installs a signature file named
> "signature_of_eigen3_matrix_library" to help library detection:
> https://gitlab.com/libeigen/eigen/-/blob/3.3.7/CMakeLists.txt#L423
> 
> This Buildroot package does not use CMake for installing files, as only
> the headers are needed in the STAGING_DIR. A generic-package is used
> instead with simple copies.

Why can't we use the cmake-package infra, rahter than duplicate what
upstream does?

Regards,
Yann E. MORIN.

> The library also provide a CMake macro that use this file to
> detect it:
> https://gitlab.com/libeigen/eigen/-/blob/3.3.7/cmake/FindEigen3.cmake#L76
> 
> Without the signature file installed, packages searching for this
> library with this method will fail. Other packages usings pkg-config are
> not affected by this issue.
> 
> This patch install the signature file at the expected path, to fix
> detections.
> 
> Signed-off-by: Julien Olivain <juju@cotds.org>
> ---
>  package/eigen/eigen.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/eigen/eigen.mk b/package/eigen/eigen.mk
> index 5c9e028442..68ffe84cb4 100644
> --- a/package/eigen/eigen.mk
> +++ b/package/eigen/eigen.mk
> @@ -34,6 +34,7 @@ define EIGEN_INSTALL_STAGING_CMDS
>  	$(RM) -r $(EIGEN_DEST_DIR)
>  	mkdir -p $(EIGEN_DEST_DIR)
>  	cp -a $(@D)/Eigen $(EIGEN_DEST_DIR)
> +	cp -a $(@D)/signature_of_eigen3_matrix_library $(EIGEN_DEST_DIR)
>  	$(EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS)
>  	$(INSTALL) -D -m 0644 $(@D)/eigen3.pc \
>  		$(STAGING_DIR)/usr/lib/pkgconfig/eigen3.pc
> -- 
> 2.26.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Julien Olivain June 14, 2020, 10:54 a.m. UTC | #2
Hi Yann, Matt,

On 2020-06-14 09:28, Yann E. MORIN wrote:
> Julien, Matt, all,
> 
> On 2020-06-13 18:16 +0200, Julien Olivain spake thusly:
>> Eigen3 library normally installs a signature file named
>> "signature_of_eigen3_matrix_library" to help library detection:
>> https://gitlab.com/libeigen/eigen/-/blob/3.3.7/CMakeLists.txt#L423
>> 
>> This Buildroot package does not use CMake for installing files, as 
>> only
>> the headers are needed in the STAGING_DIR. A generic-package is used
>> instead with simple copies.
> 
> Why can't we use the cmake-package infra, rahter than duplicate what
> upstream does?

I agree, I can't see any reason why this package cannot use its upstream 
cmake infra.
I'll try to rewrite this patch to switch it as a cmake-package.

Best regards,

Julien.
diff mbox series

Patch

diff --git a/package/eigen/eigen.mk b/package/eigen/eigen.mk
index 5c9e028442..68ffe84cb4 100644
--- a/package/eigen/eigen.mk
+++ b/package/eigen/eigen.mk
@@ -34,6 +34,7 @@  define EIGEN_INSTALL_STAGING_CMDS
 	$(RM) -r $(EIGEN_DEST_DIR)
 	mkdir -p $(EIGEN_DEST_DIR)
 	cp -a $(@D)/Eigen $(EIGEN_DEST_DIR)
+	cp -a $(@D)/signature_of_eigen3_matrix_library $(EIGEN_DEST_DIR)
 	$(EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS)
 	$(INSTALL) -D -m 0644 $(@D)/eigen3.pc \
 		$(STAGING_DIR)/usr/lib/pkgconfig/eigen3.pc