forked from IoLanguage/io
/
makePackage.io
56 lines (38 loc) · 1.22 KB
/
makePackage.io
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
41
42
43
44
45
46
47
48
49
50
51
52
53
//mkdir package
//cp /usr/local/bin/io package
//cp /usr/local/bin/libiovmall.dylib package
Socket
File dllDependencies := method(
lines := SystemCall clone setCommand("otool") setArguments(list("-L", path)) run split("\n")
lines select(beginsWithSeq("\t")) map(strip beforeSeq(" ("))
)
AddonFolder := Object clone do(
dir ::= nil
dllDir := method(
dir directoryNamed("_build") directoryNamed("dll")
)
dllFile := method(
if(dllDir exists not, return nil)
dllDir files detect(name endsWithSeq(".dylib"))
)
hasDll := method(dllFile != nil)
dependencyPaths := method(
dir path println
dllFile dllDependencies
)
pathConsideredExternal := method(path,
skippers := list("libiovmall", "/io/", "libSystem", "/System/Library/Frameworks", ".framework")
skippers foreach(skip, if(path containsSeq(skip), return false))
true
)
externalDependencyPaths := method(
dllFile dllDependencies select(path, pathConsideredExternal(path))
)
dependsFolder := Directory currentWorkingDirectory
copyExternalDependencies := method(
)
patchDependenciesToUseCopies := method(
)
)
addons := Directory with("addons") directories map(dir, AddonFolder clone setDir(dir))
addons select(hasDll) map(externalDependencyPaths)