niminst updates

This commit is contained in:
Andreas Rumpf
2016-10-21 12:12:33 +02:00
parent de7027e0bf
commit b99333f53a
8 changed files with 26 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
#? stdtmpl(subsChar='?') | standard
#proc generateBuildBatchScript(c: ConfigData, winIndex, cpuIndex: int): string =
#proc generateBuildBatchScript(c: ConfigData, winIndex, cpuIndex: int): string =
# result = "@echo off\nREM Generated by niminst\n"
SET CC=gcc
SET LINKER=gcc
@@ -23,8 +23,8 @@ CALL %CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
IF ERRORLEVEL 1 (GOTO:END)
# end for
ECHO %LINKER% -o ?{"%BIN_DIR%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS%
CALL %LINKER% -o ?{"%BIN_DIR%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS%
ECHO %LINKER% -o ?{"%BIN_DIR%"\toLowerAscii(c.name)}.exe ?linkCmd %LINK_FLAGS%
CALL %LINKER% -o ?{"%BIN_DIR%"\toLowerAscii(c.name)}.exe ?linkCmd %LINK_FLAGS%
# end block

View File

@@ -94,8 +94,8 @@ case $uos in
myos="haiku"
LINK_FLAGS="$LINK_FLAGS -lroot -lnetwork"
;;
*mingw* )
myos="windows"
*mingw* )
myos="windows"
;;
*)
echo 2>&1 "Error: unknown operating system: $uos"
@@ -147,7 +147,7 @@ case $myos in
$CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
# add(linkCmd, " \\\n" & changeFileExt(f, "o"))
# end for
$LINKER -o ?{"$binDir/" & toLower(c.name)} ?linkCmd $LINK_FLAGS
$LINKER -o ?{"$binDir/" & toLowerAscii(c.name)} ?linkCmd $LINK_FLAGS
;;
# end for
*)

View File

