blob: 9dcd7eea30838788460081f81aa2901d0024037a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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
|