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.

143 lines
3.7 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:=2
  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. 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. endef
  49. define Package/libsqlite3/description
  50. $(call Package/sqlite3/Default/description)
  51. This package contains the SQLite (v3.x) shared library, used by other
  52. programs.
  53. endef
  54. define Package/libsqlite3/config
  55. source "$(SOURCE)/Config-lib.in"
  56. endef
  57. define Package/sqlite3-cli
  58. $(call Package/sqlite3/Default)
  59. SECTION:=utils
  60. CATEGORY:=Utilities
  61. DEPENDS := \
  62. +libsqlite3 \
  63. +SQLITE3_LIBEDIT:libedit \
  64. +SQLITE3_READLINE:libreadline \
  65. +SQLITE3_READLINE:libncursesw
  66. TITLE+= (cli)
  67. endef
  68. define Package/sqlite3-cli/description
  69. $(call Package/sqlite3/Default/description)
  70. This package contains a terminal-based front-end to the SQLite (v3.x) library
  71. that can evaluate queries interactively and display the results in multiple
  72. formats.
  73. endef
  74. define Package/sqlite3-cli/config
  75. source "$(SOURCE)/Config-cli.in"
  76. endef
  77. TARGET_CFLAGS += \
  78. -DHAVE_ISNAN \
  79. -DHAVE_MALLOC_USABLE_SIZE \
  80. -DSQLITE_ENABLE_UNLOCK_NOTIFY
  81. CONFIGURE_ARGS += \
  82. --disable-debug \
  83. --disable-static-shell \
  84. --enable-shared \
  85. --enable-static \
  86. --enable-threadsafe \
  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. ifeq ($(CONFIG_SQLITE3_LIBEDIT),y)
  95. CONFIGURE_ARGS+=--disable-readline
  96. else ifeq ($(CONFIG_SQLITE3_READLINE),y)
  97. CONFIGURE_ARGS+=--disable-editline
  98. else
  99. CONFIGURE_ARGS+=--disable-editline --disable-readline
  100. endif
  101. define Build/InstallDev
  102. $(INSTALL_DIR) $(1)/usr/include
  103. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  104. $(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3{,ext}.h $(1)/usr/include/
  105. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
  106. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
  107. endef
  108. define Package/libsqlite3/install
  109. $(INSTALL_DIR) $(1)/usr/lib
  110. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
  111. endef
  112. define Package/sqlite3-cli/install
  113. $(INSTALL_DIR) $(1)/usr/bin
  114. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
  115. endef
  116. $(eval $(call BuildPackage,libsqlite3))
  117. $(eval $(call BuildPackage,sqlite3-cli))