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

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

[nongnu] elpa/sqlite3 800a4fc494 40/62: Add sqlite3.el to make installab


From: ELPA Syncer
Subject: [nongnu] elpa/sqlite3 800a4fc494 40/62: Add sqlite3.el to make installable from Melpa
Date: Tue, 14 Mar 2023 11:01:47 -0400 (EDT)

branch: elpa/sqlite3
commit 800a4fc494522eb9bbac4454659095cfba8b4012
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Add sqlite3.el to make installable from Melpa
---
 sqlite3.el | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/sqlite3.el b/sqlite3.el
new file mode 100644
index 0000000000..ee494c1dcb
--- /dev/null
+++ b/sqlite3.el
@@ -0,0 +1,57 @@
+;;; sqlite3.el --- Direct access to the core SQLite3 API  -*- lexical-binding: 
t -*-
+
+;; Copyright (C) 2018-2020  Y. N. Lo
+
+;; Author: Y. N. Lo <gordonynlo@yahoo.com>
+;; Homepage: https://github.com/pekingduck/emacs-sqlite3-api
+;; Keywords: comm, data, sql
+
+;; Package-Requires: ((emacs "25.1"))
+
+;; This file is not part of GNU Emacs.
+
+;; This file is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; This file is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; `sqlite3-api' is a dynamic module for GNU Emacs 25+ that provides
+;; direct access to the core SQLite3 C API from Emacs Lisp.
+
+;;; Code:
+
+(require 'cl-lib)
+
+(defvar sqlite3-api-build-command '("make" "all"))
+
+(cl-eval-when (load eval)
+  (unless (require 'sqlite3-api nil t)
+    (if (yes-or-no-p "sqlite3-api module must be build.  Do so now? ")
+        (let ((default-directory (file-name-directory (or load-file-name
+                                                          buffer-file-name))))
+          (with-temp-buffer
+            (unless (zerop (apply #'call-process
+                                  (car sqlite3-api-build-command) nil t t
+                                  (cdr sqlite3-api-build-command)))
+              (error "Failed to compile module using: %s: %s"
+                     (mapconcat #'identity sqlite3-api-build-command " ")
+                     (buffer-substring-no-properties
+                      (point-min)
+                      (point-max))))))
+      (user-error "Abort"))))
+
+(provide 'sqlite3)
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
+;;; sqlite3.el ends here



reply via email to

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