Skip to content

Commit

Permalink
sqlcipher: Add 4.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-PLACET committed Feb 8, 2024
1 parent 0c171ff commit aedb10d
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 1 deletion.
7 changes: 7 additions & 0 deletions recipes/sqlcipher/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"4.5.6":
url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.6.zip"
sha256: "5d269166c33c39c4dc6fc14be4ac8cd78b022f8bd59b0775becf0c896331a539"
"4.5.1":
url: "https://github.com/sqlcipher/sqlcipher/archive/v4.5.1.zip"
sha256: "08a1024b299b5527d5b5ed79f67957938b516567f68662e973c4bec1b843b28e"
Expand All @@ -18,6 +21,10 @@ sources:
url: "https://github.com/sqlcipher/sqlcipher/archive/v4.3.0.zip"
sha256: "41e1408465488e9c478ca5b7c5f8410405a10caa73b82db60ac115a76c563c05"
patches:
"4.5.6":
- patch_file: patches/Makefile.in-v4.5.6.patch

Check warning on line 25 in recipes/sqlcipher/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/Makefile ... ^ (line: 25)
- patch_file: patches/Makefile.msc-v4.5.6.patch

Check warning on line 26 in recipes/sqlcipher/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/Makefile ... ^ (line: 26)
- patch_file: patches/fix_configure-v4.5.6.patch

Check warning on line 27 in recipes/sqlcipher/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/fix_conf ... ^ (line: 27)
"4.5.1":
- patch_file: patches/Makefile.in-v4.5.1.patch

Check warning on line 29 in recipes/sqlcipher/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/Makefile ... ^ (line: 29)
- patch_file: patches/Makefile.msc-v4.5.1.patch

Check warning on line 30 in recipes/sqlcipher/all/conandata.yml

View workflow job for this annotation

GitHub Actions / Lint changed files (YAML files)

conandata.yml schema warning

Schema outlined in https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/conandata_yml_format.md#patches-fields is not followed. required key(s) 'patch_description', 'patch_type' not found in - patch_file: patches/Makefile ... ^ (line: 30)
Expand Down
2 changes: 1 addition & 1 deletion recipes/sqlcipher/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _generate_msvc(self):
env.define("OPTS", f'-I{crypto_dep.includedir} -DSQLITE_HAS_CODEC')
env.define("NO_TCL", "1")
env.define("USE_AMALGAMATION", "1")
env.define("OPT_FEATURE_FLAGS", "-DSQLCIPHER_CRYPTO_OPENSSL")
env.define("OPT_FEATURE_FLAGS", "-DSQLCIPHER_CRYPTO_OPENSSL -DSQLITE_ENABLE_COLUMN_METADATA")
env.define("SQLITE_TEMP_STORE", self._temp_store_nmake_value)
env.define("TCLSH_CMD", self.dependencies.build['tcl'].runenv_info.vars(self)['TCLSH'])

Expand Down
25 changes: 25 additions & 0 deletions recipes/sqlcipher/all/patches/Makefile.in-v4.5.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/Makefile.in b/Makefile.in
index 870c5d30..4dc5d292 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -672,8 +672,7 @@ SQLITE3_SHELL_TARGET = $(SQLITE3_SHELL_TARGET_@HAVE_WASI_SDK@)
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
-all: sqlite3.h libsqlcipher.la $(SQLITE3_SHELL_TARGET) \
- $(HAVE_TCL:1=libtclsqlite3.la)
+all: sqlite3.h libsqlcipher.la

Makefile: $(TOP)/Makefile.in
./config.status
@@ -1557,9 +1556,8 @@ lib_install: libsqlcipher.la
$(INSTALL) -d $(DESTDIR)$(libdir)
$(LTINSTALL) libsqlcipher.la $(DESTDIR)$(libdir)

