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
install install in $$(PREFIX) [$(PREFIX)]
release make a release
update-hash update hash in guix.scm
endef
export HELP_TOP
help-top:

View File

@ -48,15 +48,15 @@
(define-public mes
(package
(name "mes")
(version "0.0.e471916")
(version "0.0.5da7bf2d")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.com/janneke/mes")
(commit "master")))
(file-name (string-append name "-" version))
(sha256
(base32
"1rczxfap2d51hl619laxj3qfp89kq22sy79329kdd324nxzm3na0"))))
(base32 "1alp7gk1ikzp78addplp7ia1m4wm3jlaq53qwq3h53l5gdw8nsrd"))))
(build-system gnu-build-system)
(native-inputs
`(("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)
GUIX-HASH:=out/guix-hash
TARBALL_DIR:=$(PACKAGE)-$(VERSION)
TARBALL:=$(OUT)/$(TARBALL_DIR).tar.gz
@ -22,7 +23,7 @@ GIT_ARCHIVE_HEAD:=tar -cf-
GIT_LS_FILES:=find
endif
.tarball-version:
.tarball-version: tree-clean-p
echo $(COMMIT) > $@
dist: $(TARBALL)
@ -63,3 +64,18 @@ release: tree-clean-p check dist
git tag v$(VERSION)
git push --tags 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