Make sqlite3-abi valid nimble package (#6)
I have tested only: * `nimble install` * `nimble check` (to verify the package) * ./update.sh Please suggest if anything else is needed.
This commit is contained in:
parent
fda455cfea
commit
b99d1fe770
|
@ -1,7 +1,7 @@
|
|||
## This file contains additional definitions that nimterop does not generate
|
||||
## code for
|
||||
|
||||
import sqlite3_gen
|
||||
import sqlite3_abi/sqlite3_gen
|
||||
export sqlite3_gen
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ version = "3.34.0"
|
|||
author = "Status Research & Development GmbH"
|
||||
description = "A wrapper for SQLite"
|
||||
license = "Apache License 2.0 or MIT"
|
||||
installFiles = @["sqlite3_abi.nim", "sqlite3_gen.nim", "sqlite3.c", "sqlite3.h"]
|
||||
installFiles = @["sqlite3_abi.nim", "sqlite3_abi/sqlite3_gen.nim", "sqlite3_abi/sqlite3.c", "sqlite3_abi/sqlite3.h"]
|
||||
|
||||
### Dependencies
|
||||
requires "nim >= 0.18.1"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Generated @ 2022-06-21T09:28:04+02:00
|
||||
# Generated @ 2022-12-19T12:20:46+02:00
|
||||
# Command line:
|
||||
# /home/arnetheduck/.nimble/pkgs/nimterop-0.6.13/nimterop/toast --preprocess -m:c -H --compile+=sqlite3.c --pnim --symOverride=sqlite3_index_info,sqlite3_vmprintf,sqlite3_vsnprintf,sqlite3_str_vappendf,sqlite_int64,sqlite_uint64,sqlite3_int64,sqlite3_uint64,SQLITE_STATIC,sqlite3_version --nim:/home/arnetheduck/src/Nim/bin/nim --pluginSourcePath=/home/arnetheduck/.cache/nim/nimterop/cPlugins/nimterop_2309319294.nim /home/arnetheduck/src/nim-sqlite3-abi/sqlite3.h -o /home/arnetheduck/src/nim-sqlite3-abi/sqlite3_gen.nim
|
||||
# /home/yyoncho/.nimble/pkgs2/nimterop-0.6.13-a93246b2ad5531db11e51de7b2d188c42d95576a/nimterop/toast --preprocess -m:c -H --compile+=sqlite3_abi/sqlite3.c --pnim --symOverride=sqlite3_index_info,sqlite3_vmprintf,sqlite3_vsnprintf,sqlite3_str_vappendf,sqlite_int64,sqlite_uint64,sqlite3_int64,sqlite3_uint64,SQLITE_STATIC,sqlite3_version --nim:/home/yyoncho/.choosenim/toolchains/nim-#version-1-6/bin/nim --pluginSourcePath=/home/yyoncho/.cache/nim/nimterop/cPlugins/nimterop_2309319294.nim /home/yyoncho/Sources/nim/nim-sqlite3-abi/sqlite3_abi/sqlite3.h -o /home/yyoncho/Sources/nim/nim-sqlite3-abi/sqlite3_abi/sqlite3_gen.nim
|
||||
|
||||
# const 'SQLITE_EXTERN' has unsupported value 'extern'
|
||||
# const 'SQLITE_STDCALL' has unsupported value 'SQLITE_APICALL'
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
|
||||
{.experimental: "codeReordering".}
|
||||
{.compile: "sqlite3.c".}
|
||||
{.compile: "sqlite3_abi/sqlite3.c".}
|
||||
const
|
||||
SQLITE_VERSION* = "3.34.0"
|
||||
SQLITE_VERSION_NUMBER* = 3034000
|
|
@ -7,18 +7,21 @@ PATCH="${3:-0}"
|
|||
VER_INT="$(printf "%d%02d%02d00" "$MAJOR" "$MINOR" "$PATCH")"
|
||||
|
||||
# TODO check sha256sum
|
||||
cd sqlite3_abi
|
||||
|
||||
ZIP="sqlite-amalgamation-$VER_INT.zip"
|
||||
[ -f "$ZIP" ] || wget https://www.sqlite.org/2020/$ZIP
|
||||
|
||||
unzip -jo $ZIP "sqlite-amalgamation-$VER_INT/sqlite3.c" "sqlite-amalgamation-$VER_INT/sqlite3.h"
|
||||
|
||||
cd ..
|
||||
|
||||
[[ -v HAS_NIMTEROP ]] || nimble install -y nimterop@0.6.13
|
||||
|
||||
nim c --verbosity:0 --hints:off wrap.nim
|
||||
nim c -o:wrap --verbosity:0 --hints:off ./sqlite3_abi/wrap.nim
|
||||
./wrap
|
||||
|
||||
sed -i \
|
||||
-e "s|cdecl|cdecl, raises: [Defect]|g" \
|
||||
-e "s|$PWD/||" \
|
||||
sqlite3_gen.nim
|
||||
sqlite3_abi/sqlite3_gen.nim
|
||||
|
|
Loading…
Reference in New Issue