sqlite3: don't install ABI-less library

Don't install the ABI-less library to support potential multiple ABIs
side by side.

Add a matching tests to check the soname and ensure the ABI-less library
is not installed.

Fixes: aebfd49 ("sqlite3: bump to 3.49.1")
Signed-off-by: George Sapkin <george@sapk.in>
This commit is contained in:
George Sapkin
2025-11-20 15:51:23 +02:00
parent 7ff8ef148f
commit 0d384d4b89
2 changed files with 43 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=sqlite PKG_NAME:=sqlite
PKG_VERSION:=3.51.0 PKG_VERSION:=3.51.0
PKG_SRC_VERSION:=3510000 PKG_SRC_VERSION:=3510000
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_SRC_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_SRC_VERSION).tar.gz
PKG_SOURCE_URL:=https://www.sqlite.org/2025/ PKG_SOURCE_URL:=https://www.sqlite.org/2025/
@@ -137,7 +137,7 @@ endef
define Package/libsqlite3/install define Package/libsqlite3/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so* $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.{$(PKG_VERSION),$(ABI_VERSION)} $(1)/usr/lib
endef endef
define Package/sqlite3-cli/install define Package/sqlite3-cli/install

View File

@@ -2,6 +2,44 @@
# #
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
if [ "$1" = 'sqlite3-cli' ]; then case "$PKG_NAME" in
sqlite3 -version | grep -F "$PKG_VERSION" libsqlite3)
apk add binutils
readelf_out=$(readelf --dynamic "/usr/lib/libsqlite3.so.$PKG_VERSION")
if [ $? -ne 0 ]; then
echo "readelf failed for /usr/lib/libsqlite3.so.$PKG_VERSION" >&2
exit 1
fi fi
soname=$(echo "$readelf_out" \
| grep -F '(SONAME)' \
| sed -E 's/.*\[(.*)\]/\1/')
if [ -z "$soname" ]; then
echo "soname not found in /usr/lib/libsqlite3.so.$PKG_VERSION" >&2
exit 1
fi
link_target=$(readlink "/usr/lib/$soname")
if [ $? -ne 0 ]; then
echo "Failed to read soname link /usr/lib/$soname" >&2
exit 1
fi
expected_target="libsqlite3.so.$PKG_VERSION"
if [ "$link_target" != "$expected_target" ]; then
echo "soname link /usr/lib/$soname points to '$link_target', expected '$expected_target'" >&2
exit 1
fi
if [ -f '/usr/lib/libsqlite3.so' ]; then
echo "/usr/lib/libsqlite3.so shouldn't be installed" >&2
exit 1
fi
;;
sqlite3-cli)
sqlite3 -version | grep -F "$PKG_VERSION"
;;
esac