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.

145 lines
3.8 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:=3320100
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
  12. PKG_HASH:=486748abfb16abd8af664e3a5f03b228e5f124682b0c942e157644bf6fff7d10
  13. PKG_SOURCE_URL:=https://www.sqlite.org/2020/
  14. PKG_LICENSE:=PUBLICDOMAIN
  15. PKG_LICENSE_FILES:=
  16. PKG_MAINTAINER:=
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-autoconf-$(PKG_VERSION)
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_CPE_ID:=cpe:/a:sqlite:sqlite
  20. PKG_FIXUP:=autoreconf
  21. PKG_INSTALL:=1
  22. PKG_CONFIG_DEPENDS := \
  23. CONFIG_SQLITE3_DYNAMIC_EXTENSIONS \
  24. CONFIG_SQLITE3_FTS3 \
  25. CONFIG_SQLITE3_FTS4 \
  26. CONFIG_SQLITE3_FTS5 \
  27. CONFIG_SQLITE3_JSON1 \
  28. CONFIG_SQLITE3_LIBEDIT \
  29. CONFIG_SQLITE3_READLINE \
  30. CONFIG_SQLITE3_RTREE \
  31. CONFIG_SQLITE3_SESSION
  32. include $(INCLUDE_DIR)/package.mk
  33. define Package/sqlite3/Default
  34. SUBMENU:=Database
  35. TITLE:=SQLite (v3.x) database engine
  36. URL:=http://www.sqlite.org/
  37. endef
  38. define Package/sqlite3/Default/description
  39. SQLite is a small C library that implements a self-contained, embeddable,
  40. zero-configuration SQL database engine.
  41. endef
  42. define Package/libsqlite3
  43. $(call Package/sqlite3/Default)
  44. SECTION:=libs
  45. CATEGORY:=Libraries
  46. DEPENDS:=+libpthread +zlib
  47. TITLE+= (library)
  48. ABI_VERSION:=0
  49. endef
  50. define Package/libsqlite3/description
  51. $(call Package/sqlite3/Default/description)
  52. This package contains the SQLite (v3.x) shared library, used by other
  53. programs.
  54. endef
  55. define Package/libsqlite3/config
  56. source "$(SOURCE)/Config-lib.in"
  57. endef
  58. define Package/sqlite3-cli
  59. $(call Package/sqlite3/Default)
  60. SECTION:=utils
  61. CATEGORY:=Utilities
  62. DEPENDS := \
  63. +libsqlite3 \
  64. +SQLITE3_LIBEDIT:libedit \
  65. +SQLITE3_READLINE:libreadline \
  66. +SQLITE3_READLINE:libncursesw
  67. TITLE+= (cli)
  68. endef
  69. define Package/sqlite3-cli/description
  70. $(call Package/sqlite3/Default/description)
  71. This package contains a terminal-based front-end to the SQLite (v3.x) library
  72. that can evaluate queries interactively and display the results in multiple
  73. formats.
  74. endef
  75. define Package/sqlite3-cli/config
  76. source "$(SOURCE)/Config-cli.in"
  77. endef
  78. TARGET_CFLAGS += \
  79. -DHAVE_ISNAN \
  80. -DHAVE_MALLOC_USABLE_SIZE \
  81. -DSQLITE_ENABLE_UNLOCK_NOTIFY
  82. CONFIGURE_ARGS += \
  83. --disable-debug \
  84. --disable-static-shell \
  85. --enable-shared \
  86. --enable-static \
  87. --enable-threadsafe \
  88. $(if $(CONFIG_SQLITE3_DYNAMIC_EXTENSIONS),--enable-dynamic-extensions,--disable-dynamic-extensions) \
  89. $(if $(CONFIG_SQLITE3_FTS3),--enable-fts3,--disable-fts3) \
  90. $(if $(CONFIG_SQLITE3_FTS3),--enable-fts4,--disable-fts4) \
  91. $(if $(CONFIG_SQLITE3_FTS3),--enable-fts5,--disable-fts5) \
  92. $(if $(CONFIG_SQLITE3_JSON1),--enable-json1,--disable-json1) \
  93. $(if $(CONFIG_SQLITE3_RTREE),--enable-rtree,--disable-rtree) \
  94. $(if $(CONFIG_SQLITE3_SESSION),--enable-session,--disable-session)
  95. ifeq ($(CONFIG_SQLITE3_LIBEDIT),y)
  96. CONFIGURE_ARGS+=--disable-readline
  97. else ifeq ($(CONFIG_SQLITE3_READLINE),y)
  98. CONFIGURE_ARGS+=--disable-editline
  99. else
  100. CONFIGURE_ARGS+=--disable-editline --disable-readline
  101. endif
  102. define Build/InstallDev
  103. $(INSTALL_DIR) $(1)/usr/include
  104. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  105. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib
  106. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include
  107. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig
  108. endef
  109. define Package/libsqlite3/install
  110. $(INSTALL_DIR) $(1)/usr/lib
  111. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.$(ABI_VERSION)* $(1)/usr/lib
  112. endef
  113. define Package/sqlite3-cli/install
  114. $(INSTALL_DIR) $(1)/usr/bin
  115. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin
  116. endef
  117. $(eval $(call BuildPackage,libsqlite3))
  118. $(eval $(call BuildPackage,sqlite3-cli))