-install: sqlcipher$(TEXE) lib_install sqlite3.h sqlcipher.pc ${HAVE_TCL:1=tcl_install}
+install: lib_install sqlite3.h sqlcipher.pc
$(INSTALL) -d $(DESTDIR)$(bindir)
- $(LTINSTALL) sqlcipher$(TEXE) $(DESTDIR)$(bindir)
$(INSTALL) -d $(DESTDIR)$(includedir)
$(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)
$(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)
161 changes: 161 additions & 0 deletions recipes/sqlcipher/all/patches/Makefile.msc-v4.5.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
diff --git a/Makefile.msc b/Makefile.msc
index 85487315..e3c00752 100644
--- a/Makefile.msc
+++ b/Makefile.msc
@@ -299,9 +299,9 @@ SQLITE3H = sqlite3.h
#
!IFNDEF SQLITE3DLL
!IF $(FOR_WIN10)!=0
-SQLITE3DLL = winsqlite3.dll
+SQLITE3DLL = sqlcipher.dll
!ELSE
-SQLITE3DLL = sqlite3.dll
+SQLITE3DLL = sqlcipher.dll
!ENDIF
!ENDIF

@@ -309,9 +309,9 @@ SQLITE3DLL = sqlite3.dll
#
!IFNDEF SQLITE3LIB
!IF $(FOR_WIN10)!=0
-SQLITE3LIB = winsqlite3.lib
+SQLITE3LIB = sqlcipher.lib
!ELSE
-SQLITE3LIB = sqlite3.lib
+SQLITE3LIB = sqlcipher.lib
!ENDIF
!ENDIF

@@ -696,7 +696,7 @@ SHELL_CORE_SRC = $(SQLITE3C)
SHELL_CORE_DEP = $(SQLITE3DLL)
# <<mark>>
!ELSEIF $(USE_AMALGAMATION)==0
-SHELL_CORE_DEP = libsqlite3.lib
+SHELL_CORE_DEP = sqlcipher.lib
# <</mark>>
!ELSE
SHELL_CORE_DEP =
@@ -719,7 +719,7 @@ TESTFIXTURE_DEP = zlib $(TESTFIXTURE_DEP)
SHELL_CORE_LIB = $(SQLITE3LIB)
# <<mark>>
!ELSEIF $(USE_AMALGAMATION)==0
-SHELL_CORE_LIB = libsqlite3.lib
+SHELL_CORE_LIB = sqlcipher.lib
# <</mark>>
!ELSE
SHELL_CORE_LIB =
@@ -754,8 +754,9 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
# C compiler options for the Windows 10 platform (needs MSVC 2015).
#
!IF $(FOR_WIN10)!=0
-TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
-BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
+# /d2guard4 requires /guard:cf to be present as well, but it doesn't work with /Zi (Debug builds)
+TCC = $(TCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
+BCC = $(BCC) -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
!ENDIF

# Also, we need to dynamically link to the correct MSVC runtime
@@ -1039,8 +1040,10 @@ TLIBS =
# default to file, 2 to default to memory, and 3 to force temporary
# tables to always be in memory.
#
-TCC = $(TCC) -DSQLITE_TEMP_STORE=1
-RCC = $(RCC) -DSQLITE_TEMP_STORE=1
+
+# Allow overriding the value
+TCC = $(TCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE)
+RCC = $(RCC) -DSQLITE_TEMP_STORE=$(SQLITE_TEMP_STORE)

# Enable/disable loadable extensions, and other optional features
# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*).
@@ -1206,14 +1209,15 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
!ENDIF
LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
-LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL
!ENDIF

# When compiling for UWP or the Windows 10 platform, some extra linker
# options are also required.
#
!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
-LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
+# Remove /NODEFAULTLIB:kernel32.lib, required by OpenSSL
+LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
LTLINKOPTS = $(LTLINKOPTS) mincore.lib
!IFDEF PSDKLIBPATH
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
@@ -1268,7 +1272,7 @@ LTLIBS = $(LTLIBS) $(LIBICU)
#
LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
backup.lo bitvec.lo btmutex.lo btree.lo build.lo \
- callback.lo complete.lo ctime.lo \
+ callback.lo complete.lo crypto.lo crypto_impl.lo crypto_openssl.lo ctime.lo \
date.lo dbpage.lo dbstat.lo delete.lo \
expr.lo fault.lo fkey.lo \
fts3.lo fts3_aux.lo fts3_expr.lo fts3_hash.lo fts3_icu.lo \
@@ -1774,7 +1778,7 @@ ALL_TCL_TARGETS =
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
-core: dll libsqlite3.lib shell
+core: dll sqlcipher.lib shell

# Targets that require the Tcl library.
#
@@ -1793,11 +1797,12 @@ dll: $(SQLITE3DLL)
shell: $(SQLITE3EXE)

# <<mark>>
-libsqlite3.lib: $(LIBOBJ)
- $(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
+# LTLIBPATHS is required to find the openssl/libressl libs
+sqlcipher.lib: $(LIBOBJ)
+ $(LTLIB) $(LTLIBPATHS) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)

-libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
- $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
+libtclsqlite3.lib: tclsqlite.lo sqlcipher.lib
+ $(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo sqlcipher.lib $(LIBTCLSTUB) $(TLIBS)

tclsqlite3.def: tclsqlite.lo
echo EXPORTS > tclsqlite3.def
@@ -1819,9 +1824,9 @@ $(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)

# <<block2>>
-sqlite3.def: libsqlite3.lib
+sqlite3.def: sqlcipher.lib
echo EXPORTS > sqlite3.def
- dumpbin /all libsqlite3.lib \
+ dumpbin /all sqlcipher.lib \
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+1 _?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@]*)(?:@\d+)?$$" \1 \
| sort >> sqlite3.def
# <</block2>>
@@ -2008,6 +2013,15 @@ callback.lo: $(TOP)\src\callback.c $(HDR)
complete.lo: $(TOP)\src\complete.c $(HDR)
$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\complete.c

