diff --git a/databases/sqlcipher/Makefile b/databases/sqlcipher/Makefile new file mode 100644 index 00000000000..601323fcec1 --- /dev/null +++ b/databases/sqlcipher/Makefile @@ -0,0 +1,36 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2021/03/21 12:04:26 tim Exp $ + +COMMENT = encrypted SQLite database + +GH_ACCOUNT = sqlcipher +GH_PROJECT = sqlcipher +GH_TAGNAME = v4.4.3 + +SHARED_LIBS += sqlcipher 0.0 # 8.6 + +CATEGORIES = databases + +HOMEPAGE = https://www.zetetic.net/sqlcipher/ +MAINTAINER = Tom Murphy + +# PD and BSD +PERMIT_PACKAGE = Yes + +WANTLIB += c crypto curses pthread readline z + +CONFIGURE_STYLE = gnu + +CONFIGURE_ARGS += --enable-tempstore=yes \ + --disable-editline \ + --disable-tcl +CONFIGURE_ENV += TCLSH_CMD=${MODTCL_BIN} + +NO_TEST = Yes + +CFLAGS += -DSQLITE_HAS_CODEC -DOMIT_MEMLOCK + +MODULES = lang/tcl +MODTCL_VERSION = 8.6 +BUILD_DEPENDS = ${MODTCL_BUILD_DEPENDS} + +.include diff --git a/databases/sqlcipher/distinfo b/databases/sqlcipher/distinfo new file mode 100644 index 00000000000..c908789ab44 --- /dev/null +++ b/databases/sqlcipher/distinfo @@ -0,0 +1,2 @@ +SHA256 (sqlcipher-4.4.3.tar.gz) = uN9puZjAQs5/ipnwfPEfRd/r5REQ75LelfFyg1iFMTM= +SIZE (sqlcipher-4.4.3.tar.gz) = 17639967 diff --git a/databases/sqlcipher/patches/patch-configure b/databases/sqlcipher/patches/patch-configure new file mode 100644 index 00000000000..89d858baa6f --- /dev/null +++ b/databases/sqlcipher/patches/patch-configure @@ -0,0 +1,50 @@ +$OpenBSD: patch-configure,v 1.1.1.1 2021/03/21 12:04:26 tim Exp $ + +Fix bashisms. Should be fixed in next release. + +https://github.com/sqlcipher/sqlcipher/issues/382 + +Index: configure +--- configure.orig ++++ configure +@@ -11997,14 +11997,14 @@ if test "$crypto_lib" = "none"; then + $as_echo "none" >&6; } + else + if test "$crypto_lib" = "commoncrypto"; then +- CFLAGS+=" -DSQLCIPHER_CRYPTO_CC" +- BUILD_CFLAGS+=" -DSQLCIPHER_CRYPTO_CC" ++ CFLAGS="$CFLAGS -DSQLCIPHER_CRYPTO_CC" ++ BUILD_CFLAGS="$BUILD_CFLAGS -DSQLCIPHER_CRYPTO_CC" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: commoncrypto" >&5 + $as_echo "commoncrypto" >&6; } + else + if test "$crypto_lib" = "libtomcrypt"; then +- CFLAGS+=" -DSQLCIPHER_CRYPTO_LIBTOMCRYPT" +- BUILD_CFLAGS+=" -DSQLCIPHER_CRYPTO_LIBTOMCRYPT" ++ CFLAGS="$CFLAGS -DSQLCIPHER_CRYPTO_LIBTOMCRYPT" ++ BUILD_CFLAGS="$BUILD_CFLAGS -DSQLCIPHER_CRYPTO_LIBTOMCRYPT" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libtomcrypt" >&5 + $as_echo "libtomcrypt" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for register_cipher in -ltomcrypt" >&5 +@@ -12056,8 +12056,8 @@ fi + + else + if test "$crypto_lib" = "nss"; then +- CFLAGS+=" -DSQLCIPHER_CRYPTO_NSS" +- BUILD_CFLAGS+=" -DSQLCIPHER_CRYPTO_NSS" ++ CFLAGS="$CFLAGS -DSQLCIPHER_CRYPTO_NSS" ++ BUILD_CFLAGS="$BUILD_CFLAGS -DSQLCIPHER_CRYPTO_NSS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: nss3" >&5 + $as_echo "nss3" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PK11_Decrypt in -lnss3" >&5 +@@ -12108,8 +12108,8 @@ else + fi + + else +- CFLAGS+=" -DSQLCIPHER_CRYPTO_OPENSSL" +- BUILD_CFLAGS+=" -DSQLCIPHER_CRYPTO_OPENSSL" ++ CFLAGS="$CFLAGS -DSQLCIPHER_CRYPTO_OPENSSL" ++ BUILD_CFLAGS="$BUILD_CFLAGS -DSQLCIPHER_CRYPTO_OPENSSL" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: openssl" >&5 + $as_echo "openssl" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for HMAC_Init_ex in -lcrypto" >&5 diff --git a/databases/sqlcipher/patches/patch-src_crypto_impl_c b/databases/sqlcipher/patches/patch-src_crypto_impl_c new file mode 100644 index 00000000000..1fe19dd7904 --- /dev/null +++ b/databases/sqlcipher/patches/patch-src_crypto_impl_c @@ -0,0 +1,24 @@ +$OpenBSD: patch-src_crypto_impl_c,v 1.1.1.1 2021/03/21 12:04:26 tim Exp $ + +Fix build with -DOMIT_MEMLOCK. Should be fixed in next release. + +https://github.com/sqlcipher/sqlcipher/issues/384 + +Index: src/crypto_impl.c +--- src/crypto_impl.c.orig ++++ src/crypto_impl.c +@@ -35,10 +35,10 @@ + #include "crypto.h" + #ifndef OMIT_MEMLOCK + #if defined(__unix__) || defined(__APPLE__) || defined(_AIX) +-#include +-#include +-#include +-#include ++#include /* amalgamator: dontcache */ ++#include /* amalgamator: dontcache */ ++#include /* amalgamator: dontcache */ ++#include /* amalgamator: dontcache */ + #elif defined(_WIN32) + #include + #endif diff --git a/databases/sqlcipher/pkg/DESCR b/databases/sqlcipher/pkg/DESCR new file mode 100644 index 00000000000..4932ea508b4 --- /dev/null +++ b/databases/sqlcipher/pkg/DESCR @@ -0,0 +1,8 @@ +SQLCipher extends the SQLite database library to add security +enhancements that make it more suitable for encrypted local data +storage like: + +* on-the-fly-encryption +* tamper detection +* memory sanitization +* strong key derivation diff --git a/databases/sqlcipher/pkg/PLIST b/databases/sqlcipher/pkg/PLIST new file mode 100644 index 00000000000..94b676d6084 --- /dev/null +++ b/databases/sqlcipher/pkg/PLIST @@ -0,0 +1,9 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2021/03/21 12:04:26 tim Exp $ +@bin bin/sqlcipher +include/sqlcipher/ +include/sqlcipher/sqlite3.h +include/sqlcipher/sqlite3ext.h +@static-lib lib/libsqlcipher.a +lib/libsqlcipher.la +@lib lib/libsqlcipher.so.${LIBsqlcipher_VERSION} +lib/pkgconfig/sqlcipher.pc