[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 521a4bfde5 132/166: BUILD: replaced Makefile wi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 521a4bfde5 132/166: BUILD: replaced Makefile with CMakeLists.txt |
Date: |
Fri, 30 Sep 2022 04:59:32 -0400 (EDT) |
branch: elpa/sweeprolog
commit 521a4bfde514f8cdb13df3c1cf9c7779b335933a
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
BUILD: replaced Makefile with CMakeLists.txt
---
.build.yml | 52 ----------------------------------------------------
CMakeLists.txt | 22 ++++++++++++++++++++++
Makefile | 51 ---------------------------------------------------
sweep.el | 24 ++++++++++++++----------
4 files changed, 36 insertions(+), 113 deletions(-)
diff --git a/.build.yml b/.build.yml
deleted file mode 100644
index 255b3c027c..0000000000
--- a/.build.yml
+++ /dev/null
@@ -1,52 +0,0 @@
-image: debian/stable
-packages:
- - build-essential
- - cmake
- - ninja-build
- - pkg-config
- - ncurses-dev
- - libreadline-dev
- - libedit-dev
- - libgoogle-perftools-dev
- - libgmp-dev
- - libssl-dev
- - unixodbc-dev
- - zlib1g-dev
- - libarchive-dev
- - libossp-uuid-dev
- - libxext-dev
- - libice-dev
- - libjpeg-dev
- - libxinerama-dev
- - libxft-dev
- - libxpm-dev
- - libxt-dev
- - libdb-dev
- - libpcre2-dev
- - libyaml-dev
- - zip
- - git
- - emacs
-secrets:
- - 750079bb-9735-473b-bebf-db897c9f0c6b
- - 72d5c3dc-f83f-4cc2-96e3-b2b08f6ee8a0
-sources:
- - git@git.sr.ht:~eshel/sweep
-tasks:
- - getswipl: |
- git clone --recursive https://github.com/SWI-Prolog/swipl-devel.git
- cd swipl-devel
- mkdir build
- cd build
- export LANG="en_US.UTF-8"
- sudo localectl set-locale LANG=en_US.UTF-8
- localectl set-locale LANG=en_US.UTF-8
- cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DSWIPL_INSTALL_IN_LIB=ON
-DSWIPL_PACKAGES_ODBC=OFF -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF
-DINSTALL_DOCUMENTATION=OFF -G Ninja ..
- ninja
- sudo ninja install
- - build: |
- cd sweep
- export LD_LIBRARY_PATH=/usr/local/lib
- make
- make sweep.info
- LD_PRELOAD=/usr/local/lib/libswipl.so make check
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000..2f2f561a61
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.5)
+project(swipl-sweep)
+
+include("../cmake/PrologPackage.cmake")
+
+find_program(EMACS Emacs)
+
+find_path(
+ EMACS_INCLUDE_DIR
+ NAMES "emacs-module.h"
+ PATHS /Applications/Emacs.app/Contents/Resources/include
+)
+
+if(EMACS_INCLUDE_DIR)
+
+swipl_plugin(
+ sweep-module
+ C_SOURCES sweep.c
+ C_INCLUDE_DIR ${EMACS_INCLUDE_DIR}
+ PL_LIBS sweep.pl)
+
+endif(EMACS_INCLUDE_DIR)
diff --git a/Makefile b/Makefile
deleted file mode 100644
index ca0f96d6c0..0000000000
--- a/Makefile
+++ /dev/null
@@ -1,51 +0,0 @@
-BASENAME = sweep
-
-UNAME_S := $(shell uname -s)
-ifeq ($(UNAME_S),Linux)
- SOEXT = so
-endif
-ifeq ($(UNAME_S),Darwin)
- SOEXT = dylib
-endif
-
-SWIPL ?= swipl
-SWIPLBASE = $(shell $(SWIPL) --dump-runtime-variables | grep PLBASE | cut
-f 2 -d = | cut -f 1 -d ';')
-SWIPLLIBDIR = $(shell $(SWIPL) --dump-runtime-variables | grep PLLIBDIR | cut
-f 2 -d = | cut -f 1 -d ';')
-
-EMACS ?= emacs
-
-TARGET = $(BASENAME)-module.$(SOEXT)
-OBJECT = $(BASENAME).o
-SOURCE = $(BASENAME).c
-
-LDFLAGS += -shared
-LDFLAGS += -L$(SWIPLLIBDIR)
-LDFLAGS += -lswipl
-
-CFLAGS += -fPIC
-CFLAGS += -Wall
-CFLAGS += -Wextra
-CFLAGS += -O2
-CFLAGS += -I$(SWIPLBASE)/include
-
-.PHONY: clean all check info
-
-all: $(TARGET)
-
-$(OBJECT): $(SOURCE)
- $(CC) $(CFLAGS) -o $@ -c $(SOURCE)
-
-$(TARGET): $(OBJECT)
- $(CC) -o $@ $(OBJECT) $(LDFLAGS)
-
-clean:
- rm -f $(TARGET) $(OBJECT) $(BASENAME).info $(BASENAME).texi
$(BASENAME).html
-
-info: $(BASENAME).info
-$(BASENAME).info:: README.org
- $(EMACS) -Q --batch --eval "(require 'ox-texinfo)" \
- --eval "(with-current-buffer (find-file \"README.org\")
(org-export-to-file (quote texinfo) \"$@\" nil nil nil nil nil (quote
org-texinfo-compile)))"
-
-check: $(TARGET)
- $(EMACS) --batch --eval '(add-to-list (quote load-path)
(expand-file-name "."))' \
- -l ert -l sweep -l sweep-tests.el -f
ert-run-tests-batch-and-exit
diff --git a/sweep.el b/sweep.el
index a9c9c311b0..9291e97b75 100644
--- a/sweep.el
+++ b/sweep.el
@@ -121,9 +121,9 @@ inserted to the input history in `sweep-top-level-mode'
buffers."
:type 'boolean
:group 'sweep)
-(defcustom sweep-init-args (list (expand-file-name
- "sweep.pl"
- (file-name-directory load-file-name)))
+(defcustom sweep-init-args (list "-q"
+ "--no-signals"
+ "-g [library(sweep)]")
"List of strings used as initialization arguments for Prolog."
:package-version '((sweep "0.1.0"))
:type '(list string)
@@ -156,12 +156,16 @@ inserted to the input history in `sweep-top-level-mode'
buffers."
(declare-function sweep-cleanup "sweep-module")
(defun sweep--ensure-module ()
- (unless (require 'sweep-module nil t)
- (if (y-or-n-p "Sweep needs `sweep-module' to work. Compile it now? ")
- (progn
- (sweep--compile-module)
- (require 'sweep-module))
- (error "Sweep will not work until `sweep-module' is compiled!"))))
+ (let ((swipl-lib-dir (car
+ (split-string-and-unquote
+ (shell-command-to-string
+ (concat
+ (or sweep-swipl-path (executable-find "swipl"))
+ " --dump-runtime-variables |"
+ " grep PLLIBDIR |"
+ " cut -f 2 -d = |"
+ " cut -f 1 -d ';'"))))))
+ (load (expand-file-name "sweep-module" swipl-lib-dir))))
(defface sweep-debug-prefix-face
@@ -301,7 +305,7 @@ FLAG and VALUE are specified as strings and read as Prolog
terms."
(defun sweep-init ()
(apply #'sweep-initialize
(cons (or sweep-swipl-path (executable-find "swipl"))
- (cons "-q" (cons "--no-signals" sweep-init-args))))
+ sweep-init-args))
(sweep-setup-message-hook)
(sweep-start-prolog-server))
- [nongnu] elpa/sweeprolog a6e37f306b 069/166: ENHANCED: fontify mutlifile predicate calls in a dedicated face, (continued)
- [nongnu] elpa/sweeprolog a6e37f306b 069/166: ENHANCED: fontify mutlifile predicate calls in a dedicated face, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 4299c39d62 070/166: ENHANCED: indentation edge cases handling, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 1a19f7b3be 074/166: DOC: document font-lock and xref integration for sweep-mode, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 1c6d2e96a8 078/166: ENHANCED: allow user to specify location of swipl binary, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5a8f70149f 099/166: FIXED: (sweep-load-buffer): error after prompting for a buffer, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 7327016d15 095/166: FIXED: sweep_predicates_collection/2: include preds defined in user, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog a70a730f48 087/166: PORT: don't use the 2nd arg to looking-at, added only in Emacs 29, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog d1a2913f75 115/166: ENHANCED: Update semantic highlighting on idle timer in sweep-mode, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog b168465391 098/166: FIXED: sweep_load_buffer/3: load files in the context of "user", ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog db7ef44a61 083/166: DOC: add manual section about setting Prolog flags, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 521a4bfde5 132/166: BUILD: replaced Makefile with CMakeLists.txt,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog ecf601dd54 133/166: FIXED: indentation error when typing at end of buffer, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 7bca15bd1e 141/166: DOC: fix copy-paste error in README.org, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 83bbd58031 153/166: ADDED: new command sweeprolog-restart for resetting sweep, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog a369e46143 160/166: ENHANCED: underline occurrences of the variable at point, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 8d13f21c0d 162/166: ADDED: new command sweeprolog-highlight-variable, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 3d5d0deda5 161/166: ADDED: new user option sweeprolog-enable-cursor-sensor, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 8f0e4a644d 164/166: FIXED: error on interactively removing variable highlighting, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog b43b6019ff 154/166: DOC: document the newly added sweeprolog-restart command, ELPA Syncer, 2022/09/30