From b5af238305bcf87ce6ef2c5fe55b8c635dfd56e1 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 18 Oct 2016 23:50:09 +0200 Subject: [PATCH] Update guix hash. * make/install.make (update-hash): New target. * guix.scm: Prepare for update. --- GNUmakefile | 1 + guix.scm | 6 +++--- make/install.make | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 548d4b4e..b692b447 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -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: diff --git a/guix.scm b/guix.scm index db8ece35..e2591d3d 100644 --- a/guix.scm +++ b/guix.scm @@ -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) diff --git a/make/install.make b/make/install.make index e44cba2f..e8628d56 100644 --- a/make/install.make +++ b/make/install.make @@ -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 +