From 2acbbdcc0e63002a013fff49f015708522875832 Mon Sep 17 00:00:00 2001 From: tersec Date: Mon, 12 Jun 2023 14:32:14 +0000 Subject: [PATCH] remove Nim 1.2 and 1.4 support (#52) --- .github/workflows/ci.yml | 2 +- secp256k1.nim | 7 ++----- secp256k1.nimble | 5 ++--- secp256k1/abi.nim | 8 +------- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70de0cf..f18640f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: cpu: amd64 #- os: windows #cpu: i386 - branch: [version-1-2, version-1-4, version-1-6, version-2-0, devel] + branch: [version-1-6, version-2-0, devel] include: - target: os: linux diff --git a/secp256k1.nim b/secp256k1.nim index 7799d22..bee3855 100644 --- a/secp256k1.nim +++ b/secp256k1.nim @@ -1,4 +1,4 @@ -## Copyright (c) 2018-2020 Status Research & Development GmbH +## Copyright (c) 2018-2023 Status Research & Development GmbH ## Licensed under either of ## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) ## * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -7,10 +7,7 @@ ## those terms. ## -when (NimMajor, NimMinor) < (1, 4): - {.push raises: [Defect].} -else: - {.push raises: [].} +{.push raises: [].} import strformat, typetraits, diff --git a/secp256k1.nimble b/secp256k1.nimble index 66cf15d..d22fc67 100644 --- a/secp256k1.nimble +++ b/secp256k1.nimble @@ -8,7 +8,7 @@ license = "Apache License 2.0" skipDirs = @["tests"] installDirs = @["vendor"] -requires "nim >= 1.2.0", +requires "nim >= 1.6.0", "stew", "nimcrypto" @@ -17,9 +17,8 @@ let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js) let flags = getEnv("NIMFLAGS", "") # Extra flags for the compiler let verbose = getEnv("V", "") notin ["", "0"] -let styleCheckStyle = if (NimMajor, NimMinor) < (1, 6): "hint" else: "error" let cfg = - " --styleCheck:usages --styleCheck:" & styleCheckStyle & + " --styleCheck:usages --styleCheck:error" & (if verbose: "" else: " --verbosity:0 --hints:off") & " --skipParentCfg --skipUserCfg --outdir:build --nimcache:build/nimcache -f" diff --git a/secp256k1/abi.nim b/secp256k1/abi.nim index 5253edd..9bb5528 100644 --- a/secp256k1/abi.nim +++ b/secp256k1/abi.nim @@ -18,13 +18,7 @@ const compileFlags = " -I" & quoteShell(srcPath) & asmFlags -when (NimMajor, NimMinor) >= (1, 4): - {.compile(srcPath & "/secp256k1.c", compileFlags).} -else: - # Per-compile flags not supported in 1.2 - {.passc: compileFlags.} - {.compile: srcPath & "/secp256k1.c".} - +{.compile(srcPath & "/secp256k1.c", compileFlags).} {.compile: srcPath & "/precomputed_ecmult.c".} {.compile: srcPath & "/precomputed_ecmult_gen.c".}