diff --git a/lang/nim/Makefile b/lang/nim/Makefile index 9dc636e707b5..0cdb6e211f9f 100644 --- a/lang/nim/Makefile +++ b/lang/nim/Makefile @@ -1,94 +1,94 @@ PORTNAME= nim -DISTVERSION= 2.2.2 +DISTVERSION= 2.2.4 CATEGORIES= lang MASTER_SITES= https://nim-lang.org/download/ MAINTAINER= ports@nicandneal.net COMMENT= Nim programming language WWW= https://nim-lang.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/copying.txt LIB_DEPENDS= libpcre.so:devel/pcre TEST_DEPENDS= node18>=0:www/node USES= compiler:c11 cpe tar:xz CPE_VENDOR= nim-lang SUB_FILES= pkg-message OPTIONS_DEFINE= DOCS TOOLS OPTIONS_DEFAULT= TOOLS OPTIONS_EXCLUDE_powerpc64= DOCS OPTIONS_SUB= yes TOOLS_DESC= Build and install nim tools, not including nimble nor nimfind TEST_BINARY_ALIAS= node=nodejs .include TLIST= nimgrep nimpretty nimsuggest testament NIMDIR= ${STAGEDIR}${PREFIX}/nim do-build: cd ${WRKSRC} && ${SETENV} CC="${CC}" LINKER="${CC}" \ COMP_FLAGS="${CPPFLAGS} ${CFLAGS}" LINK_FLAGS="${LDFLAGS}" \ ${SH} build.sh cd ${WRKSRC} && bin/nim c --parallelBuild=${MAKE_JOBS_NUMBER} \ --nimcache=${WRKDIR}/nimcache -d:release koch cd ${WRKSRC} && ./koch boot --parallelBuild=${MAKE_JOBS_NUMBER} \ -d:release --nimcache=${WRKDIR}/nimcache cd ${WRKSRC} && bin/nim c --parallelBuild=${MAKE_JOBS_NUMBER} \ -d:release --nimcache=${WRKDIR}/nimcache --app:lib \ -d:createNimRtl lib/nimrtl.nim do-build-DOCS-on: cd ${WRKSRC} && ./koch --localdocs docs \ -d:release --nimcache=${WRKDIR}/nimcache --docCmd=skip do-build-TOOLS-on: cd ${WRKSRC} && ./koch tools --parallelBuild=${MAKE_JOBS_NUMBER} \ -d:release --nimcache=${WRKSRC}/nimcache do-install: ${MKDIR} ${NIMDIR} ${MKDIR} ${NIMDIR}/bin # Install nim compiler ${INSTALL_PROGRAM} ${WRKSRC}/bin/nim ${NIMDIR}/bin ${STRIP_CMD} ${NIMDIR}/bin/nim # Install lib nim rtl ${MKDIR} ${NIMDIR}/lib ${INSTALL_LIB} ${WRKSRC}/lib/libnimrtl.so ${NIMDIR}/lib # Install nim lib files (cd ${WRKSRC}/lib && ${COPYTREE_SHARE} . ${NIMDIR}/lib "! -name libnimrtl.so") ${MKDIR} ${NIMDIR}/lib/compiler (cd ${WRKSRC}/compiler && ${COPYTREE_SHARE} . ${NIMDIR}/lib/compiler "! -name nim ! -name nim1") (cd ${WRKSRC}/dist/checksums && ${COPYTREE_SHARE} . ${NIMDIR}/lib/dist/checksums) # Configuration files ${MKDIR} ${NIMDIR}/config .for file in nim.cfg nimdoc.cfg nimdoc.tex.cfg ${INSTALL_DATA} ${WRKSRC}/config/${file} ${NIMDIR}/config .endfor do-install-DOCS-on: ${FIND} ${WRKSRC}/doc -name "*.idx" -delete ${MKDIR} ${NIMDIR}/doc (cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${NIMDIR}/doc) ${MKDIR} ${NIMDIR}/tools/dochack ${INSTALL_SCRIPT} ${WRKSRC}/tools/dochack/dochack.nim ${NIMDIR}/tools/dochack ${INSTALL_SCRIPT} ${WRKSRC}/tools/dochack/dochack.js ${NIMDIR}/tools/dochack ${INSTALL_SCRIPT} ${WRKSRC}/tools/dochack/fuzzysearch.nim ${NIMDIR}/tools/dochack do-install-TOOLS-on: .for t in ${TLIST} ${INSTALL_PROGRAM} ${WRKSRC}/bin/${t} ${NIMDIR}/bin .endfor do-test: cd ${WRKSRC} && ${SETENV} ./koch test all -d:release \ --nimcache=${WRKDIR}/nimcache --putenv:"PATH=${PATH}" .include diff --git a/lang/nim/distinfo b/lang/nim/distinfo index be7564dd85ad..2d8bda469a9d 100644 --- a/lang/nim/distinfo +++ b/lang/nim/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1739285871 -SHA256 (nim-2.2.2.tar.xz) = 7fcc9b87ac9c0ba5a489fdc26e2d8480ce96a3ca622100d6267ef92135fd8a1f -SIZE (nim-2.2.2.tar.xz) = 8188616 +TIMESTAMP = 1746626689 +SHA256 (nim-2.2.4.tar.xz) = f82b419750fcce561f3f897a0486b180186845d76fb5d99f248ce166108189c7 +SIZE (nim-2.2.4.tar.xz) = 8168916 diff --git a/lang/nim/files/patch-koch.nim b/lang/nim/files/patch-koch.nim index d6e6ef39e3b3..dec5e472402e 100644 --- a/lang/nim/files/patch-koch.nim +++ b/lang/nim/files/patch-koch.nim @@ -1,320 +1,323 @@ ---- koch.nim.orig 2025-02-06 01:49:40 UTC +--- koch.nim.orig 2025-05-07 14:07:39 UTC +++ koch.nim -@@ -150,31 +150,31 @@ proc csource(args: string) = +@@ -150,38 +150,38 @@ proc csource(args: string) = "--main:compiler/nim.nim compiler/installer.ini $1") % [args, VersionAsString, compileNimInst]) -proc bundleC2nim(args: string) = - cloneDependency(distDir, "https://github.com/nim-lang/c2nim.git") - nimCompile("dist/c2nim/c2nim", - options = "--noNimblePath --path:. " & args) +#proc bundleC2nim(args: string) = +# cloneDependency(distDir, "https://github.com/nim-lang/c2nim.git") +# nimCompile("dist/c2nim/c2nim", +# options = "--noNimblePath --path:. " & args) -proc bundleNimbleExe(latest: bool, args: string) = - let commit = if latest: "HEAD" else: NimbleStableCommit - cloneDependency(distDir, "https://github.com/nim-lang/nimble.git", - commit = commit, allowBundled = true) - updateSubmodules(distDir / "nimble", allowBundled = true) - nimCompile("dist/nimble/src/nimble.nim", - options = "-d:release --noNimblePath " & args) - const zippyTests = "dist/nimble/vendor/zippy/tests" - if dirExists(zippyTests): - removeDir(zippyTests) +#proc bundleNimbleExe(latest: bool, args: string) = +# let commit = if latest: "HEAD" else: NimbleStableCommit +# cloneDependency(distDir, "https://github.com/nim-lang/nimble.git", +# commit = commit, allowBundled = true) +# updateSubmodules(distDir / "nimble", allowBundled = true) +# nimCompile("dist/nimble/src/nimble.nim", +# options = "-d:release --noNimblePath " & args) +# const zippyTests = "dist/nimble/vendor/zippy/tests" +# if dirExists(zippyTests): +# removeDir(zippyTests) -proc bundleAtlasExe(latest: bool, args: string) = - let commit = if latest: "HEAD" else: AtlasStableCommit - cloneDependency(distDir, "https://github.com/nim-lang/atlas.git", - commit = commit, allowBundled = true) - cloneDependency(distDir / "atlas" / distDir, "https://github.com/nim-lang/sat.git", -- commit = SatStableCommit, allowBundled = true) +- commit = SatStableCommit, allowBundled = true) - # installer.ini expects it under $nim/bin - nimCompile("dist/atlas/src/atlas.nim", - options = "-d:release --noNimblePath -d:nimAtlasBootstrap " & args) +#proc bundleAtlasExe(latest: bool, args: string) = +# let commit = if latest: "HEAD" else: AtlasStableCommit +# cloneDependency(distDir, "https://github.com/nim-lang/atlas.git", +# commit = commit, allowBundled = true) +# cloneDependency(distDir / "atlas" / distDir, "https://github.com/nim-lang/sat.git", -+# commit = SatStableCommit, allowBundled = true) ++# commit = SatStableCommit, allowBundled = true) +# # installer.ini expects it under $nim/bin +# nimCompile("dist/atlas/src/atlas.nim", +# options = "-d:release --noNimblePath -d:nimAtlasBootstrap " & args) - proc bundleNimsuggest(args: string) = - nimCompileFold("Compile nimsuggest", "nimsuggest/nimsuggest.nim", -@@ -205,14 +205,14 @@ proc bundleWinTools(args: string) = - nimCompile(r"tools\downloader.nim", - options = r"--cc:vcc --app:gui -d:ssl --noNimblePath --path:..\ui " & args) - -proc bundleChecksums(latest: bool) = - let commit = if latest: "HEAD" else: ChecksumsStableCommit - cloneDependency(distDir, "https://github.com/nim-lang/checksums.git", commit, allowBundled = true) +#proc bundleChecksums(latest: bool) = +# let commit = if latest: "HEAD" else: ChecksumsStableCommit -+# cloneDependency(distDir, "https://github.com/nim-lang/checksums.git", commit, allowBundled = true) ++# cloneDependency(distDir, "https://github.com/nim-lang/checksums.git", commit, allowBundled #= true) + + proc bundleNimsuggest(args: string) = +- bundleChecksums(false) ++ #bundleChecksums(false) + nimCompileFold("Compile nimsuggest", "nimsuggest/nimsuggest.nim", + options = "-d:danger " & args) + +@@ -211,9 +211,9 @@ proc zip(latest: bool; args: string) = + options = r"--cc:vcc --app:gui -d:ssl --noNimblePath --path:..\ui " & args) proc zip(latest: bool; args: string) = - bundleChecksums(latest) - bundleNimbleExe(latest, args) - bundleAtlasExe(latest, args) + #bundleChecksums(latest) + #bundleNimbleExe(latest, args) + #bundleAtlasExe(latest, args) bundleNimsuggest(args) bundleNimpretty(args) bundleWinTools(args) -@@ -221,15 +221,15 @@ proc zip(latest: bool; args: string) = +@@ -222,15 +222,15 @@ proc zip(latest: bool; args: string) = exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim zip compiler/installer.ini" % ["tools/niminst/niminst".exe, VersionAsString]) -proc ensureCleanGit() = - let (outp, status) = osproc.execCmdEx("git diff") - if outp.len != 0: - quit "Not a clean git repository; 'git diff' not empty!" - if status != 0: - quit "Not a clean git repository; 'git diff' returned non-zero!" +#proc ensureCleanGit() = +# let (outp, status) = osproc.execCmdEx("git diff") +# if outp.len != 0: +# quit "Not a clean git repository; 'git diff' not empty!" +# if status != 0: +# quit "Not a clean git repository; 'git diff' returned non-zero!" proc xz(latest: bool; args: string) = - ensureCleanGit() + #ensureCleanGit() nimexec("cc -r $2 --var:version=$1 --var:mingw=none --main:compiler/nim.nim scripts compiler/installer.ini" % [VersionAsString, compileNimInst]) exec("$# --var:version=$# --var:mingw=none --main:compiler/nim.nim xz compiler/installer.ini" % -@@ -264,9 +264,9 @@ proc nsis(latest: bool; args: string) = +@@ -265,9 +265,9 @@ proc nsis(latest: bool; args: string) = nimCompileFold("Compile testament", "testament/testament.nim", options = "-d:release " & args) proc nsis(latest: bool; args: string) = - bundleChecksums(latest) - bundleNimbleExe(latest, args) - bundleAtlasExe(latest, args) + #bundleChecksums(latest) + #bundleNimbleExe(latest, args) + #bundleAtlasExe(latest, args) bundleNimsuggest(args) bundleWinTools(args) # make sure we have generated the niminst executables: -@@ -286,21 +286,21 @@ proc install(args: string) = +@@ -287,21 +287,21 @@ proc install(args: string) = geninstall() exec("sh ./install.sh $#" % args) -proc installDeps(dep: string, commit = "") = - # the hashes/urls are version controlled here, so can be changed seamlessly - # and tied to a nim release (mimicking git submodules) - var commit = commit - case dep - of "tinyc": - if commit.len == 0: commit = "916cc2f94818a8a382dd8d4b8420978816c1dfb3" - cloneDependency(distDir, "https://github.com/timotheecour/nim-tinyc-archive", commit) - of "libffi": - # technically a nimble package, however to play nicely with --noNimblePath, - # let's just clone it wholesale: - if commit.len == 0: commit = "bb2bdaf1a29a4bff6fbd8ae4695877cbb3ec783e" - cloneDependency(distDir, "https://github.com/Araq/libffi", commit) - else: doAssert false, "unsupported: " & dep - # xxx: also add linenoise, niminst etc, refs https://github.com/nim-lang/RFCs/issues/206 +#proc installDeps(dep: string, commit = "") = +# # the hashes/urls are version controlled here, so can be changed seamlessly +# # and tied to a nim release (mimicking git submodules) +# var commit = commit +# case dep +# of "tinyc": +# if commit.len == 0: commit = "916cc2f94818a8a382dd8d4b8420978816c1dfb3" +# cloneDependency(distDir, "https://github.com/timotheecour/nim-tinyc-archive", commit) +# of "libffi": +# # technically a nimble package, however to play nicely with --noNimblePath, +# # let's just clone it wholesale: +# if commit.len == 0: commit = "bb2bdaf1a29a4bff6fbd8ae4695877cbb3ec783e" +# cloneDependency(distDir, "https://github.com/Araq/libffi", commit) +# else: doAssert false, "unsupported: " & dep +# # xxx: also add linenoise, niminst etc, refs https://github.com/nim-lang/RFCs/issues/206 # -------------- boot --------------------------------------------------------- -@@ -344,11 +344,11 @@ proc boot(args: string, skipIntegrityCheck: bool) = +@@ -345,11 +345,11 @@ proc boot(args: string, skipIntegrityCheck: bool) = let smartNimcache = (if "release" in args or "danger" in args: "nimcache/r_" else: "nimcache/d_") & hostOS & "_" & hostCPU - bundleChecksums(false) + #bundleChecksums(false) let usingLibFFI = "nimHasLibFFI" in args - if usingLibFFI and not dirExists("dist/libffi"): - installDeps("libffi") + #if usingLibFFI and not dirExists("dist/libffi"): + # installDeps("libffi") let nimStart = findStartNim().quoteShell() let times = 2 - ord(skipIntegrityCheck) -@@ -507,7 +507,7 @@ proc temp(args: string) = +@@ -508,7 +508,7 @@ proc temp(args: string) = result[1].add " " & quoteShell(args[i]) inc i - bundleChecksums(false) + #bundleChecksums(false) let d = getAppDir() let output = d / "compiler" / "nim".exe -@@ -551,27 +551,27 @@ proc icTest(args: string) = +@@ -552,27 +552,27 @@ proc icTest(args: string) = exec(cmd) inc i -proc buildDrNim(args: string) = - if not dirExists("dist/nimz3"): - exec("git clone https://github.com/zevv/nimz3.git dist/nimz3") - when defined(windows): - if not dirExists("dist/dlls"): - exec("git clone -q https://github.com/nim-lang/dlls.git dist/dlls") - copyExe("dist/dlls/libz3.dll", "bin/libz3.dll") - execFold("build drnim", "nim c -o:$1 $2 drnim/drnim" % ["bin/drnim".exe, args]) - else: - if not dirExists("dist/z3"): - exec("git clone -q https://github.com/Z3Prover/z3.git dist/z3") - withDir("dist/z3"): - exec("git fetch") - exec("git checkout " & Z3StableCommit) - createDir("build") - withDir("build"): - exec("""cmake -DZ3_BUILD_LIBZ3_SHARED=FALSE -G "Unix Makefiles" ../""") - exec("make -j4") - execFold("build drnim", "nim cpp --dynlibOverride=libz3 -o:$1 $2 drnim/drnim" % ["bin/drnim".exe, args]) - # always run the tests for now: - exec("testament/testament".exe & " --nim:" & "drnim".exe & " pat drnim/tests") +#proc buildDrNim(args: string) = +# if not dirExists("dist/nimz3"): +# exec("git clone https://github.com/zevv/nimz3.git dist/nimz3") +# when defined(windows): +# if not dirExists("dist/dlls"): +# exec("git clone -q https://github.com/nim-lang/dlls.git dist/dlls") +# copyExe("dist/dlls/libz3.dll", "bin/libz3.dll") +# execFold("build drnim", "nim c -o:$1 $2 drnim/drnim" % ["bin/drnim".exe, args]) +# else: +# if not dirExists("dist/z3"): +# exec("git clone -q https://github.com/Z3Prover/z3.git dist/z3") +# withDir("dist/z3"): +# exec("git fetch") +# exec("git checkout " & Z3StableCommit) +# createDir("build") +# withDir("build"): +# exec("""cmake -DZ3_BUILD_LIBZ3_SHARED=FALSE -G "Unix Makefiles" ../""") +# exec("make -j4") +# execFold("build drnim", "nim cpp --dynlibOverride=libz3 -o:$1 $2 drnim/drnim" % ["bin/drnim".exe, args]) +# # always run the tests for now: +# exec("testament/testament".exe & " --nim:" & "drnim".exe & " pat drnim/tests") proc hostInfo(): string = -@@ -619,14 +619,14 @@ proc runCI(cmd: string) = +@@ -620,14 +620,14 @@ proc runCI(cmd: string) = # BUG: with initOptParser, `--batch:'' all` interprets `all` as the argument of --batch, pending bug #14343 execFold("Run tester", "nim c -r --putenv:NIM_TESTAMENT_REMOTE_NETWORKING:1 -d:nimStrictMode testament/testament $# all -d:nimCoroutines" % batchParam) - block: # nimHasLibFFI: - when defined(posix): # windows can be handled in future PR's - installDeps("libffi") - const nimFFI = "bin/nim.ctffi" - # no need to bootstrap with koch boot (would be slower) - let backend = if doUseCpp(): "cpp" else: "c" - execFold("build with -d:nimHasLibFFI", "nim $1 -d:release --noNimblePath -d:nimHasLibFFI --path:./dist -o:$2 compiler/nim.nim" % [backend, nimFFI]) - execFold("test with -d:nimHasLibFFI", "$1 $2 -r testament/testament --nim:$1 r tests/misc/trunner.nim -d:nimTrunnerFfi" % [nimFFI, backend]) + #block: # nimHasLibFFI: + # when defined(posix): # windows can be handled in future PR's + # installDeps("libffi") + # const nimFFI = "bin/nim.ctffi" + # # no need to bootstrap with koch boot (would be slower) + # let backend = if doUseCpp(): "cpp" else: "c" + # execFold("build with -d:nimHasLibFFI", "nim $1 -d:release --noNimblePath -d:nimHasLibFFI --path:./dist -o:$2 compiler/nim.nim" % [backend, nimFFI]) + # execFold("test with -d:nimHasLibFFI", "$1 $2 -r testament/testament --nim:$1 r tests/misc/trunner.nim -d:nimTrunnerFfi" % [nimFFI, backend]) execFold("Run nimdoc tests", "nim r nimdoc/tester") execFold("Run rst2html tests", "nim r nimdoc/rsttester") -@@ -698,18 +698,18 @@ proc showHelp(success: bool) = +@@ -699,18 +699,18 @@ proc showHelp(success: bool) = quit(HelpText % [VersionAsString & spaces(44-len(VersionAsString)), CompileDate, CompileTime], if success: QuitSuccess else: QuitFailure) -proc branchDone() = - let thisBranch = execProcess("git symbolic-ref --short HEAD").strip() - if thisBranch != "devel" and thisBranch != "": - exec("git checkout devel") - exec("git branch -D " & thisBranch) - exec("git pull --rebase") +#proc branchDone() = +# let thisBranch = execProcess("git symbolic-ref --short HEAD").strip() +# if thisBranch != "devel" and thisBranch != "": +# exec("git checkout devel") +# exec("git branch -D " & thisBranch) +# exec("git pull --rebase") when isMainModule: var op = initOptParser() var latest = false - localDocsOnly = false + localDocsOnly = true localDocsOut = "" skipIntegrityCheck = false while true: -@@ -745,34 +745,34 @@ when isMainModule: +@@ -746,34 +746,34 @@ when isMainModule: of "distrohelper": geninstall() of "install": install(op.cmdLineRest) of "testinstall": testUnixInstall(op.cmdLineRest) - of "installdeps": installDeps(op.cmdLineRest) + #of "installdeps": installDeps(op.cmdLineRest) of "runci": runCI(op.cmdLineRest) of "test", "tests": tests(op.cmdLineRest) of "temp": temp(op.cmdLineRest) of "xtemp": xtemp(op.cmdLineRest) of "wintools": bundleWinTools(op.cmdLineRest) - of "nimble": bundleNimbleExe(latest, op.cmdLineRest) - of "atlas": bundleAtlasExe(latest, op.cmdLineRest) + #of "nimble": bundleNimbleExe(latest, op.cmdLineRest) + #of "atlas": bundleAtlasExe(latest, op.cmdLineRest) of "nimsuggest": bundleNimsuggest(op.cmdLineRest) # toolsNoNimble is kept for backward compatibility with build scripts of "toolsnonimble", "toolsnoexternal": buildTools(op.cmdLineRest) of "tools": buildTools(op.cmdLineRest) - bundleNimbleExe(latest, op.cmdLineRest) - bundleAtlasExe(latest, op.cmdLineRest) - of "checksums": - bundleChecksums(latest) - of "pushcsource": - quit "use this instead: https://github.com/nim-lang/csources_v1/blob/master/push_c_code.nim" + #bundleNimbleExe(latest, op.cmdLineRest) + #bundleAtlasExe(latest, op.cmdLineRest) + #of "checksums": + # bundleChecksums(latest) + #of "pushcsource": + # quit "use this instead: https://github.com/nim-lang/csources_v1/blob/master/push_c_code.nim" of "valgrind": valgrind(op.cmdLineRest) - of "c2nim": bundleC2nim(op.cmdLineRest) - of "drnim": buildDrNim(op.cmdLineRest) + #of "c2nim": bundleC2nim(op.cmdLineRest) + #of "drnim": buildDrNim(op.cmdLineRest) of "fusion": let suffix = if latest: HeadHash else: FusionStableHash exec("nimble install -y fusion@$#" % suffix) of "ic": icTest(op.cmdLineRest) - of "branchdone": branchDone() + #of "branchdone": branchDone() else: showHelp(success = false) break of cmdEnd: diff --git a/lang/nim/files/patch-tools_deps.nim b/lang/nim/files/patch-tools_deps.nim index ab6d46bf2e34..fb942d0e5c83 100644 --- a/lang/nim/files/patch-tools_deps.nim +++ b/lang/nim/files/patch-tools_deps.nim @@ -1,52 +1,56 @@ ---- tools/deps.nim.orig 2025-02-06 01:49:40 UTC +--- tools/deps.nim.orig 2025-05-07 14:22:20 UTC +++ tools/deps.nim -@@ -20,28 +20,29 @@ proc cloneDependency*(destDirBase: string, url: string +@@ -22,30 +22,31 @@ proc cloneDependency*(destDirBase: string, url: string proc cloneDependency*(destDirBase: string, url: string, commit = commitHead, appendRepoName = true, allowBundled = false) = - let destDirBase = destDirBase.absolutePath - let p = url.parseUri.path - let name = p.splitFile.name - var destDir = destDirBase - if appendRepoName: destDir = destDir / name - let quotedDestDir = destDir.quoteShell - if not dirExists(destDir): + #let destDirBase = destDirBase.absolutePath + #let p = url.parseUri.path + #let name = p.splitFile.name + #var destDir = destDirBase + #if appendRepoName: destDir = destDir / name + #let quotedDestDir = destDir.quoteShell + #if not dirExists(destDir): # note: old code used `destDir / .git` but that wouldn't prevent git clone # from failing - execRetry fmt"git clone -q {url} {quotedDestDir}" - if isGitRepo(destDir): - let oldDir = getCurrentDir() - setCurrentDir(destDir) - try: -- execRetry "git fetch -q" -- exec fmt"git checkout -q {commit}" +- let checkoutCmd = fmt"git checkout -q {commit}" +- if tryexec(checkoutCmd) != 0: +- execRetry "git fetch -q" +- exec checkoutCmd - finally: - setCurrentDir(oldDir) - elif allowBundled: - discard "this dependency was bundled with Nim, don't do anything" - else: - quit "FAILURE: " & destdir & " already exists but is not a git repo" + # execRetry fmt"git clone -q {url} {quotedDestDir}" + #if isGitRepo(destDir): + # let oldDir = getCurrentDir() + # setCurrentDir(destDir) + # try: -+ # execRetry "git fetch -q" -+ # exec fmt"git checkout -q {commit}" ++ # let checkoutCmd = fmt"git checkout -q {commit}" ++ # if tryexec(checkoutCmd) != 0: ++ # execRetry "git fetch -q" ++ # exec checkoutCmd + # finally: + # setCurrentDir(oldDir) + #elif allowBundled: + # discard "this dependency was bundled with Nim, don't do anything" + #else: + # quit "FAILURE: " & destdir & " already exists but is not a git repo" -+ quit "FAILURE: git operations now allowed!: " & destDirBase ++ quit "FAILURE: git operations not allowed in ports!: " & destDirBase proc updateSubmodules*(dir: string, allowBundled = false) = if isGitRepo(dir):