View | Details | Raw Unified | Return to bug 255958 | Differences between
and this patch

Collapse All | Expand All

(-)b/databases/Makefile (+1 lines)
Lines 65-70 Link Here
65
    SUBDIR += elixir-mongo
65
    SUBDIR += elixir-mongo
66
    SUBDIR += elixir-postgrex
66
    SUBDIR += elixir-postgrex
67
    SUBDIR += elixir-timex_ecto
67
    SUBDIR += elixir-timex_ecto
68
    SUBDIR += emacsql
68
    SUBDIR += erlang-couchbeam
69
    SUBDIR += erlang-couchbeam
69
    SUBDIR += erlang-epgsql
70
    SUBDIR += erlang-epgsql
70
    SUBDIR += erlang-eredis
71
    SUBDIR += erlang-eredis
(-)b/databases/emacsql/Makefile (+46 lines)
Added Link Here
1
PORTNAME=	emacsql
2
DISTVERSION=	3.0.0-14
3
DISTVERSIONSUFFIX=	-g6d8cd93
4
CATEGORIES=	databases elisp
5
PKGNAMESUFFIX=	${EMACS_PKGNAMESUFFIX}
6
7
MAINTAINER=	yasu@utahime.org
8
COMMENT=	High-level Emacs Lisp RDBMS front-end
9
10
LICENSE=	UNLICENSE
11
LICENSE_FILE=	${WRKSRC}/UNLICENSE
12
13
BUILD_DEPENDS=	pg.el${EMACS_PKGNAMESUFFIX}>=0.13:databases/pg.el@${EMACS_FLAVOR}
14
LIB_DEPENDS=	libsqlite3.so:databases/sqlite3
15
RUN_DEPENDS=	pg.el${EMACS_PKGNAMESUFFIX}>=0.13:databases/pg.el@${EMACS_FLAVOR}
16
17
USES=		emacs localbase:ldflags
18
19
USE_GITHUB=	yes
20
GH_ACCOUNT=	skeeto
21
22
MAKE_ENV+=	LOAD_PATH="-L ${PREFIX}/${EMACS_SITE_LISPDIR} -L ${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}"
23
ALL_TARGET=	binary compile
24
TEST_TARGET=	check
25
26
PORTDOCS=	README.md
27
28
OPTIONS_DEFINE=	DOCS
29
30
post-patch:
31
	${RM} ${WRKSRC}/sqlite/sqlite3.[ch]
32
	${REINPLACE_CMD} 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/emacsql-sqlite.el
33
34
do-install:
35
	@${MKDIR} ${STAGEDIR}${PREFIX}/bin \
