summary refs log tree commit diff
path: root/gnu/packages/vulkan.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2023-01-08 20:58:53 +0100
committerMarius Bakke <marius@gnu.org>2023-01-08 21:02:20 +0100
commit0d65f7daae7428b26a8141b83c2567e6d0d9d009 (patch)
tree705952944e490276232070b171fb01697796b6ef /gnu/packages/vulkan.scm
parent2aa2fbf18b8a07248a6008dfa74cd01a55f351d6 (diff)
downloadguix-0d65f7daae7428b26a8141b83c2567e6d0d9d009.tar.gz
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.
Diffstat (limited to 'gnu/packages/vulkan.scm')
-rw-r--r--gnu/packages/vulkan.scm23
1 files changed, 13 insertions, 10 deletions
diff --git a/gnu/packages/vulkan.scm b/gnu/packages/vulkan.scm
index 62a4621172..e7f507fe85 100644
--- a/gnu/packages/vulkan.scm
+++ b/gnu/packages/vulkan.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020, 2023 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2022 Kaelyn Takata <kaelyn.alexi@protonmail.com>
 ;;; Copyright © 2022 dan <i@dan.games>
@@ -235,8 +235,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
@@ -248,14 +246,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