From ab4e190d474eab1f62e93cd7794592c174f85162 Mon Sep 17 00:00:00 2001 From: benbierens Date: Thu, 9 May 2024 10:18:06 +0200 Subject: [PATCH] copy in submodule and build.sh --- .gitmodules | 3 +++ build.sh | 16 ++++++++++++++++ sources | 1 + 3 files changed, 20 insertions(+) create mode 100644 .gitmodules create mode 100644 build.sh create mode 160000 sources diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..06101e6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "sources"] + path = sources + url = https://github.com/google/leveldb diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..60fb27c --- /dev/null +++ b/build.sh @@ -0,0 +1,16 @@ +#!/bin/bash +root=$(dirname "$0") + +# install nimterop, if not already installed +if ! [ -x "$(command -v toast)" ]; then + nimble install -y nimterop@0.6.13 +fi + +# generate nim wrapper with nimterop +toast \ + --compile="${root}/sources/randombytes.c" \ + --compile="${root}/sources/hazmat.c" \ + --pnim \ + --noHeader \ + "${root}/sources/randombytes.h" \ + "${root}/sources/hazmat.h" > "${root}/sss/cwrapper.nim" diff --git a/sources b/sources new file mode 160000 index 0000000..99b3c03 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +Subproject commit 99b3c03b3284f5886f9ef9a4ef703d57373e61be