Fix installation (default output dir changed).

This commit is contained in:
Dominik Picheta 2015-06-04 18:33:38 +01:00
commit 4ffcdf141e
2 changed files with 7 additions and 7 deletions

View file

@ -464,7 +464,7 @@ proc buildFromDir(pkgInfo: PackageInfo, paths: seq[string], forRelease: bool) =
var args = ""
for path in paths: args.add("--path:\"" & path & "\" ")
for bin in pkgInfo.bin:
let outputOpt = pkgInfo.getOutputOption(bin)
let outputOpt = "-o:\"" & pkgInfo.getOutputDir(bin) & "\""
echo("Building ", pkginfo.name, "/", bin, " using ", pkgInfo.backend,
" backend...")
doCmd(getNimBin() & " $# $# --noBabelPath $# $# \"$#\"" %
@ -553,7 +553,8 @@ proc installFromDir(dir: string, latest: bool, options: Options,
# and symlink them on *nix OS' to $nimbleDir/bin/
for bin in pkgInfo.bin:
if not existsFile(pkgDestDir / bin):
filesInstalled.incl copyFileD(realDir / bin, pkgDestDir / bin)
filesInstalled.incl copyFileD(pkgInfo.getOutputDir(bin),
pkgDestDir / bin)
let currentPerms = getFilePermissions(pkgDestDir / bin)
setFilePermissions(pkgDestDir / bin, currentPerms + {fpUserExec})

View file

@ -329,13 +329,12 @@ proc getRealDir*(pkgInfo: PackageInfo): string =
else:
result = pkgInfo.mypath.splitFile.dir
proc getOutputOption*(pkgInfo: PackageInfo, bin: string): string =
## Returns an output option for the nim compiler if a build directory
## has been set.
proc getOutputDir*(pkgInfo: PackageInfo, bin: string): string =
## Returns a binary output dir for the package.
if pkgInfo.binDir != "":
result = " -o:\"" & pkgInfo.mypath.splitFile.dir / pkgInfo.binDir / bin & "\""
result = pkgInfo.mypath.splitFile.dir / pkgInfo.binDir / bin
else:
result = " -o:\"" & pkgInfo.mypath.splitFile.dir / bin & "\""
result = pkgInfo.mypath.splitFile.dir / bin
proc getNameVersion*(pkgpath: string): tuple[name, version: string] =
## Splits ``pkgpath`` in the format ``/home/user/.nimble/pkgs/package-0.1``