forked from openwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lua-lsqlite3: add build VARIANT for Lua5.3
Signed-off-by: Jianhui Zhao <[email protected]>
- Loading branch information
1 parent
c2d7f6a
commit 9b38508
Showing
1 changed file
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,27 +18,46 @@ PKG_HASH:=d38402aa7640055d260c1246c36e6d6d31b425a25a805431f13695694466b722 | |
PKG_LICENSE:=MIT | ||
PKG_MAINTAINER:=Oskari Rauta <[email protected]> | ||
|
||
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)) |