bundling app

This commit is contained in:
Peter Tillemans 2024-05-22 22:27:17 +02:00
parent e82381e39f
commit dd6b56bcb7
6 changed files with 46 additions and 5 deletions

2
.gitignore vendored
View file

@ -12,3 +12,5 @@
/*.log
/.envrc
/gnu/
/bloatrunner
/*.tar.gz

View file

@ -7,6 +7,7 @@
#:use-module (guix git-download)
#:use-module (guix git)
#:use-module (guix build-system gnu)
#:use-module (guix build guile-build-system)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
@ -31,7 +32,40 @@
#:select? vcs-file?))
(build-system gnu-build-system)
(arguments
'(#:make-flags '("GUILE_AUTO_COMPILE=0")))
'(#:make-flags '("GUILE_AUTO_COMPILE=0")
#:phases
(modify-phases %standard-phases
;; (replace 'bootstrap
;; (lambda _
;; ;; The 'bootstrap' script lacks a shebang, leading to "Exec
;; ;; format error" with glibc 2.35.
;; (invoke "autoreconf" "-vfi")))
(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"))
(chickadee (assoc-ref inputs "guile-chickadee"))
(deps (list out chickadee))
(guile (assoc-ref inputs "guile"))
(effective (target-guile-effective-version))
(mods (string-drop-right ;drop trailing colon
(string-join deps
(string-append "/share/guile/site/"
effective ":")
'suffix)
1))
(objs (string-drop-right
(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)))))))
))
(native-inputs
(list autoconf automake pkg-config))
(inputs

View file

@ -10,7 +10,10 @@ nobase_go_DATA = $(GOBJECTS)
guile_install_go_files = install-nobase_goDATA
$(guile_install_go_files): install-nobase_modDATA
CLEANFILES = $(GOBJECTS)
bin_SCRIPTS = bloatrunner
CLEANFILES = $(bin_SCRIPTS) \
$(GOBJECTS)
GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
SUFFIXES = .scm .go
.scm.go:
@ -39,3 +42,5 @@ EXTRA_DIST = \
$(SOURCES) \
$(asset_files) \
README.org

View file

@ -105,7 +105,7 @@ To run the game from the source checkout, use the `pre-inst-env`
wrapper script:
```
./pre-inst-env run-game
./pre-inst-env bloatrunner
```
** REPL-driven development
@ -126,7 +126,7 @@ errors so I can read the error and immediately see if it is fixed on
saving.
```
$ watchexec -e .scm ./pre-inst-env run-game
$ watchexec -e .scm ./pre-inst-env bloatrunner
```

View file

@ -8,7 +8,7 @@ AM_SILENT_RULES([yes])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_CONFIG_FILES([scripts/run-game], [chmod +x scripts/run-game])
AC_CONFIG_FILES([bloatrunner], [chmod +x bloatrunner])
GUILE_PKG([3.0])
GUILE_PROGS