me
/
guix
Archived
1
0
Fork 0

gnu: godot-lts: Improve package style.

* gnu/packages/game-development.scm (godot-lts): Re-indent and ensure
max column length to 79.
  [arguments]: Use gexp.

Change-Id: I0bedb66a4e7e0ebe6242df885f1e687ce3a43ce0
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
master
Nicolas Graves 2024-05-19 18:16:06 +02:00 committed by Maxim Cournoyer
parent 7f1c40df92
commit c12a6e7419
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 88 additions and 78 deletions

View File

@ -29,6 +29,7 @@
;;; Copyright © 2022 Jai Vetrivelan <jaivetrivelan@gmail.com>
;;; Copyright © 2022 dan <i@dan.games>
;;; Copyright © 2023 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@ -1972,14 +1973,16 @@ games.")
"vhacd"
"xatlas")))
(for-each delete-file-recursively
(lset-difference string=?
(lset-difference
string=?
(scandir ".")
(cons* "." ".." preserved-files)))))))))
(build-system scons-build-system)
(arguments
`(#:scons-flags (list "platform=x11" "target=release_debug"
(list
;; Avoid using many of the bundled libs.
;; Note: These options can be found in the SConstruct file.
#:scons-flags #~(list "platform=x11" "target=release_debug"
"builtin_bullet=no"
"builtin_freetype=no"
"builtin_glew=no"
@ -1998,7 +2001,7 @@ games.")
"builtin_zstd=no")
#:tests? #f ; There are no tests
#:phases
(modify-phases %standard-phases
#~(modify-phases %standard-phases
(add-after 'unpack 'scons-use-env
(lambda _
;; Scons does not use the environment variables by default,
@ -2008,12 +2011,14 @@ games.")
(string-append
"env_base = Environment(tools=custom_tools)\n"
"env_base = Environment(ENV=os.environ)")))))
;; Build headless tools, used for packaging games without depending on X.
;; Build headless tools, to package games without depending on X.
(add-after 'build 'build-headless
(lambda* (#:key scons-flags #:allow-other-keys)
(apply invoke "scons"
`(,(string-append "-j" (number->string (parallel-job-count)))
"platform=server" ,@(delete "platform=x11" scons-flags)))))
`(,(string-append
"-j" (number->string (parallel-job-count)))
"platform=server"
,@(delete "platform=x11" scons-flags)))))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@ -2027,17 +2032,21 @@ games.")
(rename-file file dest)))
(find-files "." "godot.*\\.x11\\.opt\\.tools.*"))
(install-file "godot" (string-append out "/bin"))
(install-file "godot_server" (string-append headless "/bin")))
(install-file "godot_server"
(string-append headless "/bin")))
;; Tell the editor where to find zenity for OS.alert().
(wrap-program (string-append out "/bin/godot")
`("PATH" ":" prefix (,(string-append zenity "/bin")))))))
(add-after 'install 'wrap-ld-path
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(pulseaudio_path (string-append (assoc-ref inputs "pulseaudio") "/lib"))
(alas_lib_path (string-append (assoc-ref inputs "alsa-lib") "/lib")))
(pulseaudio_path (string-append
(assoc-ref inputs "pulseaudio") "/lib"))
(alas_lib_path (string-append
(assoc-ref inputs "alsa-lib") "/lib")))
(wrap-program (string-append out "/bin/godot")
`("LD_LIBRARY_PATH" ":" prefix (,pulseaudio_path ,alas_lib_path))))))
`("LD_LIBRARY_PATH" ":" prefix
(,pulseaudio_path ,alas_lib_path))))))
(add-after 'install 'install-godot-desktop
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@ -2051,7 +2060,8 @@ games.")
(copy-file icon dest))
'("icon.png" "icon.svg")
`(,(string-append icons "/256x256/apps/godot.png")
,(string-append icons "/scalable/apps/godot.svg")))))))))
,(string-append icons
"/scalable/apps/godot.svg")))))))))
(outputs '("out" "headless"))
(native-inputs
(list pkg-config))