Handle bad conan uri, test Windows static

This commit is contained in:
Ganesh Viswanathan 2020-06-14 16:53:24 -05:00
commit f21dab89ca
3 changed files with 11 additions and 9 deletions

View file

@ -40,12 +40,6 @@ const
conanPackage = "conan_package.tgz"
conanManifest = "conanmanifest.txt"
# https://github.com/kdheepak/binary-builder-downloader/blob/master/src/bbd.nim
# https://bintray.com/conan/conan-center
# https://bintray.com/bincrafters/public-conan/
# https://docs.conan.io/en/latest/howtos/manage_shared_libraries.html#manage-shared
var
# Bintray download URL for explicit `user/channel`
baseAltUrl {.compiletime.} = {
@ -73,7 +67,10 @@ proc jsonGet(url: string): JsonNode =
file
downloadUrl(url, temp, quiet = true)
result = readFile(file).parseJson()
try:
result = readFile(file).parseJson()
except JsonParsingError:
discard
rmFile(file)
proc `==`*(pkg1, pkg2: ConanPackage): bool =
@ -352,10 +349,11 @@ proc downloadConan*(pkg: ConanPackage, outdir: string, clean = true) =
elif clean:
cleanDir(outdir)
echo &"# Downloading {pkg.name} v{pkg.version} from Conan"
pkg.getConanBuilds()
doAssert pkg.recipes.len != 0, &"# Failed to download {pkg.name} v{pkg.version} from Conan - check https://conan.io/center"
echo &"# Downloading {pkg.name} v{pkg.version} from Conan"
for recipe, builds in pkg.recipes:
for build in builds:
if pkg.bhash.len == 0 or pkg.bhash == build.bhash:

View file

@ -39,6 +39,9 @@ when defined(posix):
# conan static
testCall(cmd & " -d:libssh2Conan -d:libssh2SetVer=1.9.0 -d:libssh2Static" & sshcmd, zexp, 0)
else:
# conan static for Windows
testCall(cmd & " -d:zlibConan -d:zlibSetVer=1.2.11 -d:zlibStatic" & zrcmd, zexp, 0)
# git
testCall(cmd & " -d:envTest" & zrcmd, zexp, 0)

View file

@ -27,6 +27,7 @@ getHeader(
"zlib.h",
giturl = "https://github.com/madler/zlib",
dlurl = "http://zlib.net/zlib-$1.tar.gz",
conanuri = "zlib/$1",
outdir = baseDir,
altNames = "z,zlib"
)