@@ -148,7 +148,7 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string,
## binaries/config/docs/lib: files relative to nim's root, that need to
## be installed.
let pkgName = packName.toLower()
let pkgName = packName.toLowerAscii()
var workingDir = getTempDir() / "niminst" / "deb"
var upstreamSource = (pkgName & "-" & version)
@@ -168,7 +168,7 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string,
echo("Creating necessary files in debian/")
createDir(workingDir / upstreamSource / "debian")
template writeDebian(f, s: string): expr =
template writeDebian(f, s: string) =
writeFile(workingDir / upstreamSource / "debian" / f, s)
var controlFile = createControl(pkgName, makeMtn(mtnName, mtnEmail),

View File

@@ -1,7 +1,7 @@
#? stdtmpl(subsChar='?') | standard
#proc generateDeinstallScript(c: ConfigData): string =
# result = "#! /bin/sh\n# Generated by niminst\n"
# var proj = c.name.toLower
# var proj = c.name.toLowerAscii
if [ $# -eq 1 ] ; then
case $1 in

View File

@@ -1,7 +1,7 @@
#? stdtmpl(subsChar = '?') | standard
#proc generateInstallScript(c: ConfigData): string =
# result = "#! /bin/sh\n# Generated by niminst\n"
# var proj = c.name.toLower
# var proj = c.name.toLowerAscii
## Current directory you start script from
BASE_DIR=$(pwd)

View File

@@ -157,7 +157,7 @@ endif
%.o: %.c
$(CC) $(COMP_FLAGS) -Ic_code -c $< -o $@
?{"$(binDir)/" & toLower(c.name)}: $(oFiles)
?{"$(binDir)/" & toLowerAscii(c.name)}: $(oFiles)
@mkdir -p $(binDir)
$(LINKER) -o $@ $^ $(LINK_FLAGS)
@echo "SUCCESS"
@@ -165,4 +165,4 @@ endif
.PHONY: clean
clean:
rm -f $(oFiles) ?{"$(binDir)/" & toLower(c.name)}
rm -f $(oFiles) ?{"$(binDir)/" & toLowerAscii(c.name)}

View File

@@ -552,7 +552,7 @@ proc srcdist(c: var ConfigData) =
# --------------------- generate inno setup -----------------------------------
proc setupDist(c: var ConfigData) =
let scrpt = generateInnoSetup(c)
let n = "build" / "install_$#_$#.iss" % [toLower(c.name), c.version]
let n = "build" / "install_$#_$#.iss" % [toLowerAscii(c.name), c.version]
writeFile(n, scrpt, "\13\10")
when defined(windows):
if c.innosetup.path.len == 0:
@@ -569,7 +569,7 @@ proc setupDist(c: var ConfigData) =
# --------------------- generate NSIS setup -----------------------------------
proc setupDist2(c: var ConfigData) =
let scrpt = generateNsisSetup(c)
let n = "build" / "install_$#_$#.nsi" % [toLower(c.name), c.version]
let n = "build" / "install_$#_$#.nsi" % [toLowerAscii(c.name), c.version]
writeFile(n, scrpt, "\13\10")
when defined(windows):
if c.nsisSetup.path.len == 0:
@@ -586,7 +586,7 @@ proc setupDist2(c: var ConfigData) =
# ------------------ generate ZIP file ---------------------------------------
when haveZipLib:
proc zipDist(c: var ConfigData) =
var proj = toLower(c.name) & "-" & c.version
var proj = toLowerAscii(c.name) & "-" & c.version
var n = "$#.zip" % proj
if c.outdir.len == 0: n = "build" / n
else: n = c.outdir / n
@@ -618,7 +618,7 @@ when haveZipLib:
quit("Cannot open for writing: " & n)
proc xzDist(c: var ConfigData; windowsZip=false) =
let proj = toLower(c.name) & "-" & c.version
let proj = toLowerAscii(c.name) & "-" & c.version
let tmpDir = if c.outdir.len == 0: "build" else: c.outdir
template processFile(destFile, src) =
@@ -630,17 +630,17 @@ proc xzDist(c: var ConfigData; windowsZip=false) =
if not dirExists(destDir): createDir(destDir)
copyFileWithPermissions(src, dest)
if not existsFile("build" / buildBatFile32):
if not windowsZip and not existsFile("build" / buildBatFile32):
quit("No C sources found in ./build/, please build by running " &
"./koch csource -d:release.")
processFile(proj / buildBatFile32, "build" / buildBatFile32)
processFile(proj / buildBatFile64, "build" / buildBatFile64)
processFile(proj / buildShFile, "build" / buildShFile)
processFile(proj / makeFile, "build" / makeFile)
processFile(proj / installShFile, installShFile)
processFile(proj / deinstallShFile, deinstallShFile)
if not windowsZip:
processFile(proj / buildBatFile32, "build" / buildBatFile32)
processFile(proj / buildBatFile64, "build" / buildBatFile64)
processFile(proj / buildShFile, "build" / buildShFile)
processFile(proj / makeFile, "build" / makeFile)
processFile(proj / installShFile, installShFile)
processFile(proj / deinstallShFile, deinstallShFile)
for f in walkFiles(c.libpath / "lib/*.h"):
processFile(proj / "c_code" / extractFilename(f), f)
for osA in 1..c.oses.len:
@@ -688,11 +688,11 @@ proc debDist(c: var ConfigData) =
echo("Copying source to tmp/niminst/deb/")
var currentSource = getCurrentDir()
var workingDir = getTempDir() / "niminst" / "deb"
var upstreamSource = (c.name.toLower() & "-" & c.version)
var upstreamSource = (c.name.toLowerAscii() & "-" & c.version)
createDir(workingDir / upstreamSource)
template copyNimDist(f, dest: string): stmt =
template copyNimDist(f, dest: string) =
createDir((workingDir / upstreamSource / dest).splitFile.dir)
copyFile(currentSource / f, workingDir / upstreamSource / dest)

View File

@@ -202,7 +202,7 @@
; Shortcuts
# if d.len >= 6:
# let startMenuEntry = d[5]
# let e = splitFile(startMenuEntry).name.capitalize
# let e = splitFile(startMenuEntry).name.capitalizeAscii
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\?{e}.lnk" "$INSTDIR\?dir\?{startMenuEntry.toWin}"
!insertmacro MUI_STARTMENU_WRITE_END