[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql be9c46c274 259/427: Change the way tuples are comp
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql be9c46c274 259/427: Change the way tuples are computed. |
Date: |
Tue, 13 Dec 2022 02:59:49 -0500 (EST) |
branch: elpa/emacsql
commit be9c46c2746a7e27d06a294547edfcf480f011ed
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>
Change the way tuples are computed.
---
emacsql-sqlite.el | 2 +-
emacsql-system.el | 48 +++++++++++++++++++-----------------------------
2 files changed, 20 insertions(+), 30 deletions(-)
diff --git a/emacsql-sqlite.el b/emacsql-sqlite.el
index a8afc23cdd..5a60eec670 100644
--- a/emacsql-sqlite.el
+++ b/emacsql-sqlite.el
@@ -8,7 +8,7 @@
(require 'emacsql-system)
(defvar emacsql-sqlite-executable
- (expand-file-name (emacsql-system-binary "bin/emacsql-sqlite")
+ (expand-file-name (concat "bin/emacsql-sqlite-" (emacsql-system-tuple))
(file-name-directory load-file-name))
"Path to the Emacsql backend (this is not the sqlite3 shell).")
diff --git a/emacsql-system.el b/emacsql-system.el
index 8bca22b24a..38a8618f23 100644
--- a/emacsql-system.el
+++ b/emacsql-system.el
@@ -8,40 +8,30 @@
(defun emacsql-system-normalize-arch (arch)
"Normalize the name of string ARCH."
- (cl-case (intern arch)
- ((x86 i386 i486 i586 i686) 'x86)
- ((x86_64 amd64) 'x86_64)
- (otherwise (intern arch))))
-
-(defun emacsql-system-architecture ()
- "Determine this system's architecture."
- (emacsql-system-normalize-arch
- (if (executable-find "uname")
- (with-temp-buffer
- (call-process "uname" nil (current-buffer) nil "-m")
- (replace-regexp-in-string "\\s " "" (buffer-string)))
- (getenv "PROCESSOR_ARCHITECTURE"))))
+ (cond ((string-match-p "^i[0-9]\\{3\\}" arch) "x86")
+ ((string-match-p "^amd64" arch) "x86_64")
+ (arch)))
+
+(defun emacsql-system-normalize-os (os)
+ "Normalize OS into a simple canonical name.
+Unfortunately config.guess has lots of names for Windows."
+ (cond ((string-match-p "^nt" os) "windows")
+ ((string-match-p "^ming" os) "windows")
+ ((string-match-p "^cygwin" os) "windows")
+ ((string-match-p "^linux" os) "linux")
+ (os)))
(defun emacsql-system-tuple ()
- "Return a tuple (kernel architecture) for the current system."
- (list
- (emacsql-system-architecture)
- (cl-ecase system-type
- (gnu 'hurd)
- (gnu/linux 'linux)
- ((gnu/kfreebsd berkeley-unix) 'bsd)
- (darwin 'darwin)
- (ms-dos 'dos)
- (windows-nt 'windows)
- (cygwin 'windows))))
-
-(defun emacsql-system-binary (prefix)
- "Determine an executable name for PREFIX."
- (concat prefix "-" (mapconcat #'symbol-name (emacsql-system-tuple) "-")))
+ "Determine the architecture-system tuple for Emacs' host system."
+ (cl-destructuring-bind (arch _vendor . os-parts)
+ (split-string system-configuration "-")
+ (let ((os (mapconcat #'identity os-parts "-")))
+ (format "%s-%s" (emacsql-system-normalize-arch arch)
+ (emacsql-system-normalize-os os)))))
(defun emacsql-system-print-tuple ()
"This is for calling from a Makefile."
- (princ (mapconcat #'symbol-name (emacsql-system-tuple) "-"))
+ (emacsql-system-tuple)
(princ "\n"))
(provide 'emacsql-system)
- [nongnu] elpa/emacsql 2db4a84598 225/427: Allow os tuples to be specified as an env var., (continued)
- [nongnu] elpa/emacsql 2db4a84598 225/427: Allow os tuples to be specified as an env var., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ba2fac7701 228/427: Update the README., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql af2cdddca1 231/427: Squash a bunch of bugs., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql d3fa5b908f 234/427: Add funcall operator., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b29ea275d4 236/427: Tweak limitations notes., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 45ac14390a 239/427: Fix up emacsql.el header to match new syntax., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 7c774ffe12 248/427: Improve MySQL error parsing., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 89e42aed13 253/427: Add docstring to emacsql-mysql., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5c423307a8 254/427: Fix README typo., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c5e1ccef73 257/427: Flesh out the rest of mysql-connection's constructor., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql be9c46c274 259/427: Change the way tuples are computed.,
ELPA Syncer <=
- [nongnu] elpa/emacsql de9b3633d2 262/427: Oops do clean with distclean., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 0f5f560f8b 267/427: Fix README example typo., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 203cff9007 269/427: Rename the project to EmacSQL., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 38bd19ed6f 276/427: Oops, use the right equality., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 50e47ee01a 278/427: Remove shell quote., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6c7576e497 295/427: Rename condition emacsql-lock to emacsql-locked., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 39ce3b9736 287/427: Smarter identifier identification in expressions., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 20391923d1 292/427: Add option to disable local builds., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b375cd7759 294/427: Bump version number due to protocol change., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b60d9e05e2 277/427: Flesh out some docstrings., ELPA Syncer, 2022/12/13