Lines 1-109
Link Here
|
1 |
--- koch.nim.orig 2019-07-22 09:56:30 UTC |
|
|
2 |
+++ koch.nim |
3 |
@@ -43,15 +43,11 @@ Usage: |
4 |
koch [options] command [options for command] |
5 |
Options: |
6 |
--help, -h shows this help and quits |
7 |
- --latest bundle the installers with a bleeding edge Nimble |
8 |
- --stable bundle the installers with a stable Nimble (default) |
9 |
Possible Commands: |
10 |
boot [options] bootstraps with given command line options |
11 |
distrohelper [bindir] helper for distro packagers |
12 |
- tools builds Nim related tools |
13 |
- toolsNoNimble builds Nim related tools (except nimble) |
14 |
+ tools builds Nim related tools (except nimble) |
15 |
doesn't require network connectivity |
16 |
- nimble builds the Nimble tool |
17 |
Boot options: |
18 |
-d:release produce a release version of the compiler |
19 |
-d:useLinenoise use the linenoise library for interactive mode |
20 |
@@ -127,41 +123,6 @@ proc bundleC2nim(args: string) = |
21 |
nimCompile("dist/c2nim/c2nim", |
22 |
options = "--noNimblePath --path:. " & args) |
23 |
|
24 |
-proc bundleNimbleExe(latest: bool, args: string) = |
25 |
- if not dirExists("dist/nimble/.git"): |
26 |
- exec("git clone https://github.com/nim-lang/nimble.git dist/nimble") |
27 |
- if not latest: |
28 |
- withDir("dist/nimble"): |
29 |
- exec("git fetch") |
30 |
- exec("git checkout " & NimbleStableCommit) |
31 |
- # installer.ini expects it under $nim/bin |
32 |
- nimCompile("dist/nimble/src/nimble.nim", |
33 |
- options = "-d:release --nilseqs:on " & args) |
34 |
- |
35 |
-proc buildNimble(latest: bool, args: string) = |
36 |
- # if koch is used for a tar.xz, build the dist/nimble we shipped |
37 |
- # with the tarball: |
38 |
- var installDir = "dist/nimble" |
39 |
- if not latest and dirExists(installDir) and not dirExists("dist/nimble/.git"): |
40 |
- discard "don't do the git dance" |
41 |
- else: |
42 |
- if not dirExists("dist/nimble/.git"): |
43 |
- if dirExists(installDir): |
44 |
- var id = 0 |
45 |
- while dirExists("dist/nimble" & $id): |
46 |
- inc id |
47 |
- installDir = "dist/nimble" & $id |
48 |
- exec("git clone https://github.com/nim-lang/nimble.git " & installDir) |
49 |
- withDir(installDir): |
50 |
- if latest: |
51 |
- exec("git checkout -f master") |
52 |
- exec("git pull") |
53 |
- else: |
54 |
- exec("git fetch") |
55 |
- exec("git checkout " & NimbleStableCommit) |
56 |
- nimCompile(installDir / "src/nimble.nim", |
57 |
- options = "--noNimblePath --nilseqs:on -d:release " & args) |
58 |
- |
59 |
proc bundleNimsuggest(args: string) = |
60 |
nimCompileFold("Compile nimsuggest", "nimsuggest/nimsuggest.nim", |
61 |
options = "-d:release -d:danger " & args) |
62 |
@@ -182,7 +143,6 @@ proc bundleWinTools(args: string) = |
63 |
options = r"--cc:vcc --app:gui -d:ssl --noNimblePath --path:..\ui " & args) |
64 |
|
65 |
proc zip(latest: bool; args: string) = |
66 |
- bundleNimbleExe(latest, args) |
67 |
bundleNimsuggest(args) |
68 |
bundleWinTools(args) |
69 |
nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" % |
70 |
@@ -219,7 +179,6 @@ proc buildTools(args: string = "") = |
71 |
options = "-d:release " & args) |
72 |
|
73 |
proc nsis(latest: bool; args: string) = |
74 |
- bundleNimbleExe(latest, args) |
75 |
bundleNimsuggest(args) |
76 |
bundleWinTools(args) |
77 |
# make sure we have generated the niminst executables: |
78 |
@@ -466,8 +425,6 @@ proc runCI(cmd: string) = |
79 |
# boot without -d:nimHasLibFFI to make sure this still works |
80 |
kochExecFold("Boot in release mode", "boot -d:release -d:danger") |
81 |
|
82 |
- ## build nimble early on to enable remainder to depend on it if needed |
83 |
- kochExecFold("Build Nimble", "nimble") |
84 |
|
85 |
when false: |
86 |
execFold("nimble install -y libffi", "nimble install -y libffi") |
87 |
@@ -588,8 +545,6 @@ when isMainModule: |
88 |
case op.kind |
89 |
of cmdLongOption, cmdShortOption: |
90 |
case normalize(op.key) |
91 |
- of "latest": latest = true |
92 |
- of "stable": latest = false |
93 |
else: showHelp() |
94 |
of cmdArgument: |
95 |
case normalize(op.key) |
96 |
@@ -613,13 +568,9 @@ when isMainModule: |
97 |
of "temp": temp(op.cmdLineRest) |
98 |
of "xtemp": xtemp(op.cmdLineRest) |
99 |
of "wintools": bundleWinTools(op.cmdLineRest) |
100 |
- of "nimble": buildNimble(latest, op.cmdLineRest) |
101 |
of "nimsuggest": bundleNimsuggest(op.cmdLineRest) |
102 |
- of "toolsnonimble": |
103 |
- buildTools(op.cmdLineRest) |
104 |
of "tools": |
105 |
buildTools(op.cmdLineRest) |
106 |
- buildNimble(latest, op.cmdLineRest) |
107 |
of "pushcsource", "pushcsources": pushCsources() |
108 |
of "valgrind": valgrind(op.cmdLineRest) |
109 |
of "c2nim": bundleC2nim(op.cmdLineRest) |