From 5a190fce5f37cfa102d87d7c94c98fb73c6281d2 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 8 Jan 2023 20:58:53 +0100 Subject: [PATCH] gnu: vulkan-loader: Don't build (and install) googletest. * gnu/packages/vulkan.scm (vulkan-loader)[arguments]: Add phase to use system googletest. Remove unpack-googletest phase. [native-inputs]: Change from (PACKAGE-SOURCE GOOGLETEST) to GOOGLETEST. --- gnu/packages/vulkan.scm | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm index e0ff2dc71b9bd1920e125388d56bea9bc54d773b..dfc073b379c6a0996f0a429904e7f41bc2818aee 100644 --- a/gnu/packages/vulkan.scm +++ b/gnu/packages/vulkan.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2017, 2018, 2019 Rutger Helling ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2018 Efraim Flashner -;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2020, 2023 Marius Bakke ;;; Copyright © 2021 Mathieu Othacehe ;;; Copyright © 2022 Kaelyn Takata ;;; Copyright © 2022 dan @@ -232,8 +232,6 @@ interpretation of the specifications for these languages.") (dirname (dirname (search-input-directory %build-inputs "include/vulkan")))) - (string-append "-DGOOGLETEST_INSTALL_DIR=" - (getcwd) "/source/external/googletest") "-DBUILD_TESTS=ON") #:phases #~(modify-phases %standard-phases @@ -245,14 +243,19 @@ interpretation of the specifications for these languages.") (substitute* "loader/vulkan.pc.in" (("^includedir=.*") (string-append "includedir=" vulkan-headers "\n")))))) - (add-after 'unpack 'unpack-googletest - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (let ((gtest (search-input-directory (or native-inputs inputs) - "googletest"))) - (copy-recursively (dirname gtest) - "external/googletest"))))))) + (add-after 'unpack 'use-system-googletest + (lambda _ + ;; Inform the build system that googletest is already built. + (substitute* "CMakeLists.txt" + ((".*if\\(TARGET gtest\\)") + (string-append " find_package(GTest REQUIRED)\n" + " if(true)"))) + ;; Use the namespaced variable. + (substitute* "tests/framework/CMakeLists.txt" + (("PUBLIC gtest ") + "PUBLIC GTest::gtest "))))))) (native-inputs - (list (package-source googletest) + (list googletest libxrandr pkg-config python