Subject: [PATCH 5/5] build-system: android-ndk: Improve style.

From: Nicolas Graves <[email-masked]>
Date: Fri, 25 Apr 2025 02:04:50 +0200

Like in other build-systems, make proper procedures to resolve the
build-system build-inputs bindings.

* guix/build-system/android-ndk.scm (default-android-build,
default-android-googletest): Add procedures.
(lower): Use them.
---
 guix/build-system/android-ndk.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/guix/build-system/android-ndk.scm b/guix/build-system/android-ndk.scm
index b8cd56b8719..565ec1d3632 100644
--- a/guix/build-system/android-ndk.scm
+++ b/guix/build-system/android-ndk.scm
@@ -33,6 +33,16 @@ (define %android-ndk-build-system-modules
   `((guix build android-ndk-build-system)
     ,@%default-gnu-imported-modules))
 
+(define (default-android-build)
+  ;; Lazily resolve the binding to avoid a circular dependency.
+  (let ((android (resolve-interface '(gnu packages android))))
+    (module-ref android 'android-make-stub)))
+
+(define (default-android-googletest)
+  ;; Lazily resolve the binding to avoid a circular dependency.
+  (let ((android (resolve-interface '(gnu packages android))))
+    (module-ref android 'android-googletest)))
+
 (define* (android-ndk-build name inputs
                             #:key
                             source
@@ -100,8 +110,8 @@ (define private-keywords
 
                         ;; Keep the standard inputs of 'gnu-build-system'
                         ,@(standard-packages)))
-         (build-inputs `(("android-build" ,(module-ref (resolve-interface '(gnu packages android)) 'android-make-stub))
-                         ("android-googletest" ,(module-ref (resolve-interface '(gnu packages android)) 'android-googletest))
+         (build-inputs `(("android-build" ,(default-android-build))
+                         ("android-googletest" ,(default-android-googletest))
                          ,@native-inputs))
          (outputs outputs)
          (build android-ndk-build)
-- 
2.49.0