You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

125 lines
3.1 KiB

  1. #
  2. # Copyright (C) 2006-2014 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:=sqlite
  9. PKG_VERSION:=3260000
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
  12. PKG_HASH:=5daa6a3fb7d1e8c767cd59c4ded8da6e4b00c61d3b466d0685e35c4dd6d7bf5d
  13. PKG_SOURCE_URL:=https://www.sqlite.org/2018/
  14. PKG_LICENSE:=PUBLICDOMAIN
  15. PKG_LICENSE_FILES:=
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-autoconf-$(PKG_VERSION)
  17. PKG_FIXUP:=autoreconf
  18. PKG_INSTALL:=1
  19. PKG_CONFIG_DEPENDS := \
  20. CONFIG_SQLITE_FTS3 \
  21. CONFIG_SQLITE_RTREE
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/sqlite3/Default
  24. SUBMENU:=database
  25. TITLE:=SQLite (v3.x) database engine
  26. URL:=http://www.sqlite.org/
  27. MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
  28. endef
  29. define Package/sqlite3/Default/description
  30. SQLite is a small C library that implements a self-contained, embeddable,
  31. zero-configuration SQL database engine.
  32. endef
  33. define Package/libsqlite3
  34. $(call Package/sqlite3/Default)
  35. SECTION:=libs
  36. CATEGORY:=Libraries
  37. DEPENDS:=+libpthread +zlib
  38. TITLE+= (library)
  39. endef
  40. define Package/libsqlite3/description
  41. $(call Package/sqlite3/Default/description)
  42. This package contains the SQLite (v3.x) shared library, used by other
  43. programs.
  44. endef
  45. define Package/libsqlite3/config
  46. source "$(SOURCE)/Config.in"
  47. endef
  48. define Package/sqlite3-cli
  49. $(call Package/sqlite3/Default)
  50. SECTION:=utils
  51. CATEGORY:=Utilities
  52. DEPENDS:=+libsqlite3 +libncurses +libreadline
  53. TITLE+= (cli)
  54. endef
  55. define Package/sqlite3-cli/description
  56. $(call Package/sqlite3/Default/description)
  57. This package contains a terminal-based front-end to the SQLite (v3.x) library
  58. that can evaluate queries interactively and display the results in multiple
  59. formats.
  60. endef
  61. TARGET_CFLAGS += \
  62. -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \
  63. -DHAVE_ISNAN=1 \
  64. -DHAVE_MALLOC_USABLE_SIZE=1
  65. ifneq ($(CONFIG_SQLITE_FTS3),y)
  66. TARGET_CFLAGS += -USQLITE_ENABLE_FTS3
  67. endif
  68. ifneq ($(CONFIG_SQLITE_RTREE),y)
  69. TARGET_CFLAGS += -USQLITE_ENABLE_RTREE
  70. endif
  71. CONFIGURE_ARGS += \
  72. --enable-shared \
  73. --enable-static \
  74. --disable-editline \
  75. --disable-static-shell
  76. CONFIGURE_VARS += \
  77. config_BUILD_CC="$(HOSTCC)" \
  78. config_BUILD_CFLAGS="-O2" \
  79. config_TARGET_CC="$(TARGET_CC)" \
  80. config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
  81. config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
  82. config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
  83. define Build/InstallDev
  84. $(INSTALL_DIR) $(1)/usr/include
  85. $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include/
  86. $(INSTALL_DIR) $(1)/usr/lib
  87. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
  88. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  89. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
  90. endef
  91. define Package/libsqlite3/install
  92. $(INSTALL_DIR) $(1)/usr/lib
  93. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
  94. endef
  95. define Package/sqlite3-cli/install
  96. $(INSTALL_DIR) $(1)/usr/bin
  97. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
  98. endef
  99. $(eval $(call BuildPackage,libsqlite3))
  100. $(eval $(call BuildPackage,sqlite3-cli))