all repos — hastyscribe @ c9491a761c5c15f101034ea70a7e6c6773d0a9b4

A professional markdown compiler.

Added support for Linux x64.
* Closes #37.
h3rald h3rald@h3rald.com
Sat, 11 Jun 2016 12:10:26 +0200
commit

c9491a761c5c15f101034ea70a7e6c6773d0a9b4

parent

0222c2a271ee40d38abc2a4fb710cd1b065e3fc4

A config.nim

@@ -0,0 +1,37 @@

+import + parsecfg, + streams, + strutils + +const + cfgfile = "hastyscribe.nimble".slurp + +var + version*: string + f = newStringStream(cfgfile) + +if f != nil: + var p: CfgParser + open(p, f, "hastyscribe.nimble") + while true: + var e = next(p) + case e.kind + of cfgEof: + break + of cfgKeyValuePair: + case e.key: + of "version": + version = e.value + else: + discard + of cfgError: + stderr.writeLine("Configuration error.") + quit(1) + else: + discard + close(p) +else: + stderr.writeLine("Cannot process configuration file.") + quit(2) + +
M hastyscribe.nimhastyscribe.nim

@@ -10,9 +10,10 @@ markdown,

tables, httpclient -from version import v +import + config -let usage* = " HastyScribe v" & v & " - Self-contained Markdown Compiler" & """ +let usage* = " HastyScribe v" & version & " - Self-contained Markdown Compiler" & """ (c) 2013-2016 Fabio Cevasco
M hastyscribe.nim.cfghastyscribe.nim.cfg

@@ -1,3 +1,5 @@

+define:release + # https://gist.github.com/Drakulix/9881160 amd64.windows.gcc.path = "/usr/local/mingw/bin" amd64.windows.gcc.exe = "x86_64-w64-mingw32-gcc"

@@ -12,6 +14,11 @@ # http://crossgcc.rts-software.org/doku.php?id=compiling_for_linux

i386.linux.gcc.path = "/usr/local/gcc-4.8.1-for-linux32/bin" i386.linux.gcc.exe = "i586-pc-linux-gcc" i386.linux.gcc.linkerexe = "i586-pc-linux-gcc" + +# http://crossgcc.rts-software.org/doku.php?id=compiling_for_linux +amd64.linux.gcc.path = "/usr/local/gcc-4.8.1-for-linux64/bin" +amd64.linux.gcc.exe = "x86_64-pc-linux-gcc" +amd64.linux.gcc.linkerexe = "x86_64-pc-linux-gcc" # http://www.jaredwolff.com/toolchains/ arm.linux.gcc.path = "/usr/local/arm-none-linux-gnueabi/bin"
M hastyscribe.nimblehastyscribe.nimble

@@ -40,6 +40,7 @@ vendor/libmarkdown_macosx_x64.a

vendor/libmarkdown_windows_x64.a vendor/libmarkdown_windows_x86.a vendor/libmarkdown_linux_x86.a +vendor/libmarkdown_linux_x64.a vendor/libmarkdown_linux_arm.a """
M markdown.nimmarkdown.nim

@@ -193,5 +193,7 @@ {.link: "vendor/libmarkdown_windows_x64.a".}

when defined(linux): when defined(arm): {.link: "vendor/libmarkdown_linux_arm.a".} - when defined(i386) or defined(amd64): + when defined(i386): {.link: "vendor/libmarkdown_linux_x86.a".} + when defined(amd64): + {.link: "vendor/libmarkdown_linux_x64.a".}
M nakefile.nimnakefile.nim

@@ -1,9 +1,13 @@

-import nake -from version import v +import + nake + +import + config const compile = "nim c -d:release" linux_x86 = "--cpu:i386 --os:linux" + linux_x64 = "--cpu:amd64 --os:linux" linux_arm = "--cpu:arm --os:linux" windows_x86 = "--cpu:i386 --os:windows" windows_x64 = "--cpu:amd64 --os:windows"

@@ -14,7 +18,7 @@ hs_file = "hastyscribe.nim"

zip = "zip -X" proc filename_for(os: string, arch: string): string = - return "hastyscribe" & "_v" & v & "_" & os & "_" & arch & ".zip" + return "hastyscribe" & "_v" & version & "_" & os & "_" & arch & ".zip" task "windows-x86-build", "Build HastyScribe for Windows (x86)": direshell compile, windows_x86, hs_file

@@ -24,6 +28,9 @@ direshell compile, windows_x64, hs_file

task "linux-x86-build", "Build HastyScribe for Linux (x86)": direshell compile, linux_x86, hs_file + +task "linux-x64-build", "Build HastyScribe for Linux (x64)": + direshell compile, linux_x64, hs_file task "linux-arm-build", "Build HastyScribe for Linux (ARM)": direshell compile, linux_arm, hs_file

@@ -40,6 +47,10 @@ echo "\n\n\n WINDOWS - x64:\n\n"

runTask "windows-x64-build" direshell zip, filename_for("windows", "x64"), hs & ".exe" direshell "rm", hs & ".exe" + echo "\n\n\n LINUX - x64:\n\n" + runTask "linux-x64-build" + direshell zip, filename_for("linux", "x64"), hs + direshell "rm", hs echo "\n\n\n LINUX - x86:\n\n" runTask "linux-x86-build" direshell zip, filename_for("linux", "x86"), hs
D version.nim

@@ -1,1 +0,0 @@

-let v* = "1.1.4"