Binary packages can now be used as libraries by other binary packages.
This commit is contained in:
parent
5b45d6be2d
commit
30d3177228
1 changed files with 5 additions and 9 deletions
14
babel.nim
14
babel.nim
|
|
@ -177,13 +177,10 @@ proc processDeps(pkginfo: TPackageInfo): seq[string] =
|
||||||
if not findPkg(pkglist, dep, pkg):
|
if not findPkg(pkglist, dep, pkg):
|
||||||
echo("None found, installing...")
|
echo("None found, installing...")
|
||||||
let dest = install(@[dep.name], dep.ver)
|
let dest = install(@[dep.name], dep.ver)
|
||||||
if dest != "":
|
result.add(dest)
|
||||||
# only add if not a binary package
|
|
||||||
result.add(dest)
|
|
||||||
else:
|
else:
|
||||||
echo("Dependency already satisfied.")
|
echo("Dependency already satisfied.")
|
||||||
if pkg.bin.len == 0:
|
result.add(pkg.mypath.splitFile.dir)
|
||||||
result.add(pkg.mypath.splitFile.dir)
|
|
||||||
|
|
||||||
proc buildFromDir(dir: string, paths: seq[string]) =
|
proc buildFromDir(dir: string, paths: seq[string]) =
|
||||||
## Builds a package which resides in ``dir``
|
## Builds a package which resides in ``dir``
|
||||||
|
|
@ -195,8 +192,8 @@ proc buildFromDir(dir: string, paths: seq[string]) =
|
||||||
doCmd("nimrod c -d:release " & args & dir / bin.changeFileExt("nim"))
|
doCmd("nimrod c -d:release " & args & dir / bin.changeFileExt("nim"))
|
||||||
|
|
||||||
proc installFromDir(dir: string, latest: bool): string =
|
proc installFromDir(dir: string, latest: bool): string =
|
||||||
## Returns where package has been installed to. If package is a binary,
|
## Returns where package has been installed to.
|
||||||
## ``""`` is returned. The return value of this function is used by
|
## The return value of this function is used by
|
||||||
## ``processDeps`` to gather a list of paths to pass to the nimrod compiler.
|
## ``processDeps`` to gather a list of paths to pass to the nimrod compiler.
|
||||||
var pkgInfo = getPkgInfo(dir)
|
var pkgInfo = getPkgInfo(dir)
|
||||||
let pkgDestDir = libsDir / (pkgInfo.name &
|
let pkgDestDir = libsDir / (pkgInfo.name &
|
||||||
|
|
@ -240,10 +237,9 @@ proc installFromDir(dir: string, latest: bool): string =
|
||||||
writeFile(dest, pkgDestDir / bin & " %*\n")
|
writeFile(dest, pkgDestDir / bin & " %*\n")
|
||||||
else:
|
else:
|
||||||
{.error: "Sorry, your platform is not supported.".}
|
{.error: "Sorry, your platform is not supported.".}
|
||||||
result = ""
|
|
||||||
else:
|
else:
|
||||||
copyFilesRec(dir, dir, pkgDestDir, pkgInfo)
|
copyFilesRec(dir, dir, pkgDestDir, pkgInfo)
|
||||||
result = pkgDestDir
|
result = pkgDestDir
|
||||||
|
|
||||||
echo(pkgInfo.name & " installed successfully.")
|
echo(pkgInfo.name & " installed successfully.")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue