Update guix hash.

* make/install.make (update-hash): New target.
* guix.scm: Prepare for update.
This commit is contained in:
Jan Nieuwenhuizen 2016-10-18 23:50:09 +02:00
parent ac6fb6feed
commit b5af238305
3 changed files with 21 additions and 4 deletions

View file

@ -114,6 +114,7 @@ Targets:
mescc compile cc/main.c to a.out mescc compile cc/main.c to a.out
install install in $$(PREFIX) [$(PREFIX)] install install in $$(PREFIX) [$(PREFIX)]
release make a release release make a release
update-hash update hash in guix.scm
endef endef
export HELP_TOP export HELP_TOP
help-top: help-top:

View file

@ -48,15 +48,15 @@
(define-public mes (define-public mes
(package (package
(name "mes") (name "mes")
(version "0.0.e471916") (version "0.0.5da7bf2d")
(source (origin (source (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://gitlab.com/janneke/mes") (url "https://gitlab.com/janneke/mes")
(commit "master"))) (commit "master")))
(file-name (string-append name "-" version))
(sha256 (sha256
(base32 (base32 "1alp7gk1ikzp78addplp7ia1m4wm3jlaq53qwq3h53l5gdw8nsrd"))))
"1rczxfap2d51hl619laxj3qfp89kq22sy79329kdd324nxzm3na0"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
`(("git" ,git) `(("git" ,git)

View file

@ -10,6 +10,7 @@ READMES:=\
# #
COMMIT:=$(shell test -d .git && (git show 2>/dev/null | head -1 | cut -d' ' -f 2) || cat .tarball-version) COMMIT:=$(shell test -d .git && (git show 2>/dev/null | head -1 | cut -d' ' -f 2) || cat .tarball-version)
GUIX-HASH:=out/guix-hash
TARBALL_DIR:=$(PACKAGE)-$(VERSION) TARBALL_DIR:=$(PACKAGE)-$(VERSION)
TARBALL:=$(OUT)/$(TARBALL_DIR).tar.gz TARBALL:=$(OUT)/$(TARBALL_DIR).tar.gz
@ -22,7 +23,7 @@ GIT_ARCHIVE_HEAD:=tar -cf-
GIT_LS_FILES:=find GIT_LS_FILES:=find
endif endif
.tarball-version: .tarball-version: tree-clean-p
echo $(COMMIT) > $@ echo $(COMMIT) > $@
dist: $(TARBALL) dist: $(TARBALL)
@ -63,3 +64,18 @@ release: tree-clean-p check dist
git tag v$(VERSION) git tag v$(VERSION)
git push --tags origin master git push --tags origin master
git push origin master git push origin master
$(GUIX-HASH): tree-clean-p
rm -rf out/mes && mkdir -p out && git clone . out/mes && guix hash -rx out/mes > $@
update-hash: $(GUIX-HASH) .tarball-version
@echo -n hash:
cat $^
sed -i \
-e 's,(base32 "[^"]*"),(base32 "$(shell cat $<)"),'\
-e 's,(commit "[^"]*"),(commit "$(shell cat .tarball-version)"),'\
-e 's,(version "[^"]*"),(version "$(VERSION).$(shell cut -b1-8 .tarball-version)"),'\
guix.scm
! git diff --exit-code
git commit -m 'guix hash: $(shell cat $<)' guix.scm