blob: 1ddf0c7c518b2d13cc14be1d2e72de22c827b5f8 (
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
|
(use-modules (vkraus packages webid-oidc))
(use-modules (gnu packages bash))
(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"))))
(mkdir tmp-dirname)
(setenv "GIT_WORK_TREE" tmp-dirname)
(if ref
(invoke git "checkout" "-f" "--ignore-other-worktrees" ref)
(invoke git
"checkout-index"
(format #f "--prefix=~a/" tmp-dirname)
"-a"))
(invoke bash
"-c"
(format #f "~a describe --tags --always > ~a/.tarball-version"
git 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))))))
|