forked from IoLanguage/io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeBinaryRelease.io
More file actions
40 lines (34 loc) · 1.31 KB
/
MakeBinaryRelease.io
File metadata and controls
40 lines (34 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
dynlibs := Directory with("addons") directories map(f,
r := nil
try(
r = f at("_build") at("dll") files select(name endsWithSeq(".dylib")) first
)
r
) select(!= nil)
depends := dynlibs map(dllFile,
lines := SystemCall clone setCommand("otool") setArguments(list("-L", dllFile path)) run split("\n") //stdout readLines
//foreach(println)
lines mapInPlace(beforeSeq("(") strip)
lines removeFirst
lines selectInPlace(beginsWithSeq("/"))
lines selectInPlace(beginsWithSeq("/usr/lib/") not)
lines selectInPlace(beginsWithSeq("/usr/local/lib/io/addons/") not)
lines selectInPlace(beginsWithSeq("/System/Library/") not)
if(lines isEmpty not,
writeln("\n", dllFile name, " needs: ")
lines foreach(line, writeln(" ", line))
)
lines
) flatten
external := Directory directoryNamed("_build") createSubdirectory("external")
installScript := external fileNamed("install.sh") remove open
depends foreach(depend,
writeln("copying ", depend, " to ", external path)
installScript write("cp ", Path with(external path, depend lastPathComponent), " ", depend, "\n");
SystemCall clone setCommand("cp") setArguments(list(depend, external path)) run split("\n") //stdout readLines
)
installScript close
SystemCall clone setCommand("chmod") setArguments(list("ug+x", installScript path)) run
/*
/opt/local/include/ncurses
*/