From 2d399e324700dc324b783fb5d2006f2e495d12df Mon Sep 17 00:00:00 2001 From: ThatBen Date: Mon, 13 May 2024 14:08:17 +0200 Subject: [PATCH] renames to leveldbstatic --- build.sh | 12 +----------- leveldb.nimble | 12 ------------ leveldb.nim => leveldbstatic.nim | 6 +++--- leveldbstatic.nimble | 12 ++++++++++++ {leveldb => leveldbstatic}/prelude.nim | 0 {leveldb => leveldbstatic}/raw.nim | 0 leveldbtool.nim | 2 +- tests/packagetest/packagetest.nimble | 2 +- tests/packagetest/src/packagetest.nim | 2 +- tests/test.nim | 5 +++-- 10 files changed, 22 insertions(+), 31 deletions(-) delete mode 100644 leveldb.nimble rename leveldb.nim => leveldbstatic.nim (99%) create mode 100644 leveldbstatic.nimble rename {leveldb => leveldbstatic}/prelude.nim (100%) rename {leveldb => leveldbstatic}/raw.nim (100%) diff --git a/build.sh b/build.sh index 5128be9..20c045f 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ root=$(dirname "$0") sourceDir="${root}/vendor" buildDir="${root}/build" -output="${root}/leveldb/raw.nim" +output="${root}/leveldbstatic/raw.nim" # install nimterop, if not already installed if ! [ -x "$(command -v toast)" ]; then @@ -50,17 +50,7 @@ toast \ --includeDirs="${buildDir}/include" \ "${sourceDir}/include/leveldb/c.h" >> "${output}" -# {.compile: "./vendor -# {.compile: root & "/vendor - -# {.passC: "-I./vendor".} -# {.passC: "-I./build/include".} -# {.passC: "-I" & root/"vendor - - - sed -i 's/\bpassC\b/passc/g' "${output}" - sed -i 's/{\.compile\:\ \"\./{\.compile\:\ root\ \&\ \"/g' "${output}" sed -i 's/{\.passc\:\ \"-I\./{\.passc\:\ \"-I\"\ \&\ root\ \&\ \"/g' "${output}" diff --git a/leveldb.nimble b/leveldb.nimble deleted file mode 100644 index cfe1a78..0000000 --- a/leveldb.nimble +++ /dev/null @@ -1,12 +0,0 @@ -# Package - -version = "0.4.1" -author = "Michał Zieliński" -description = "LevelDB wrapper for Nim" -license = "MIT" -bin = @["leveldbtool"] -installDirs = @["build", "leveldb", "vendor"] -installFiles = @["leveldb.nim"] - -# Dependencies -requires "nim >= 1.4.0" diff --git a/leveldb.nim b/leveldbstatic.nim similarity index 99% rename from leveldb.nim rename to leveldbstatic.nim index 2c58810..7bc69ab 100644 --- a/leveldb.nim +++ b/leveldbstatic.nim @@ -9,7 +9,7 @@ ## Create a database: ## ## .. code-block:: Nim -## import leveldb +## import leveldbstatic ## import options ## ## var db = leveldb.open("/tmp/mydata") @@ -52,7 +52,7 @@ ## db.close() import options, os, strutils -import leveldb/raw +import leveldbstatic/raw type LevelDb* = ref object @@ -78,7 +78,7 @@ type const version* = block: - const configFile = "leveldb.nimble" + const configFile = "leveldbstatic.nimble" const sourcePath = currentSourcePath() const parentConfig = sourcePath.parentDir.parentDir / configFile const localConfig = sourcePath.parentDir / configFile diff --git a/leveldbstatic.nimble b/leveldbstatic.nimble new file mode 100644 index 0000000..a185674 --- /dev/null +++ b/leveldbstatic.nimble @@ -0,0 +1,12 @@ +# Package + +version = "0.1.0" +author = "leveldbstatic authors" +description = "Statically linked LevelDB wrapper for Nim" +license = "MIT" +bin = @["leveldbtool"] +installDirs = @["build", "leveldbstatic", "vendor"] +installFiles = @["leveldbstatic.nim"] + +# Dependencies +requires "nim >= 1.4.0" diff --git a/leveldb/prelude.nim b/leveldbstatic/prelude.nim similarity index 100% rename from leveldb/prelude.nim rename to leveldbstatic/prelude.nim diff --git a/leveldb/raw.nim b/leveldbstatic/raw.nim similarity index 100% rename from leveldb/raw.nim rename to leveldbstatic/raw.nim diff --git a/leveldbtool.nim b/leveldbtool.nim index 1a485cf..27dbc5e 100644 --- a/leveldbtool.nim +++ b/leveldbtool.nim @@ -1,5 +1,5 @@ import options, os, strutils -import leveldb +import leveldbstatic as leveldb proc tool() = proc usage() = diff --git a/tests/packagetest/packagetest.nimble b/tests/packagetest/packagetest.nimble index a3e1c7d..59441c7 100644 --- a/tests/packagetest/packagetest.nimble +++ b/tests/packagetest/packagetest.nimble @@ -12,4 +12,4 @@ bin = @["packagetest"] # Dependencies requires "nim >= 0.18.0" -requires "leveldb" +requires "leveldbstatic" diff --git a/tests/packagetest/src/packagetest.nim b/tests/packagetest/src/packagetest.nim index 3e12356..3f379b7 100644 --- a/tests/packagetest/src/packagetest.nim +++ b/tests/packagetest/src/packagetest.nim @@ -1,6 +1,6 @@ import os import options -import leveldb +import leveldbstatic as leveldb when isMainModule: let tempDir = getTempDir() / "testleveldb" / "tooldb" diff --git a/tests/test.nim b/tests/test.nim index af12346..1a7d19f 100644 --- a/tests/test.nim +++ b/tests/test.nim @@ -1,5 +1,6 @@ import unittest, options, os, osproc, sequtils, strutils -import leveldb, leveldb/raw +import leveldbstatic as leveldb +import leveldbstatic/raw const tmpDir = getTempDir() / "testleveldb" @@ -212,7 +213,7 @@ suite "package": test "import as package": let (output, exitCode) = execNimble("install") check exitCode == QuitSuccess - check output.contains("leveldb installed successfully.") + check output.contains("leveldbstatic installed successfully.") cd "tests"/"packagetest": var (output, exitCode) = execNimble("build")