From 97fd9a8ab7e37602f5d857dd37fceeba399f43de Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Mon, 29 Mar 2021 19:20:04 +0200 Subject: [PATCH 09/10] guix: build-system: cmake: Support #:disallowed-references. * guix/build-system/cmake.scm (cmake-build): Add #:disallowed-references. (cmake-cross-build): Likewise. --- guix/build-system/cmake.scm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm index f590b6ea42..c15197508a 100644 --- a/guix/build-system/cmake.scm +++ b/guix/build-system/cmake.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2013 Cyril Roelandt ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,6 +29,7 @@ #:use-module (guix build-system gnu) #:use-module (guix packages) #:use-module (ice-9 match) + #:use-module (srfi srfi-26) #:export (%cmake-build-system-modules cmake-build cmake-build-system)) @@ -117,9 +119,13 @@ (substitutable? #t) (imported-modules %cmake-build-system-modules) (modules '((guix build cmake-build-system) - (guix build utils)))) + (guix build utils))) + disallowed-references) "Build SOURCE using CMAKE, and with INPUTS. This assumes that SOURCE provides a 'CMakeLists.txt' file as its build system." + (define specialized-canonicalize-reference + (cut canonicalize-reference store system <>)) + (define builder `(begin (use-modules ,@modules) @@ -165,6 +171,10 @@ provides a 'CMakeLists.txt' file as its build system." #:modules imported-modules #:outputs outputs #:substitutable? substitutable? + #:disallowed-references + (and disallowed-references + (map specialized-canonicalize-reference + disallowed-references)) #:guile-for-build guile-for-build)) @@ -200,10 +210,14 @@ provides a 'CMakeLists.txt' file as its build system." (build (nix-system->gnu-triplet system)) (imported-modules %cmake-build-system-modules) (modules '((guix build cmake-build-system) - (guix build utils)))) + (guix build utils))) + disallowed-references) "Cross-build NAME using CMAKE for TARGET, where TARGET is a GNU triplet and with INPUTS. This assumes that SOURCE provides a 'CMakeLists.txt' file as its build system." + (define specialized-canonicalize-reference + (cut canonicalize-cross-reference store target system <>)) + (define builder `(begin (use-modules ,@modules) @@ -276,6 +290,10 @@ build system." #:outputs outputs #:modules imported-modules #:substitutable? substitutable? + #:disallowed-references + (and disallowed-references + (map specialized-canonicalize-reference + disallowed-references)) #:guile-for-build guile-for-build)) (define cmake-build-system -- 2.31.1