summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorSergey Avseyev <sergey.avseyev@gmail.com>2015-05-26 12:51:31 +0300
committerSergey Avseyev <sergey.avseyev@gmail.com>2015-05-26 13:23:41 +0300
commitba2aa474a1e96acb06190236fbc2896d2e170494 (patch)
treebcaaed23837ba3a4036977890c0cdaa7ce058deb /koch.nim
parent8ee98b36814fd83973d408d49c8b702a3308d014 (diff)
downloadNim-ba2aa474a1e96acb06190236fbc2896d2e170494.tar.gz
Implement support for XZ dist tarball
Motivation
----------
Currenly tarballs for linux created manually. ZIP files are not
suitable, because they do not preserve unix file permissions.

Modification
------------
Implement 'koch xz' command to produce dist tarball in xz format. Also
the same command implemented in niminst.nim.

Result
------
Now it is easy to create source distribution for git stapshot and use it
further in packaging scripts.
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/koch.nim b/koch.nim
index a951b422f..c6db6893c 100644
--- a/koch.nim
+++ b/koch.nim
@@ -47,6 +47,7 @@ Possible Commands:
   csource [options]        builds the C sources for installation
   pdf                      builds the PDF documentation
   zip                      builds the installation ZIP package
+  xz                       builds the installation XZ package
   nsis [options]           builds the NSIS Setup installer (for Windows)
   tests [options]          run the testsuite
   update                   updates nim to the latest version from github
@@ -112,6 +113,12 @@ proc targz(args: string) =
   exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim targz compiler/installer.ini" %
        ["tools" / "niminst" / "niminst".exe, VersionAsString])
 
+proc xz(args: string) =
+  exec("$3 cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" %
+       [VersionAsString, compileNimInst, findNim()])
+  exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" %
+       ["tools" / "niminst" / "niminst".exe, VersionAsString])
+
 proc buildTool(toolname, args: string) =
   exec("$# cc $# $#" % [findNim(), args, toolname])
   copyFile(dest="bin"/ splitFile(toolname).name.exe, source=toolname.exe)
@@ -368,6 +375,7 @@ of cmdArgument:
   of "csource", "csources": csource(op.cmdLineRest)
   of "zip": zip(op.cmdLineRest)
   of "targz": targz(op.cmdLineRest)
+  of "xz": xz(op.cmdLineRest)
   of "nsis": nsis(op.cmdLineRest)
   of "install": install(op.cmdLineRest)
   of "test", "tests": tests(op.cmdLineRest)