Ticket #9: buildme.patch

File buildme.patch, 2.1 kB (added by larsivi, 1 year ago)

Patch to make buildme work with tango

  • buildme.d

    old new  
    3434//============================================================================== 
    3535version(Tango) 
    3636{ 
    37     static assert(0, "Tango support for the build script is currently incomplete."); 
     37//    static assert(0, "Tango support for the build script is currently incomplete."); 
    3838    private 
    3939    { 
    4040        import tango.text.Ascii; 
     
    4545        import tango.core.Version; 
    4646        import tango.stdc.stringz; 
    4747        import tango.stdc.stdio; 
     48        import tango.io.FilePath; 
     49        import tango.io.Stdout; 
     50        import tango.sys.Environment; 
    4851    } 
    4952} 
    5053else 
     
    7679{ 
    7780    version = NixConst; 
    7881} 
     82else version(Posix) 
     83{ 
     84    version = NixConst; 
     85} 
    7986 
    8087version(NixConst) 
    8188{ 
     
    116123void main(char[][] args) 
    117124{ 
    118125    // check if the first arg is the cleanlib argument 
    119     if(args.length == 2 && (cmpStr(toLowerStr(args[1]), "cleanlib") == 0)) 
     126    if(args.length == 2 && (cmpStr(toLowerStr(args[1].dup), "cleanlib") == 0)) 
    120127    { 
    121128        cleanLib(); 
    122129        return; 
     
    128135    // parse the command line 
    129136    foreach(c; args) 
    130137    { 
    131         char[] lower = toLowerStr(c); 
     138        char[] lower = toLowerStr(c.dup); 
    132139        switch(lower) 
    133140        { 
    134141            case "bud": 
     
    197204        // cycle through every Derelict directory to find buildable packages 
    198205        version(Tango) 
    199206        { 
     207            scope dir = new FilePath("."); 
     208            foreach(c; dir.toList) { 
     209                scope path = new FilePath(c); 
     210                if (path.isFolder && c[0] != '.') 
     211                    processPackage(c); 
     212            } 
     213             
    200214        } 
    201215        else 
    202216        { 
     
    424438{ 
    425439    version(Tango) 
    426440    { 
    427         auto p = new Process(cmd, null); 
     441        auto p = new Process(cmd, Environment.get); 
    428442        p.execute(); 
     443        Stdout.stream.copy(p.stdout); 
    429444        auto r = p.wait(); 
    430445        return r.status; 
    431446    }