summaryrefslogtreecommitdiff
path: root/build-farm.el
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2018-07-16 21:58:53 +0300
committerAlex Kost <alezost@gmail.com>2018-07-27 12:14:24 +0300
commit4fff68f8401a772d92a8698e0391d260fae8ef69 (patch)
treebf0827406542b9c7e2f4712334975a614621e410 /build-farm.el
parentAdd "Builds" button everywhere (diff)
downloademacs-build-farm-4fff68f8401a772d92a8698e0391d260fae8ef69.tar.gz
Distinguish system types supported by Nix and Guix
* build-farm.el (build-farm-system-types): Remove variable. (build-farm-guix-system-types, build-farm-nix-system-types): New variables. (build-farm-system-types): New function. (build-farm-read-system): Use it. (build-farm-job-regexp): Adjust to avoid using system types.
Diffstat (limited to 'build-farm.el')
-rw-r--r--build-farm.el34
1 files changed, 29 insertions, 5 deletions
diff --git a/build-farm.el b/build-farm.el
index 723eb97..6cde870 100644
--- a/build-farm.el
+++ b/build-farm.el
@@ -60,12 +60,36 @@
:group 'build-farm
:group 'faces)
-(defvar build-farm-system-types
+
+;;; System types
+
+;; XXX I don't like this hard-coding very much. But it looks like there
+;; is no way to receive system types from a build farm.
+
+(defvar build-farm-guix-system-types
'("x86_64-linux" "i686-linux" "armhf-linux" "mips64el-linux")
- "List of supported systems.")
+ "List of systems supported by Guix build farms.")
-(defvar build-farm-job-regexp
- (concat ".*\\." (regexp-opt build-farm-system-types) "\\'")
+(defvar build-farm-nix-system-types
+ '("x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux")
+ "List of systems supported by Nix build farms.")
+
+(defun build-farm-system-types (&optional url)
+ "Return a list of systems supported by URL.
+If URL is nil, use `build-farm-url'."
+ (or url (setq url build-farm-url))
+ (cond ((string-match-p "nix" url)
+ build-farm-nix-system-types)
+ ((or (string-match-p "gnu" url)
+ (string-match-p "guix" url))
+ build-farm-guix-system-types)
+ (t
+ (delete-dups
+ (append build-farm-nix-system-types
+ build-farm-guix-system-types)))))
+
+
+(defvar build-farm-job-regexp ".+\\.[^.]+"
"Regexp matching full name of a job (including system).")
(defun build-farm-job-name-specification (name version)
@@ -127,7 +151,7 @@ See `build-farm-search-url' for the meaning of SEARCH-TYPE and ARGS."
(build-farm-define-readers
:require-match nil
- :completions-var build-farm-system-types
+ :completions-getter build-farm-system-types
:single-reader build-farm-read-system
:single-prompt "System: ")