From efde2462c68fa1c33b9587dcd3e4914cccf1ad0b Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 19 May 2021 17:16:43 +0300 Subject: [PATCH 1/2] libs: gdbm: enable/install Berkley DBM compat layer Python supports both GNU dbm and Berkley DBM. GNU dbm also has a compatibility layer for Berkeley. The current Berkley DB in OpenWrt is 4.7 and hasn't been updated in ages. It's also pretty big. So, an alternative for Python is to use GNU dbm for both (GNU and Berkley). Also, removing static shared libraries from the build, to encourage the usage of the shared ones. Signed-off-by: Alexandru Ardelean --- libs/gdbm/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/gdbm/Makefile b/libs/gdbm/Makefile index 8e0e85d70..b23cb74c9 100644 --- a/libs/gdbm/Makefile +++ b/libs/gdbm/Makefile @@ -19,7 +19,7 @@ PKG_MAINTAINER:=Marcel Denia PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING -PKG_INSTALL:=1 +PKG_INSTALL:=2 PKG_BUILD_PARALLEL:=0 include $(INCLUDE_DIR)/package.mk @@ -38,8 +38,8 @@ define Package/libgdbm/description endef CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static + --enable-libgdbm-compat \ + --enable-shared define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ @@ -51,14 +51,16 @@ endef define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/gdbm.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/{gdbm,ndbm}.h $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm_compat.so* $(1)/usr/lib/ endef define Package/libgdbm/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgdbm_compat.so* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libgdbm)) From 78f6c2c5ad2fd3de8a33a1cddb02204177cf60ad Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 19 May 2021 14:46:06 +0300 Subject: [PATCH 2/2] python3: use gdbm for Berkley dbm Python works with GNU DBM and with Berkley DBM. Berkley DBM has been under Oracle for some time. And it's not clear how many Python users actually use DBM. In the packages feed, we have both libdb47 (which is now under Oracle) and GNU DBM. The GNU DBM has a compatibility layer for Berkley DBM. There are newer versions than libdb47, but it's probably not worth having them yet. The libbd47 tarball is ~40+ MB. Odds are newer versions will be bigger and more bloated. This change merges the old `python3-gdbm` package into the `python3-dbm` package, since they are effectively using the same underlying library now, i.e. gdbm. Signed-off-by: Alexandru Ardelean --- lang/python/python3/Makefile | 2 +- lang/python/python3/files/python3-package-dbm.mk | 3 ++- .../python/python3/files/python3-package-gdbm.mk | 16 ---------------- 3 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 lang/python/python3/files/python3-package-gdbm.mk diff --git a/lang/python/python3/Makefile b/lang/python/python3/Makefile index 17356c71e..794d003b1 100644 --- a/lang/python/python3/Makefile +++ b/lang/python/python3/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk include ../python3-version.mk PKG_NAME:=python3 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO) PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz diff --git a/lang/python/python3/files/python3-package-dbm.mk b/lang/python/python3/files/python3-package-dbm.mk index 409940229..ede9af163 100644 --- a/lang/python/python3/files/python3-package-dbm.mk +++ b/lang/python/python3/files/python3-package-dbm.mk @@ -8,10 +8,11 @@ define Package/python3-dbm $(call Package/python3/Default) TITLE:=Python $(PYTHON3_VERSION) dbm module - DEPENDS:=+python3-light +libdb47 + DEPENDS:=+python3-light +libgdbm endef $(eval $(call Py3BasePackage,python3-dbm, \ /usr/lib/python$(PYTHON3_VERSION)/dbm \ /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_dbm.$(PYTHON3_SO_SUFFIX) \ + /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_gdbm.$(PYTHON3_SO_SUFFIX) \ )) diff --git a/lang/python/python3/files/python3-package-gdbm.mk b/lang/python/python3/files/python3-package-gdbm.mk deleted file mode 100644 index 7f98badf3..000000000 --- a/lang/python/python3/files/python3-package-gdbm.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2006-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Package/python3-gdbm -$(call Package/python3/Default) - TITLE:=Python $(PYTHON3_VERSION) gdbm module - DEPENDS:=+python3-light +libgdbm -endef - -$(eval $(call Py3BasePackage,python3-gdbm, \ - /usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_gdbm.$(PYTHON3_SO_SUFFIX) \ -))