Skip to content

Commit

Permalink
koch: bundle nim-lang/fusion with Nim
Browse files Browse the repository at this point in the history
Initial work on bundling nim-lang/fusion as part of the Nim distribution.
  • Loading branch information
alaviss committed Jul 24, 2020
1 parent add003a commit 75ce88c
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions koch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

const
NimbleStableCommit = "63695f490728e3935692c29f3d71944d83bb1e83" # master
FusionStableCommit = "88100a2f45860e98850f7a62fe0b11c37c7a86a1"

when not defined(windows):
const
Expand Down Expand Up @@ -50,18 +51,22 @@ Usage:
koch [options] command [options for command]
Options:
--help, -h shows this help and quits
--latest bundle the installers with a bleeding edge Nimble
--stable bundle the installers with a stable Nimble (default)
--latest bundle the installers with bleeding edge versions of
external components.
--stable bundle the installers with stable versions of
external components (default).
--nim:path use specified path for nim binary
--localdocs[:path] only build local documentations. If a path is not
specified (or empty), the default is used.
Possible Commands:
boot [options] bootstraps with given command line options
distrohelper [bindir] helper for distro packagers
tools builds Nim related tools
toolsNoNimble builds Nim related tools (except nimble)
toolsNoExternal builds Nim related tools (except external tools,
ie. nimble)
doesn't require network connectivity
nimble builds the Nimble tool
fusion clone fusion into the working tree
Boot options:
-d:release produce a release version of the compiler
-d:nimUseLinenoise use the linenoise library for interactive mode
Expand Down Expand Up @@ -194,7 +199,13 @@ proc bundleWinTools(args: string) =
nimCompile(r"tools\downloader.nim",
options = r"--cc:vcc --app:gui -d:ssl --noNimblePath --path:..\ui " & args)

proc bundleFusion(latest: bool) =
let commit = if latest: "HEAD" else: FusionStableCommit
cloneDependency(distDir, "https://github.com/nim-lang/fusion.git", commit)
copyDir(distDir / "fusion" / "src" / "fusion", "lib" / "fusion")

proc zip(latest: bool; args: string) =
bundleFusion(latest)
bundleNimbleExe(latest, args)
bundleNimsuggest(args)
bundleNimpretty(args)
Expand Down Expand Up @@ -234,6 +245,7 @@ proc buildTools(args: string = "") =
options = "-d:release " & args)

proc nsis(latest: bool; args: string) =
bundleFusion(latest)
bundleNimbleExe(latest, args)
bundleNimsuggest(args)
bundleWinTools(args)
Expand Down Expand Up @@ -693,15 +705,18 @@ when isMainModule:
of "wintools": bundleWinTools(op.cmdLineRest)
of "nimble": buildNimble(latest, op.cmdLineRest)
of "nimsuggest": bundleNimsuggest(op.cmdLineRest)
of "toolsnonimble":
# toolsNoNimble is kept for backward compatibility with build scripts
of "toolsnonimble", "toolsnoexternal":
buildTools(op.cmdLineRest)
of "tools":
buildTools(op.cmdLineRest)
buildNimble(latest, op.cmdLineRest)
bundleFusion(latest)
of "pushcsource", "pushcsources": pushCsources()
of "valgrind": valgrind(op.cmdLineRest)
of "c2nim": bundleC2nim(op.cmdLineRest)
of "drnim": buildDrNim(op.cmdLineRest)
of "fusion": bundleFusion(latest)
else: showHelp()
break
of cmdEnd: break

0 comments on commit 75ce88c

Please sign in to comment.