diff --git a/src/nimble.nim b/src/nimble.nim index a4d3bdb..e108070 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -939,6 +939,10 @@ proc doAction(options: Options) = let (_, pkgInfo) = install(options.action.packages, options) if options.action.packages.len == 0: nimScriptHint(pkgInfo) + if pkgInfo.foreignDeps.len > 0: + echo("To finish the installation, run: ") + for i in 0.. 0: raise newException(NimbleError, previousMsg) # Extract all the necessary fields populated by the nimscript file. - proc getSym(thisModule: PSym, ident: string): PSym = - result = thisModule.tab.strTableGet(getIdent(ident)) + proc getSym(apiModule: PSym, ident: string): PSym = + result = apiModule.tab.strTableGet(getIdent(ident)) if result.isNil: raise newException(NimbleError, "Ident not found: " & ident) template trivialField(field) = - result.field = getGlobal(getSym(thisModule, astToStr field)) + result.field = getGlobal(getSym(apiModule, astToStr field)) template trivialFieldSeq(field) = - result.field.add getGlobalAsSeq(getSym(thisModule, astToStr field)) + result.field.add getGlobalAsSeq(getSym(apiModule, astToStr field)) # keep reasonable default: - let name = getGlobal(thisModule.tab.strTableGet(getIdent"packageName")) + let name = getGlobal(apiModule.tab.strTableGet(getIdent"packageName")) if name.len > 0: result.name = name trivialField version @@ -333,14 +352,15 @@ proc readPackageInfoFromNims*(scriptName: string, options: Options, trivialFieldSeq installDirs trivialFieldSeq installFiles trivialFieldSeq installExt + trivialFieldSeq foreignDeps - extractRequires(getSym(thisModule, "requiresData"), result.requires) + extractRequires(getSym(apiModule, "requiresData"), result.requires) - let binSeq = getGlobalAsSeq(getSym(thisModule, "bin")) + let binSeq = getGlobalAsSeq(getSym(apiModule, "bin")) for i in binSeq: result.bin.add(i.addFileExt(ExeExt)) - let backend = getGlobal(getSym(thisModule, "backend")) + let backend = getGlobal(getSym(apiModule, "backend")) if backend.len == 0: result.backend = "c" elif cmpIgnoreStyle(backend, "javascript") == 0: diff --git a/src/nimblepkg/packageinfo.nim b/src/nimblepkg/packageinfo.nim index c4e5498..bf2802f 100644 --- a/src/nimblepkg/packageinfo.nim +++ b/src/nimblepkg/packageinfo.nim @@ -37,6 +37,7 @@ proc initPackageInfo*(path: string): PackageInfo = result.installFiles = @[] result.installExt = @[] result.requires = @[] + result.foreignDeps = @[] result.bin = @[] result.srcDir = "" result.binDir = ""