posix.nim compiles again

This commit is contained in:
Araq 2014-08-29 01:28:48 +02:00
commit a68f17a9f7
9 changed files with 76 additions and 76 deletions

View file

@ -3,10 +3,10 @@
import os, sets, pegs
type
TProcessResult = enum prSkipIncludeDir, prAddIncludeDir
ProcessResult = enum prSkipIncludeDir, prAddIncludeDir
proc process(dir, infile: string, outfile: TFile,
processed: var TSet[string]): TProcessResult =
proc process(dir, infile: string, outfile: File,
processed: var HashSet[string]): ProcessResult =
if processed.containsOrIncl(infile): return prSkipIncludeDir
let toProcess = dir / infile
if not existsFile(toProcess):
@ -24,7 +24,7 @@ proc process(dir, infile: string, outfile: TFile,
writeln(outfile, line)
proc main(dir, outfile: string) =
var o: TFile
var o: File
if open(o, outfile, fmWrite):
var processed = initSet[string]()
processed.incl(outfile)

View file

@ -1,8 +1,8 @@
# Posix detect program
# (c) 2010 Andreas Rumpf
# This program produces a C program that produces a Nimrod include file.
# The Nimrod include file lists the values of each POSIX constant.
# This program produces a C program that produces a Nim include file.
# The Nim include file lists the values of each POSIX constant.
# This is needed because POSIX is brain-dead: It only cares for C, any other
# language is ignored. It would have been easier had they specified the
# concrete values of the constants. Sigh.

View file

@ -1,6 +1,6 @@
#
#
# Nimrod Grep Utility
# Nim Grep Utility
# (c) Copyright 2012 Andreas Rumpf
#
# See the file "copying.txt", included in this
@ -12,7 +12,7 @@ import
const
Version = "0.9"
Usage = "nimgrep - Nimrod Grep Utility Version " & version & """
Usage = "nimgrep - Nim Grep Utility Version " & version & """
(c) 2012 Andreas Rumpf
Usage:
@ -194,7 +194,7 @@ proc processFile(filename: string) =
i = t.last+1
if optReplace in options:
result.add(substr(buffer, i))
var f: TFile
var f: File
if open(f, filename, fmWrite):
f.write(result)
f.close()

View file

@ -1,6 +1,6 @@
#
#
# The Nimrod Installation Generator
# The Nim Installation Generator
# (c) Copyright 2012 Dominik Picheta
#
# See the file "copying.txt", included in this
@ -104,7 +104,7 @@ proc createChangelog(pkgName, version, maintainer: string): string =
formatDateTime(getGMTime(getTime()), "+0000"))
proc createRules(): string =
## Creates a nimrod application-agnostic rules file for building deb packages.
## Creates a nim application-agnostic rules file for building deb packages.
## Please note: this assumes the c sources have been built and the
## ``build.sh`` and ``install.sh`` files are available.
result = ""
@ -131,9 +131,9 @@ proc createDotInstall(pkgName: string, binaries, config, docs,
for c in config:
addN(pkgName / c & " " & "etc/")
for d in docs:
addN(pkgName / d & " " & "usr/share/doc/nimrod/")
addN(pkgName / d & " " & "usr/share/doc/nim/")
for l1 in lib:
addN(pkgName / l1 & " " & "usr/lib/nimrod")
addN(pkgName / l1 & " " & "usr/lib/nim")
proc makeMtn(name, email: string): string =
return name & " <" & email & ">"
@ -145,7 +145,7 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string,
licenses: seq[tuple[files, license: string]], binaries,
config, docs, lib: seq[string],
buildDepends, pkgDepends = "") =
## binaries/config/docs/lib: files relative to nimrod's root, that need to
## binaries/config/docs/lib: files relative to nim's root, that need to
## be installed.
let pkgName = packName.toLower()
@ -212,24 +212,24 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string,
echo("And execute `debuild -us -uc` to build the .deb")
when isMainModule:
#var controlFile = createControl("nimrod", "Dominik Picheta <morfeusz8@gmail.com>",
# "The Nimrod compiler", "Compiler for the Nimrod programming language", "gcc (>= 4:4.3.2)", "gcc (>= 4:4.3.2)")
#var controlFile = createControl("nim", "Dominik Picheta <morfeusz8@gmail.com>",
# "The Nim compiler", "Compiler for the Nim programming language", "gcc (>= 4:4.3.2)", "gcc (>= 4:4.3.2)")
#echo(controlFile)
#var copyrightFile = createCopyright("nimrod", "Dominik Picheta", "morfeusz8@a.b", "0.8.14",
# @[("bin/nimrod", "gpl2"), ("lib/*", "lgpl")])
#var copyrightFile = createCopyright("nim", "Dominik Picheta", "morfeusz8@a.b", "0.8.14",
# @[("bin/nim", "gpl2"), ("lib/*", "lgpl")])
#echo copyrightFile
#var changelogFile = createChangelog("nimrod", "0.8.14", "Dom P <m@b.c>")
#var changelogFile = createChangelog("nim", "0.8.14", "Dom P <m@b.c>")
#echo(changelogFile)
#echo(createRules())
prepDeb("nimrod", "0.9.2", "Dominik Picheta", "morfeusz8@gmail.com",
"The Nimrod compiler", "Compiler for the Nimrod programming language",
@[("bin/nimrod", "MIT"), ("lib/*", "MIT")],
@["bin/nimrod"], @["config/*"], @["doc/*"], @["lib/*"],
prepDeb("nim", "0.9.2", "Dominik Picheta", "morfeusz8@gmail.com",
"The Nim compiler", "Compiler for the Nim programming language",
@[("bin/nim", "MIT"), ("lib/*", "MIT")],
@["bin/nim"], @["config/*"], @["doc/*"], @["lib/*"],
"gcc (>= 4:4.3.2)", "gcc (>= 4:4.3.2)")

View file

@ -1,7 +1,7 @@
#
#
# The Nimrod Installation Generator
# (c) Copyright 2013 Andreas Rumpf
# The Nim Installation Generator
# (c) Copyright 2014 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
@ -60,7 +60,7 @@ type
explicitPlatforms: bool
vars: PStringTable
app: TAppType
nimrodArgs: string
nimArgs: string
debOpts: TDebOptions
const
@ -85,7 +85,7 @@ proc initConfigData(c: var TConfigData) =
c.license = ""
c.infile = ""
c.outdir = ""
c.nimrodArgs = ""
c.nimArgs = ""
c.libpath = ""
c.innoSetupFlag = false
c.installScript = false
@ -126,7 +126,7 @@ include "deinstall.tmpl"
const
Version = "0.9"
Usage = "niminst - Nimrod Installation Generator Version " & Version & """
Usage = "niminst - Nim Installation Generator Version " & Version & """
(c) 2013 Andreas Rumpf
Usage:
@ -166,7 +166,7 @@ proc parseCmdLine(c: var TConfigData) =
else: quit(Usage)
else:
c.infile = addFileExt(key.string, "ini")
c.nimrodArgs = cmdLineRest(p).string
c.nimArgs = cmdLineRest(p).string
break
of cmdLongoption, cmdShortOption:
case normalize(key.string)
@ -451,14 +451,14 @@ proc srcdist(c: var TConfigData) =
var dir = getOutputDir(c) / buildDir(osA, cpuA)
if existsDir(dir): removeDir(dir)
createDir(dir)
var cmd = ("nimrod compile -f --symbolfiles:off --compileonly " &
var cmd = ("nim compile -f --symbolfiles:off --compileonly " &
"--gen_mapping --cc:gcc --skipUserCfg" &
" --os:$# --cpu:$# $# $#") %
[osname, cpuname, c.nimrodArgs,
[osname, cpuname, c.nimArgs,
changeFileExt(c.infile, "nim")]
echo(cmd)
if execShellCmd(cmd) != 0:
quit("Error: call to nimrod compiler failed")
quit("Error: call to nim compiler failed")
readCFiles(c, osA, cpuA)
for i in 0 .. c.cfiles[osA][cpuA].len-1:
let dest = dir / extractFilename(c.cfiles[osA][cpuA][i])

View file

@ -1,6 +1,6 @@
#
#
# Nimrod REPL
# Nim REPL
# (c) Copyright 2012 Dominik Picheta
#
# See the file "copying.txt", included in this
@ -14,8 +14,8 @@ when defined(tinyc):
else:
const runCmd = "c -r"
var nimExe = findExe("nimrod")
if nimExe.len == 0: nimExe = "../bin" / addFileExt("nimrod", os.exeExt)
var nimExe = findExe("nim")
if nimExe.len == 0: nimExe = "../bin" / addFileExt("nim", os.exeExt)
proc execCode(code: string): string =
var f: TFile
@ -36,7 +36,7 @@ var OutputTextBuffer: PTextBuffer
proc destroy(widget: PWidget, data: pgpointer){.cdecl.} =
main_quit()
proc FileOpenClicked(menuitem: PMenuItem, userdata: pgpointer) {.cdecl.} =
proc fileOpenClicked(menuitem: PMenuItem, userdata: pgpointer) {.cdecl.} =
var path = ChooseFileToOpen(w)
if path != "":
var file = readFile(path)
@ -45,7 +45,7 @@ proc FileOpenClicked(menuitem: PMenuItem, userdata: pgpointer) {.cdecl.} =
else:
error(w, "Unable to read from file")
proc FileSaveClicked(menuitem: PMenuItem, userdata: pgpointer) {.cdecl.} =
proc fileSaveClicked(menuitem: PMenuItem, userdata: pgpointer) {.cdecl.} =
var path = ChooseFileToSave(w)
if path == "": return
@ -115,12 +115,12 @@ proc initControls() =
append(FileMenu, OpenMenuItem)
show(OpenMenuItem)
discard signal_connect(OpenMenuItem, "activate",
SIGNAL_FUNC(FileOpenClicked), nil)
SIGNAL_FUNC(fileOpenClicked), nil)
var SaveMenuItem = menu_item_new("Save...")
append(FileMenu, SaveMenuItem)
show(SaveMenuItem)
discard signal_connect(SaveMenuItem, "activate",
SIGNAL_FUNC(FileSaveClicked), nil)
SIGNAL_FUNC(fileSaveClicked), nil)
var FileMenuItem = menu_item_new("File")

View file

@ -1,6 +1,6 @@
#
#
# Nimrod Website Generator
# Nim Website Generator
# (c) Copyright 2012 Andreas Rumpf
#
# See the file "copying.txt", included in this
@ -54,7 +54,7 @@ include "website.tmpl"
const
Version = "0.7"
Usage = "nimweb - Nimrod Website Generator Version " & version & """
Usage = "nimweb - Nim Website Generator Version " & version & """
(c) 2012 Andreas Rumpf
Usage:

View file

@ -80,7 +80,7 @@
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48159761-1', 'nimrod-lang.org');
ga('create', 'UA-48159761-1', 'nim-lang.org');
ga('send', 'pageview');
</script>