eigen: 3.4.0-unstable-2022-05-19 -> 3.4.1

This commit is contained in:
Guilhem Saurel 2025-10-02 15:35:43 +02:00
parent b38b396f9d
commit 00f587fdf2
2 changed files with 35 additions and 75 deletions

View file

@ -1,57 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
# cmake_minimum_require must be the first command of the file
-cmake_minimum_required(VERSION 3.5.0)
+cmake_minimum_required(VERSION 3.7.0)
project(Eigen3)
@@ -443,7 +443,7 @@ set(PKGCONFIG_INSTALL_DIR
CACHE PATH "The directory relative to CMAKE_INSTALL_PREFIX where eigen3.pc is installed"
)
-foreach(var INCLUDE_INSTALL_DIR CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR)
+foreach(var CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR)
# If an absolute path is specified, make it relative to "{CMAKE_INSTALL_PREFIX}".
if(IS_ABSOLUTE "${${var}}")
file(RELATIVE_PATH "${var}" "${CMAKE_INSTALL_PREFIX}" "${${var}}")
@@ -466,13 +466,6 @@ install(FILES
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
)
-if(EIGEN_BUILD_PKGCONFIG)
- configure_file(eigen3.pc.in eigen3.pc @ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
- DESTINATION ${PKGCONFIG_INSTALL_DIR}
- )
-endif()
-
install(DIRECTORY Eigen DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
@@ -593,8 +586,15 @@ set ( EIGEN_VERSION_MAJOR ${EIGEN_WORLD_VERSION} )
set ( EIGEN_VERSION_MINOR ${EIGEN_MAJOR_VERSION} )
set ( EIGEN_VERSION_PATCH ${EIGEN_MINOR_VERSION} )
set ( EIGEN_DEFINITIONS "")
-set ( EIGEN_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" )
set ( EIGEN_ROOT_DIR ${CMAKE_INSTALL_PREFIX} )
+GNUInstallDirs_get_absolute_install_dir(EIGEN_INCLUDE_DIR INCLUDE_INSTALL_DIR)
+
+if(EIGEN_BUILD_PKGCONFIG)
+ configure_file(eigen3.pc.in eigen3.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
+ DESTINATION ${PKGCONFIG_INSTALL_DIR}
+ )
+endif()
include (CMakePackageConfigHelpers)
--- a/eigen3.pc.in
+++ b/eigen3.pc.in
@@ -6,4 +6,4 @@ Description: A C++ template library for linear algebra: vectors, matrices, and r
Requires:
Version: @EIGEN_VERSION_NUMBER@
Libs:
-Cflags: -I${prefix}/@INCLUDE_INSTALL_DIR@
+Cflags: -I@EIGEN_INCLUDE_DIR@

View file

@ -1,43 +1,60 @@
{
lib,
stdenv,
fetchFromGitLab,
fetchpatch,
# nativeBuildInputs
cmake,
# nativeCheckInputs
ctestCheckHook,
}:
stdenv.mkDerivation {
stdenv.mkDerivation (finalAttrs: {
pname = "eigen";
version = "3.4.0-unstable-2022-05-19";
version = "3.4.1";
src = fetchFromGitLab {
owner = "libeigen";
repo = "eigen";
rev = "e7248b26a1ed53fa030c5c459f7ea095dfd276ac";
hash = "sha256-uQ1YYV3ojbMVfHdqjXRyUymRPjJZV3WHT36PTxPRius=";
tag = finalAttrs.version;
hash = "sha256-NSq1tUfy2thz5gtsyASsKeYE4vMf71aSG4uXfrX86rk=";
};
patches = [
./include-dir.patch
# fix bug1213 test
# ref https://gitlab.com/libeigen/eigen/-/merge_requests/2005 merged upstream
(fetchpatch {
url = "https://gitlab.com/libeigen/eigen/-/commit/3e1367a3b5efcdc8ce716db77a322cedeb5e01b4.patch";
hash = "sha256-oykUbzaZeVW1A8nBoiMtJvh68Zpu7PDFtAfAjtTQoC0=";
})
];
# ref. https://gitlab.com/libeigen/eigen/-/merge_requests/977
# This was merged upstream and can be removed on next release
postPatch = ''
substituteInPlace Eigen/src/SVD/BDCSVD.h --replace-fail \
"if (l == 0) {" \
"if (i >= k && l == 0) {"
'';
nativeBuildInputs = [
cmake
];
nativeBuildInputs = [ cmake ];
nativeCheckInputs = [
ctestCheckHook
];
meta = with lib; {
cmakeFlags = [
(lib.cmakeBool "EIGEN_LEAVE_TEST_IN_ALL_TARGET" true) # Build tests in parallel
];
# too many flaky tests
doCheck = false;
meta = {
homepage = "https://eigen.tuxfamily.org";
description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [
sander
raskin
];
platforms = platforms.unix;
platforms = lib.platforms.unix;
};
}
})