···
1
-
diff --git a/src/tools/haxelib/Main.hx b/src/tools/haxelib/Main.hx
2
-
index dc18815..def5231 100644
3
-
--- a/extra/haxelib_src/src/tools/haxelib/Main.hx
4
-
+++ b/extra/haxelib_src/src/tools/haxelib/Main.hx
5
-
@@ -1301,21 +1301,26 @@ class Main {
8
-
function checkRec( prj : String, version : String, l : List<{ project : String, version : String, info : Infos }> ) {
9
-
- var pdir = getRepository() + Data.safe(prj);
10
-
- if( !FileSystem.exists(pdir) )
11
-
- throw "Library "+prj+" is not installed : run 'haxelib install "+prj+"'";
12
-
- var version = if( version != null ) version else getCurrent(pdir);
13
-
- var vdir = pdir + "/" + Data.safe(version);
14
-
- if( vdir.endsWith("dev") )
15
-
- vdir = getDev(pdir);
16
-
- if( !FileSystem.exists(vdir) )
17
-
- throw "Library "+prj+" version "+version+" is not installed";
19
-
- if( p.project == prj ) {
20
-
- if( p.version == version )
22
-
- throw "Library "+prj+" has two version included "+version+" and "+p.version;
24
-
+ var vdir = this.getNixLib(prj);
25
-
+ if (vdir == null) {
26
-
+ var pdir = getRepository() + Data.safe(prj);
27
-
+ if( !FileSystem.exists(pdir) )
28
-
+ throw "Library "+prj+" is not installed : run 'haxelib install "+prj+"'";
29
-
+ var version = if( version != null ) version else getCurrent(pdir);
30
-
+ var vdir = pdir + "/" + Data.safe(version);
31
-
+ if( vdir.endsWith("dev") )
32
-
+ vdir = getDev(pdir);
33
-
+ if( !FileSystem.exists(vdir) )
34
-
+ throw "Library "+prj+" version "+version+" is not installed";
36
-
+ if( p.project == prj ) {
37
-
+ if( p.version == version )
39
-
+ throw "Library "+prj+" has two version included "+version+" and "+p.version;
44
-
var json = try File.getContent(vdir+"/"+Data.JSON) catch( e : Dynamic ) null;
45
-
var inf = Data.readData(json,false);
46
-
l.add({ project : prj, version : version, info: inf });
47
-
@@ -1330,15 +1335,21 @@ class Main {
48
-
var a = args[argcur++].split(":");
49
-
checkRec(a[0],a[1],list);
51
-
- var rep = getRepository();
53
-
- var pdir = Data.safe(d.project)+"/"+Data.safe(d.version)+"/";
54
-
- var dir = rep + pdir;
56
-
- dir = getDev(rep+Data.safe(d.project));
57
-
+ var dir = this.getNixLib(d.project);
58
-
+ var pdir = Data.safe(d.project)+"/";
59
-
+ if (dir == null) {
60
-
+ var rep = getRepository();
61
-
+ pdir += Data.safe(d.version)+"/";
64
-
+ dir = getDev(rep+Data.safe(d.project));
65
-
+ dir = Path.addTrailingSlash(dir);
67
-
+ } catch( e : Dynamic ) {}
69
-
dir = Path.addTrailingSlash(dir);
71
-
- } catch( e : Dynamic ) {}
73
-
var ndir = dir + "ndll";
74
-
if( FileSystem.exists(ndir) ) {
75
-
var sysdir = ndir+"/"+Sys.systemName();
76
-
@@ -1491,23 +1502,43 @@ class Main {
80
-
+ function getNixLib(project:String):Null<String>
82
-
+ var hlibPath = Sys.getEnv("HAXELIB_PATH");
83
-
+ if (hlibPath != null) {
84
-
+ for (libDir in hlibPath.split(":")) {
85
-
+ var fullpath = libDir;
86
-
+ fullpath += libDir.substr(-1, 1) == "/" ? "" : "/";
87
-
+ fullpath += Data.safe(project);
88
-
+ if (FileSystem.exists(fullpath))
96
-
- var rep = getRepository();
97
-
var project = param("Library");
98
-
var temp = project.split(":");
100
-
- var pdir = rep + Data.safe(project);
101
-
- if( !FileSystem.exists(pdir) )
102
-
- throw "Library "+project+" is not installed";
104
-
- var version = temp[1] != null ? temp[1] : getCurrent(pdir);
105
-
- var dev = try getDev(pdir) catch ( e : Dynamic ) null;
106
-
- var vdir = dev != null ? dev : pdir + Data.safe(version);
108
-
args.push(cli.cwd);
110
-
+ var vdir = this.getNixLib(project);
111
-
+ if (vdir == null) {
112
-
+ var rep = getRepository();
113
-
+ var pdir = rep + Data.safe(project);
114
-
+ if( !FileSystem.exists(pdir) )
115
-
+ throw "Library "+project+" is not installed";
117
-
+ var version = temp[1] != null ? temp[1] : getCurrent(pdir);
118
-
+ var dev = try getDev(pdir) catch ( e : Dynamic ) null;
119
-
+ vdir = dev!=null ? dev : pdir + Data.safe(version);
120
-
+ var rdir = vdir + "/run.n";
121
-
+ if( !FileSystem.exists(rdir) )
122
-
+ throw "Library "+project+" version "+version+" does not have a run script";
127
-
switch try [Data.readData(File.getContent(vdir + '/haxelib.json'), false), null] catch (e:Dynamic) [null, e] {