1
0

Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # Copyright (C) 2006-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lsqlite3
  9. PKG_VERSION:=0.9.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
  12. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  13. PKG_SOURCE_URL:=http://lua.sqlite.org/index.cgi/zip/lsqlite3_fsl09w.zip
  14. PKG_HASH:=b857df8b66d01a803378cc86e56b787958beffdc8b851ad304f4ce8c7f0e9dbb
  15. PKG_LICENSE:=MIT
  16. PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)_fsl09w.zip
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/lsqlite3
  20. SUBMENU:=Lua
  21. SECTION:=lang
  22. CATEGORY:=Languages
  23. TITLE:=Lua wrapper for the SQLite3 library
  24. URL:=http://lua.sqlite.org
  25. DEPENDS:= +lua +libsqlite3
  26. endef
  27. define Package/lsqlite3/description
  28. LuaSQLite3 is a thin wrapper around the public domain SQLite3 database engine.
  29. endef
  30. TARGET_CFLAGS += $(FPIC) -std=gnu99
  31. TARGET_CPPFLAGS += -DLUA_USE_LINUX
  32. TARGET_LDFLAGS += -llua -lsqlite3 -lpthread
  33. define Build/Compile
  34. $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \
  35. -c $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.c \
  36. -o $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.o \
  37. -DSQLITE_VERSION="$(PKG_VERSION)"
  38. $(TARGET_CC) $(TARGET_LDFLAGS) -shared \
  39. $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.o \
  40. -o $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/lsqlite3.so
  41. endef
  42. define Package/lsqlite3/install
  43. $(INSTALL_DIR) $(1)/usr/lib/lua
  44. $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/*.so $(1)/usr/lib/lua/
  45. endef
  46. $(eval $(call BuildPackage,lsqlite3))