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

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

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

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