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