gnu: fifengine: Do not alter PYTHONPATH.
* gnu/packages/games.scm (fifengine): Import the (guix build python-build-system) module. [phases]{check}: Simplify by using the 'add-installed-pythonpath' procedure. Remove trailing #t.
This commit is contained in:
parent
d7354701dc
commit
b6a50fae1f
|
@ -3445,9 +3445,12 @@ (define-public fifengine
|
||||||
(build-system cmake-build-system)
|
(build-system cmake-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #f ; TODO The test running fails to run some tests.
|
`(#:tests? #f ; TODO The test running fails to run some tests.
|
||||||
#:modules ((srfi srfi-1)
|
#:imported-modules ,(cons '(guix build python-build-system)
|
||||||
(guix build cmake-build-system)
|
%cmake-build-system-modules)
|
||||||
(guix build utils))
|
#:modules ((guix build cmake-build-system)
|
||||||
|
((guix build python-build-system) #:select (guix-pythonpath))
|
||||||
|
(guix build utils)
|
||||||
|
(srfi srfi-1))
|
||||||
#:configure-flags
|
#:configure-flags
|
||||||
(list
|
(list
|
||||||
(string-append "-DOPENALSOFT_INCLUDE_DIR="
|
(string-append "-DOPENALSOFT_INCLUDE_DIR="
|
||||||
|
@ -3474,30 +3477,15 @@ (define-public fifengine
|
||||||
(delete 'check)
|
(delete 'check)
|
||||||
(add-after 'install 'check
|
(add-after 'install 'check
|
||||||
(lambda* (#:key inputs outputs tests? #:allow-other-keys)
|
(lambda* (#:key inputs outputs tests? #:allow-other-keys)
|
||||||
(define python-version
|
|
||||||
(let* ((version (last (string-split
|
|
||||||
(assoc-ref inputs "python")
|
|
||||||
#\-)))
|
|
||||||
(components (string-split version #\.))
|
|
||||||
(major+minor (take components 2)))
|
|
||||||
(string-join major+minor ".")))
|
|
||||||
|
|
||||||
(when tests?
|
(when tests?
|
||||||
;; Set PYTHONPATH so that python finds the installed modules.
|
(add-installed-pythonpath inputs outputs)
|
||||||
(setenv "PYTHONPATH"
|
|
||||||
(string-append (getenv "PYTHONPATH") ":"
|
|
||||||
(assoc-ref outputs "out")
|
|
||||||
"/lib/python"
|
|
||||||
python-version
|
|
||||||
"/site-packages"))
|
|
||||||
;; The tests require an X server.
|
;; The tests require an X server.
|
||||||
(system "Xvfb :1 &")
|
(system "Xvfb :1 &")
|
||||||
(setenv "DISPLAY" ":1")
|
(setenv "DISPLAY" ":1")
|
||||||
(setenv "XDG_RUNTIME_DIR" "/tmp")
|
(setenv "XDG_RUNTIME_DIR" "/tmp")
|
||||||
;; Run tests
|
;; Run tests
|
||||||
(chdir ,(string-append "../" name "-" version))
|
(chdir ,(string-append "../" name "-" version))
|
||||||
(invoke "python3" "run_tests.py" "-a"))
|
(invoke "python3" "run_tests.py" "-a")))))))
|
||||||
#t)))))
|
|
||||||
(inputs
|
(inputs
|
||||||
`(("sdl2" ,sdl2)
|
`(("sdl2" ,sdl2)
|
||||||
("sdl2-image" ,sdl2-image)
|
("sdl2-image" ,sdl2-image)
|
||||||
|
|
Loading…
Reference in a new issue