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.

144 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:=3310100
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
  12. PKG_HASH:=62284efebc05a76f909c580ffa5c008a7d22a1287285d68b7825a2b6b51949ae
  13. PKG_SOURCE_URL:=https://www.sqlite.org/2020/
  14. PKG_LICENSE:=PUBLICDOMAIN
  15. PKG_LICENSE_FILES:=
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-autoconf-$(PKG_VERSION)
  17. PKG_BUILD_PARALLEL:=1
  18. PKG_CPE_ID:=cpe:/a:sqlite:sqlite
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. PKG_CONFIG_DEPENDS := \
  22. CONFIG_SQLITE3_DYNAMIC_EXTENSIONS \
  23. CONFIG_SQLITE3_FTS3 \
  24. CONFIG_SQLITE3_FTS4 \
  25. CONFIG_SQLITE3_FTS5 \
  26. CONFIG_SQLITE3_JSON1 \
  27. CONFIG_SQLITE3_LIBEDIT \
  28. CONFIG_SQLITE3_READLINE \
  29. CONFIG_SQLITE3_RTREE \
  30. CONFIG_SQLITE3_SESSION
  31. include $(INCLUDE_DIR)/package.mk
  32. define Package/sqlite3/Default
  33. SUBMENU:=Database
  34. TITLE:=SQLite (v3.x) database engine
  35. URL:=http://www.sqlite.org/
  36. MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
  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))