FreeBSD Bugzilla – Attachment 225045 Details for
Bug 255958
New port: databases/emacsql High-level Emacs Lisp RDBMS front-end
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch file
databases_emacsql.patch (text/plain), 9.89 KB, created by
Yasuhiro Kimura
on 2021-05-17 23:49:21 UTC
(
hide
)
Description:
Patch file
Filename:
MIME Type:
Creator:
Yasuhiro Kimura
Created:
2021-05-17 23:49:21 UTC
Size:
9.89 KB
patch
obsolete
>From bcfb550751788b22c56ed654e64c3ca0d60173f8 Mon Sep 17 00:00:00 2001 >From: Yasuhiro Kimura <yasu@utahime.org> >Date: Tue, 18 May 2021 02:23:05 +0900 >Subject: [PATCH] New port: databases/emacsql High-level Emacs Lisp RDBMS > front-end > >EmacSQL is a high-level Emacs Lisp front-end for SQLite (primarily), >PostgreSQL, MySQL, and potentially other SQL databases. > >It works by maintaining a inferior process running (a "connection") >for interacting with the back-end database. Connections are >automatically cleaned up if they are garbage collected. All requests >are synchronous. > >Any readable lisp value can be stored as a value in EmacSQL, including >numbers, strings, symbols, lists, vectors, and closures. EmacSQL has >no concept of "TEXT" values; it's all just lisp objects. The lisp >object nil corresponds 1:1 with NULL in the database. >--- > databases/Makefile | 1 + > databases/emacsql/Makefile | 46 +++++++++++++++++++ > databases/emacsql/distinfo | 3 ++ > databases/emacsql/files/patch-Makefile | 12 +++++ > .../emacsql/files/patch-emacsql-sqlite.el | 43 +++++++++++++++++ > databases/emacsql/files/patch-sqlite_Makefile | 22 +++++++++ > .../emacsql/files/patch-sqlite_emacsql.c | 11 +++++ > databases/emacsql/pkg-descr | 14 ++++++ > databases/emacsql/pkg-plist | 13 ++++++ > 9 files changed, 165 insertions(+) > create mode 100644 databases/emacsql/Makefile > create mode 100644 databases/emacsql/distinfo > create mode 100644 databases/emacsql/files/patch-Makefile > create mode 100644 databases/emacsql/files/patch-emacsql-sqlite.el > create mode 100644 databases/emacsql/files/patch-sqlite_Makefile > create mode 100644 databases/emacsql/files/patch-sqlite_emacsql.c > create mode 100644 databases/emacsql/pkg-descr > create mode 100644 databases/emacsql/pkg-plist > >diff --git a/databases/Makefile b/databases/Makefile >index 630eb0789b43..f2a6ba62a5ad 100644 >--- a/databases/Makefile >+++ b/databases/Makefile >@@ -65,6 +65,7 @@ > SUBDIR += elixir-mongo > SUBDIR += elixir-postgrex > SUBDIR += elixir-timex_ecto >+ SUBDIR += emacsql > SUBDIR += erlang-couchbeam > SUBDIR += erlang-epgsql > SUBDIR += erlang-eredis >diff --git a/databases/emacsql/Makefile b/databases/emacsql/Makefile >new file mode 100644 >index 000000000000..8e1339d2cec0 >--- /dev/null >+++ b/databases/emacsql/Makefile >@@ -0,0 +1,46 @@ >+PORTNAME= emacsql >+DISTVERSION= 3.0.0-14 >+DISTVERSIONSUFFIX= -g6d8cd93 >+CATEGORIES= databases elisp >+PKGNAMESUFFIX= ${EMACS_PKGNAMESUFFIX} >+ >+MAINTAINER= yasu@utahime.org >+COMMENT= High-level Emacs Lisp RDBMS front-end >+ >+LICENSE= UNLICENSE >+LICENSE_FILE= ${WRKSRC}/UNLICENSE >+ >+BUILD_DEPENDS= pg.el${EMACS_PKGNAMESUFFIX}>=0.13:databases/pg.el@${EMACS_FLAVOR} >+LIB_DEPENDS= libsqlite3.so:databases/sqlite3 >+RUN_DEPENDS= pg.el${EMACS_PKGNAMESUFFIX}>=0.13:databases/pg.el@${EMACS_FLAVOR} >+ >+USES= emacs localbase:ldflags >+ >+USE_GITHUB= yes >+GH_ACCOUNT= skeeto >+ >+MAKE_ENV+= LOAD_PATH="-L ${PREFIX}/${EMACS_SITE_LISPDIR} -L ${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}" >+ALL_TARGET= binary compile >+TEST_TARGET= check >+ >+PORTDOCS= README.md >+ >+OPTIONS_DEFINE= DOCS >+ >+post-patch: >+ ${RM} ${WRKSRC}/sqlite/sqlite3.[ch] >+ ${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/emacsql-sqlite.el >+ >+do-install: >+ @${MKDIR} ${STAGEDIR}${PREFIX}/bin \ >+ ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/${PORTNAME} >+ ${INSTALL_PROGRAM} ${WRKSRC}/sqlite/emacsql-sqlite \ >+ ${STAGEDIR}${PREFIX}/bin >+ ${INSTALL_DATA} ${WRKSRC}/*.el ${WRKSRC}/*.elc \ >+ ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/${PORTNAME} >+ >+do-install-DOCS-on: >+ @${MKDIR} ${STAGEDIR}${DOCSDIR} >+ ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} >+ >+.include <bsd.port.mk> >diff --git a/databases/emacsql/distinfo b/databases/emacsql/distinfo >new file mode 100644 >index 000000000000..bdda1209745b >--- /dev/null >+++ b/databases/emacsql/distinfo >@@ -0,0 +1,3 @@ >+TIMESTAMP = 1621275191 >+SHA256 (skeeto-emacsql-3.0.0-14-g6d8cd93_GH0.tar.gz) = 820258612e19c137a2ab3f5c1eb3c292f28358aa4410eb211ce509bb5693e8ee >+SIZE (skeeto-emacsql-3.0.0-14-g6d8cd93_GH0.tar.gz) = 2057085 >diff --git a/databases/emacsql/files/patch-Makefile b/databases/emacsql/files/patch-Makefile >new file mode 100644 >index 000000000000..f3ffc1349e85 >--- /dev/null >+++ b/databases/emacsql/files/patch-Makefile >@@ -0,0 +1,12 @@ >+--- Makefile.orig 2021-05-17 18:22:23 UTC >++++ Makefile >+@@ -7,8 +7,7 @@ >+ .POSIX: >+ .SUFFIXES: .el .elc >+ EMACS = emacs >+-LDFLAGS = -L ../pg >+-BATCH = $(EMACS) -batch -Q -L . -L tests $(LDFLAGS) >++BATCH = $(EMACS) -batch -Q -L . -L tests $(LOAD_PATH) >+ >+ EL = emacsql-compiler.el \ >+ emacsql.el \ >diff --git a/databases/emacsql/files/patch-emacsql-sqlite.el b/databases/emacsql/files/patch-emacsql-sqlite.el >new file mode 100644 >index 000000000000..6f76c8d9e152 >--- /dev/null >+++ b/databases/emacsql/files/patch-emacsql-sqlite.el >@@ -0,0 +1,43 @@ >+--- emacsql-sqlite.el.orig 2020-07-14 00:28:59 UTC >++++ emacsql-sqlite.el >+@@ -33,16 +33,7 @@ >+ "sqlite/emacsql-sqlite") >+ "Relative path to emacsql executable.") >+ >+-(defvar emacsql-sqlite-executable >+- (expand-file-name emacsql-sqlite-executable-path >+- (if (or (file-writable-p emacsql-sqlite-data-root) >+- (file-exists-p (expand-file-name >+- emacsql-sqlite-executable-path >+- emacsql-sqlite-data-root))) >+- emacsql-sqlite-data-root >+- (expand-file-name >+- (concat "emacsql/" emacsql-version) >+- user-emacs-directory))) >++(defvar emacsql-sqlite-executable "%%PREFIX%%/bin/emacsql-sqlite" >+ "Path to the EmacSQL backend (this is not the sqlite3 shell).") >+ >+ (defvar emacsql-sqlite-reserved >+@@ -100,6 +91,7 @@ used.") >+ (emacsql-wait connection) >+ (emacsql connection [:pragma (= busy-timeout $s1)] >+ (/ (* emacsql-global-timeout 1000) 2)) >++ (emacsql connection [:pragma (= foreign_keys 1)]) >+ (emacsql-register connection))) >+ >+ (cl-defun emacsql-sqlite (file &key debug) >+@@ -163,12 +155,11 @@ If called with non-nil ASYNC the return value is meani >+ if path return it)) >+ (src (expand-file-name "sqlite" emacsql-sqlite-data-root)) >+ (files (mapcar (lambda (f) (expand-file-name f src)) >+- '("sqlite3.c" "emacsql.c"))) >++ '("emacsql.c"))) >+ (cflags (list (format "-I%s" src) (format "-O%d" (or o-level 2)))) >+ (ldlibs (cl-case system-type >+ (windows-nt (list)) >+- (berkeley-unix (list "-lm")) >+- (otherwise (list "-lm" "-ldl")))) >++ (otherwise (list "-lsqlite3")))) >+ (options (emacsql-sqlite-compile-switches)) >+ (output (list "-o" emacsql-sqlite-executable)) >+ (arguments (nconc cflags options files ldlibs output))) >diff --git a/databases/emacsql/files/patch-sqlite_Makefile b/databases/emacsql/files/patch-sqlite_Makefile >new file mode 100644 >index 000000000000..463df817ee70 >--- /dev/null >+++ b/databases/emacsql/files/patch-sqlite_Makefile >@@ -0,0 +1,22 @@ >+--- sqlite/Makefile.orig 2020-07-14 00:28:59 UTC >++++ sqlite/Makefile >+@@ -1,6 +1,6 @@ >+ .POSIX: >+-LDLIBS = -ldl -lm >+-CFLAGS = -O2 -Wall -Wextra \ >++LDLIBS = -lsqlite3 >++CFLAGS += \ >+ -DSQLITE_THREADSAFE=0 \ >+ -DSQLITE_DEFAULT_FOREIGN_KEYS=1 \ >+ -DSQLITE_ENABLE_FTS5 \ >+@@ -10,8 +10,8 @@ CFLAGS = -O2 -Wall -Wextra \ >+ -DSQLITE_ENABLE_JSON1 \ >+ -DSQLITE_SOUNDEX >+ >+-emacsql-sqlite: emacsql.c sqlite3.c >+- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ emacsql.c sqlite3.c $(LDLIBS) >++emacsql-sqlite: emacsql.c >++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ emacsql.c $(LDLIBS) >+ >+ clean: >+ rm -f emacsql-sqlite >diff --git a/databases/emacsql/files/patch-sqlite_emacsql.c b/databases/emacsql/files/patch-sqlite_emacsql.c >new file mode 100644 >index 000000000000..24590656df22 >--- /dev/null >+++ b/databases/emacsql/files/patch-sqlite_emacsql.c >@@ -0,0 +1,11 @@ >+--- sqlite/emacsql.c.orig 2020-07-14 00:28:59 UTC >++++ sqlite/emacsql.c >+@@ -1,7 +1,7 @@ >+ #include <stdio.h> >+ #include <stdlib.h> >+ #include <string.h> >+-#include "sqlite3.h" >++#include <sqlite3.h> >+ >+ #define TRUE 1 >+ #define FALSE 0 >diff --git a/databases/emacsql/pkg-descr b/databases/emacsql/pkg-descr >new file mode 100644 >index 000000000000..a5076f716a34 >--- /dev/null >+++ b/databases/emacsql/pkg-descr >@@ -0,0 +1,14 @@ >+EmacSQL is a high-level Emacs Lisp front-end for SQLite (primarily), >+PostgreSQL, MySQL, and potentially other SQL databases. >+ >+It works by maintaining a inferior process running (a "connection") >+for interacting with the back-end database. Connections are >+automatically cleaned up if they are garbage collected. All requests >+are synchronous. >+ >+Any readable lisp value can be stored as a value in EmacSQL, including >+numbers, strings, symbols, lists, vectors, and closures. EmacSQL has >+no concept of "TEXT" values; it's all just lisp objects. The lisp >+object nil corresponds 1:1 with NULL in the database. >+ >+WWW: https://github.com/skeeto/emacsql >diff --git a/databases/emacsql/pkg-plist b/databases/emacsql/pkg-plist >new file mode 100644 >index 000000000000..c80325c828a1 >--- /dev/null >+++ b/databases/emacsql/pkg-plist >@@ -0,0 +1,13 @@ >+bin/emacsql-sqlite >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-compiler.el >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-compiler.elc >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-mysql.el >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-mysql.elc >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-pg.el >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-pg.elc >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-psql.el >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-psql.elc >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-sqlite.el >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-sqlite.elc >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql.el >+%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql.elc >-- >2.31.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 255958
:
225045
|
225135