summaryrefslogtreecommitdiff
path: root/doc/decompress-compile-run.scm
blob: 95bc9f823072d5901cbf8bd0ac0e5078ff00aa5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(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)
           #:stdout "run-output.txt"))

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