2024-05-22 12:08:20 +02:00
|
|
|
|
|
|
|
(define-module (bloatrunner)
|
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
|
|
|
#:use-module (guix download)
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
#:use-module (guix git-download)
|
|
|
|
#:use-module (guix git)
|
|
|
|
#:use-module (guix build-system gnu)
|
2024-05-22 22:27:17 +02:00
|
|
|
#:use-module (guix build guile-build-system)
|
2024-05-22 12:08:20 +02:00
|
|
|
#:use-module (guix utils)
|
|
|
|
#:use-module (gnu packages)
|
|
|
|
#:use-module (gnu packages autotools)
|
|
|
|
#:use-module (gnu packages guile)
|
|
|
|
#:use-module (gnu packages game-development)
|
|
|
|
#:use-module (gnu packages pkg-config)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(define vcs-file?
|
|
|
|
;; Return true if the given file is under version control.
|
|
|
|
(or (git-predicate (dirname (dirname (current-source-directory))))
|
|
|
|
(const #t))) ;not in a Git checkout
|
|
|
|
|
|
|
|
(define-public bloatrunner
|
|
|
|
(package
|
|
|
|
(name "bloatrunner")
|
|
|
|
(version "0.1.0-git")
|
|
|
|
;; (source (git-checkout (url (dirname (current-filename)))))
|
|
|
|
(source (local-file "../.." "guile-checkout"
|
|
|
|
#:recursive? #t
|
|
|
|
#:select? vcs-file?))
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
2024-05-22 23:29:52 +02:00
|
|
|
'(#:modules ((guix build gnu-build-system)
|
|
|
|
(guix build utils)
|
|
|
|
(ice-9 popen)
|
|
|
|
(ice-9 rdelim))
|
|
|
|
#:make-flags '("GUILE_AUTO_COMPILE=0")
|
2024-05-22 22:27:17 +02:00
|
|
|
|
|
|
|
#:phases
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
(add-after 'install-bin 'wrap-program
|
|
|
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
|
|
;; (use-modules (guix build guile-build-system))
|
|
|
|
;; Wrap the 'gitile' command to refer to the right modules.
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
(guile (assoc-ref inputs "guile"))
|
2024-05-23 10:09:14 +02:00
|
|
|
(guile-opengl (assoc-ref inputs "guile-opengl"))
|
|
|
|
(guile-sdl22 (assoc-ref inputs "guile-sdl2"))
|
|
|
|
(chickadee (assoc-ref inputs "guile-chickadee"))
|
|
|
|
(deps (list out chickadee guile))
|
2024-05-22 23:29:52 +02:00
|
|
|
(effective (read-line
|
|
|
|
(open-pipe* OPEN_READ
|
|
|
|
(string-append guile "/bin/guile")
|
|
|
|
"-c" "(display (effective-version))")))
|
2024-05-22 22:27:17 +02:00
|
|
|
(mods (string-drop-right ;drop trailing colon
|
|
|
|
(string-join deps
|
|
|
|
(string-append "/share/guile/site/"
|
|
|
|
effective ":")
|
|
|
|
'suffix)
|
2024-05-22 23:54:12 +02:00
|
|
|
1))
|
2024-05-22 22:27:17 +02:00
|
|
|
(objs (string-drop-right
|
2024-05-22 23:32:56 +02:00
|
|
|
(string-join deps
|
|
|
|
(string-append "/lib/guile/" effective
|
|
|
|
"/site-ccache:")
|
|
|
|
'suffix)
|
|
|
|
1)))
|
|
|
|
(wrap-program (string-append out "/bin/bloatrunner")
|
|
|
|
`("GUILE_LOAD_PATH" ":" prefix (,mods))
|
|
|
|
`("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))
|
|
|
|
`("ASSET_DIR" ":" prefix (,(string-append out "/share/bloatrunner")))
|
|
|
|
)))))
|
|
|
|
))
|
|
|
|
(native-inputs
|
|
|
|
(list autoconf automake pkg-config))
|
|
|
|
(inputs
|
|
|
|
(list guile-3.0))
|
|
|
|
(propagated-inputs
|
|
|
|
(list guile-chickadee))
|
|
|
|
(synopsis "Loderunner inspired game")
|
|
|
|
(description "Small game written for the 2024 lisp game jam.")
|
|
|
|
(home-page "https://www.snamellit.com/projects/bloatrunner.html")
|
|
|
|
(license license:gpl3)))
|
2024-05-22 12:08:20 +02:00
|
|
|
|
|
|
|
|
|
|
|
bloatrunner
|