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

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

[nongnu] elpa/sqlite3 5218e49511 41/62: Merge pull request #2 from tarsi


From: ELPA Syncer
Subject: [nongnu] elpa/sqlite3 5218e49511 41/62: Merge pull request #2 from tarsiiformes/melpa
Date: Tue, 14 Mar 2023 11:01:47 -0400 (EDT)

branch: elpa/sqlite3
commit 5218e4951129200f7e3653ead92e015f2b3d22d0
Merge: 9a2dbb9dc2 800a4fc494
Author: Peking Duck <pekingduck@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #2 from tarsiiformes/melpa
    
    Add a wrapper library so that this package can be distributed on Melpa
---
 Makefile   | 10 +++++-----
 sqlite3.el | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index b9d329ee3a..6dd70593f8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,15 @@
-CC = gcc
-INC=-I.
-LIB=-lsqlite3
+CC  ?= gcc
+INC ?= -I.
+LIB ?= -lsqlite3
 
 ifeq ($(HOMEBREW), 1)
  INC=-I/usr/local/opt/sqlite3/include
  LIB=-L/usr/local/opt/sqlite3/lib -lsqlite3
 endif
 
-CFLAGS=-g3 -Wall -std=c99 $(INC)
+CFLAGS ?= -g3 -Wall -std=c99 $(INC)
 
-EMACS=/Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14
+EMACS ?= /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14
 
 # Melpa package
 PKG=sqlite3-api
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]