diff options
author | Araq <rumpf_a@web.de> | 2016-10-24 15:02:43 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2016-10-24 15:02:43 +0200 |
commit | 9605a0f87f16c0606231f04eb351574423302fad (patch) | |
tree | 68ea0425c8ea059457e85c98bcdf60d1273c0beb | |
parent | e700e3f205f8f206a6e24797b18154bd94edfc78 (diff) | |
download | Nim-9605a0f87f16c0606231f04eb351574423302fad.tar.gz |
deprecated install_nimble.nims in favor of 'koch nimble'; refs #4934
-rw-r--r-- | install_nimble.nims | 4 | ||||
-rw-r--r-- | koch.nim | 23 | ||||
-rw-r--r-- | tools/noprefix.nim | 32 |
3 files changed, 25 insertions, 34 deletions
diff --git a/install_nimble.nims b/install_nimble.nims index 05024c046..6e929f499 100644 --- a/install_nimble.nims +++ b/install_nimble.nims @@ -3,6 +3,8 @@ import ospaths mode = ScriptMode.Verbose +echo "This script is deprecated. Use 'koch nimble' instead." + var id = 0 while dirExists("nimble" & $id): inc id @@ -20,4 +22,4 @@ try: mvFile "nimble" & $id & "/src/nimble".toExe, "bin/nimble".toExe except OSError: cpFile "nimble" & $id & "/src/nimble".toExe, "bin/nimble".toExe - + diff --git a/koch.nim b/koch.nim index 8262c7c3d..ad82b101a 100644 --- a/koch.nim +++ b/koch.nim @@ -49,6 +49,7 @@ Possible Commands: tests [options] run the testsuite temp options creates a temporary compiler for testing winrelease creates a release (for coredevs only) + nimble builds the Nimble tool Boot options: -d:release produce a release version of the compiler -d:tinyc include the Tiny C backend (not supported on Windows) @@ -148,6 +149,8 @@ proc csource(args: string) = [args, VersionAsString, compileNimInst, findNim()]) proc bundleNimbleSrc() = + ## bunldeNimbleSrc() bundles a specific Nimble commit with the tarball. We + ## always bundle the latest official release. if dirExists("dist/nimble/.git"): exec("git --git-dir dist/nimble/.git pull") else: @@ -163,6 +166,23 @@ proc bundleNimbleExe() = exec(findNim() & " c dist/nimble/src/nimble.nim") copyExe("dist/nimble/src/nimble".exe, "bin/nimble".exe) +proc buildNimble() = + ## buildNimble() builds Nimble for the building via "github". As such, we + ## choose the most recent commit of Nimble too. + var installDir = "dist/nimble" + if dirExists("dist/nimble/.git"): + exec("git --git-dir dist/nimble/.git pull") + else: + # if dist/nimble exist, but is not a git repo, don't mess with it: + if dirExists(installDir): + var id = 0 + while dirExists("dist/nimble" & $id): + inc id + installDir = "dist/nimble" & $id + exec("git clone https://github.com/nim-lang/nimble.git " & installDir) + exec(findNim() & " c " & installDir / "src/nimble.nim") + copyExe(installDir / "src/nimble".exe, "bin/nimble".exe) + proc bundleNimsuggest(buildExe: bool) = if dirExists("dist/nimsuggest/.git"): exec("git --git-dir dist/nimsuggest/.git pull") @@ -371,7 +391,7 @@ of cmdArgument: of "boot": boot(op.cmdLineRest) of "clean": clean(op.cmdLineRest) of "web": web(op.cmdLineRest) - of "docs": web("--onlyDocs " & op.cmdLineRest) + of "doc", "docs": web("--onlyDocs " & op.cmdLineRest) of "json2": web("--json2 " & op.cmdLineRest) of "website": website(op.cmdLineRest & " --googleAnalytics:UA-48159761-1") of "web0": @@ -389,5 +409,6 @@ of cmdArgument: of "test", "tests": tests(op.cmdLineRest) of "temp": temp(op.cmdLineRest) of "winrelease": winRelease() + of "nimble": buildNimble() else: showHelp() of cmdEnd: showHelp() diff --git a/tools/noprefix.nim b/tools/noprefix.nim deleted file mode 100644 index d16c2b520..000000000 --- a/tools/noprefix.nim +++ /dev/null @@ -1,32 +0,0 @@ -# strip those silly GTK/ATK prefixes... - -import - expandimportc, os - -const - filelist = [ - ("sdl/sdl", "sdl"), - ("sdl/sdl_net", "sdl"), - ("sdl/sdl_gfx", "sdl"), - ("sdl/sdl_image", "sdl"), - ("sdl/sdl_mixer_nosmpeg", "sdl"), - ("sdl/sdl_mixer", "sdl"), - ("sdl/sdl_ttf", "sdl"), - ("sdl/smpeg", "sdl"), - - ("libcurl", "curl"), - ("mysql", "mysql"), - ("postgres", ""), - ("sqlite3", "sqlite3"), - - ("pcre/pcre", "pcre") - ] - -proc createDirs = - createDir("lib/newwrap/sdl") - createDir("lib/newwrap/pcre") - -for filename, prefix in items(filelist): - var f = addFileExt(filename, "nim") - main("lib/wrappers" / f, "lib/newwrap" / f, prefix) - |