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.

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