mirror of
https://github.com/openwrt/packages.git
synced 2025-12-10 12:41:22 +00:00
sqlite3: fix line editing in sqlite3-cli
- fix building sqlite3-cli with readline and libedit - add linenoise line editing option. This adds 12k to the size of the bare sqlite3-cli, but doesn't add any extra dependencies - make linenoise the default choice as the most space conserving but still convenient variant - bump PKG_RELEASE Signed-off-by: Maxim Storchak <m.storchak@gmail.com>
This commit is contained in:
committed by
George Sapkin
parent
485fa40414
commit
9ba287e7fd
@@ -3,17 +3,22 @@ menu "Configuration"
|
||||
|
||||
choice
|
||||
prompt "Select command-line editing support"
|
||||
default SQLITE3_LIBEDIT
|
||||
default SQLITE3_LINENOISE
|
||||
|
||||
config SQLITE3_LINENOISE
|
||||
bool "linenoise"
|
||||
help
|
||||
Build with linenoise. This is the default. Adds ~12k compared to the "none" variant
|
||||
|
||||
config SQLITE3_LIBEDIT
|
||||
bool "libedit"
|
||||
help
|
||||
Link against libedit. This is the default.
|
||||
Link against libedit. Adds 4k + ~192k for libedit + ~341k for ncurses
|
||||
|
||||
config SQLITE3_READLINE
|
||||
bool "readline"
|
||||
help
|
||||
Link against GNU readline.
|
||||
Link against GNU readline. Adds 4k + ~333k for readline + ~341k for ncurses
|
||||
|
||||
config SQLITE3_READLINE_NONE
|
||||
bool "none"
|
||||
|
||||
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sqlite
|
||||
PKG_VERSION:=3.50.4
|
||||
PKG_SRC_VERSION:=3500400
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_SRC_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://www.sqlite.org/2025/
|
||||
@@ -34,10 +34,13 @@ PKG_CONFIG_DEPENDS := \
|
||||
CONFIG_SQLITE3_FTS4 \
|
||||
CONFIG_SQLITE3_FTS5 \
|
||||
CONFIG_SQLITE3_LIBEDIT \
|
||||
CONFIG_SQLITE3_LINENOISE \
|
||||
CONFIG_SQLITE3_READLINE \
|
||||
CONFIG_SQLITE3_RTREE \
|
||||
CONFIG_SQLITE3_SESSION
|
||||
|
||||
PKG_BUILD_DEPENDS += SQLITE3_LINENOISE:linenoise
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/sqlite3/Default
|
||||
@@ -77,8 +80,7 @@ define Package/sqlite3-cli
|
||||
DEPENDS := \
|
||||
+libsqlite3 \
|
||||
+SQLITE3_LIBEDIT:libedit \
|
||||
+SQLITE3_READLINE:libreadline \
|
||||
+SQLITE3_READLINE:libncursesw
|
||||
+SQLITE3_READLINE:libreadline
|
||||
EXTRA_DEPENDS:=libsqlite3 (=$(PKG_VERSION)-r$(PKG_RELEASE))
|
||||
TITLE+= (cli)
|
||||
endef
|
||||
@@ -99,7 +101,9 @@ TARGET_CFLAGS += \
|
||||
-DHAVE_MALLOC_USABLE_SIZE \
|
||||
-DSQLITE_ENABLE_UNLOCK_NOTIFY \
|
||||
$(if $(CONFIG_SQLITE3_BATCH_ATOMIC_WRITE),-DSQLITE_ENABLE_BATCH_ATOMIC_WRITE) \
|
||||
$(if $(CONFIG_SQLITE3_COLUMN_METADATA),-DSQLITE_ENABLE_COLUMN_METADATA)
|
||||
$(if $(CONFIG_SQLITE3_COLUMN_METADATA),-DSQLITE_ENABLE_COLUMN_METADATA) \
|
||||
-DHAVE_EDITLINE=$(if $(CONFIG_SQLITE3_LIBEDIT),1,0) \
|
||||
-DHAVE_READLINE=$(if $(CONFIG_SQLITE3_READLINE),1,0)
|
||||
|
||||
CONFIGURE_ARGS := \
|
||||
$(filter-out --target=% $(DISABLE_IPV6) $(DISABLE_NLS),$(CONFIGURE_ARGS)) \
|
||||
@@ -117,9 +121,11 @@ CONFIGURE_ARGS := \
|
||||
$(if $(CONFIG_SQLITE3_SESSION),--enable-session,--disable-session)
|
||||
|
||||
ifeq ($(CONFIG_SQLITE3_LIBEDIT),y)
|
||||
CONFIGURE_ARGS+=--disable-readline
|
||||
CONFIGURE_ARGS+=--editline --with-readline-header=$(STAGING_DIR)/usr/include/editline/readline.h
|
||||
else ifeq ($(CONFIG_SQLITE3_READLINE),y)
|
||||
CONFIGURE_ARGS+=--disable-editline
|
||||
CONFIGURE_ARGS+=--readline --with-readline-header=$(STAGING_DIR)/usr/include/readline/readline.h
|
||||
else ifeq ($(CONFIG_SQLITE3_LINENOISE),y)
|
||||
CONFIGURE_ARGS+=--with-linenoise=$(STAGING_DIR)/usr/include/linenoise
|
||||
else
|
||||
CONFIGURE_ARGS+=--disable-editline --disable-readline
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user