package/eigen: fix package detection with CMake
PATCH 1/1 package/eigen: fix package detection with CMake
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.
--- package/eigen/eigen.mk | 1 + 1 file changed, 1 insertion(+)
package/eigen/eigen.mk +1 -0
@@ -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
Signature · 1 line
2.26.2
PATCH 1/1 package/eigen: fix package detection with CMake
Julien, Matt, all,
On 2020-06-13 18:16 +0200, Julien Olivain spake thusly:
Quoted 7 lines
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#L423This 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.
Quoted 35 lines
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#L76Without 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 <[email protected]>--- package/eigen/eigen.mk | 1 + 1 file changed, 1 insertion(+)package/eigen/eigen.mk +1
-0@@ -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.pcSignature · 6 lines
2.26.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/1 package/eigen: fix package detection with CMake
Hi Yann, Matt,
Quoted 7 lines · Yann E. MORIN
Julien, Matt, all,
On 2020-06-13 18:16 +0200, Julien Olivain spake thusly:
Quoted 4 lines
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
Quoted 7 lines
Quoted 4 lines
This Buildroot package does not use CMake for installing files, as only
the headers are needed in theSTAGING_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.
PATCH v2 1/1 package/eigen: use cmake-package infra
In reply to Julien OlivainThe eigen package was introduced as a generic package, but upstream was in fact using CMake.
The motivation of this change is to fix package detection with CMake.
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
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.
By using the cmake-package infrastructure, all the needed files are now installed, fixing this CMake detection issue.
Other changes in this patch:
- Updated the Eigen git repository to the new url:
https://gitlab.com/libeigen/eigen
- Removed all build and install staging commands (now included in upstream cmake)
- Package needs EIGEN_SUPPORTS_IN_SOURCE_BUILD = NO
- Removed the BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES option, as this option is not proposed by the upstream CMake
- Updated hash for source package
- Reformat hash file with two spaces delimiters
- Define EIGEN_CONF_OPTS to set pkg-config .pc install path
---
Changes v1 -> v2:
- use cmake package infra, instead of fixing cmake detection issue by duplicating upstream commands, as suggested by Yann.
--- package/eigen/Config.in | 8 -------- package/eigen/eigen.hash | 14 +++++++------- package/eigen/eigen.mk | 37 ++++++++----------------------------- 3 files changed, 15 insertions(+), 44 deletions(-)
package/eigen/Config.in +0 -8
@@ -13,13 +13,5 @@ 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
package/eigen/eigen.hash +7 -7
@@ -1,8 +1,8 @@ # Locally computed -sha256 9f13cf90dedbe3e52a19f43000d71fdf72e986beb9a5436dddcd61ff9d77a3ce 3.3.7.tar.bz2 -sha256 4f877e5ae4672568ef82cfd0023e2cef4a7cf55d867ab249efc9569a7eb9e5b1 COPYING.BSD -sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING.GPL -sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL -sha256 f5b330efdad110cdd84d585ec61220b0650461fa599e36b13e1726c9346dcfb9 COPYING.MINPACK -sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 COPYING.MPL2 -sha256 c83230b770f17ef1386ea1fd3681271dd98aa93646bdbfb5bff3a1b7050fff9d COPYING.README +sha256 685adf14bd8e9c015b78097c1dc22f2f01343756f196acdc76a678e1ae352e11 eigen-3.3.7.tar.bz2 +sha256 4f877e5ae4672568ef82cfd0023e2cef4a7cf55d867ab249efc9569a7eb9e5b1 COPYING.BSD +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING.GPL +sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL +sha256 f5b330efdad110cdd84d585ec61220b0650461fa599e36b13e1726c9346dcfb9 COPYING.MINPACK +sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 COPYING.MPL2 +sha256 c83230b770f17ef1386ea1fd3681271dd98aa93646bdbfb5bff3a1b7050fff9d COPYING.README
package/eigen/eigen.mk +8 -29
@@ -5,38 +5,17 @@ ################################################################################ EIGEN_VERSION = 3.3.7 -EIGEN_SOURCE = $(EIGEN_VERSION).tar.bz2 -EIGEN_SITE = https://bitbucket.org/eigen/eigen/get +EIGEN_SOURCE = eigen-$(EIGEN_VERSION).tar.bz2 +EIGEN_SITE = https://gitlab.com/libeigen/eigen/-/archive/$(EIGEN_VERSION) EIGEN_LICENSE = MPL2, BSD-3-Clause, LGPL-2.1 EIGEN_LICENSE_FILES = COPYING.MPL2 COPYING.BSD COPYING.LGPL COPYING.README EIGEN_INSTALL_STAGING = YES EIGEN_INSTALL_TARGET = NO -EIGEN_DEST_DIR = $(STAGING_DIR)/usr/include/eigen3 +EIGEN_SUPPORTS_IN_SOURCE_BUILD = NO -ifeq ($(BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES),y) -define EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS - mkdir -p $(EIGEN_DEST_DIR)/unsupported - cp -a $(@D)/unsupported/Eigen $(EIGEN_DEST_DIR)/unsupported -endef -endif +# Default Eigen CMake installs .pc file in +# $(STAGING)/usr/share/pkgconfig +# change it to lib/pkgconfig, to be consistent with other packages. +EIGEN_CONF_OPTS = -DPKGCONFIG_INSTALL_DIR:PATH=lib/pkgconfig -# Generate the .pc file at build time -define EIGEN_BUILD_CMDS - sed -r -e 's,^Version: .*,Version: $(EIGEN_VERSION),' \ - -e 's,^Cflags: .*,Cflags: -I$$\{prefix\}/include/eigen3,' \ - -e 's,^prefix.*,prefix=/usr,' \ - $(@D)/eigen3.pc.in >$(@D)/eigen3.pc -endef - -# This package only consists of headers that need to be -# copied over to the sysroot for compile time use -define EIGEN_INSTALL_STAGING_CMDS - $(RM) -r $(EIGEN_DEST_DIR) - mkdir -p $(EIGEN_DEST_DIR) - cp -a $(@D)/Eigen $(EIGEN_DEST_DIR) - $(EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS) - $(INSTALL) -D -m 0644 $(@D)/eigen3.pc \ - $(STAGING_DIR)/usr/lib/pkgconfig/eigen3.pc -endef - -$(eval $(generic-package)) +$(eval $(cmake-package))
Signature · 1 line
2.26.2
PATCH v2 1/1 package/eigen: use cmake-package infra
Julien, All,
On 2020-06-14 19:37 +0200, Julien Olivain spake thusly:
Quoted 20 lines
The eigen package was introduced as a generic package, but upstream was in fact using CMake.
The motivation of this change is to fix package detection with CMake.
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#L423The 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#L76Without 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.
By using the cmake-package infrastructure, all the needed files are now installed, fixing this CMake detection issue.
Quoted 8 lines
Other changes in this patch:
- Updated the Eigen git repository to the new url:
https://gitlab.com/libeigen/eigen
- Removed all build and install staging commands (now included in upstream cmake)
- Package needsEIGEN_SUPPORTS_IN_SOURCE_BUILD= NO
- Removed theBR2_PACKAGE_EIGEN_UNSUPPORTED_MODULESoption, as this option is not proposed by the upstream CMake
... but they are unconditionally installed. A such, no need to introduce a legacy entry for BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES:
users that had it enabled will still get the files installed, while those that did not will get them installed now.
Quoted 1 line
- Updated hash for source package
... because the first component in the stored paths changed from eigen-eigen-323c052e1731/ to eigen-3.3.7/ and some mercurial related files (.hg_archival.txt, .hgtags) got dropped after the conversion to git.
Quoted 2 lines
- Reformat hash file with two spaces delimiters
- DefineEIGEN_CONF_OPTSto set pkg-config .pc install path
This one I am having a hard time with, see below...
Quoted 1 line
Signed-off-by Julien Olivain <[email protected]>
[--SNIP--]
package/eigen/eigen.mk line 19
Quoted 4 lines
package/eigen/eigen.mk +4
-0+# Default Eigen CMake installs .pc file in +# $(STAGING)/usr/share/pkgconfig +# change it to lib/pkgconfig, to be consistent with other packages. +EIGEN_CONF_OPTS = -DPKGCONFIG_INSTALL_DIR:PATH=lib/pkgconfig
So this is a syntax that I am not familiar with.
First, it uses a non-absolute path "lib/pkgconfig". This is strange to me. Second, it uses a variable with a colon PKGCONFIG_INSTALL_DIR:PATH, and I don't know that either.
Yes, it works as expected, but I like to understand what's going on. Can you shed a light on this, please?
I've tested -DPKGCONFIG_INSTALL_DIR=/usr/lib/pkgconfig which is the usual way we're used to in Buildroot, and that works too.
I'll wait for your feedback on the above, but I'd prefer we use the more traditional form unless there is a good reason not to.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 1/1 package/eigen: use cmake-package infra
Yann, All,
Quoted 34 lines · Yann E. MORIN
Julien, All,
On 2020-06-14 19:37 +0200, Julien Olivain spake thusly:
Quoted 22 lines
The eigen package was introduced as a generic package, but upstream was
in fact using CMake.The motivation of this change is to fix package detection with CMake.
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#L423The 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#L76Without 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.By using the cmake-package infrastructure, all the needed files are now installed, fixing this CMake detection issue.
Quoted 8 lines
Other changes in this patch:
- Updated the Eigen git repository to the new url:
https://gitlab.com/libeigen/eigen
- Removed all build and install staging commands (now included in upstream cmake)
- Package needsEIGEN_SUPPORTS_IN_SOURCE_BUILD= NO
- Removed theBR2_PACKAGE_EIGEN_UNSUPPORTED_MODULESoption, as this option is not proposed by the upstream CMake
Quoted 4 lines
... but they are unconditionally installed. A such, no need to introduce a legacy entry for
BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES:
users that had it enabled will still get the files installed, while those that did not will get them installed now.
I'll clarify the commit log by including your comment in an updated patch.
Quoted 6 lines
Quoted 1 line
- Updated hash for source package
... because the first component in the stored paths changed from eigen-eigen-323c052e1731/ to eigen-3.3.7/ and some mercurial related files (.hg_archival.txt, .hgtags) got dropped after the conversion to git.
I'll also include this comment.
Quoted 22 lines
Quoted 2 lines
- Reformat hash file with two spaces delimiters
- DefineEIGEN_CONF_OPTSto set pkg-config .pc install pathThis one I am having a hard time with, see below...
Quoted 1 line
Signed-off-by Julien Olivain <[email protected]>[--SNIP--]
package/eigen/eigen.mk line 19
Quoted 4 lines
package/eigen/eigen.mk +4
-0+# Default Eigen CMake installs .pc file in +# $(STAGING)/usr/share/pkgconfig +# change it to lib/pkgconfig, to be consistent with other packages. +EIGEN_CONF_OPTS = -DPKGCONFIG_INSTALL_DIR:PATH=lib/pkgconfigSo this is a syntax that I am not familiar with.
First, it uses a non-absolute path "lib/pkgconfig". This is strange to me. Second, it uses a variable with a colon PKGCONFIG_INSTALL_DIR:PATH, and I don't know that either.
Yes, it works as expected, but I like to understand what's going on. Can
you shed a light on this, please?
Quoted 6 lines
I've tested -DPKGCONFIG_INSTALL_DIR=/usr/lib/pkgconfig which is the usual way we're used to in Buildroot, and that works too.
I'll wait for your feedback on the above, but I'd prefer we use the more
traditional form unless there is a good reason not to.
The notations:
-DPKGCONFIG_INSTALL_DIR:PATH=lib/pkgconfig
and
-DPKGCONFIG_INSTALL_DIR=/usr/lib/pkgconfig
will indeed give the same result.
I'll update the patch to use the traditional notation.
Some explanations how/why the first notation also works:
The -D variable:type=value option has been in cmake for at least a decade,
it just gives a hint of the type of CMake variable. It was already present in CMake 2.4:
https://cmake.org/cmake/help/cmake2.4docs.html
The reason I've set the variable type was to match the type in CMakeLists.txt:
https://gitlab.com/libeigen/eigen/-/blob/3.3.7/CMakeLists.txt#L407
But this is not mandatory.
Then, the PKGCONFIG_INSTALL_DIR variable is used as a destination of a install() cmake command:
https://cmake.org/cmake/help/v3.18/command/install.html
A relative path is relative to CMAKE_INSTALL_PREFIX, which is set to "/usr" by cmake-package infra:
https://git.busybox.net/buildroot/tree/package/pkg-cmake.mk?h=2020.05#n96
Then, everything gets relocated at "make DESTDIR=... install/fast" time, to be installed in staging directory (in that case).
Thanks for the review, I'll send the updated patch soon.
Julien.
PATCH v3 1/1 package/eigen: use cmake-package infra
In reply to Julien OlivainThe eigen package was introduced as a generic package, but upstream was in fact using CMake.
The motivation of this change is to fix package detection with CMake.
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
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.
By using the cmake-package infrastructure, all the needed files are now installed, fixing this CMake detection issue.
Other changes in this patch:
- Updated the Eigen git repository to the new url:
https://gitlab.com/libeigen/eigen
- Removed all build and install staging commands
(now included in upstream cmake)
- Package needs EIGEN_SUPPORTS_IN_SOURCE_BUILD = NO
- Removed the BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES option, as this option is not proposed by the upstream CMake. Unsupported module header files are now unconditionally installed. As such, no need to introduce a legacy entry for BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES: users that had it enabled will still get the files installed, while those that did not will get them installed now.
- Updated hash for source package, because the first component in the stored paths changed from eigen-eigen-323c052e1731/ to eigen-3.3.7/ and some mercurial related files (.hg_archival.txt, .hgtags) got dropped after the conversion to git.
- Reformat hash file with two spaces delimiters
- Define EIGEN_CONF_OPTS to set pkg-config .pc install path
---
Changes v2 -> v3:
Suggested by Yann:
- clarified commit log about hash change
- clarified commit log about unsupported module option removal
- Use absolute path to set PKGCONFIG_INSTALL_DIR CMake variable
Changes v1 -> v2:
- use cmake package infra, instead of fixing cmake detection issue by duplicating upstream commands, as suggested by Yann.
--- package/eigen/Config.in | 8 -------- package/eigen/eigen.hash | 14 +++++++------- package/eigen/eigen.mk | 36 +++++++----------------------------- 3 files changed, 14 insertions(+), 44 deletions(-)
package/eigen/Config.in +0 -8
@@ -13,13 +13,5 @@ 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
package/eigen/eigen.hash +7 -7
@@ -1,8 +1,8 @@ # Locally computed -sha256 9f13cf90dedbe3e52a19f43000d71fdf72e986beb9a5436dddcd61ff9d77a3ce 3.3.7.tar.bz2 -sha256 4f877e5ae4672568ef82cfd0023e2cef4a7cf55d867ab249efc9569a7eb9e5b1 COPYING.BSD -sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING.GPL -sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL -sha256 f5b330efdad110cdd84d585ec61220b0650461fa599e36b13e1726c9346dcfb9 COPYING.MINPACK -sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 COPYING.MPL2 -sha256 c83230b770f17ef1386ea1fd3681271dd98aa93646bdbfb5bff3a1b7050fff9d COPYING.README +sha256 685adf14bd8e9c015b78097c1dc22f2f01343756f196acdc76a678e1ae352e11 eigen-3.3.7.tar.bz2 +sha256 4f877e5ae4672568ef82cfd0023e2cef4a7cf55d867ab249efc9569a7eb9e5b1 COPYING.BSD +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING.GPL +sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL +sha256 f5b330efdad110cdd84d585ec61220b0650461fa599e36b13e1726c9346dcfb9 COPYING.MINPACK +sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 COPYING.MPL2 +sha256 c83230b770f17ef1386ea1fd3681271dd98aa93646bdbfb5bff3a1b7050fff9d COPYING.README
package/eigen/eigen.mk +7 -29
@@ -5,38 +5,16 @@ ################################################################################ EIGEN_VERSION = 3.3.7 -EIGEN_SOURCE = $(EIGEN_VERSION).tar.bz2 -EIGEN_SITE = https://bitbucket.org/eigen/eigen/get +EIGEN_SOURCE = eigen-$(EIGEN_VERSION).tar.bz2 +EIGEN_SITE = https://gitlab.com/libeigen/eigen/-/archive/$(EIGEN_VERSION) EIGEN_LICENSE = MPL2, BSD-3-Clause, LGPL-2.1 EIGEN_LICENSE_FILES = COPYING.MPL2 COPYING.BSD COPYING.LGPL COPYING.README EIGEN_INSTALL_STAGING = YES EIGEN_INSTALL_TARGET = NO -EIGEN_DEST_DIR = $(STAGING_DIR)/usr/include/eigen3 +EIGEN_SUPPORTS_IN_SOURCE_BUILD = NO -ifeq ($(BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES),y) -define EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS - mkdir -p $(EIGEN_DEST_DIR)/unsupported - cp -a $(@D)/unsupported/Eigen $(EIGEN_DEST_DIR)/unsupported -endef -endif +# Default Eigen CMake installs .pc file in /usr/share/pkgconfig +# change it to /usr/lib/pkgconfig, to be consistent with other packages. +EIGEN_CONF_OPTS = -DPKGCONFIG_INSTALL_DIR=/usr/lib/pkgconfig -# Generate the .pc file at build time -define EIGEN_BUILD_CMDS - sed -r -e 's,^Version: .*,Version: $(EIGEN_VERSION),' \ - -e 's,^Cflags: .*,Cflags: -I$$\{prefix\}/include/eigen3,' \ - -e 's,^prefix.*,prefix=/usr,' \ - $(@D)/eigen3.pc.in >$(@D)/eigen3.pc -endef - -# This package only consists of headers that need to be -# copied over to the sysroot for compile time use -define EIGEN_INSTALL_STAGING_CMDS - $(RM) -r $(EIGEN_DEST_DIR) - mkdir -p $(EIGEN_DEST_DIR) - cp -a $(@D)/Eigen $(EIGEN_DEST_DIR) - $(EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS) - $(INSTALL) -D -m 0644 $(@D)/eigen3.pc \ - $(STAGING_DIR)/usr/lib/pkgconfig/eigen3.pc -endef - -$(eval $(generic-package)) +$(eval $(cmake-package))
Signature · 1 line
2.26.2
PATCH v3 1/1 package/eigen: use cmake-package infra
Julien,
Quoted 3 lines · Julien Olivain
The eigen package was introduced as a generic package, but upstream was in fact using CMake.
The original reason for going the generic route was because the pkg suggested just copying the headers and that documentation used CMake. Hindsight being what it is, looks like a good point to now clean things up and go the CMake route :)
Quoted 18 lines
The motivation of this change is to fix package detection with CMake.
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#L423The 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#L76Without 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.
By using the cmake-package infrastructure, all the needed files are now installed, fixing this CMake detection issue.
Quoted 13 lines
Other changes in this patch:
- Updated the Eigen git repository to the new url:
https://gitlab.com/libeigen/eigen
- Removed all build and install staging commands
(now included in upstream cmake)
- Package needsEIGEN_SUPPORTS_IN_SOURCE_BUILD= NO
- Removed theBR2_PACKAGE_EIGEN_UNSUPPORTED_MODULESoption, as this option is not proposed by the upstream CMake. Unsupported module header files are now unconditionally installed. As such, no need to introduce a legacy entry forBR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES: users that had it enabled will still get the files installed, while those that did not will get them installed now.
I've built the package and confirmed the .files-list-staging.txt includes the additional signature file, unsupported modules and cmake helpers.
Quoted 30 lines
- Updated hash for source package, because the first component in the stored paths changed from eigen-eigen-323c052e1731/ to eigen-3.3.7/ and some mercurial related files (.hg_archival.txt, .hgtags) got dropped after the conversion to git.
- Reformat hash file with two spaces delimiters
- DefineEIGEN_CONF_OPTSto set pkg-config .pc install pathSigned-off-by Julien Olivain <[email protected]>---
Changes v2 -> v3:
Suggested by Yann:
- clarified commit log about hash change
- clarified commit log about unsupported module option removal
- Use absolute path to setPKGCONFIG_INSTALL_DIRCMake variableChanges v1 -> v2:
- use cmake package infra, instead of fixing cmake detection issue by duplicating upstream commands, as suggested by Yann.--- package/eigen/Config.in | 8 -------- package/eigen/eigen.hash | 14 +++++++------- package/eigen/eigen.mk | 36 +++++++----------------------------- 3 files changed, 14 insertions(+), 44 deletions(-)package/eigen/Config.in +0
-0
package/eigen/Config.in config BR2_PACKAGE_EIGEN · line 18
Quoted 6 lines
package/eigen/Config.in +0
-3@@ -13,13 +13,5 @@ config BR2_PACKAGE_EIGEN http://eigen.tuxfamily.org/ -if BR2_PACKAGE_EIGEN - -config BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES
Do we need to add a legacy config for this?
Thanks for cleaning this up!
Matt
PATCH v3 1/1 package/eigen: use cmake-package infra
Matthew, All,
On 2020-06-15 18:50 -0500, Matthew Weber spake thusly:
Quoted 1 line · Julien Olivain
[--SNIP--]
Quoted 2 lines
Quoted 1 line
-config
BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULESDo we need to add a legacy config for this?
As explained in the commit log, no. ;-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
Yann E. MORIN
AppliedPATCH v3 1/1 package/eigen: use cmake-package infra
In reply to Julien OlivainJulien, All,
On 2020-06-15 20:49 +0200, Julien Olivain spake thusly:
Quoted 40 lines
The eigen package was introduced as a generic package, but upstream was in fact using CMake.
The motivation of this change is to fix package detection with CMake.
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#L423The 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#L76Without 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.
By using the cmake-package infrastructure, all the needed files are now installed, fixing this CMake detection issue.
Other changes in this patch:
- Updated the Eigen git repository to the new url:
https://gitlab.com/libeigen/eigen
- Removed all build and install staging commands
(now included in upstream cmake)
- Package needsEIGEN_SUPPORTS_IN_SOURCE_BUILD= NO
- Removed theBR2_PACKAGE_EIGEN_UNSUPPORTED_MODULESoption, as this option is not proposed by the upstream CMake. Unsupported module header files are now unconditionally installed. As such, no need to introduce a legacy entry forBR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES: users that had it enabled will still get the files installed, while those that did not will get them installed now.
- Updated hash for source package, because the first component in the stored paths changed from eigen-eigen-323c052e1731/ to eigen-3.3.7/ and some mercurial related files (.hg_archival.txt, .hgtags) got dropped after the conversion to git.
- Reformat hash file with two spaces delimiters
- DefineEIGEN_CONF_OPTSto set pkg-config .pc install path
Quoted 1 line
Signed-off-by Julien Olivain <[email protected]>
Applied to master, thanks.
Regards,
Yann E. MORIN.
Quoted 111 lines
---
Changes v2 -> v3:
Suggested by Yann:
- clarified commit log about hash change
- clarified commit log about unsupported module option removal
- Use absolute path to setPKGCONFIG_INSTALL_DIRCMake variableChanges v1 -> v2:
- use cmake package infra, instead of fixing cmake detection issue by duplicating upstream commands, as suggested by Yann.--- package/eigen/Config.in | 8 -------- package/eigen/eigen.hash | 14 +++++++------- package/eigen/eigen.mk | 36 +++++++----------------------------- 3 files changed, 14 insertions(+), 44 deletions(-)package/eigen/Config.in +0
-8@@ -13,13 +13,5 @@ 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_LIBSTDCPPpackage/eigen/eigen.hash +7
-7@@ -1,8 +1,8 @@ # Locally computed -sha256 9f13cf90dedbe3e52a19f43000d71fdf72e986beb9a5436dddcd61ff9d77a3ce 3.3.7.tar.bz2 -sha256 4f877e5ae4672568ef82cfd0023e2cef4a7cf55d867ab249efc9569a7eb9e5b1 COPYING.BSD -sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING.GPL -sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL -sha256 f5b330efdad110cdd84d585ec61220b0650461fa599e36b13e1726c9346dcfb9 COPYING.MINPACK -sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 COPYING.MPL2 -sha256 c83230b770f17ef1386ea1fd3681271dd98aa93646bdbfb5bff3a1b7050fff9d COPYING.README +sha256 685adf14bd8e9c015b78097c1dc22f2f01343756f196acdc76a678e1ae352e11 eigen-3.3.7.tar.bz2 +sha256 4f877e5ae4672568ef82cfd0023e2cef4a7cf55d867ab249efc9569a7eb9e5b1 COPYING.BSD +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING.GPL +sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING.LGPL +sha256 f5b330efdad110cdd84d585ec61220b0650461fa599e36b13e1726c9346dcfb9 COPYING.MINPACK +sha256 fab3dd6bdab226f1c08630b1dd917e11fcb4ec5e1e020e2c16f83a0a13863e85 COPYING.MPL2 +sha256 c83230b770f17ef1386ea1fd3681271dd98aa93646bdbfb5bff3a1b7050fff9d COPYING.READMEpackage/eigen/eigen.mk +7
-29@@ -5,38 +5,16 @@ ################################################################################ EIGEN_VERSION = 3.3.7 -EIGEN_SOURCE = $(EIGEN_VERSION).tar.bz2 -EIGEN_SITE = https://bitbucket.org/eigen/eigen/get +EIGEN_SOURCE = eigen-$(EIGEN_VERSION).tar.bz2 +EIGEN_SITE = https://gitlab.com/libeigen/eigen/-/archive/$(EIGEN_VERSION) EIGEN_LICENSE = MPL2, BSD-3-Clause, LGPL-2.1 EIGEN_LICENSE_FILES = COPYING.MPL2 COPYING.BSD COPYING.LGPL COPYING.README EIGEN_INSTALL_STAGING = YES EIGEN_INSTALL_TARGET = NO -EIGEN_DEST_DIR = $(STAGING_DIR)/usr/include/eigen3 +EIGEN_SUPPORTS_IN_SOURCE_BUILD = NO -ifeq ($(BR2_PACKAGE_EIGEN_UNSUPPORTED_MODULES),y) -define EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS - mkdir -p $(EIGEN_DEST_DIR)/unsupported - cp -a $(@D)/unsupported/Eigen $(EIGEN_DEST_DIR)/unsupported -endef -endif +# Default Eigen CMake installs .pc file in /usr/share/pkgconfig +# change it to /usr/lib/pkgconfig, to be consistent with other packages. +EIGEN_CONF_OPTS = -DPKGCONFIG_INSTALL_DIR=/usr/lib/pkgconfig -# Generate the .pc file at build time -define EIGEN_BUILD_CMDS - sed -r -e 's,^Version: .*,Version: $(EIGEN_VERSION),' \ - -e 's,^Cflags: .*,Cflags: -I$$\{prefix\}/include/eigen3,' \ - -e 's,^prefix.*,prefix=/usr,' \ - $(@D)/eigen3.pc.in >$(@D)/eigen3.pc -endef - -# This package only consists of headers that need to be -# copied over to the sysroot for compile time use -define EIGEN_INSTALL_STAGING_CMDS - $(RM) -r $(EIGEN_DEST_DIR) - mkdir -p $(EIGEN_DEST_DIR) - cp -a $(@D)/Eigen $(EIGEN_DEST_DIR) - $(EIGEN_INSTALL_UNSUPPORTED_MODULES_CMDS) - $(INSTALL) -D -m 0644 $(@D)/eigen3.pc \ - $(STAGING_DIR)/usr/lib/pkgconfig/eigen3.pc -endef - -$(eval $(generic-package)) +$(eval $(cmake-package))Signature · 6 lines
2.26.2 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'