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