Rename compiler/nim.ini back to compiler/installer.ini

- Niminst has a new -m/--main option to set the main file, by default
  ini-file with .nim extension (old behaviour)
- Koch uses this to pass --main:compiler/nim.nim
- Fix includes/links of website.ini
This commit is contained in:
def
2015-03-13 17:03:57 +01:00
parent 02432f1052
commit 06b986dbd5
5 changed files with 16 additions and 12 deletions

View File

@@ -61,7 +61,7 @@ Files: "icons/koch.res"
Files: "icons/koch_icon.o"
Files: "compiler/readme.txt"
Files: "compiler/nim.ini"
Files: "compiler/installer.ini"
Files: "compiler/nim.nimrod.cfg"
Files: "compiler/*.nim"
Files: "doc/*.txt"
@@ -77,7 +77,7 @@ Files: "tools/niminst/*.nim"
Files: "tools/niminst/*.cfg"
Files: "tools/niminst/*.tmpl"
Files: "tools/niminst/*.nsh"
Files: "web/nim.ini"
Files: "web/website.ini"
Files: "web/*.nim"
Files: "web/*.txt"

View File

@@ -195,7 +195,7 @@ In the case of Nim's own documentation, the ``txt`` value is just a commit
hash to append to a formatted URL to https://github.com/Araq/Nim. The
``tools/nimweb.nim`` helper queries the current git commit hash during doc
generation, but since you might be working on an unpublished repository, it
also allows specifying a ``githash`` value in ``web/nim.ini`` to force a
also allows specifying a ``githash`` value in ``web/website.ini`` to force a
specific commit in the output.

View File

@@ -190,6 +190,6 @@ Real world example
The installers for the Nim compiler itself are generated by niminst. Have a
look at its configuration file:
.. include:: compiler/nim.ini
.. include:: compiler/installer.ini
:literal:

View File

@@ -97,13 +97,13 @@ const
compileNimInst = "-d:useLibzipSrc tools/niminst/niminst"
proc csource(args: string) =
exec("$4 cc $1 -r $3 --var:version=$2 --var:mingw=none csource compiler/nim.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()])
proc zip(args: string) =
exec("$3 cc -r $2 --var:version=$1 --var:mingw=none scripts compiler/nim.ini" %
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 zip compiler/nim.ini" %
exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" %
["tools/niminst/niminst".exe, VersionAsString])
proc buildTool(toolname, args: string) =
@@ -121,7 +121,7 @@ proc nsis(args: string) =
" nsis compiler/nim") % [VersionAsString, $(sizeof(pointer)*8)])
proc install(args: string) =
exec("$# cc -r $# --var:version=$# --var:mingw=none scripts compiler/nim.ini" %
exec("$# cc -r $# --var:version=$# --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
[findNim(), compileNimInst, VersionAsString])
exec("sh ./install.sh $#" % args)

View File

@@ -57,7 +57,7 @@ type
platforms: array[1..maxOS, array[1..maxCPU, bool]]
ccompiler, linker, innosetup, nsisSetup: tuple[path, flags: string]
name, displayName, version, description, license, infile, outdir: string
libpath: string
mainfile, libpath: string
innoSetupFlag, installScript, uninstallScript: bool
explicitPlatforms: bool
vars: StringTableRef
@@ -88,6 +88,7 @@ proc iniConfigData(c: var ConfigData) =
c.description = ""
c.license = ""
c.infile = ""
c.mainfile = ""
c.outdir = ""
c.nimArgs = ""
c.libpath = ""
@@ -146,6 +147,8 @@ Command:
deb create files for debhelper
Options:
-o, --output:dir set the output directory
-m, --main:file set the main nim file, by default ini-file with .nim
extension
--var:name=value set the value of a variable
-h, --help shows this help
-v, --version shows the version
@@ -185,6 +188,7 @@ proc parseCmdLine(c: var ConfigData) =
stdout.write(Version & "\n")
quit(0)
of "o", "output": c.outdir = val
of "m", "main": c.mainfile = changeFileExt(val, "nim")
of "var":
var idx = val.find('=')
if idx < 0: quit("invalid command line")
@@ -192,6 +196,7 @@ proc parseCmdLine(c: var ConfigData) =
else: quit(Usage)
of cmdEnd: break
if c.infile.len == 0: quit(Usage)
if c.mainfile.len == 0: c.mainfile = changeFileExt(c.infile, "nim")
proc walkDirRecursively(s: var seq[string], root: string) =
for k, f in walkDir(root):
@@ -360,7 +365,7 @@ proc parseIniFile(c: var ConfigData) =
of cfgOption: quit(errorStr(p, "syntax error"))
of cfgError: quit(errorStr(p, k.msg))
close(p)
if c.name.len == 0: c.name = changeFileExt(extractFilename(c.infile), "")
if c.name.len == 0: c.name = changeFileExt(extractFilename(c.mainfile), "")
if c.displayName.len == 0: c.displayName = c.name
else:
quit("cannot open: " & c.infile)
@@ -466,8 +471,7 @@ proc srcdist(c: var ConfigData) =
var cmd = ("nim compile -f --symbolfiles:off --compileonly " &
"--gen_mapping --cc:gcc --skipUserCfg" &
" --os:$# --cpu:$# $# $#") %
[osname, cpuname, c.nimArgs,
changeFileExt(c.infile, "nim")]
[osname, cpuname, c.nimArgs, c.mainfile]
echo(cmd)
if execShellCmd(cmd) != 0:
quit("Error: call to nim compiler failed")