summaryrefslogtreecommitdiff
path: root/feed/build/pull.scm
diff options
context:
space:
mode:
Diffstat (limited to 'feed/build/pull.scm')
-rw-r--r--feed/build/pull.scm46
1 files changed, 46 insertions, 0 deletions
diff --git a/feed/build/pull.scm b/feed/build/pull.scm
new file mode 100644
index 0000000..3cc9a1b
--- /dev/null
+++ b/feed/build/pull.scm
@@ -0,0 +1,46 @@
+;; (define-module (feed build pull)
+;; #:use-module (guix build utils))
+
+(use-modules (guix build utils)
+ (guix build compile)
+ (ice-9 format))
+
+((lambda* (out source
+ #:key
+ (debug-port (%make-void-port "w"))
+ (log-port (current-error-port)))
+ (with-directory-excursion source
+ (copy-recursively "rss" (string-append out "/rss")
+ #:log debug-port)
+ (copy-file "feed.scm" (string-append out "/feed.scm"))
+
+ ;; Augment the search path so Scheme code can be compiled.
+ (set! %load-path (cons out %load-path))
+ (set! %load-compiled-path (cons out %load-compiled-path))
+ (let ((files (pk 'filter-all-scheme-files (filter (@@ (guix build pull) has-all-its-dependencies?)
+ (pk 'all-scheme-files ((@@ (guix build pull) all-scheme-files) out))))))
+ (compile-files out out files
+ ;; Disable warnings.
+ #:warning-options '()
+
+ #:report-load
+ (lambda (file total completed)
+ (display #\cr log-port)
+ (format log-port
+ "loading...\t~5,1f% of ~d files" ;FIXME: i18n
+ (* 100. (/ completed total)) total)
+ (force-output log-port)
+ (format debug-port "~%loading '~a'...~%" file))
+
+ #:report-compilation
+ (lambda (file total completed)
+ (display #\cr log-port)
+ (format log-port "compiling...\t~5,1f% of ~d files" ;FIXME: i18n
+ (* 100. (/ completed total)) total)
+ (force-output log-port)
+ (format debug-port "~%compiling '~a'...~%" file))))))
+ "/tmp/local/feed"
+ "/tmp/local/guile-feed")
+
+(pk '%load-path %load-path)
+