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

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

[elpa] externals/pq 04c91e8374 63/63: add pq.el and move pq.c -> pq-core


From: ELPA Syncer
Subject: [elpa] externals/pq 04c91e8374 63/63: add pq.el and move pq.c -> pq-core.c
Date: Mon, 14 Feb 2022 23:24:28 -0500 (EST)

branch: externals/pq
commit 04c91e8374bdfe7c2f973a0123c770910f1341bb
Author: Tom Gillespie <tgbugs@gmail.com>
Commit: Tom Gillespie <tgbugs@gmail.com>

    add pq.el and move pq.c -> pq-core.c
    
    The objective of this is to keep *elpa packaging systems happy by having
    an elisp file that matches the name of the package.
    
    Also updated the Makefile to use emacs to get the version and look for
    emacs-module.h in /usr/share/emacs/${emacs-version}/src/ and in
    /usr/include/emacs-${emacs-major-version}-*/.
---
 Makefile          | 10 +++++++---
 pq.c => pq-core.c |  2 +-
 pq.el             | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index d1cd312d4c..9712526fe1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,20 @@
 EMACS = emacs
+EMACS_VERSION := $(shell $(EMACS) -q --batch --eval "(princ emacs-version)")
+EMACS_MAJOR_VERSION := $(shell $(EMACS) -q --batch --eval "(princ 
emacs-major-version)")
+EMACS_INCLUDE_DIR := $(wildcard /usr/include/emacs-$(EMACS_MAJOR_VERSION)*)
+EMACS_SRC_DIR := /usr/share/emacs/$(EMACS_VERSION)
 
 PG_CONFIG = pg_config
 PGINCLUDEDIR := $(shell $(PG_CONFIG) --includedir)
 
 CC = gcc
-CFLAGS  = -I$(CURDIR) -I$(HOME)/ext/emacs/src/ -I$(PGINCLUDEDIR) -std=gnu99 
-ggdb3 -Wall -fPIC
+CFLAGS  = -I$(CURDIR) -I$(EMACS_INCLUDE_DIR) -I$(EMACS_SRC_DIR) 
-I$(PGINCLUDEDIR) -std=gnu99 -ggdb3 -Wall -fPIC
 LDFLAGS = -lpq
 
 ifeq ($(OS),Windows_NT)
-TARGET = pq.dll
+TARGET = pq-core.dll
 else
-TARGET = pq.so
+TARGET = pq-core.so
 endif
 
 all: $(TARGET)
diff --git a/pq.c b/pq-core.c
similarity index 99%
rename from pq.c
rename to pq-core.c
index abf6e0ee63..83c04c6b04 100644
--- a/pq.c
+++ b/pq-core.c
@@ -452,7 +452,7 @@ emacs_module_init (struct emacs_runtime *ert)
        env->funcall(env, Fdefine_error, 2, args);
   }
 
-  provide(env, "pq");
+  provide(env, "pq-core");
 
   /* loaded successfully */
   return 0;
diff --git a/pq.el b/pq.el
new file mode 100644
index 0000000000..3570882ce7
--- /dev/null
+++ b/pq.el
@@ -0,0 +1,32 @@
+;;; pq.el --- libpq binding
+
+;; Copyright (C) 2020 by Tom Gillespie
+
+;; Author: Tom Gillespie
+;; URL: https://github.com/tgbugs/emacs-libpq
+;; Version: 0.01
+
+;; This program 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 of the License, or
+;; (at your option) any later version.
+
+;; This program 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.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; An almost completely empty wrapper to simplify packaging on *elpa.
+
+;;; Code:
+
+(require 'pq-core)
+
+(provide 'pq)
+
+;;; pq.el ends here



reply via email to

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