3 using System.Diagnostics;
7 public class LinuxBuilder : ABuilder
9 public LinuxBuilder(Config _cfg)
14 public override string CompressPackage(Package pkg)
16 string lpath = null, ltarget = null;
18 pkg.GetCompressBases(ref lpath, ref ltarget);
20 string local_dir = Config.PathFormat("{0}/{1}",
24 string name = PackageBuildName(pkg) + ".tar.gz";
26 ProcessStartInfo info = new ProcessStartInfo();
27 info.FileName = cfg.Compressor;
28 info.WorkingDirectory = local_dir;
29 info.Arguments = "zcvf \"" + name + "\" \"" + ltarget + "\"";
30 info.UseShellExecute = false;
32 Process p = Process.Start(info);
35 local_dir = Config.PathFormat("{0}/{1}", local_dir, name);
37 if (!File.Exists(local_dir))
46 public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
48 ProcessStartInfo info = new ProcessStartInfo();
50 string path = Config.PathFormat("{0}/{1}",
54 /* PlatformExt ignored for us */
55 string binName = lib.Name;
57 if (!lib.IsExecutable)
61 binName += "_i486.so";
69 string binpath = Config.PathFormat("{0}/{1}/{2}",
74 if (File.Exists(binpath))
79 /* Clean the project first */
80 info.WorkingDirectory = path;
81 info.FileName = cfg.BuilderPath;
82 info.Arguments = "clean";
83 info.UseShellExecute = false;
85 Process p = Process.Start(info);
90 info.WorkingDirectory = path;
91 info.FileName = cfg.BuilderPath;
93 info.UseShellExecute = false;
95 if (cfg.BuildOptions != null)
97 info.Arguments += " " + cfg.BuildOptions;
100 p = Process.Start(info);
104 if (!File.Exists(binpath))