installer fixes and improvements
This commit is contained in:
parent
7f53224563
commit
82a75635f7
3 changed files with 23 additions and 3 deletions
16
koch.nim
16
koch.nim
|
|
@ -110,13 +110,28 @@ proc csource(args: string) =
|
|||
exec("$4 cc $1 -r $3 --var:version=$2 --var:mingw=none csource --main:compiler/nim.nim compiler/installer.ini $1" %
|
||||
[args, VersionAsString, compileNimInst, findNim()])
|
||||
|
||||
proc bundleNimble() =
|
||||
if dirExists("dist/nimble/.git"):
|
||||
exec("git --git-dir dist/nimble pull --rebase")
|
||||
else:
|
||||
exec("git clone https://github.com/nim-lang/nimble.git dist/nimble")
|
||||
let tags = execProcess("git --git-dir dist/nimble/.git tag -l v*").splitLines
|
||||
let tag = tags[^1]
|
||||
exec("git --git-dir dist/nimble/.git checkout " & tag)
|
||||
# now compile Nimble and copy it to $nim/bin for the installer.ini
|
||||
# to pick it up:
|
||||
exec(findNim() & " c dist/nimble/src/nimble.nim")
|
||||
copyExe("dist/nimble/nimble".exe, "bin/nimble".exe)
|
||||
|
||||
proc zip(args: string) =
|
||||
bundleNimble()
|
||||
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
||||
[VersionAsString, compileNimInst, findNim()])
|
||||
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" %
|
||||
["tools/niminst/niminst".exe, VersionAsString])
|
||||
|
||||
proc xz(args: string) =
|
||||
bundleNimble()
|
||||
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
||||
[VersionAsString, compileNimInst, findNim()])
|
||||
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" %
|
||||
|
|
@ -127,6 +142,7 @@ proc buildTool(toolname, args: string) =
|
|||
copyFile(dest="bin"/ splitFile(toolname).name.exe, source=toolname.exe)
|
||||
|
||||
proc nsis(args: string) =
|
||||
bundleNimble()
|
||||
# make sure we have generated the niminst executables:
|
||||
buildTool("tools/niminst/niminst", args)
|
||||
#buildTool("tools/nimgrep", args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue