aboutsummaryrefslogtreecommitdiff
path: root/doc/decompress-compile-run.scm
blob: a2c58bbda05b44239b4e419ea7d4e0cc69a018c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(define decompress
  (command #:inputs (compressed #:type 'File)
           #:run "gzip" "--stdout" "--decompress" compressed
           #:outputs (decompressed #:type 'stdout)))

(define compile
  (command #:inputs (source #:type 'File)
           #:run "gcc" "-x" "c" source
           #:outputs (executable
                      #:type 'File
                      #:binding '((glob . "a.out")))))

(define run
  (command #:inputs executable
           #:run executable
           #:outputs (stdout #:type 'stdout)))

(workflow ((compressed-source #:type File))
  (pipe (decompress #:compressed compressed-source)
        (compile #:source decompressed)
        (run #:executable executable)))