summaryrefslogtreecommitdiff
path: root/com/simatime/bild.scm
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-11-01 14:24:24 -0700
committerBen Sima <ben@bsima.me>2019-11-01 14:25:49 -0700
commit9756eb0806aef63137ed53c7f78eee13aa3db9d7 (patch)
tree0c3bf0becc08e37386109ff8c518fa442df6266b /com/simatime/bild.scm
parent0a6fd40946f72e9995ca04b05d7556bf20585d4f (diff)
add buildHaskellApp nix function
Diffstat (limited to 'com/simatime/bild.scm')
-rwxr-xr-xcom/simatime/bild.scm24
1 files changed, 3 insertions, 21 deletions
diff --git a/com/simatime/bild.scm b/com/simatime/bild.scm
index 604a545..44f6c74 100755
--- a/com/simatime/bild.scm
+++ b/com/simatime/bild.scm
@@ -122,6 +122,9 @@ exec guile -e "(@ (com simatime bild) main)" -s "$0" "$@"
(define-module (com simatime bild)
#:use-module ((ice-9 popen) #:prefix popen/)
#:use-module ((ice-9 format) #:select (format))
+ #:use-module ((ice-9 rdelim) #:prefix rdelim/)
+ #:use-module ((com simatime shell) #:prefix sh/)
+ #:use-module ((com simatime string) #:prefix string/)
#:export (ns?
ns->path
path->ns
@@ -156,24 +159,3 @@ exec guile -e "(@ (com simatime bild) main)" -s "$0" "$@"
((symbol? path) (to-ns (symbol->string path)))
((string? path) (to-ns path))
(else (error "path should be a string or symbol")))))
-
-
-;;
-;; general funs, to be moved to a core lib
-;;
-
-(define (string/replace s match replacement)
- (string-fold
- (lambda (a b)
- (let ((next-char (if (eq? a match)
- replacement
- a)))
- (string-concatenate (list b (string next-char)))))
- ""
- s))
-
-(define (sh/exec cmd)
- (let* ((port (popen/open-input-pipe cmd))
- (ret (read port)))
- (popen/close-pipe port)
- ret))