emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/emacsql 017cd8460d 329/427: Use own data root in emacsql-s


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 017cd8460d 329/427: Use own data root in emacsql-sqlite.
Date: Tue, 13 Dec 2022 02:59:57 -0500 (EST)

branch: elpa/emacsql
commit 017cd8460d85aa79af43d3044fdd8fbe15aeecc7
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Use own data root in emacsql-sqlite.
---
 emacsql-sqlite.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/emacsql-sqlite.el b/emacsql-sqlite.el
index 73e1f803f4..fae07dd136 100644
--- a/emacsql-sqlite.el
+++ b/emacsql-sqlite.el
@@ -45,13 +45,18 @@ version."
 
 ;;; SQLite connection
 
+(cl-eval-when (load compile)
+  (defvar emacsql-sqlite-data-root
+    (file-name-directory (or load-file-name buffer-file-name))
+    "Directory where EmacSQL is installed."))
+
 (cl-eval-when (load compile)
   (defvar emacsql-sqlite-executable
     (expand-file-name (format "bin/emacsql-sqlite-%s%s" (emacsql-system-tuple)
                               (if (memq system-type '(windows-nt cygwin 
ms-dos))
                                   ".exe"
                                 ""))
-                      emacsql-data-root)
+                      emacsql-sqlite-data-root)
     "Path to the EmacSQL backend (this is not the sqlite3 shell)."))
 
 (defvar emacsql-sqlite-reserved
@@ -144,7 +149,7 @@ buffer. This is for debugging purposes."
 
 (defun emacsql-sqlite-compile-switches ()
   "Return the compilation switches from the Makefile under sqlite/."
-  (let ((makefile (expand-file-name "sqlite/Makefile" emacsql-data-root))
+  (let ((makefile (expand-file-name "sqlite/Makefile" 
emacsql-sqlite-data-root))
         (case-fold-search nil))
     (with-temp-buffer
       (insert-file-contents makefile)
@@ -156,7 +161,7 @@ buffer. This is for debugging purposes."
   "Compile the SQLite back-end for EmacSQL, returning non-nil on success.
 If called with non-nil ASYNC the return value is meaningless."
   (let* ((cc (executable-find "cc"))
-         (src (expand-file-name "sqlite" emacsql-data-root))
+         (src (expand-file-name "sqlite" emacsql-sqlite-data-root))
          (files (mapcar (lambda (f) (expand-file-name f src))
                         '("sqlite3.c" "emacsql.c")))
          (cflags (list (format "-I%s" src) (format "-O%d" (or o-level 2))))
@@ -170,7 +175,7 @@ If called with non-nil ASYNC the return value is 
meaningless."
           ((not emacsql-sqlite-automatic-build)
            (prog1 nil
              (message "Local SQLite build disabled, skipping")))
-          (t (mkdir (expand-file-name "bin" emacsql-data-root) t)
+          (t (mkdir (expand-file-name "bin" emacsql-sqlite-data-root) t)
              (message "Compiling EmacSQL SQLite binary ...")
              (let ((log (get-buffer-create byte-compile-log-buffer)))
                (with-current-buffer log



reply via email to

[Prev in Thread] Current Thread [Next in Thread]