From fae837212b17659c834ce928d5b0a58d4d15be0d Mon Sep 17 00:00:00 2001 From: Florian Uhlig Date: Mon, 5 Dec 2022 14:54:09 +0100 Subject: [PATCH] [legacy] root: Fix compilation for CMake >= 3.24 --- cmake/legacy.cmake | 1 + ...nstall_external_tars_with_cmake_3_24.patch | 96 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 legacy/root/fix_root_install_external_tars_with_cmake_3_24.patch diff --git a/cmake/legacy.cmake b/cmake/legacy.cmake index 5ce173ca..000ae945 100644 --- a/cmake/legacy.cmake +++ b/cmake/legacy.cmake @@ -350,6 +350,7 @@ ExternalProject_Add(root COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_pyroot_code_h_inclusion_python_3_11.patch" COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_tpython_python_3_11_deprecation.patch" COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_pyroot_cast_error_python_3_11.patch" + COMMAND ${patch} -p1 -i "${CMAKE_SOURCE_DIR}/legacy/root/fix_root_install_external_tars_with_cmake_3_24.patch" ${CMAKE_DEFAULT_ARGS} CMAKE_ARGS "-Daqua=ON" "-Dasimage=ON" diff --git a/legacy/root/fix_root_install_external_tars_with_cmake_3_24.patch b/legacy/root/fix_root_install_external_tars_with_cmake_3_24.patch new file mode 100644 index 00000000..847bf3b1 --- /dev/null +++ b/legacy/root/fix_root_install_external_tars_with_cmake_3_24.patch @@ -0,0 +1,96 @@ +commit e79ef2e76ea8e20c9e4edc28844b97f82122033f +Author: Axel Naumann +Date: Fri Nov 18 15:32:34 2022 +0100 + + [cmake] Tell CMake >= 3.24 to use tared timestamps: + + Newer CMake uses extraction timestamps for extracted files, instead + of the timestamp as stored in the tar file, see + https://cmake.org/cmake/help/latest/policy/CMP0135.html#policy:CMP0135 + This causes (massive) problems with configure/Makefile tar files, + where the configure/Makefile dependencies (e.g. autoconf input files) + might be newer than configure/Makefile, causing configure/Makefile to + wanting to regenerate themselves because they are supposedly out of + date. + This is https://gitlab.kitware.com/cmake/cmake/-/issues/24003 + + For anything with "./configure", force the timestamp as stored in the tar file. + + [FU, 06.12.22] Unfortunately the fix provieded by ROOT is wrong. The parameter + must be true instead of wrong. This was already reported to the + upstream project. To get things working I changed + set(DOWNLOAD_EXTRACT_TIMESTAMP_ARG DOWNLOAD_EXTRACT_TIMESTAMP false) + to + set(DOWNLOAD_EXTRACT_TIMESTAMP_ARG DOWNLOAD_EXTRACT_TIMESTAMP true) + in the existing patch +diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake +index 7232e66a2..a9895f532 100644 +--- a/cmake/modules/SearchInstalledSoftware.cmake ++++ b/cmake/modules/SearchInstalledSoftware.cmake +@@ -19,6 +19,10 @@ macro(find_package) + endif() + endmacro() + ++if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24) ++ set(DOWNLOAD_EXTRACT_TIMESTAMP_ARG DOWNLOAD_EXTRACT_TIMESTAMP true) ++endif() ++ + #---On MacOSX, try to find frameworks after standard libraries or headers------------ + set(CMAKE_FIND_FRAMEWORK LAST) + +@@ -178,6 +182,7 @@ if(builtin_freetype) + FREETYPE + URL ${CMAKE_SOURCE_DIR}/graf2d/freetype/src/freetype-${freetype_version}.tar.gz + URL_HASH SHA256=efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938 ++ ${DOWNLOAD_EXTRACT_TIMESTAMP_ARG} + CONFIGURE_COMMAND ./configure --prefix --with-pic + --disable-shared --with-png=no --with-bzip2=no + --with-harfbuzz=no ${_freetype_brotli} ${_freetype_zlib} +@@ -275,6 +280,7 @@ if(builtin_lzma) + LZMA + URL ${CMAKE_SOURCE_DIR}/core/lzma/src/xz-${lzma_version}.tar.gz + URL_HASH SHA256=b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145 ++ ${DOWNLOAD_EXTRACT_TIMESTAMP_ARG} + INSTALL_DIR ${CMAKE_BINARY_DIR} + CONFIGURE_COMMAND /configure --prefix --libdir /lib + --with-pic --disable-shared --quiet +@@ -496,6 +502,7 @@ if(builtin_afterimage) + ExternalProject_Add( + AFTERIMAGE + DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/graf2d/asimage/src/libAfterImage AFTERIMAGE ++ ${DOWNLOAD_EXTRACT_TIMESTAMP_ARG} + INSTALL_DIR ${CMAKE_BINARY_DIR} + CONFIGURE_COMMAND ./configure --prefix + --libdir=/lib +@@ -557,6 +564,7 @@ if(mathmore OR builtin_gsl) + URL ${lcgpackages}/gsl-${gsl_version}.tar.gz + URL_HASH SHA256=0460ad7c2542caaddc6729762952d345374784100223995eb14d614861f2258d + SOURCE_DIR GSL-src # prevent "" vs GSL/ macOS warning ++ ${DOWNLOAD_EXTRACT_TIMESTAMP_ARG} + INSTALL_DIR ${CMAKE_BINARY_DIR} + CONFIGURE_COMMAND /configure --prefix + --libdir=/lib +@@ -866,6 +874,7 @@ if(builtin_fftw3) + FFTW3 + URL ${lcgpackages}/fftw-${FFTW_VERSION}.tar.gz + URL_HASH SHA256=6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303 ++ ${DOWNLOAD_EXTRACT_TIMESTAMP_ARG} + INSTALL_DIR ${CMAKE_BINARY_DIR} + CONFIGURE_COMMAND ./configure --prefix= + BUILD_COMMAND make CFLAGS=-fPIC +@@ -921,6 +930,7 @@ if(fitsio OR builtin_cfitsio) + # ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio${cfitsio_version_no_dots}.tar.gz + URL ${lcgpackages}/cfitsio${cfitsio_version_no_dots}.tar.gz + URL_HASH SHA256=bf6012dbe668ecb22c399c4b7b2814557ee282c74a7d5dc704eb17c30d9fb92e ++ ${DOWNLOAD_EXTRACT_TIMESTAMP_ARG} + INSTALL_DIR ${CMAKE_BINARY_DIR} + CONFIGURE_COMMAND /configure --prefix + LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 +@@ -1385,6 +1395,7 @@ if(builtin_tbb) + TBB + URL ${lcgpackages}/tbb-${tbb_builtin_version}.tar.gz + URL_HASH SHA256=${tbb_sha256} ++ ${DOWNLOAD_EXTRACT_TIMESTAMP_ARG} + INSTALL_DIR ${CMAKE_BINARY_DIR} + PATCH_COMMAND sed -i -e "/clang -v/s@-v@--version@" build/macos.inc + COMMAND ${tbb_command}