Add test for bootstrapping Bash
* tests/bash-without-bash.scm: New file. * Makefile.am (check-bootstrap): New target.
This commit is contained in:
parent
5287348cdc
commit
15ae84bc58
|
@ -40,6 +40,10 @@ test-list: ; @echo $(TESTS)
|
|||
check-spec:
|
||||
$(MAKE) $(AM_MAKEFLAGS) -L -C tests/spec check
|
||||
|
||||
.PHONY: check-bootstrap
|
||||
check-bootstrap:
|
||||
guix build -f tests/bash-without-bash.scm
|
||||
|
||||
dist-hook:
|
||||
echo $(VERSION) > $(distdir)/.tarball-version
|
||||
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
(use-modules ((gnu packages bash) #:select (bash))
|
||||
(guix build-system)
|
||||
(guix packages)
|
||||
(guix store)
|
||||
(guix utils)
|
||||
(ice-9 match))
|
||||
|
||||
(define geesh
|
||||
(load (string-append (current-source-directory) "/../guix.scm")))
|
||||
|
||||
(define geesh-with-links
|
||||
(package
|
||||
(inherit geesh)
|
||||
(arguments
|
||||
(substitute-keyword-arguments (package-arguments geesh)
|
||||
((#:phases phases '%standard-phases)
|
||||
`(modify-phases ,phases
|
||||
(add-after 'install 'link-bash
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let ((out (assoc-ref outputs "out")))
|
||||
(symlink (string-append out "/bin/geesh")
|
||||
(string-append out "/bin/sh"))
|
||||
(symlink (string-append out "/bin/geesh")
|
||||
(string-append out "/bin/bash")))))))))))
|
||||
|
||||
(define bash-without-bash
|
||||
(let ((bash-bag (package->bag bash)))
|
||||
(bag
|
||||
(inherit bash-bag)
|
||||
(build-inputs
|
||||
`(("bash" ,geesh-with-links)
|
||||
,@(filter (match-lambda
|
||||
((name . _)
|
||||
(not (member name '("bash")))))
|
||||
(bag-build-inputs bash-bag)))))))
|
||||
|
||||
(bag->derivation (open-connection) bash-without-bash)
|
Loading…
Reference in New Issue