diff options
author | Araq <rumpf_a@web.de> | 2014-10-19 16:07:14 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-10-19 16:07:14 +0200 |
commit | dc8d8ebb79027b1414354cdd02ad90737e195501 (patch) | |
tree | 5d35fe1ed9728dd6ffc93ae08448c2dbec6444f7 /koch.nim | |
parent | a4dcebd3c450fe3881501c45860e5c36214f9d44 (diff) | |
download | Nim-dc8d8ebb79027b1414354cdd02ad90737e195501.tar.gz |
website updates for 0.9.6
Diffstat (limited to 'koch.nim')
-rw-r--r-- | koch.nim | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/koch.nim b/koch.nim index b7cf65ff7..f05b9203a 100644 --- a/koch.nim +++ b/koch.nim @@ -43,7 +43,7 @@ Possible Commands: web generates the website csource [options] builds the C sources for installation zip builds the installation ZIP package - inno [options] builds the Inno Setup installer (for Windows) + nsis [options] builds the NSIS Setup installer (for Windows) tests [options] run the testsuite update updates nimrod to the latest version from github (compile koch with -d:withUpdate to enable) @@ -77,6 +77,14 @@ proc tryExec(cmd: string): bool = echo(cmd) result = execShellCmd(cmd) == 0 +proc safeRemove(filename: string) = + if existsFile(filename): removeFile(filename) + +proc copyExe(source, dest: string) = + safeRemove(dest) + copyFile(dest=dest, source=source) + inclFilePermissions(dest, {fpUserExec}) + const compileNimInst = "-d:useLibzipSrc tools/niminst/niminst" @@ -94,12 +102,15 @@ proc buildTool(toolname, args: string) = exec("$# cc $# $#" % [findNim(), args, toolname]) copyFile(dest="bin"/ splitFile(toolname).name.exe, source=toolname.exe) -proc inno(args: string) = +proc nsis(args: string) = # make sure we have generated the niminst executables: buildTool("tools/niminst/niminst", args) buildTool("tools/nimgrep", args) - exec("tools" / "niminst" / "niminst --var:version=$# inno compiler/nimrod" % - NimrodVersion) + # produce 'nimrod_debug.exe': + exec "nimrod c compiler" / "nimrod.nim" + copyExe("compiler/nimrod".exe, "bin/nimrod_debug".exe) + exec(("tools" / "niminst" / "niminst --var:version=$# --var:mingw=mingw32" & + " nsis compiler/nimrod") % NimrodVersion) proc install(args: string) = exec("$# cc -r $# --var:version=$# scripts compiler/nimrod.ini" % @@ -137,16 +148,8 @@ proc findStartNimrod: string = echo("Found no nimrod compiler and every attempt to build one failed!") quit("FAILURE") -proc safeRemove(filename: string) = - if existsFile(filename): removeFile(filename) - proc thVersion(i: int): string = result = ("compiler" / "nimrod" & $i).exe - -proc copyExe(source, dest: string) = - safeRemove(dest) - copyFile(dest=dest, source=source) - inclFilePermissions(dest, {fpUserExec}) proc boot(args: string) = var output = "compiler" / "nimrod".exe @@ -304,7 +307,7 @@ of cmdArgument: of "web": web(op.cmdLineRest) of "csource", "csources": csource(op.cmdLineRest) of "zip": zip(op.cmdLineRest) - of "inno": inno(op.cmdLineRest) + of "nsis": nsis(op.cmdLineRest) of "install": install(op.cmdLineRest) of "test", "tests": tests(op.cmdLineRest) of "update": |