~ruther/guix-local

d6b106b5b4c9af15a0a38561fceb1a1d4d60fea0 — Jake Forster 1 year, 4 months ago a13acf7
gnu: insight-toolkit: Exclude gtest target.

Fixes: guix/guix#776

This new phase makes it possible to configure projects that use
insight-toolkit.  I think this is what the configure flag '-DGTEST_ROOT=gtest'
was intended to do, but it does not.  In addition, the configure flag
'-DITK_USE_SYSTEM_GOOGLETEST=ON' and native input googletest are no longer
required to placate the configure phase.

* gnu/packages/image-processing (insight-toolkit) [arguments]
<#:configure-flags>: Remove -DITK_USE_SYSTEM_GOOGLETEST=ON and
-DGTEST_ROOT=gtest.
<#:phases>: Add phase 'exclude-gtest-target.
[native-inputs]: Remove googletest.

Change-Id: I9c2e051ac9cfc3439ea53e1a4f3207fbb2f3337b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
1 files changed, 15 insertions(+), 7 deletions(-)

M gnu/packages/image-processing.scm
M gnu/packages/image-processing.scm => gnu/packages/image-processing.scm +15 -7
@@ 1254,7 1254,6 @@ libraries designed for computer vision research and implementation.")
           #:configure-flags
           #~(list "-DITK_USE_GPU=ON"
                   "-DITK_USE_SYSTEM_LIBRARIES=ON"
                   "-DITK_USE_SYSTEM_GOOGLETEST=ON"
                   "-DITK_USE_SYSTEM_CASTXML=ON"
                   "-DITK_BUILD_SHARED=ON"
                   "-DITK_WRAPPING=ON"


@@ 1268,10 1267,6 @@ libraries designed for computer vision research and implementation.")
                                          "/lib/python" python-version
                                          "/site-packages")))
                     (string-append "-DPY_SITE_PACKAGES_PATH=" python-lib-path))
                   ;; This prevents "GTest::GTest" from being added to the ITK_LIBRARIES
                   ;; variable in the installed CMake files.  This is necessary as other
                   ;; packages using insight-toolkit could not be configured otherwise.
                   "-DGTEST_ROOT=gtest"
                   "-DCMAKE_CXX_STANDARD=17")

           #:phases #~(modify-phases %standard-phases


@@ 1283,7 1278,20 @@ libraries designed for computer vision research and implementation.")
                        (add-after 'unpack 'ignore-warnings
                          (lambda _
                            (substitute* "Wrapping/Generators/Python/CMakeLists.txt"
                              (("-Werror") "")))))))
                              (("-Werror") ""))))
                        (add-after 'unpack 'exclude-gtest-target
                          (lambda _
                            ;; Prevent ITKGoogleTest from being added to
                            ;; ITK_MODULES_ENABLED in the installed
                            ;; ITKConfig.cmake, which in turn prevents
                            ;; 'GTest::GTest' from being added to the
                            ;; ITK_LIBRARIES variable.  This is necessary
                            ;; because projects that use ITK fail to configure
                            ;; otherwise.  Fixes
                            ;; <https://codeberg.org/guix/guix/issues/776>.
                            ;; <https://github.com/microsoft/vcpkg/pull/27187>
                            (substitute* "Modules/ThirdParty/GoogleTest/itk-module.cmake"
                              (("DEPENDS") "DEPENDS\n  EXCLUDE_FROM_DEFAULT")))))))
    (inputs
     (list eigen
           expat


@@ 1300,7 1308,7 @@ libraries designed for computer vision research and implementation.")
           vxl-1
           zlib))
    (native-inputs
     (list castxml googletest pkg-config swig which))
     (list castxml pkg-config swig which))

    ;; The 'CMake/ITKSetStandardCompilerFlags.cmake' file normally sets
    ;; '-mtune=native -march=corei7', suggesting there's something to be