summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2025-11-29 17:24:53 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2025-12-07 07:57:25 +0100
commit712d0c27f88ea980495d3df644da0a44c8036db0 (patch)
tree77383085c832f513c97b75adac6fbcc87ec68920
parenta6c83120f26ee1c1bd8fe31ffe8357819d34d34a (diff)
build: renpy: Add check command.
* guix/build/renpy-build-system.scm (start-xorg-server, check): New variables. (%standard-phases): Adjust accordingly. * guix/build-system/renpy.scm (renpy-build): Support #:tests? and #:test-flags.
-rw-r--r--guix/build-system/renpy.scm4
-rw-r--r--guix/build/renpy-build-system.scm18
2 files changed, 20 insertions, 2 deletions
diff --git a/guix/build-system/renpy.scm b/guix/build-system/renpy.scm
index d848ecd9c4b..76410f192e8 100644
--- a/guix/build-system/renpy.scm
+++ b/guix/build-system/renpy.scm
@@ -81,6 +81,8 @@
81 (outputs '("out")) 81 (outputs '("out"))
82 (output "out") 82 (output "out")
83 (game "game") 83 (game "game")
84 (tests? #t)
85 (test-flags ''())
84 (search-paths '()) 86 (search-paths '())
85 (system (%current-system)) 87 (system (%current-system))
86 (guile #f) 88 (guile #f)
@@ -102,6 +104,8 @@
102 #:outputs #$(outputs->gexp outputs) 104 #:outputs #$(outputs->gexp outputs)
103 #:output #$output 105 #:output #$output
104 #:game #$game 106 #:game #$game
107 #:test-flags #$test-flags
108 #:tests? #$tests?
105 #:search-paths 109 #:search-paths
106 '#$(sexp->gexp 110 '#$(sexp->gexp
107 (map search-path-specification->sexp 111 (map search-path-specification->sexp
diff --git a/guix/build/renpy-build-system.scm b/guix/build/renpy-build-system.scm
index 04ac9120603..cc5ded69f4e 100644
--- a/guix/build/renpy-build-system.scm
+++ b/guix/build/renpy-build-system.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021 Liliana Marie Prikler <liliana.prikler@gmail.com> 2;;; Copyright © 2021, 2025 Liliana Marie Prikler <liliana.prikler@gmail.com>
3;;; 3;;;
4;;; This file is part of GNU Guix. 4;;; This file is part of GNU Guix.
5;;; 5;;;
@@ -39,6 +39,19 @@
39 ;; badly if we do 39 ;; badly if we do
40 "quit")) 40 "quit"))
41 41
42(define* (start-xorg-server #:key tests? inputs native-inputs #:allow-other-keys)
43 (when tests?
44 (let ((Xvfb (search-input-file (or native-inputs inputs)
45 "/bin/Xvfb")))
46 (setenv "HOME" (getcwd))
47 (system (format #f "~a :1 &" Xvfb))
48 (setenv "DISPLAY" ":1"))))
49
50(define* (check #:key game tests? (test-flags '()) #:allow-other-keys)
51 (if tests?
52 (apply invoke "renpy" game "test" test-flags)
53 (display "test suite not run\n")))
54
42(define* (install #:key inputs outputs game (output "out") #:allow-other-keys) 55(define* (install #:key inputs outputs game (output "out") #:allow-other-keys)
43 (let* ((out (assoc-ref outputs output)) 56 (let* ((out (assoc-ref outputs output))
44 (json-dump (call-with-input-file (string-append game 57 (json-dump (call-with-input-file (string-append game
@@ -87,7 +100,8 @@
87 (delete 'bootstrap) 100 (delete 'bootstrap)
88 (delete 'configure) 101 (delete 'configure)
89 (replace 'build build) 102 (replace 'build build)
90 (delete 'check) 103 (add-before 'check 'start-xorg-server start-xorg-server)
104 (replace 'check check)
91 (replace 'install install) 105 (replace 'install install)
92 (add-after 'install 'install-desktop-file install-desktop-file))) 106 (add-after 'install 'install-desktop-file install-desktop-file)))
93 107