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:=3270200
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
  12. PKG_HASH:=50c39e85ea28b5ecfdb3f9e860afe9ba606381e21836b2849efca6a0bfe6ef6e
  13. PKG_SOURCE_URL:=https://www.sqlite.org/2019/
  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. CONFIG_SQLITE3_THREADSAFE
  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. MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
  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. 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. $(if $(CONFIG_SQLITE3_DYNAMIC_EXTENSIONS),--enable-dynamic-extensions,--disable-dynamic-extensions) \
  88. $(if $(CONFIG_SQLITE3_FTS3),--enable-fts3,--disable-fts3) \
  89. $(if $(CONFIG_SQLITE3_FTS3),--enable-fts4,--disable-fts4) \
  90. $(if $(CONFIG_SQLITE3_FTS3),--enable-fts5,--disable-fts5) \
  91. $(if $(CONFIG_SQLITE3_JSON1),--enable-json1,--disable-json1) \
  92. $(if $(CONFIG_SQLITE3_RTREE),--enable-rtree,--disable-rtree) \
  93. $(if $(CONFIG_SQLITE3_SESSION),--enable-session,--disable-session) \
  94. $(if $(CONFIG_SQLITE3_THREADSAFE),--enable-threadsafe,--disable-threadsafe)
  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/include/sqlite3{,ext}.h $(1)/usr/include/
  106. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
  107. $(CP) $(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.* $(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))