summaryrefslogtreecommitdiff
path: root/release
diff options
context:
space:
mode:
Diffstat (limited to 'release')
-rwxr-xr-xrelease95
1 files changed, 95 insertions, 0 deletions
diff --git a/release b/release
new file mode 100755
index 0000000..9dcd7ee
--- /dev/null
+++ b/release
@@ -0,0 +1,95 @@
+#!/bin/sh
+
+VERSION=$(((guix environment --ad-hoc --container git -- \
+ git describe --tags) \
+ || echo "UNRELEASED") \
+ | sed 's|/|_|g')
+
+>&2 echo "Version is: $VERSION"
+
+COMMIT=$(git rev-parse HEAD)
+
+>&2 echo "Commit is: $COMMIT"
+
+rm -rf pure
+
+guix environment --ad-hoc --container git -- \
+ git checkout-index -a -f --prefix=pure/ \
+ || exit 1
+
+cd pure || exit 1
+
+HASH=$(guix hash -r -x .)
+
+rm -rf guix.scm configure.ac Makefile.am pre-inst-env.in build-aux/test-driver.scm
+
+sed -i "s/SNAPSHOT/$VERSION/g" hall.scm || exit 1
+
+hall scan -x || exit 1
+
+hall dist -x || exit 1
+
+hall guix -x || exit 1
+
+sed -i "s/$VERSION/SNAPSHOT/g" hall.scm || exit 1
+
+cp hall.scm guix.scm configure.ac Makefile.am pre-inst-env.in ../ || exit 1
+
+mkdir -p ../build-aux || exit 1
+
+cp build-aux/test-driver.scm ../build-aux || exit 1
+
+cd .. || exit 1
+
+mkdir -p guix/vkraus/packages || exit 1
+
+cat > release.scm <<EOF
+(define-public guile-ldp
+ (package
+ (inherit guile-ldp-local)
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "http://labo.planete-kraus.eu/ldp.git")
+ (commit "$COMMIT")))
+ (sha256
+ (base32
+ "$HASH"))))))
+EOF
+
+rm -f guix/vkraus/packages/ldp.scm || exit 1
+
+guix environment --ad-hoc --container emacs -- \
+ emacs --batch --file guix/vkraus/packages/ldp.scm \
+ --eval '(insert "(define-module (vkraus packages ldp))\n")' \
+ --eval '(insert-file "../../../guix.scm")' \
+ -f end-of-buffer \
+ -f backward-sexp \
+ --eval '(insert "(define guile-ldp-local\n")' \
+ -f forward-sexp \
+ --eval '(insert ")\n\n")' \
+ --eval '(insert-file "../../../release.scm")' \
+ -f save-buffer \
+ || exit 1
+
+guix environment --ad-hoc --container git -- \
+ git add hall.scm guix.scm \
+ configure.ac Makefile.am pre-inst-env.in \
+ build-aux/test-driver.scm \
+ guix/vkraus/packages/ldp.scm \
+ || exit 1
+
+guix environment --container -l guix.scm -- autoreconf -vif \
+ || exit 1
+
+guix environment --container -l guix.scm -- ./configure \
+ || exit 1
+
+guix environment --container -l guix.scm -- make -j \
+ || exit 1
+
+guix environment --container -l guix.scm -- make -j check \
+ || exit 1
+
+rm -rf pure