diff --git a/all.html b/all.html index 9b6a1fa..618ff78 100644 --- a/all.html +++ b/all.html @@ -850,7 +850,7 @@ function main() { diff --git a/build.html b/build.html index d470cfd..f1880f7 100644 --- a/build.html +++ b/build.html @@ -849,7 +849,9 @@ function main() {
  • rmFile
  • rmDir
  • + title="rmDir(dir: string)">rmDir +
  • getProjectCacheDir
  • extractZip
  • gitCheckout
  • gitPull
  • -
  • findFile
  • +
  • findFile
  • flagBuild
  • +
  • linkLibs
  • configure
  • setCmakePositionIndependentCode
  • cmake
  • -
  • make
  • +
  • make
  • getGccPaths
  • setDefines
  • clearDefines
  • +
  • isDefined
  • -
    proc rmDir(source: string) {...}{.raises: [OSError, Exception, IOError, Defect, ValueError],
    -                          tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    +
    proc rmDir(dir: string) {...}{.raises: [OSError, Exception, IOError, Defect, ValueError],
    +                       tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    Remove a directory or pattern at compile time +
    + +
    proc getProjectCacheDir(name: string; forceClean = true): string {...}{.
    +    raises: [OSError, Exception, IOError, Defect, ValueError],
    +    tags: [ReadEnvEffect, ReadIOEffect, ExecIOEffect, RootEffect].}
    +
    + +

    Get a cache directory where all nimterop artifacts can be stored

    +

    Projects can use this location to download source code and build binaries that can be then accessed by multiple apps. This is created under the per-user Nim cache directory.

    +

    Use name to specify the subdirectory name for a project.

    +

    forceClean is enabled by default and effectively deletes the folder if Nim is compiled with the -f or --forceBuild flag. This allows any project to start out with a clean cache dir on a forced build.

    +

    NOTE: avoid calling getProjectCacheDir() multiple times on the same name when forceClean = true else checked out source might get deleted at the wrong time during build.

    +
    E.g.
    +

    nimgit2 downloads libgit2 source so name = "libgit2"

    +

    nimarchive downloads libarchive, bzlib, liblzma and zlib so name = "nimarchive" / "libarchive" for libarchive, etc.

    +
    +
    + +
    proc extractZip(zipfile, outdir: string) {...}{.raises: [OSError, Exception, IOError, Defect,
    @@ -1050,12 +1075,13 @@ Hard reset the git repository at the specified directory
     
     
     
    -
    -
    proc findFile(file: string | Regex; dir: string; recurse = true; first = false): string
    + +
    proc findFile(file: string; dir: string; recurse = true; first = false; regex = false): string {...}{.
    +    raises: [ValueError], tags: [].}

    Find the file in the specified directory

    -

    file can be a string or a regex object

    +

    file is a regular expression if regex is true

    Turn off recursive search with recurse and stop on first match with first. Without it, the shortest match is returned.

    @@ -1073,6 +1099,16 @@ Hard reset the git repository at the specified directory

    flagBuild(base, flags) => " --disable-one --disable-two"

    +
    + +
    proc linkLibs(names: openArray[string]; staticLink = true): string {...}{.
    +    raises: [ValueError], tags: [].}
    +
    + +

    Create linker flags for specified libraries

    +

    Prepends lib to the name so you only need ssl for libssl.

    + +
    proc configure(path, check: string; flags = "") {...}{.
    @@ -1145,13 +1181,16 @@ Set a cmake directive
     
     
     
    -
    -
    proc make(path, check: string | Regex; flags = "")
    + +
    proc make(path, check: string; flags = ""; regex = false) {...}{.
    +    raises: [ValueError, OSError, Exception, IOError, Defect],
    +    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}

    Run the make command to build all binaries in the specified path

    check is a file that will be generated by the make command. This is required to prevent make from running on every build. It is relative to the path and should not be an absolute path.

    flags are any flags that should be passed to the make command.

    +

    regex can be set to true if check is a regular expression.

    If make.exe is missing and mingw32-make.exe is available, it will be copied over to make.exe in the same location.

    @@ -1196,6 +1235,13 @@ Set a cmake directive Clear all defines set using setDefines(). +
    + +
    macro isDefined(def: untyped): untyped
    +
    + +Check if -d:xxx is set globally or via setDefines() +
    macro getHeader(header: static[string]; giturl: static[string] = "";
    @@ -1208,6 +1254,7 @@ Clear all defines set using setDe
     

    This proc checks -d:xxx defines based on the header name (e.g. lzma from lzma.h), and accordingly employs different ways to obtain the source.

    -d:xxxStd - search standard system paths. E.g. /usr/include and /usr/lib on Linux -d:xxxGit - clone source from a git repo specified in giturl -d:xxxDL - download source from dlurl and extract if required

    This allows a single wrapper to be used in different ways depending on the user's needs. If no -d:xxx defines are specified, outdir will be searched for the header as is.

    +

    If multiple -d:xxx defines are specified, precedence is Std and then Git or DL. This allows using a system installed library if available before falling back to manual building.

    -d:xxxSetVer=x.y.z can be used to specify which version to use. It is used as a tag name for Git whereas for DL, it replaces $1 in the URL defined.

    All defines can also be set in code using setDefines().

    The library is then configured (with cmake or autotools if possible) and built using make, unless using -d:xxxStd which presumes that the system package manager was used to install prebuilt headers and binaries.

    @@ -1231,7 +1278,7 @@ Clear all defines set using setDe diff --git a/build.idx b/build.idx index 157a2da..326c09e 100644 --- a/build.idx +++ b/build.idx @@ -6,24 +6,27 @@ mkDir build.html#mkDir,string build: mkDir(dir: string) cpFile build.html#cpFile,string,string build: cpFile(source, dest: string; move = false) mvFile build.html#mvFile,string,string build: mvFile(source, dest: string) rmFile build.html#rmFile,string build: rmFile(source: string; dir = false) -rmDir build.html#rmDir,string build: rmDir(source: string) +rmDir build.html#rmDir,string build: rmDir(dir: string) +getProjectCacheDir build.html#getProjectCacheDir,string build: getProjectCacheDir(name: string; forceClean = true): string extractZip build.html#extractZip,string,string build: extractZip(zipfile, outdir: string) extractTar build.html#extractTar,string,string build: extractTar(tarfile, outdir: string) downloadUrl build.html#downloadUrl,string,string build: downloadUrl(url, outdir: string) gitReset build.html#gitReset,string build: gitReset(outdir: string) gitCheckout build.html#gitCheckout,string,string build: gitCheckout(file, outdir: string) gitPull build.html#gitPull,string,string,string,string build: gitPull(url: string; outdir = ""; plist = ""; checkout = "") -findFile build.html#findFile,,string build: findFile(file: string | Regex; dir: string; recurse = true; first = false): string +findFile build.html#findFile,string,string build: findFile(file: string; dir: string; recurse = true; first = false; regex = false): string flagBuild build.html#flagBuild,string,openArray[string] build: flagBuild(base: string; flags: openArray[string]): string +linkLibs build.html#linkLibs,openArray[string] build: linkLibs(names: openArray[string]; staticLink = true): string configure build.html#configure,string,string,string build: configure(path, check: string; flags = "") getCmakeIncludePath build.html#getCmakeIncludePath,openArray[string] build: getCmakeIncludePath(paths: openArray[string]): string setCmakeProperty build.html#setCmakeProperty,string,string,string,string build: setCmakeProperty(outdir, name, property, value: string) setCmakeLibName build.html#setCmakeLibName,string,string,string,string,string build: setCmakeLibName(outdir, name, prefix = ""; oname = ""; suffix = "") setCmakePositionIndependentCode build.html#setCmakePositionIndependentCode,string build: setCmakePositionIndependentCode(outdir: string) cmake build.html#cmake,string,string,string build: cmake(path, check, flags: string) -make build.html#make,,,string build: make(path, check: string | Regex; flags = "") +make build.html#make,string,string,string build: make(path, check: string; flags = ""; regex = false) getGccPaths build.html#getGccPaths,string build: getGccPaths(mode = "c"): seq[string] getGccLibPaths build.html#getGccLibPaths,string build: getGccLibPaths(mode = "c"): seq[string] setDefines build.html#setDefines.m build: setDefines(defs: static openArray[string]): untyped clearDefines build.html#clearDefines.m build: clearDefines(): untyped +isDefined build.html#isDefined.m,untyped build: isDefined(def: untyped): untyped getHeader build.html#getHeader.m,static[string],static[string],static[string],static[string],static[string],static[string],static[string],static[string] build: getHeader(header: static[string]; giturl: static[string] = "";\n dlurl: static[string] = ""; outdir: static[string] = "";\n conFlags: static[string] = ""; cmakeFlags: static[string] = "";\n makeFlags: static[string] = ""; altNames: static[string] = ""): untyped diff --git a/cimport.html b/cimport.html index b48d03c..916fde6 100644 --- a/cimport.html +++ b/cimport.html @@ -1090,7 +1090,7 @@ Add an include directory that is forwarded to the C/C++ preprocessor if called w @@ -1100,7 +1100,7 @@ Add an include directory that is forwarded to the C/C++ preprocessor if called w diff --git a/compat.html b/compat.html index b718728..2ef05e0 100644 --- a/compat.html +++ b/compat.html @@ -859,7 +859,7 @@ function main() { diff --git a/dochack.js b/dochack.js index 2ce5f19..23d9eb7 100644 --- a/dochack.js +++ b/dochack.js @@ -601,7 +601,6 @@ function nimMin(a_65203, b_65204) { return result_65205; } -var nimvm_49710 = false; var nim_program_result = 0; var global_raise_hook_59618 = [null]; var local_raise_hook_59623 = [null]; diff --git a/git.html b/git.html deleted file mode 100644 index e5f05dd..0000000 --- a/git.html +++ /dev/null @@ -1,1048 +0,0 @@ - - - - - - - - - - - - - - - - - -git - - - - - - - - -
    -
    -

    git

    -
    -
    - -
    - Search: -
    -
    - Group by: - -
    - - -
    -
    -
    - -

    - -
    -

    Procs

    -
    - -
    proc execAction(cmd: string; nostderr = false): string {...}{.
    -    raises: [OSError, Exception, ValueError, IOError, Defect],
    -    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -

    Execute an external command - supported at compile time

    -

    Checks if command exits successfully before returning. If not, an error is raised.

    - - -
    - -
    proc findExe(exe: string): string {...}{.raises: [], tags: [].}
    -
    - -Find the specified executable using the which/where command - supported at compile time - -
    - -
    proc mkDir(dir: string) {...}{.raises: [OSError, Exception, ValueError, IOError, Defect], tags: [
    -    ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -

    Create a directory at cmopile time

    -

    The os module is not available at compile time so a few crucial helper functions are included with nimterop.

    - - -
    - -
    proc cpFile(source, dest: string; move = false) {...}{.
    -    raises: [OSError, Exception, ValueError, IOError, Defect],
    -    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -Copy a file from source to destination at compile time - -
    - -
    proc mvFile(source, dest: string) {...}{.raises: [OSError, Exception, ValueError, IOError,
    -                                        Defect],
    -                                tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -Move a file from source to destination at compile time - -
    - -
    proc rmFile(source: string; dir = false) {...}{.raises: [OSError, Exception, ValueError,
    -    IOError, Defect], tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -Remove a file or pattern at compile time - -
    - -
    proc rmDir(source: string) {...}{.raises: [OSError, Exception, ValueError, IOError, Defect],
    -                          tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -Remove a directory or pattern at compile time - -
    - -
    proc extractZip(zipfile, outdir: string) {...}{.raises: [OSError, Exception, ValueError,
    -    IOError, Defect], tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -Extract a zip file using powershell on Windows and unzip on other systems to the specified output directory - -
    - -
    proc downloadUrl(url, outdir: string) {...}{.raises: [OSError, Exception, ValueError,
    -    IOError, Defect], tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -

    Download a file using curl or wget (or powershell on Windows) to the specified directory

    -

    If a zip file, it is automatically extracted after download.

    - - -
    - -
    proc gitReset(outdir: string) {...}{.raises: [ValueError, OSError, Exception, IOError, Defect], tags: [
    -    ExecIOEffect, ReadIOEffect, RootEffect, TimeEffect].}
    -
    - -Hard reset the git repository at the specified directory - -
    - -
    proc gitCheckout(file, outdir: string) {...}{.raises: [ValueError, OSError, Exception,
    -    IOError, Defect], tags: [ExecIOEffect, ReadIOEffect, RootEffect, TimeEffect].}
    -
    - -

    Checkout the specified file in the git repository specified

    -

    This effectively resets all changes in the file and can be used to undo any changes that were made to source files to enable successful wrapping with cImport() or c2nImport().

    - - -
    - -
    proc gitPull(url: string; outdir = ""; plist = ""; checkout = "") {...}{.
    -    raises: [ValueError, OSError, Exception, IOError, Defect], tags: [ReadDirEffect,
    -    ExecIOEffect, ReadIOEffect, RootEffect, TimeEffect, WriteIOEffect].}
    -
    - -

    Pull the specified git repository to the output directory

    -

    plist is the list of specific files and directories or wildcards to sparsely checkout. Multiple values can be specified one entry per line. It is optional and if omitted, the entire repository will be checked out.

    -

    checkout is the git tag, branch or commit hash to checkout once the repository is downloaded. This allows for pinning to a specific version of the code.

    - - -
    - -
    proc configure(path, check: string; flags = "") {...}{.
    -    raises: [OSError, Exception, ValueError, IOError, Defect],
    -    tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -

    Run the GNU configure command to generate all Makefiles or other build scripts in the specified path

    -

    If a configure script is not present and an autogen.sh script is present, it will be run before attempting configure.

    -

    check is a file that will be generated by the configure command. This is required to prevent configure from running on every build. It is relative to the path and should not be an absolute path.

    -

    flags are any flags that should be passed to the configure command.

    - - -
    - -
    proc cmake(path, check, flags: string) {...}{.raises: [OSError, Exception, ValueError,
    -    IOError, Defect], tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -

    Run the cmake command to generate all Makefiles or other build scripts in the specified path

    -

    path will be created since typically cmake is run in an empty directory.

    -

    check is a file that will be generated by the cmake command. This is required to prevent cmake from running on every build. It is relative to the path and should not be an absolute path.

    -

    flags are any flags that should be passed to the cmake command. Unlike configure, it is required since typically it will be the path to the repository, typically .. when path is a subdir.

    - - -
    - -
    proc make(path, check: string; flags = "") {...}{.raises: [OSError, Exception, ValueError,
    -    IOError, Defect], tags: [ReadDirEffect, ExecIOEffect, ReadIOEffect, RootEffect].}
    -
    - -

    Run the make command to build all binaries in the specified path

    -

    check is a file that will be generated by the make command. This is required to prevent make from running on every build. It is relative to the path and should not be an absolute path.

    -

    flags are any flags that should be passed to the make command.

    -

    If make.exe is missing and mingw32-make.exe is available, it will be copied over to make.exe in the same location.

    - - -
    - -
    - -
    -
    - -
    - -
    -
    -
    - - - diff --git a/git.idx b/git.idx deleted file mode 100644 index aea3d3b..0000000 --- a/git.idx +++ /dev/null @@ -1,15 +0,0 @@ -execAction git.html#execAction,string git: execAction(cmd: string; nostderr = false): string -findExe git.html#findExe,string git: findExe(exe: string): string -mkDir git.html#mkDir,string git: mkDir(dir: string) -cpFile git.html#cpFile,string,string git: cpFile(source, dest: string; move = false) -mvFile git.html#mvFile,string,string git: mvFile(source, dest: string) -rmFile git.html#rmFile,string git: rmFile(source: string; dir = false) -rmDir git.html#rmDir,string git: rmDir(source: string) -extractZip git.html#extractZip,string,string git: extractZip(zipfile, outdir: string) -downloadUrl git.html#downloadUrl,string,string git: downloadUrl(url, outdir: string) -gitReset git.html#gitReset,string git: gitReset(outdir: string) -gitCheckout git.html#gitCheckout,string,string git: gitCheckout(file, outdir: string) -gitPull git.html#gitPull,string,string,string,string git: gitPull(url: string; outdir = ""; plist = ""; checkout = "") -configure git.html#configure,string,string,string git: configure(path, check: string; flags = "") -cmake git.html#cmake,string,string,string git: cmake(path, check, flags: string) -make git.html#make,string,string,string git: make(path, check: string; flags = "") diff --git a/paths.html b/paths.html index d7a180d..e2e5787 100644 --- a/paths.html +++ b/paths.html @@ -823,19 +823,29 @@ function main() {
    cPlugin:
    enumOp:
    extractTar: