aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGanesh Viswanathan <dev@genotrance.com>2020-06-14 16:53:24 -0500
committerGanesh Viswanathan <dev@genotrance.com>2020-06-16 20:43:50 -0500
commit8a8e9077bd941d4b5172d500c8376fcf6c28fe51 (patch)
tree80e0be0bf37fa8d58c248e2b31f4afd149a7ad72
parent6b91902ac953b28934558e4303795d230476ad78 (diff)
downloadnimterop-8a8e9077bd941d4b5172d500c8376fcf6c28fe51.tar.gz
nimterop-8a8e9077bd941d4b5172d500c8376fcf6c28fe51.zip
Handle bad conan uri, test Windows static
-rw-r--r--nimterop/conan.nim16
-rw-r--r--tests/getheader.nims3
-rw-r--r--tests/zlib.nim1
3 files changed, 11 insertions, 9 deletions
diff --git a/nimterop/conan.nim b/nimterop/conan.nim
index 872d138..95ab24f 100644
--- a/nimterop/conan.nim
+++ b/nimterop/conan.nim
@@ -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:
diff --git a/tests/getheader.nims b/tests/getheader.nims
index 55d00f1..349b9bb 100644
--- a/tests/getheader.nims
+++ b/tests/getheader.nims
@@ -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)
diff --git a/tests/zlib.nim b/tests/zlib.nim
index 852dca9..15400d4 100644
--- a/tests/zlib.nim
+++ b/tests/zlib.nim
@@ -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"
)