36
		${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/${PORTNAME}
37
	${INSTALL_PROGRAM} ${WRKSRC}/sqlite/emacsql-sqlite \
38
		${STAGEDIR}${PREFIX}/bin
39
	${INSTALL_DATA} ${WRKSRC}/*.el ${WRKSRC}/*.elc \
40
		${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/${PORTNAME}
41
42
do-install-DOCS-on:
43
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
44
	${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR}
45
46
.include <bsd.port.mk>
(-)b/databases/emacsql/distinfo (+3 lines)
Added Link Here
1
TIMESTAMP = 1621275191
2
SHA256 (skeeto-emacsql-3.0.0-14-g6d8cd93_GH0.tar.gz) = 820258612e19c137a2ab3f5c1eb3c292f28358aa4410eb211ce509bb5693e8ee
3
SIZE (skeeto-emacsql-3.0.0-14-g6d8cd93_GH0.tar.gz) = 2057085
(-)b/databases/emacsql/files/patch-Makefile (+12 lines)
Added Link Here
1
--- Makefile.orig	2021-05-17 18:22:23 UTC
2
+++ Makefile
3
@@ -7,8 +7,7 @@
4
 .POSIX:
5
 .SUFFIXES: .el .elc
6
 EMACS   = emacs
7
-LDFLAGS = -L ../pg
8
-BATCH   = $(EMACS) -batch -Q -L . -L tests $(LDFLAGS)
9
+BATCH   = $(EMACS) -batch -Q -L . -L tests $(LOAD_PATH)
10
 
11
 EL = emacsql-compiler.el \
12
      emacsql.el \
(-)b/databases/emacsql/files/patch-emacsql-sqlite.el (+43 lines)
Added Link Here
1
--- emacsql-sqlite.el.orig	2020-07-14 00:28:59 UTC
2
+++ emacsql-sqlite.el
3
@@ -33,16 +33,7 @@
4
     "sqlite/emacsql-sqlite")
5
   "Relative path to emacsql executable.")
6
 
7
-(defvar emacsql-sqlite-executable
8
-  (expand-file-name emacsql-sqlite-executable-path
9
-                    (if (or (file-writable-p emacsql-sqlite-data-root)
10
-                            (file-exists-p (expand-file-name
11
-                                            emacsql-sqlite-executable-path
12
-                                            emacsql-sqlite-data-root)))
13
-                        emacsql-sqlite-data-root
14
-                      (expand-file-name
15
-                       (concat "emacsql/" emacsql-version)
16
-                       user-emacs-directory)))
17
+(defvar emacsql-sqlite-executable "%%PREFIX%%/bin/emacsql-sqlite"
18
   "Path to the EmacSQL backend (this is not the sqlite3 shell).")
19
 
20
 (defvar emacsql-sqlite-reserved
21
@@ -100,6 +91,7 @@ used.")
22
     (emacsql-wait connection)
23
     (emacsql connection [:pragma (= busy-timeout $s1)]
24
              (/ (* emacsql-global-timeout 1000) 2))
25
+    (emacsql connection [:pragma (= foreign_keys 1)])
26
     (emacsql-register connection)))
27
 
28
 (cl-defun emacsql-sqlite (file &key debug)
29
@@ -163,12 +155,11 @@ If called with non-nil ASYNC the return value is meani
30
                       if path return it))
31
          (src (expand-file-name "sqlite" emacsql-sqlite-data-root))
32
          (files (mapcar (lambda (f) (expand-file-name f src))
33
-                        '("sqlite3.c" "emacsql.c")))
34
+                        '("emacsql.c")))
35
          (cflags (list (format "-I%s" src) (format "-O%d" (or o-level 2))))
36
          (ldlibs (cl-case system-type
37
                    (windows-nt (list))
38
-                   (berkeley-unix (list "-lm"))
39
-                   (otherwise (list "-lm" "-ldl"))))
40
+                   (otherwise (list "-lsqlite3"))))
41
          (options (emacsql-sqlite-compile-switches))
42
          (output (list "-o" emacsql-sqlite-executable))
43
          (arguments (nconc cflags options files ldlibs output)))
(-)b/databases/emacsql/files/patch-sqlite_Makefile (+22 lines)
Added Link Here
1
--- sqlite/Makefile.orig	2020-07-14 00:28:59 UTC
2
+++ sqlite/Makefile
3
@@ -1,6 +1,6 @@
4
 .POSIX:
5
-LDLIBS = -ldl -lm
6
-CFLAGS = -O2 -Wall -Wextra \
7
+LDLIBS = -lsqlite3
8
+CFLAGS += \
9
     -DSQLITE_THREADSAFE=0 \
10
     -DSQLITE_DEFAULT_FOREIGN_KEYS=1 \
11
     -DSQLITE_ENABLE_FTS5 \
12
@@ -10,8 +10,8 @@ CFLAGS = -O2 -Wall -Wextra \
13
     -DSQLITE_ENABLE_JSON1 \
14
     -DSQLITE_SOUNDEX
15
 
16
-emacsql-sqlite: emacsql.c sqlite3.c
17
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ emacsql.c sqlite3.c $(LDLIBS)
18
+emacsql-sqlite: emacsql.c
19
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ emacsql.c $(LDLIBS)
20
 
21
 clean:
22
 	rm -f emacsql-sqlite
(-)b/databases/emacsql/files/patch-sqlite_emacsql.c (+11 lines)
Added Link Here
1
--- sqlite/emacsql.c.orig	2020-07-14 00:28:59 UTC
2
+++ sqlite/emacsql.c
3
@@ -1,7 +1,7 @@
4
 #include <stdio.h>
5
 #include <stdlib.h>
6
 #include <string.h>
7
-#include "sqlite3.h"
8
+#include <sqlite3.h>
9
 
10
 #define TRUE 1
11
 #define FALSE 0
(-)b/databases/emacsql/pkg-descr (+14 lines)
Added Link Here
1
EmacSQL is a high-level Emacs Lisp front-end for SQLite (primarily),
2
PostgreSQL, MySQL, and potentially other SQL databases.
3
4
It works by maintaining a inferior process running (a "connection")
5
for interacting with the back-end database. Connections are
6
automatically cleaned up if they are garbage collected. All requests
7
are synchronous.
8
9
Any readable lisp value can be stored as a value in EmacSQL, including
10
numbers, strings, symbols, lists, vectors, and closures. EmacSQL has
11
no concept of "TEXT" values; it's all just lisp objects. The lisp
12
object nil corresponds 1:1 with NULL in the database.
13
14
WWW: https://github.com/skeeto/emacsql
(-)b/databases/emacsql/pkg-plist (-1 / +13 lines)
Added Link Here
0
- 
1
bin/emacsql-sqlite
2
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-compiler.el
3
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-compiler.elc
4
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-mysql.el
5
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-mysql.elc
6
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-pg.el
7
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-pg.elc
8
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-psql.el
9
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-psql.elc
10
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-sqlite.el
11
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql-sqlite.elc
12
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql.el
13
%%EMACS_VERSION_SITE_LISPDIR%%/emacsql/emacsql.elc

Return to bug 255958