branch: elpa/emacsql
commit fbe3627422964b4e6f3702bc0b2769d35c398571
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    Show no warnings when dependencies are missing
    
    Until now we distributed each back-end as a separate package,
    which made sure that all of its dependencies are available.
    
    The maintainers of NonGNU Elpa want to distribute all back-ends
    as a single package.  We cannot make that package depend on all
    dependencies of all the optional back-ends, so instead we have
    to suppress warnings about missing dependencies.
    
    Because some of the missing functions from back-end libraries are
    implemented in C, `declare-function' does not succeed in convincing
    `check-declare-directory'.  So we have to stop relying on the latter
    as well.  It's all a bit unfortunate.
---
 Makefile                  | 4 ++--
 emacsql-sqlite-builtin.el | 6 +++++-
 emacsql-sqlite-module.el  | 8 +++++++-
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 5cb01bf168..26a3666b63 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ binary: sqlite/emacsql-sqlite
 sqlite/emacsql-sqlite:
        $(MAKE) -C sqlite
 
-lisp: $(ELCS) loaddefs check-declare
+lisp: $(ELCS) loaddefs
 
 loaddefs: $(PKG)-autoloads.el
 
@@ -74,7 +74,7 @@ $(PKG)-autoloads.el: $(ELS)
       (coding-system-for-write 'utf-8-emacs-unix))\
   (write-region (autoload-rubric file \"package\" nil) nil file nil 'silent)\
   (cl-letf (((symbol-function 'progress-reporter-do-update) (lambda (&rest 
_)))\
-            ((symbol-function 'progress-reporter-done) (lambda (_))))\
+           ((symbol-function 'progress-reporter-done) (lambda (_))))\
     (let ((generated-autoload-file file))\
       (update-directory-autoloads default-directory))))" \
        2>&1 | sed "/^Package autoload is deprecated$$/d"
diff --git a/emacsql-sqlite-builtin.el b/emacsql-sqlite-builtin.el
index b65d6df3d9..a5fadd2988 100644
--- a/emacsql-sqlite-builtin.el
+++ b/emacsql-sqlite-builtin.el
@@ -16,9 +16,13 @@
 
 ;;; Code:
 
-(require 'sqlite)
 (require 'emacsql)
 
+(unless (require 'sqlite nil t)
+  (declare-function sqlite-open "sqlite")
+  (declare-function sqlite-select "sqlite")
+  (declare-function sqlite-close "sqlite"))
+
 (emacsql-register-reserved emacsql-sqlite-reserved)
 
 (defclass emacsql-sqlite-builtin-connection (emacsql-connection)
diff --git a/emacsql-sqlite-module.el b/emacsql-sqlite-module.el
index dd3c99fee8..617cbc7d84 100644
--- a/emacsql-sqlite-module.el
+++ b/emacsql-sqlite-module.el
@@ -16,9 +16,15 @@
 
 ;;; Code:
 
-(require 'sqlite3)
 (require 'emacsql)
 
+(unless (require 'sqlite3 nil t)
+  (declare-function sqlite3-open "sqlite3-api")
+  (declare-function sqlite3-exec "sqlite3-api")
+  (declare-function sqlite3-close "sqlite3-api"))
+(defvar sqlite-open-readwrite)
+(defvar sqlite-open-create)
+
 (emacsql-register-reserved emacsql-sqlite-reserved)
 
 (defclass emacsql-sqlite-module-connection (emacsql-connection)

Reply via email to