mirror of
https://github.com/status-im/nim-sqlcipher.git
synced 2025-02-19 20:48:20 +00:00
refactor: various adjustments made in process of refactoring this repo's integration in nim-status
This commit is contained in:
parent
96c9d37940
commit
a306430824
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -19,6 +19,13 @@ jobs:
|
||||
name: ${{ matrix.platform }} - ${{ matrix.env.NPROC }} processes
|
||||
|
||||
steps:
|
||||
- name: Link Homebrew OpenSSL 1.1 to /usr/local/opt/openssl
|
||||
if: startsWith(matrix.platform, 'macos')
|
||||
shell: bash
|
||||
run: |
|
||||
rm -f /usr/local/opt/openssl
|
||||
ln -s /usr/local/opt/openssl@1.1 /usr/local/opt/openssl
|
||||
|
||||
- name: Install Scoop
|
||||
if: startsWith(matrix.platform, 'windows')
|
||||
shell: powershell
|
||||
@ -76,6 +83,7 @@ jobs:
|
||||
- name: Build the sqlite.nim wrapper and run tests (shared)
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf nimcache sqlcipher sqlite test/build
|
||||
[[ ${{ matrix.platform }} = macos* ]] && \
|
||||
export SSL_INCLUDE_DIR=/usr/local/opt/openssl/include && \
|
||||
export SSL_LIB_DIR=/usr/local/opt/openssl/lib
|
||||
@ -95,6 +103,7 @@ jobs:
|
||||
- name: "Build the sqlite.nim wrapper and run tests (mixed: shared SQLITE)"
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf nimcache sqlcipher sqlite test/build
|
||||
[[ ${{ matrix.platform }} = macos* ]] && \
|
||||
export SSL_INCLUDE_DIR=/usr/local/opt/openssl/include && \
|
||||
export SSL_LIB_DIR=/usr/local/opt/openssl/lib
|
||||
@ -113,6 +122,7 @@ jobs:
|
||||
- name: "Build the sqlite.nim wrapper and run tests (mixed: shared SSL)"
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf nimcache sqlcipher sqlite test/build
|
||||
[[ ${{ matrix.platform }} = macos* ]] && \
|
||||
export SSL_INCLUDE_DIR=/usr/local/opt/openssl/include && \
|
||||
export SSL_LIB_DIR=/usr/local/opt/openssl/lib
|
||||
|
46
Makefile
46
Makefile
@ -16,6 +16,9 @@ BUILD_SYSTEM_DIR := vendor/nimbus-build-system
|
||||
.PHONY: \
|
||||
all \
|
||||
clean \
|
||||
clean-build-dirs \
|
||||
clean-generator \
|
||||
clean-nimterop \
|
||||
deps \
|
||||
sqlite \
|
||||
sqlite.nim \
|
||||
@ -49,20 +52,29 @@ ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
|
||||
else ifeq ($(strip $(shell uname)),Darwin)
|
||||
detected_OS := macOS
|
||||
else
|
||||
detected_OS := $(strip $(shell uname)) # e.g. Linux
|
||||
# e.g. Linux
|
||||
detected_OS := $(strip $(shell uname))
|
||||
endif
|
||||
|
||||
clean: | clean-common
|
||||
clean: | clean-common clean-build-dirs clean-generator clean-nimterop
|
||||
|
||||
clean-build-dirs:
|
||||
rm -rf \
|
||||
$(NIMTEROP_TOAST) \
|
||||
$(NIMTEROP_TOAST).dSYM \
|
||||
generator/generate \
|
||||
generator/generate.exe \
|
||||
generator/generate.dSYM \
|
||||
sqlcipher \
|
||||
sqlite \
|
||||
test/build
|
||||
|
||||
clean-generator:
|
||||
rm -rf \
|
||||
generator/generate \
|
||||
generator/generate.exe \
|
||||
generator/generate.dSYM
|
||||
|
||||
clean-nimterop:
|
||||
rm -rf \
|
||||
$(NIMTEROP_TOAST) \
|
||||
$(NIMTEROP_TOAST).dSYM
|
||||
|
||||
deps: | deps-common
|
||||
|
||||
update: | update-common
|
||||
@ -79,16 +91,19 @@ endif
|
||||
ifndef SSL_LDFLAGS
|
||||
ifeq ($(SSL_STATIC),false)
|
||||
SSL_LDFLAGS := -L$(SSL_LIB_DIR) -lcrypto
|
||||
SSL_LDFLAGS_SQLITE3_C ?= $(SSL_LDFLAGS)
|
||||
else
|
||||
SSL_LDFLAGS := $(SSL_LIB_DIR)/libcrypto.a
|
||||
# SQLCipher's configure script fails if SSL_LIB_DIR isn't supplied with -L in LDFLAGS
|
||||
SSL_LDFLAGS_SQLITE3_C ?= -L$(SSL_LIB_DIR) $(SSL_LDFLAGS)
|
||||
endif
|
||||
ifeq ($(detected_OS),Windows)
|
||||
SSL_LDFLAGS += -lws2_32
|
||||
endif
|
||||
endif
|
||||
ifeq ($(SSL_STATIC),false)
|
||||
SSL_LDFLAGS_SQLITE3_C ?= $(SSL_LDFLAGS)
|
||||
else
|
||||
# SQLCipher's configure script fails if SSL_LIB_DIR isn't supplied with -L in LDFLAGS
|
||||
SSL_LDFLAGS_SQLITE3_C ?= -L$(SSL_LIB_DIR) $(SSL_LDFLAGS)
|
||||
endif
|
||||
|
||||
SQLITE_STATIC ?= true
|
||||
SQLITE_CDEFS ?= -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=3
|
||||
@ -124,10 +139,11 @@ endif
|
||||
vendor/sqlcipher/sqlite3.c \
|
||||
vendor/sqlcipher/sqlite3.h \
|
||||
sqlite/
|
||||
cd vendor/sqlcipher && \
|
||||
git clean -dfx $(HANDLE_OUTPUT) && \
|
||||
(git stash $(HANDLE_OUTPUT) || true) && \
|
||||
(git stash drop $(HANDLE_OUTPUT) || true)
|
||||
cd vendor/sqlcipher && git clean -dfx $(HANDLE_OUTPUT)
|
||||
([[ $(detected_OS) = Windows ]] && \
|
||||
cd vendor/sqlcipher && \
|
||||
git stash $(HANDLE_OUTPUT) && \
|
||||
git stash drop $(HANDLE_OUTPUT)) || true
|
||||
|
||||
sqlite3.c: $(SQLITE3_C)
|
||||
|
||||
@ -220,7 +236,7 @@ $(SQLITE_NIM): $(NIMTEROP_TOAST) $(SQLITE_LIB)
|
||||
--nimcache:nimcache/sqlcipher \
|
||||
--verbosity:0 \
|
||||
generator/generate.nim > $(SQLITE_NIM) 2> /dev/null
|
||||
rm -rf generator/generate generator/generate.exe generator/generate.dSYM
|
||||
$(MAKE) clean-generator
|
||||
|
||||
sqlite.nim: $(SQLITE_NIM)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user