From 9b38508b862c5a12f24cee34988080a1dd09c273 Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Thu, 24 Aug 2023 03:14:45 +0000 Subject: [PATCH] lua-lsqlite3: add build VARIANT for Lua5.3 Signed-off-by: Jianhui Zhao --- lang/lua-lsqlite3/Makefile | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/lang/lua-lsqlite3/Makefile b/lang/lua-lsqlite3/Makefile index 64d5d06348..7a31424c5b 100644 --- a/lang/lua-lsqlite3/Makefile +++ b/lang/lua-lsqlite3/Makefile @@ -18,27 +18,46 @@ PKG_HASH:=d38402aa7640055d260c1246c36e6d6d31b425a25a805431f13695694466b722 PKG_LICENSE:=MIT PKG_MAINTAINER:=Oskari Rauta -PKG_BUILD_DIR:=$(BUILD_DIR)/$(basename $(PKG_SOURCE)) +PKG_BUILD_DIR:=$(BUILD_DIR)/lsqlite3-$(BUILD_VARIANT)/$(basename $(PKG_SOURCE)) include $(INCLUDE_DIR)/package.mk -define Package/lsqlite3 +define Package/lsqlite3/default SUBMENU:=Lua SECTION:=lang CATEGORY:=Languages TITLE:=Lua wrapper for the SQLite3 library URL:=http://lua.sqlite.org - DEPENDS:= +lua +libsqlite3 + DEPENDS:=+libsqlite3 +endef + +define Package/lsqlite3 + $(Package/lsqlite3/default) + DEPENDS+=+liblua + VARIANT:=lua-51 +endef + +define Package/lsqlite3-lua5.3 + $(Package/lsqlite3/default) + DEPENDS+=+liblua5.3 + VARIANT:=lua-53 endef -define Package/lsqlite3/description +define Package/lsqlite3/default/description LuaSQLite3 is a thin wrapper around the public domain SQLite3 database engine. endef +Package/lsqlite3/description = $(Package/lsqlite3/default/description) +Package/lsqlite3-lua5.3/description = $(Package/lsqlite3/default/description) + TARGET_CFLAGS += $(FPIC) -std=gnu99 TARGET_CPPFLAGS += -DLUA_USE_LINUX TARGET_LDFLAGS += -lsqlite3 -lpthread +ifeq ($(BUILD_VARIANT),lua-53) + TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/lua5.3 +endif + define Build/Compile $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \ -c $(PKG_BUILD_DIR)/lsqlite3.c \ @@ -54,4 +73,10 @@ define Package/lsqlite3/install $(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib/lua/ endef +define Package/lsqlite3-lua5.3/install + $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3 + $(CP) $(PKG_BUILD_DIR)/*.so $(1)/usr/local/lib/lua/5.3 +endef + $(eval $(call BuildPackage,lsqlite3)) +$(eval $(call BuildPackage,lsqlite3-lua5.3)) -- 2.30.2