tar.xz contains nimble and nimsuggest
This commit is contained in:
parent
084ed53baa
commit
d8430f5a75
5 changed files with 42 additions and 5 deletions
3
build_tools.sh
Normal file
3
build_tools.sh
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
./bin/nim c --noNimblePath -p:compiler -o:./bin/nimble dist/nimble/src/nimble.nim
|
||||||
|
./bin/nim c --noNimblePath -p:compiler -o:./bin/nimsuggest dist/nimsuggest/nimsuggest.nim
|
||||||
|
./bin/nim c -o:./bin/nimgrep tools/nimgrep.nim
|
||||||
|
|
@ -50,6 +50,7 @@ Files: "readme.txt;install.txt;contributors.txt;copying.txt"
|
||||||
Files: "makefile"
|
Files: "makefile"
|
||||||
Files: "koch.nim"
|
Files: "koch.nim"
|
||||||
Files: "install_nimble.nims"
|
Files: "install_nimble.nims"
|
||||||
|
Files: "install_tools.nims"
|
||||||
|
|
||||||
Files: "icons/nim.ico"
|
Files: "icons/nim.ico"
|
||||||
Files: "icons/nim.rc"
|
Files: "icons/nim.rc"
|
||||||
|
|
@ -77,7 +78,8 @@ Files: "lib"
|
||||||
|
|
||||||
[Other]
|
[Other]
|
||||||
Files: "examples"
|
Files: "examples"
|
||||||
#Files: "dist/nimble"
|
Files: "dist/nimble"
|
||||||
|
Files: "dist/nimsuggest"
|
||||||
|
|
||||||
Files: "tests"
|
Files: "tests"
|
||||||
|
|
||||||
|
|
|
||||||
15
install_tools.nims
Normal file
15
install_tools.nims
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
import ospaths
|
||||||
|
|
||||||
|
mode = ScriptMode.Verbose
|
||||||
|
|
||||||
|
let nimbleExe = "./bin/nimble".toExe
|
||||||
|
selfExec "c --noNimblePath -p:compiler -o:" & nimbleExe &
|
||||||
|
" dist/nimble/src/nimble.nim"
|
||||||
|
|
||||||
|
let nimsugExe = "./bin/nimsuggest".toExe
|
||||||
|
selfExec "c --noNimblePath -p:compiler -o:" & nimsugExe &
|
||||||
|
" dist/nimsuggest/nimsuggest.nim"
|
||||||
|
|
||||||
|
let nimgrepExe = "./bin/nimgrep".toExe
|
||||||
|
selfExec "c -o:./bin/nimgrep tools/nimgrep.nim"
|
||||||
24
koch.nim
24
koch.nim
|
|
@ -123,6 +123,8 @@ proc testUnixInstall() =
|
||||||
execCleanPath("./koch boot -d:release", destDir / "bin")
|
execCleanPath("./koch boot -d:release", destDir / "bin")
|
||||||
# check the docs build:
|
# check the docs build:
|
||||||
execCleanPath("./koch web", destDir / "bin")
|
execCleanPath("./koch web", destDir / "bin")
|
||||||
|
# check nimble builds:
|
||||||
|
execCleanPath("./bin/nim e install_tools.nims")
|
||||||
# check the tests work:
|
# check the tests work:
|
||||||
execCleanPath("./koch tests", destDir / "bin")
|
execCleanPath("./koch tests", destDir / "bin")
|
||||||
else:
|
else:
|
||||||
|
|
@ -149,7 +151,7 @@ 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" %
|
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()])
|
[args, VersionAsString, compileNimInst, findNim()])
|
||||||
|
|
||||||
proc bundleNimble() =
|
proc bundleNimbleSrc() =
|
||||||
if dirExists("dist/nimble/.git"):
|
if dirExists("dist/nimble/.git"):
|
||||||
exec("git --git-dir dist/nimble/.git pull")
|
exec("git --git-dir dist/nimble/.git pull")
|
||||||
else:
|
else:
|
||||||
|
|
@ -157,20 +159,33 @@ proc bundleNimble() =
|
||||||
let tags = execProcess("git --git-dir dist/nimble/.git tag -l v*").splitLines
|
let tags = execProcess("git --git-dir dist/nimble/.git tag -l v*").splitLines
|
||||||
let tag = tags[^1]
|
let tag = tags[^1]
|
||||||
exec("git --git-dir dist/nimble/.git checkout " & tag)
|
exec("git --git-dir dist/nimble/.git checkout " & tag)
|
||||||
|
|
||||||
|
proc bundleNimbleExe() =
|
||||||
|
bundleNimbleSrc()
|
||||||
# now compile Nimble and copy it to $nim/bin for the installer.ini
|
# now compile Nimble and copy it to $nim/bin for the installer.ini
|
||||||
# to pick it up:
|
# to pick it up:
|
||||||
exec(findNim() & " c dist/nimble/src/nimble.nim")
|
exec(findNim() & " c dist/nimble/src/nimble.nim")
|
||||||
copyExe("dist/nimble/src/nimble".exe, "bin/nimble".exe)
|
copyExe("dist/nimble/src/nimble".exe, "bin/nimble".exe)
|
||||||
|
|
||||||
|
proc bundleNimsuggest(buildExe: bool) =
|
||||||
|
if dirExists("dist/nimsuggest/.git"):
|
||||||
|
exec("git --git-dir dist/nimsuggest/.git pull")
|
||||||
|
else:
|
||||||
|
exec("git clone https://github.com/nim-lang/nimsuggest.git dist/nimsuggest")
|
||||||
|
if buildExe:
|
||||||
|
exec(findNim() & " c --noNimblePath -p:compiler dist/nimsuggest/nimsuggest.nim")
|
||||||
|
copyExe("dist/nimsuggest/nimsuggest".exe, "bin/nimsuggest".exe)
|
||||||
|
|
||||||
proc zip(args: string) =
|
proc zip(args: string) =
|
||||||
bundleNimble()
|
bundleNimbleSrc()
|
||||||
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
||||||
[VersionAsString, compileNimInst, findNim()])
|
[VersionAsString, compileNimInst, findNim()])
|
||||||
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" %
|
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" %
|
||||||
["tools/niminst/niminst".exe, VersionAsString])
|
["tools/niminst/niminst".exe, VersionAsString])
|
||||||
|
|
||||||
proc xz(args: string) =
|
proc xz(args: string) =
|
||||||
bundleNimble()
|
bundleNimbleSrc()
|
||||||
|
bundleNimsuggest(false)
|
||||||
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
|
||||||
[VersionAsString, compileNimInst, findNim()])
|
[VersionAsString, compileNimInst, findNim()])
|
||||||
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" %
|
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" %
|
||||||
|
|
@ -181,7 +196,8 @@ proc buildTool(toolname, args: string) =
|
||||||
copyFile(dest="bin"/ splitFile(toolname).name.exe, source=toolname.exe)
|
copyFile(dest="bin"/ splitFile(toolname).name.exe, source=toolname.exe)
|
||||||
|
|
||||||
proc nsis(args: string) =
|
proc nsis(args: string) =
|
||||||
bundleNimble()
|
bundleNimbleExe()
|
||||||
|
bundleNimsuggest(true)
|
||||||
# make sure we have generated the niminst executables:
|
# make sure we have generated the niminst executables:
|
||||||
buildTool("tools/niminst/niminst", args)
|
buildTool("tools/niminst/niminst", args)
|
||||||
#buildTool("tools/nimgrep", args)
|
#buildTool("tools/nimgrep", args)
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ Now open a terminal and follow these instructions:
|
||||||
``cd ~/programs/nim``.
|
``cd ~/programs/nim``.
|
||||||
* run ``sh build.sh``.
|
* run ``sh build.sh``.
|
||||||
* Add ``$your_install_dir/bin`` to your PATH.
|
* Add ``$your_install_dir/bin`` to your PATH.
|
||||||
|
* To build associated tools like ``nimble`` and ``nimsuggest`` run ``nim e install_tools.nims``.
|
||||||
|
|
||||||
After restarting your terminal, you should be able to run ``nim -v``
|
After restarting your terminal, you should be able to run ``nim -v``
|
||||||
which should show you the version of Nim you just installed.
|
which should show you the version of Nim you just installed.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue