summaryrefslogtreecommitdiff
path: root/mbld/install.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-05-13 19:31:35 -0700
committerOri Bernstein <ori@eigenstate.org>2016-05-13 19:31:36 -0700
commit5bc9a99994e20a7d5ea6bc298e4b37bf7db2e48d (patch)
tree48888d7c487c74cf4227ef7ec3820be907738876 /mbld/install.myr
parentf8152dae21873cf42f2d65bdf657a717c2240a25 (diff)
downloadmc-5bc9a99994e20a7d5ea6bc298e4b37bf7db2e48d.tar.gz
Switch to using lib{}.use.
Does 3 things; 1) Teaches the compiler about how to load libfoo.use, falling back to 'foo' 2) teaches muse how to generate packages named 'pkg' in fille 'libthing.use' 3) teaches mbld how to look up and resolve libfoo.use named usefiles. Eventually a fallback will be implemented.
Diffstat (limited to 'mbld/install.myr')
-rw-r--r--mbld/install.myr15
1 files changed, 9 insertions, 6 deletions
diff --git a/mbld/install.myr b/mbld/install.myr
index 448db99..8a4f496 100644
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -23,7 +23,7 @@ const uninstall = {b
}
const movetargs = {b, rm
- var libarchive
+ var libarchive, libuse
var pfx
for tn in b.all
@@ -34,10 +34,12 @@ const movetargs = {b, rm
;;
| `Lib lt:
if lt.install && !lt.istest
- movefile(b, rm, lt.dir, lt.name, config.Libpath, 0o644)
+ libuse = std.fmt("lib{}.use", lt.name)
+ movefile(b, rm, lt.dir, libuse, config.Libpath, 0o644)
libarchive = std.fmt("lib{}.a", lt.name)
movefile(b, rm, lt.dir, libarchive, config.Libpath, 0o644)
std.slfree(libarchive)
+ std.slfree(libuse)
;;
| `Data dt:
for blob in dt.blobs
@@ -75,13 +77,14 @@ const movefile = {b, rm, dir, file, prefix, perm
std.put("\t\tno such file {}\n", file)
;;
else
- std.put("\t{} => {}\n", file, path)
std.remove(path)
match std.slurp(file)
- | `std.Fail m: std.fatal("Could not open {} for reading\n", file)
+ | `std.Fail m: std.fatal("could not open {} for reading\n", file)
| `std.Ok buf:
- if !std.blat(path, buf, perm)
- std.put("Could not write {}\n", file)
+ if std.blat(path, buf, perm)
+ std.put("\t{} => {}\n", file, path)
+ else
+ std.put("could not write {}\n", file)
;;
;;
;;