diff --git a/.gitmodules b/.gitmodules index 823969b1..ed6bcb8a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,9 @@ [submodule "vendor/zippy"] path = vendor/zippy url = https://github.com/guzba/zippy.git +[submodule "vendor/sat"] + path = vendor/sat + url = https://github.com/nim-lang/sat.git +[submodule "vendor/checksums"] + path = vendor/checksums + url = https://github.com/nim-lang/checksums.git diff --git a/config.nims b/config.nims index 55ab2cd8..4a4759f6 100644 --- a/config.nims +++ b/config.nims @@ -4,3 +4,5 @@ import std/os switch("warning", "ObservableStores:off") switch("define", "ssl") switch("path", "vendor" / "zippy" / "src") +switch("path", "vendor" / "sat" / "src") +switch("path", "vendor" / "checksums" / "src") diff --git a/nimble.nimble b/nimble.nimble index b9bd2a16..6d7901aa 100644 --- a/nimble.nimble +++ b/nimble.nimble @@ -10,9 +10,7 @@ srcDir = "src" installExt = @["nim"] # Dependencies - -requires "nim >= 0.13.0", "sat" -requires "checksums" +requires "nim >= 2.0.12" when defined(nimdistros): import distros diff --git a/src/nimble.nim b/src/nimble.nim index 70640643..c85da215 100644 --- a/src/nimble.nim +++ b/src/nimble.nim @@ -8,10 +8,7 @@ import std/options as std_opt import strutils except toLower from unicode import toLower -when defined(nimNimbleBootstrap): - import ../dist/sat/src/sat/sat -else: - import sat/sat +import sat/sat import nimblepkg/packageinfotypes, nimblepkg/packageinfo, nimblepkg/version, nimblepkg/tools, nimblepkg/download, nimblepkg/common, nimblepkg/publish, nimblepkg/options, nimblepkg/packageparser, diff --git a/src/nimblepkg/checksums.nim b/src/nimblepkg/checksums.nim index ac0db127..8eaf4b7b 100644 --- a/src/nimblepkg/checksums.nim +++ b/src/nimblepkg/checksums.nim @@ -3,11 +3,7 @@ import os, strformat, algorithm import common, version, sha1hashes, vcstools, paths, cli - -when defined(nimNimbleBootstrap): - import ../../dist/checksums/src/checksums/sha1 -else: - import pkg/checksums/sha1 +import pkg/checksums/sha1 type ChecksumError* = object of NimbleError diff --git a/src/nimblepkg/nimblesat.nim b/src/nimblepkg/nimblesat.nim index 14197f56..d7ec016d 100644 --- a/src/nimblepkg/nimblesat.nim +++ b/src/nimblepkg/nimblesat.nim @@ -1,7 +1,4 @@ -when defined(nimNimbleBootstrap): - import ../../dist/sat/src/sat/[sat, satvars] -else: - import sat/[sat, satvars] +import sat/[sat, satvars] import version, packageinfotypes, download, packageinfo, packageparser, options, sha1hashes, tools, downloadnim diff --git a/src/nimblepkg/sha1hashes.nim b/src/nimblepkg/sha1hashes.nim index 0a9bccdc..432097b8 100644 --- a/src/nimblepkg/sha1hashes.nim +++ b/src/nimblepkg/sha1hashes.nim @@ -3,11 +3,7 @@ import strformat, strutils, json, hashes import common - -when defined(nimNimbleBootstrap): - import ../../dist/checksums/src/checksums/sha1 -else: - import pkg/checksums/sha1 +import pkg/checksums/sha1 type InvalidSha1HashError* = object of NimbleError diff --git a/src/nimblepkg/vcstools.nim b/src/nimblepkg/vcstools.nim index 5e466377..3defd1f2 100644 --- a/src/nimblepkg/vcstools.nim +++ b/src/nimblepkg/vcstools.nim @@ -638,10 +638,7 @@ proc fastForwardMerge*(path: Path, remoteBranch, localBranch: string) = when isMainModule: import unittest, sequtils - when defined(nimNimbleBootstrap): - import ../../dist/checksums/src/checksums/sha1 - else: - import pkg/checksums/sha1 + import pkg/checksums/sha1 type NameToVcsRevision = OrderedTable[string, Sha1Hash] diff --git a/tests/testscommon.nim b/tests/testscommon.nim index 86548ef9..1f9bc676 100644 --- a/tests/testscommon.nim +++ b/tests/testscommon.nim @@ -4,11 +4,7 @@ {.used.} import sequtils, strutils, strformat, os, osproc, sugar, unittest, macros - -when defined(nimNimbleBootstrap): - import ../dist/checksums/src/checksums/sha1 -else: - import pkg/checksums/sha1 +import pkg/checksums/sha1 from nimblepkg/common import cd, nimblePackagesDirName, ProcessOutput from nimblepkg/developfile import developFileVersion diff --git a/vendor/checksums b/vendor/checksums new file mode 160000 index 00000000..f8f6bd34 --- /dev/null +++ b/vendor/checksums @@ -0,0 +1 @@ +Subproject commit f8f6bd34bfa3fe12c64b919059ad856a96efcba0 diff --git a/vendor/sat b/vendor/sat new file mode 160000 index 00000000..faf1617f --- /dev/null +++ b/vendor/sat @@ -0,0 +1 @@ +Subproject commit faf1617f44d7632ee9601ebc13887644925dcc01