mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-29 18:11:44 +00:00
Merge pull request #361 from ackalker/fix-bootstrap
install.sh failure, bootstrap = chicken & egg problem
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -29,6 +29,8 @@ examples/cross_todo/nimrod_backend/backend
|
|||||||
examples/cross_todo/nimrod_backend/testbackend
|
examples/cross_todo/nimrod_backend/testbackend
|
||||||
examples/cross_todo/nimrod_backend/todo.sqlite3
|
examples/cross_todo/nimrod_backend/todo.sqlite3
|
||||||
examples/cross_todo/nimrod_commandline/nimtodo
|
examples/cross_todo/nimrod_commandline/nimtodo
|
||||||
|
install.sh
|
||||||
|
deinstall.sh
|
||||||
|
|
||||||
# iOS specific wildcards.
|
# iOS specific wildcards.
|
||||||
*.mode1v3
|
*.mode1v3
|
||||||
|
|||||||
5
koch.nim
5
koch.nim
@@ -36,6 +36,7 @@ Options:
|
|||||||
--help, -h shows this help and quits
|
--help, -h shows this help and quits
|
||||||
Possible Commands:
|
Possible Commands:
|
||||||
boot [options] bootstraps with given command line options
|
boot [options] bootstraps with given command line options
|
||||||
|
install [dir] installs to given directory
|
||||||
clean cleans Nimrod project; removes generated files
|
clean cleans Nimrod project; removes generated files
|
||||||
web generates the website
|
web generates the website
|
||||||
csource [options] builds the C sources for installation
|
csource [options] builds the C sources for installation
|
||||||
@@ -84,7 +85,9 @@ proc inno(args: string) =
|
|||||||
NimrodVersion)
|
NimrodVersion)
|
||||||
|
|
||||||
proc install(args: string) =
|
proc install(args: string) =
|
||||||
exec("sh ./build.sh")
|
exec("nimrod cc -r tools/niminst/niminst --var:version=$# scripts compiler/nimrod.ini" %
|
||||||
|
NimrodVersion)
|
||||||
|
exec("sh ./install.sh $#" % args)
|
||||||
|
|
||||||
proc web(args: string) =
|
proc web(args: string) =
|
||||||
exec(("nimrod cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" &
|
exec(("nimrod cc -r tools/nimweb.nim web/nimrod --putenv:nimrodversion=$#" &
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ type
|
|||||||
actionNone, # action not yet known
|
actionNone, # action not yet known
|
||||||
actionCSource # action: create C sources
|
actionCSource # action: create C sources
|
||||||
actionInno, # action: create Inno Setup installer
|
actionInno, # action: create Inno Setup installer
|
||||||
|
actionScripts # action: create install and deinstall scripts
|
||||||
actionZip, # action: create zip file
|
actionZip, # action: create zip file
|
||||||
actionDeb # action: prepare deb package
|
actionDeb # action: prepare deb package
|
||||||
|
|
||||||
@@ -128,6 +129,7 @@ Usage:
|
|||||||
niminst [options] command[;command2...] ini-file[.ini] [compile_options]
|
niminst [options] command[;command2...] ini-file[.ini] [compile_options]
|
||||||
Command:
|
Command:
|
||||||
csource build C source code for source based installations
|
csource build C source code for source based installations
|
||||||
|
scripts build install and deinstall scripts
|
||||||
zip build the ZIP file
|
zip build the ZIP file
|
||||||
inno build the Inno Setup installer
|
inno build the Inno Setup installer
|
||||||
deb create files for debhelper
|
deb create files for debhelper
|
||||||
@@ -153,6 +155,7 @@ proc parseCmdLine(c: var TConfigData) =
|
|||||||
for a in split(normalize(key.string), {';', ','}):
|
for a in split(normalize(key.string), {';', ','}):
|
||||||
case a
|
case a
|
||||||
of "csource": incl(c.actions, actionCSource)
|
of "csource": incl(c.actions, actionCSource)
|
||||||
|
of "scripts": incl(c.actions, actionScripts)
|
||||||
of "zip": incl(c.actions, actionZip)
|
of "zip": incl(c.actions, actionZip)
|
||||||
of "inno": incl(c.actions, actionInno)
|
of "inno": incl(c.actions, actionInno)
|
||||||
of "deb": incl(c.actions, actionDeb)
|
of "deb": incl(c.actions, actionDeb)
|
||||||
@@ -382,6 +385,12 @@ proc removeDuplicateFiles(c: var TConfigData) =
|
|||||||
RemoveFile(dup)
|
RemoveFile(dup)
|
||||||
c.cfiles[osA][cpuA][i] = orig
|
c.cfiles[osA][cpuA][i] = orig
|
||||||
|
|
||||||
|
proc writeInstallScripts(c: var TConfigData) =
|
||||||
|
if c.installScript:
|
||||||
|
writeFile(installShFile, GenerateInstallScript(c), "\10")
|
||||||
|
if c.uninstallScript:
|
||||||
|
writeFile(deinstallShFile, GenerateDeinstallScript(c), "\10")
|
||||||
|
|
||||||
proc srcdist(c: var TConfigData) =
|
proc srcdist(c: var TConfigData) =
|
||||||
for x in walkFiles(c.libpath / "lib/*.h"):
|
for x in walkFiles(c.libpath / "lib/*.h"):
|
||||||
CopyFile(dest="build" / extractFilename(x), source=x)
|
CopyFile(dest="build" / extractFilename(x), source=x)
|
||||||
@@ -408,10 +417,7 @@ proc srcdist(c: var TConfigData) =
|
|||||||
writeFile(buildShFile, GenerateBuildShellScript(c), "\10")
|
writeFile(buildShFile, GenerateBuildShellScript(c), "\10")
|
||||||
writeFile(buildBatFile32, GenerateBuildBatchScript(c, tWin32), "\13\10")
|
writeFile(buildBatFile32, GenerateBuildBatchScript(c, tWin32), "\13\10")
|
||||||
writeFile(buildBatFile64, GenerateBuildBatchScript(c, tWin64), "\13\10")
|
writeFile(buildBatFile64, GenerateBuildBatchScript(c, tWin64), "\13\10")
|
||||||
if c.installScript:
|
writeInstallScripts(c)
|
||||||
writeFile(installShFile, GenerateInstallScript(c), "\10")
|
|
||||||
if c.uninstallScript:
|
|
||||||
writeFile(deinstallShFile, GenerateDeinstallScript(c), "\10")
|
|
||||||
|
|
||||||
# --------------------- generate inno setup -----------------------------------
|
# --------------------- generate inno setup -----------------------------------
|
||||||
proc setupDist(c: var TConfigData) =
|
proc setupDist(c: var TConfigData) =
|
||||||
@@ -514,6 +520,8 @@ if actionInno in c.actions:
|
|||||||
setupDist(c)
|
setupDist(c)
|
||||||
if actionCSource in c.actions:
|
if actionCSource in c.actions:
|
||||||
srcdist(c)
|
srcdist(c)
|
||||||
|
if actionScripts in c.actions:
|
||||||
|
writeInstallScripts(c)
|
||||||
if actionZip in c.actions:
|
if actionZip in c.actions:
|
||||||
when haveZipLib:
|
when haveZipLib:
|
||||||
zipdist(c)
|
zipdist(c)
|
||||||
|
|||||||
Reference in New Issue
Block a user