| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | |
| 20 |
|
| 21 | (use-modules (srfi srfi-26))
|
| 22 |
|
| 23 | |
| 24 | (fluid-set! %file-port-name-canonicalization #f)
|
| 25 |
|
| 26 | |
| 27 | (eval-when (expand load eval)
|
| 28 | (and=> (or (getenv "XDG_CONFIG_HOME")
|
| 29 | (and=> (getenv "HOME")
|
| 30 | (cut string-append <> "/.config/guix/current")))
|
| 31 | (lambda (current)
|
| 32 | (set! %load-path
|
| 33 | (cons (string-append current "/share/guile/site/"
|
| 34 | (effective-version))
|
| 35 | %load-path))
|
| 36 | (set! %load-compiled-path
|
| 37 | (cons (string-append current "/lib/guile/" (effective-version)
|
| 38 | "/site-ccache")
|
| 39 | %load-compiled-path)))))
|
| 40 |
|
| 41 | (use-modules (guix) (guix ui)
|
| 42 | (guix git-download)
|
| 43 | (ice-9 match))
|
| 44 |
|
| 45 | (match (command-line)
|
| 46 | ((program source)
|
| 47 | |
| 48 | |
| 49 | (setvbuf (current-error-port) 'line)
|
| 50 |
|
| 51 | (with-error-handling
|
| 52 | (with-store store
|
| 53 | (let* ((script (string-append source "/build-aux/build-self.scm"))
|
| 54 | (build (primitive-load script))
|
| 55 | (git? (git-predicate source)))
|
| 56 | (run-with-store store
|
| 57 | |
| 58 | (mlet* %store-monad ((source (interned-file source "guix-source"
|
| 59 | #:select? git?
|
| 60 | #:recursive? #t))
|
| 61 | (drv (build source #:pull-version 1)))
|
| 62 | (mbegin %store-monad
|
| 63 | (show-what-to-build* (list drv))
|
| 64 | (built-derivations (list drv))
|
| 65 | (with-monad %store-monad
|
| 66 | (display (derivation->output-path drv))
|
| 67 | (newline)
|
| 68 | (return drv))))))))))
|