blob: 85fb21d1f35a1be8943b89edded2226a7fb05239 (
about) (
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
|
(use-modules (vkraus packages webid-oidc))
(use-modules (gnu packages bash))
(use-modules (gnu packages base))
(use-modules (gnu packages tex))
(use-modules (gnu packages code))
(use-modules (gnu packages version-control))
(use-modules (guix build-system gnu))
(use-modules (guix packages))
(use-modules (guix gexp))
(use-modules (guix modules))
(use-modules (guix build utils))
(use-modules (guix store))
(use-modules (ice-9 textual-ports))
(define ref
(getenv "CI_REF"))
(let ((checked-out-index
(let ((tmp-dirname (tmpnam))
(git
(run-with-store
(open-connection)
(package-file git "bin/git")))
(bash
(run-with-store
(open-connection)
(package-file bash "bin/bash")))
(tar
(run-with-store
(open-connection)
(package-file tar "bin/tar"))))
(mkdir tmp-dirname)
(if ref
(begin
(invoke git "archive" ref "-o" (string-append tmp-dirname "/source.tar.gz"))
(with-directory-excursion
tmp-dirname
(invoke tar "xf" (string-append tmp-dirname "/source.tar.gz"))
(delete-file (string-append tmp-dirname "/source.tar.gz"))))
(invoke git
"checkout-index"
(format #f "--prefix=~a/" tmp-dirname)
"-a"))
(invoke bash
"-c"
(format #f "~a describe ~a --tags --always > ~a/.tarball-version"
git (or ref "") tmp-dirname))
(let ((interned
(run-with-store
(open-connection)
(interned-file tmp-dirname "ci-checkout" #:recursive? #t))))
(delete-file-recursively tmp-dirname)
interned))))
(let ((dist-without-maintainer (dist-package webid-oidc-snapshot checked-out-index))
(version
(car
(string-split
(call-with-input-file (string-append checked-out-index "/.tarball-version")
get-string-all)
#\newline))))
(let ((tar-name (string-append "webid-oidc-" version ".tar.gz")))
(computed-file
tar-name
#~(let ((source
#$(file-append
(package
(inherit dist-without-maintainer)
(native-inputs
(cons* `("indent" ,indent)
`("texlive" ,texlive)
(package-native-inputs dist-without-maintainer))))
"/" tar-name))
(destination #$output))
(format (current-error-port) "Symlinking ~a -> ~a...\n" source destination)
(symlink source destination))))))
|