koch winrelease: also bundle c2nim for Windows

This commit is contained in:
Araq
2019-02-06 14:39:23 +01:00
committed by narimiran
parent c9441c6f79
commit 12bc7c9882
2 changed files with 13 additions and 1 deletions

View File

@@ -74,7 +74,7 @@ template withDir(dir, body) =
setCurrentDir(dir)
body
finally:
setCurrentdir(old)
setCurrentDir(old)
proc tryExec(cmd: string): bool =
echo(cmd)
@@ -110,6 +110,11 @@ proc bundleNimbleSrc(latest: bool) =
exec("git checkout -f stable")
exec("git pull")
proc bundleC2nim() =
if not dirExists("dist/c2nim/.git"):
exec("git clone https://github.com/nim-lang/c2nim.git dist/c2nim")
nimCompile("dist/c2nim/c2nim", options = "--noNimblePath --path:.")
proc bundleNimbleExe(latest: bool) =
bundleNimbleSrc(latest)
# now compile Nimble and copy it to $nim/bin for the installer.ini
@@ -160,6 +165,7 @@ proc bundleWinTools() =
buildVccTool()
nimexec("c -o:bin/nimgrab.exe -d:ssl tools/nimgrab.nim")
nimexec("c -o:bin/nimgrep.exe tools/nimgrep.nim")
bundleC2nim()
when false:
# not yet a tool worth including
nimexec(r"c --cc:vcc --app:gui -o:bin\downloader.exe -d:ssl --noNimblePath " &
@@ -548,6 +554,7 @@ when isMainModule:
else: buildTools(existsDir(".git") or latest)
of "pushcsource", "pushcsources": pushCsources()
of "valgrind": valgrind(op.cmdLineRest)
of "c2nim": bundleC2nim()
else: showHelp()
break
of cmdEnd: break

View File

@@ -54,6 +54,11 @@ proc execCleanPath*(cmd: string,
proc nimexec*(cmd: string) =
exec findNim() & " " & cmd
proc nimCompile*(input: string, outputDir = "bin", mode = "c", options = "") =
let output = outputDir / input.splitFile.name.exe
let cmd = findNim() & " " & mode & " -o:" & output & " " & options & " " & input
exec cmd
const
pdf = """
doc/manual.rst