mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2026-02-13 21:30:52 +00:00
- Fixes https://github.com/termux/termux-packages/issues/27877 - The new `sqlcipher` is extremely similar to `libsqlite` to the point that it is named exactly the same thing - Some desktop linux distros have already updated to `sqlcipher` 4.12.0, so follow the precedent observed in NixOS and LigurOS of renaming everything conflicting in `sqlcipher` to allow it to be installed at the same time as `libsqlite` - Disable static library because it is more difficult to massage than the shared library and is not currently known to be wanted by anyone
64 lines
2.4 KiB
Bash
64 lines
2.4 KiB
Bash
TERMUX_PKG_HOMEPAGE=https://github.com/sqlcipher/sqlcipher
|
|
TERMUX_PKG_DESCRIPTION="SQLCipher is an SQLite extension that provides 256 bit AES encryption of database files"
|
|
TERMUX_PKG_LICENSE="BSD"
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
|
TERMUX_PKG_VERSION="4.12.0"
|
|
TERMUX_PKG_REVISION=1
|
|
TERMUX_PKG_SRCURL="https://github.com/sqlcipher/sqlcipher/archive/v$TERMUX_PKG_VERSION.tar.gz"
|
|
TERMUX_PKG_SHA256=151a1c618c7ae175dfd0f862a8d52e8abd4c5808d548072290e8656032bb0f12
|
|
TERMUX_PKG_DEPENDS="libedit, openssl"
|
|
TERMUX_PKG_BUILD_DEPENDS="tcl"
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
|
TERMUX_PKG_UPDATE_TAG_TYPE="newest-tag"
|
|
# will overwrite libsqlite during installation
|
|
TERMUX_PKG_ON_DEVICE_BUILD_NOT_SUPPORTED=true
|
|
# --enable-editline --disable-readline
|
|
# prevents
|
|
# error: 'regparm' is not valid on this platform
|
|
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
|
--with-tempstore=yes
|
|
--enable-editline
|
|
--disable-readline
|
|
--with-tcl=${TERMUX__PREFIX__LIB_DIR}
|
|
TCLLIBDIR=${TERMUX__PREFIX__LIB_DIR}/tcl8.6/sqlite
|
|
"
|
|
|
|
termux_step_pre_configure() {
|
|
# CPPFLAGS and LDFLAGS as directed by README.md
|
|
CPPFLAGS+=" -DSQLCIPHER_OMIT_LOG_DEVICE"
|
|
CPPFLAGS+=" -DSQLITE_HAS_CODEC"
|
|
CPPFLAGS+=" -DSQLITE_EXTRA_INIT=sqlcipher_extra_init"
|
|
CPPFLAGS+=" -DSQLITE_EXTRA_SHUTDOWN=sqlcipher_extra_shutdown"
|
|
LDFLAGS+=" -lcrypto"
|
|
}
|
|
|
|
# See: https://github.com/termux/termux-packages/issues/23268#issuecomment-2685308408
|
|
# (some packages do not accept '--rpath' or '--rpath-hack' configure arguments)
|
|
# Error: Unknown option --rpath-hack
|
|
termux_step_configure() {
|
|
"$TERMUX_PKG_SRCDIR"/configure \
|
|
--prefix="$TERMUX_PREFIX" \
|
|
--libexecdir="$TERMUX_PREFIX/libexec" \
|
|
--libdir="$TERMUX__PREFIX__LIB_DIR" \
|
|
--includedir="$TERMUX__PREFIX__INCLUDE_DIR" \
|
|
--sbindir="$TERMUX_PREFIX/bin" \
|
|
--disable-static \
|
|
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS
|
|
}
|
|
|
|
termux_step_post_massage() {
|
|
# Rename files from sqlite3 to sqlcipher to prevent file collisons
|
|
# based on the precedent being set by LigurOS, NixOS
|
|
# https://gitlab.com/liguros/liguros-repo/-/blob/2406209f428ab349fc33209834caf1a7a0477fda/dev-db/sqlcipher/sqlcipher-4.12.0.ebuild#L70
|
|
local sql_version="$(cat "$TERMUX_PKG_SRCDIR"/VERSION)"
|
|
mv bin/{sqlite3,sqlcipher}
|
|
mv include/{sqlite3,sqlcipher}.h
|
|
mv include/{sqlite3ext,sqlcipherext}.h
|
|
mv lib/lib{sqlite3,sqlcipher}.so
|
|
mv lib/lib{sqlite3,sqlcipher}.so.0
|
|
mv lib/lib{sqlite3,sqlcipher}.so."$sql_version"
|
|
mv lib/pkgconfig/{sqlite3,sqlcipher}.pc
|
|
mv share/man/man1/{sqlite3,sqlcipher}.1.gz
|
|
sed -i s/-lsqlite3/-lsqlcipher/ lib/pkgconfig/sqlcipher.pc
|
|
}
|