summaryrefslogtreecommitdiff
path: root/mbld
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-01-07 20:46:19 -0800
committerOri Bernstein <ori@eigenstate.org>2019-01-07 20:46:19 -0800
commit89aa864b92914c1fddcdf352ca57a97a1f06bb4b (patch)
treec6723f4d1e4d6438ec4fbf10a26400e33c7564a2 /mbld
parentaf63c8fc4082fca2b5148cb55a6870ac926660e4 (diff)
downloadmc-89aa864b92914c1fddcdf352ca57a97a1f06bb4b.tar.gz
Correctly strip manpage names on Plan 9.
Diffstat (limited to 'mbld')
-rw-r--r--mbld/config+plan9-x64.myr1
-rw-r--r--mbld/deps.myr16
-rw-r--r--mbld/install.myr12
-rw-r--r--mbld/types.myr3
4 files changed, 21 insertions, 11 deletions
diff --git a/mbld/config+plan9-x64.myr b/mbld/config+plan9-x64.myr
index e246d4d..1fa7774 100644
--- a/mbld/config+plan9-x64.myr
+++ b/mbld/config+plan9-x64.myr
@@ -14,4 +14,5 @@ pkg config =
const Binpath = "amd64/bin"
const Libpath = "amd64/lib/myr"
const Sharepath = "lib"
+ const Stripman = true
;;
diff --git a/mbld/deps.myr b/mbld/deps.myr
index ec5c09e..be12b4c 100644
--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -75,8 +75,8 @@ const myrdeps = {b, name, mt
go.instdir = config.Libpath
gu.instdir = config.Libpath
;;
- go.instmod = 0o644
- gu.instmod = 0o644
+ go.instmode = 0o644
+ gu.instmode = 0o644
generates(g, gu, tu)
generates(g, go, to)
@@ -116,7 +116,7 @@ const myrdeps = {b, name, mt
addnode(g, "all", go)
if mt.install
go.instdir = config.Binpath
- go.instmod = 0o755
+ go.instmode = 0o755
;;
;;
std.slfree(u)
@@ -251,10 +251,14 @@ const mandeps = {b, name, mt
n = leaf(b.deps, p)
match std.strrfind(pg, ".")
| `std.None: std.fatal("manpage {} missing section\n", pg)
- | `std.Some i: r = std.strcat(config.Manpath, pg[i + 1:])
+ | `std.Some i:
+ r = std.strcat(config.Manpath, pg[i + 1:])
+ if config.Stripman
+ n.instname = std.sldup(pg[:i])
+ ;;
;;
n.instdir = r
- n.instmod = 0o644
+ n.instmode = 0o644
addnode(b.deps, "all", n)
;;
}
@@ -269,7 +273,7 @@ const datdeps = {b, name, dt
if dt.path.len == 0
n.instdir = config.Sharepath
;;
- n.instmod = 0o644
+ n.instmode = 0o644
addnode(b.deps, "all", n)
;;
}
diff --git a/mbld/install.myr b/mbld/install.myr
index e2119ed..9ab879e 100644
--- a/mbld/install.myr
+++ b/mbld/install.myr
@@ -20,7 +20,7 @@ const uninstall = {b
}
const movetargs = {b, rm
- var inst
+ var inst, name
inst = std.htgetv(b.deps.targs, "all", [][:])
for n : inst
@@ -28,7 +28,11 @@ const movetargs = {b, rm
continue
;;
for g : n.gen
- if !movefile(b, rm, g, n.instdir, n.instmod)
+ name = n.instname
+ if name.len == 0
+ name = std.basename(g)
+ ;;
+ if !movefile(b, rm, g, n.instdir, name, n.instmode)
-> false
;;
;;
@@ -37,11 +41,11 @@ const movetargs = {b, rm
}
-const movefile = {b, rm, file, prefix, perm
+const movefile = {b, rm, file, prefix, instname, perm
var path, ok
ok = true
- path = std.pathjoin([opt_destdir, opt_instbase, prefix, std.basename(file)][:])
+ path = std.pathjoin([opt_destdir, opt_instbase, prefix, instname][:])
if rm
mbldput("\trm {}\n", path)
if !std.remove(path)
diff --git a/mbld/types.myr b/mbld/types.myr
index 84db996..809a543 100644
--- a/mbld/types.myr
+++ b/mbld/types.myr
@@ -115,7 +115,8 @@ pkg bld =
/* install info */
instdir : byte[:]
- instmod : int64
+ instname: byte[:]
+ instmode: int64
/* dependency names */
gen : byte[:][:]