+crypto.lo: $(TOP)\src\crypto.c $(HDR)
+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto.c
+
+crypto_impl.lo: $(TOP)\src\crypto_impl.c $(HDR)
+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_impl.c
+
+crypto_openssl.lo: $(TOP)\src\crypto_openssl.c $(HDR)
+ $(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\crypto_openssl.c
+
ctime.lo: $(TOP)\src\ctime.c $(HDR)
$(LTCOMPILE) $(CORE_COMPILE_OPTS) -c $(TOP)\src\ctime.c

@@ -2427,7 +2441,7 @@ sqlite3rbu.lo: $(TOP)\ext\rbu\sqlite3rbu.c $(HDR) $(EXTHDR)
# Rules to build the 'testfixture' application.
#
# If using the amalgamation, use sqlite3.c directly to build the test
-# fixture. Otherwise link against libsqlite3.lib. (This distinction is
+# fixture. Otherwise link against sqlcipher.lib. (This distinction is
# necessary because the test fixture requires non-API symbols which are
# hidden when the library is built via the amalgamation).
#
20 changes: 20 additions & 0 deletions recipes/sqlcipher/all/patches/fix_configure-v4.5.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/configure b/configure
index a2909ce..9c25987 100755
--- a/configure
+++ b/configure
@@ -12732,7 +12732,6 @@ then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcrypto $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

@@ -12764,7 +12763,6 @@ if test "x$ac_cv_lib_crypto_HMAC_Init_ex" = xyes
then :
printf "%s\n" "#define HAVE_LIBCRYPTO 1" >>confdefs.h

- LIBS="-lcrypto $LIBS"

else $as_nop
as_fn_error $? "Library crypto not found. Install openssl!\"" "$LINENO" 5
2 changes: 2 additions & 0 deletions recipes/sqlcipher/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"4.5.6":
folder: all
"4.5.1":
folder: all
"4.5.0":
Expand Down

0 comments on commit aedb10d

Please sign in to comment.