niminst updates
This commit is contained in:
parent
de7027e0bf
commit
b99333f53a
8 changed files with 26 additions and 26 deletions
|
|
@ -23,8 +23,8 @@ CALL %CC% %COMP_FLAGS% -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||||
IF ERRORLEVEL 1 (GOTO:END)
|
IF ERRORLEVEL 1 (GOTO:END)
|
||||||
# end for
|
# end for
|
||||||
|
|
||||||
ECHO %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%"\toLower(c.name)}.exe ?linkCmd %LINK_FLAGS%
|
CALL %LINKER% -o ?{"%BIN_DIR%"\toLowerAscii(c.name)}.exe ?linkCmd %LINK_FLAGS%
|
||||||
|
|
||||||
# end block
|
# end block
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ case $myos in
|
||||||
$CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
|
$CC $COMP_FLAGS -Ic_code -c ?{f} -o ?{changeFileExt(f, "o")}
|
||||||
# add(linkCmd, " \\\n" & changeFileExt(f, "o"))
|
# add(linkCmd, " \\\n" & changeFileExt(f, "o"))
|
||||||
# end for
|
# end for
|
||||||
$LINKER -o ?{"$binDir/" & toLower(c.name)} ?linkCmd $LINK_FLAGS
|
$LINKER -o ?{"$binDir/" & toLowerAscii(c.name)} ?linkCmd $LINK_FLAGS
|
||||||
;;
|
;;
|
||||||
# end for
|
# end for
|
||||||
*)
|
*)
|
||||||
|
|
|
||||||
|
|
@ -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
|
## binaries/config/docs/lib: files relative to nim's root, that need to
|
||||||
## be installed.
|
## be installed.
|
||||||
|
|
||||||
let pkgName = packName.toLower()
|
let pkgName = packName.toLowerAscii()
|
||||||
|
|
||||||
var workingDir = getTempDir() / "niminst" / "deb"
|
var workingDir = getTempDir() / "niminst" / "deb"
|
||||||
var upstreamSource = (pkgName & "-" & version)
|
var upstreamSource = (pkgName & "-" & version)
|
||||||
|
|
@ -168,7 +168,7 @@ proc prepDeb*(packName, version, mtnName, mtnEmail, shortDesc, desc: string,
|
||||||
echo("Creating necessary files in debian/")
|
echo("Creating necessary files in debian/")
|
||||||
createDir(workingDir / upstreamSource / "debian")
|
createDir(workingDir / upstreamSource / "debian")
|
||||||
|
|
||||||
template writeDebian(f, s: string): expr =
|
template writeDebian(f, s: string) =
|
||||||
writeFile(workingDir / upstreamSource / "debian" / f, s)
|
writeFile(workingDir / upstreamSource / "debian" / f, s)
|
||||||
|
|
||||||
var controlFile = createControl(pkgName, makeMtn(mtnName, mtnEmail),
|
var controlFile = createControl(pkgName, makeMtn(mtnName, mtnEmail),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#? stdtmpl(subsChar='?') | standard
|
#? stdtmpl(subsChar='?') | standard
|
||||||
#proc generateDeinstallScript(c: ConfigData): string =
|
#proc generateDeinstallScript(c: ConfigData): string =
|
||||||
# result = "#! /bin/sh\n# Generated by niminst\n"
|
# result = "#! /bin/sh\n# Generated by niminst\n"
|
||||||
# var proj = c.name.toLower
|
# var proj = c.name.toLowerAscii
|
||||||
|
|
||||||
if [ $# -eq 1 ] ; then
|
if [ $# -eq 1 ] ; then
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#? stdtmpl(subsChar = '?') | standard
|
#? stdtmpl(subsChar = '?') | standard
|
||||||
#proc generateInstallScript(c: ConfigData): string =
|
#proc generateInstallScript(c: ConfigData): string =
|
||||||
# result = "#! /bin/sh\n# Generated by niminst\n"
|
# result = "#! /bin/sh\n# Generated by niminst\n"
|
||||||
# var proj = c.name.toLower
|
# var proj = c.name.toLowerAscii
|
||||||
|
|
||||||
## Current directory you start script from
|
## Current directory you start script from
|
||||||
BASE_DIR=$(pwd)
|
BASE_DIR=$(pwd)
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ endif
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(COMP_FLAGS) -Ic_code -c $< -o $@
|
$(CC) $(COMP_FLAGS) -Ic_code -c $< -o $@
|
||||||
|
|
||||||
?{"$(binDir)/" & toLower(c.name)}: $(oFiles)
|
?{"$(binDir)/" & toLowerAscii(c.name)}: $(oFiles)
|
||||||
@mkdir -p $(binDir)
|
@mkdir -p $(binDir)
|
||||||
$(LINKER) -o $@ $^ $(LINK_FLAGS)
|
$(LINKER) -o $@ $^ $(LINK_FLAGS)
|
||||||
@echo "SUCCESS"
|
@echo "SUCCESS"
|
||||||
|
|
@ -165,4 +165,4 @@ endif
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(oFiles) ?{"$(binDir)/" & toLower(c.name)}
|
rm -f $(oFiles) ?{"$(binDir)/" & toLowerAscii(c.name)}
|
||||||
|
|
|
||||||
|
|
@ -552,7 +552,7 @@ proc srcdist(c: var ConfigData) =
|
||||||
# --------------------- generate inno setup -----------------------------------
|
# --------------------- generate inno setup -----------------------------------
|
||||||
proc setupDist(c: var ConfigData) =
|
proc setupDist(c: var ConfigData) =
|
||||||
let scrpt = generateInnoSetup(c)
|
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")
|
writeFile(n, scrpt, "\13\10")
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
if c.innosetup.path.len == 0:
|
if c.innosetup.path.len == 0:
|
||||||
|
|
@ -569,7 +569,7 @@ proc setupDist(c: var ConfigData) =
|
||||||
# --------------------- generate NSIS setup -----------------------------------
|
# --------------------- generate NSIS setup -----------------------------------
|
||||||
proc setupDist2(c: var ConfigData) =
|
proc setupDist2(c: var ConfigData) =
|
||||||
let scrpt = generateNsisSetup(c)
|
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")
|
writeFile(n, scrpt, "\13\10")
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
if c.nsisSetup.path.len == 0:
|
if c.nsisSetup.path.len == 0:
|
||||||
|
|
@ -586,7 +586,7 @@ proc setupDist2(c: var ConfigData) =
|
||||||
# ------------------ generate ZIP file ---------------------------------------
|
# ------------------ generate ZIP file ---------------------------------------
|
||||||
when haveZipLib:
|
when haveZipLib:
|
||||||
proc zipDist(c: var ConfigData) =
|
proc zipDist(c: var ConfigData) =
|
||||||
var proj = toLower(c.name) & "-" & c.version
|
var proj = toLowerAscii(c.name) & "-" & c.version
|
||||||
var n = "$#.zip" % proj
|
var n = "$#.zip" % proj
|
||||||
if c.outdir.len == 0: n = "build" / n
|
if c.outdir.len == 0: n = "build" / n
|
||||||
else: n = c.outdir / n
|
else: n = c.outdir / n
|
||||||
|
|
@ -618,7 +618,7 @@ when haveZipLib:
|
||||||
quit("Cannot open for writing: " & n)
|
quit("Cannot open for writing: " & n)
|
||||||
|
|
||||||
proc xzDist(c: var ConfigData; windowsZip=false) =
|
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
|
let tmpDir = if c.outdir.len == 0: "build" else: c.outdir
|
||||||
|
|
||||||
template processFile(destFile, src) =
|
template processFile(destFile, src) =
|
||||||
|
|
@ -630,17 +630,17 @@ proc xzDist(c: var ConfigData; windowsZip=false) =
|
||||||
if not dirExists(destDir): createDir(destDir)
|
if not dirExists(destDir): createDir(destDir)
|
||||||
copyFileWithPermissions(src, dest)
|
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 " &
|
quit("No C sources found in ./build/, please build by running " &
|
||||||
"./koch csource -d:release.")
|
"./koch csource -d:release.")
|
||||||
|
|
||||||
|
if not windowsZip:
|
||||||
processFile(proj / buildBatFile32, "build" / buildBatFile32)
|
processFile(proj / buildBatFile32, "build" / buildBatFile32)
|
||||||
processFile(proj / buildBatFile64, "build" / buildBatFile64)
|
processFile(proj / buildBatFile64, "build" / buildBatFile64)
|
||||||
processFile(proj / buildShFile, "build" / buildShFile)
|
processFile(proj / buildShFile, "build" / buildShFile)
|
||||||
processFile(proj / makeFile, "build" / makeFile)
|
processFile(proj / makeFile, "build" / makeFile)
|
||||||
processFile(proj / installShFile, installShFile)
|
processFile(proj / installShFile, installShFile)
|
||||||
processFile(proj / deinstallShFile, deinstallShFile)
|
processFile(proj / deinstallShFile, deinstallShFile)
|
||||||
if not windowsZip:
|
|
||||||
for f in walkFiles(c.libpath / "lib/*.h"):
|
for f in walkFiles(c.libpath / "lib/*.h"):
|
||||||
processFile(proj / "c_code" / extractFilename(f), f)
|
processFile(proj / "c_code" / extractFilename(f), f)
|
||||||
for osA in 1..c.oses.len:
|
for osA in 1..c.oses.len:
|
||||||
|
|
@ -688,11 +688,11 @@ proc debDist(c: var ConfigData) =
|
||||||
echo("Copying source to tmp/niminst/deb/")
|
echo("Copying source to tmp/niminst/deb/")
|
||||||
var currentSource = getCurrentDir()
|
var currentSource = getCurrentDir()
|
||||||
var workingDir = getTempDir() / "niminst" / "deb"
|
var workingDir = getTempDir() / "niminst" / "deb"
|
||||||
var upstreamSource = (c.name.toLower() & "-" & c.version)
|
var upstreamSource = (c.name.toLowerAscii() & "-" & c.version)
|
||||||
|
|
||||||
createDir(workingDir / upstreamSource)
|
createDir(workingDir / upstreamSource)
|
||||||
|
|
||||||
template copyNimDist(f, dest: string): stmt =
|
template copyNimDist(f, dest: string) =
|
||||||
createDir((workingDir / upstreamSource / dest).splitFile.dir)
|
createDir((workingDir / upstreamSource / dest).splitFile.dir)
|
||||||
copyFile(currentSource / f, workingDir / upstreamSource / dest)
|
copyFile(currentSource / f, workingDir / upstreamSource / dest)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@
|
||||||
; Shortcuts
|
; Shortcuts
|
||||||
# if d.len >= 6:
|
# if d.len >= 6:
|
||||||
# let startMenuEntry = d[5]
|
# let startMenuEntry = d[5]
|
||||||
# let e = splitFile(startMenuEntry).name.capitalize
|
# let e = splitFile(startMenuEntry).name.capitalizeAscii
|
||||||
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
|
||||||
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\?{e}.lnk" "$INSTDIR\?dir\?{startMenuEntry.toWin}"
|
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\?{e}.lnk" "$INSTDIR\?dir\?{startMenuEntry.toWin}"
|
||||||
!insertmacro MUI_STARTMENU_WRITE_END
|
!insertmacro MUI_STARTMENU_WRITE_END
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue