Last active
April 15, 2019 06:35
-
-
Save jl2/a6420f0355c5a453b130109df202805f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/lisp --script | |
;;-*-lisp-*- | |
(let* ((git-out-string (make-array '(0) :element-type 'base-char :fill-pointer 0 :adjustable t)) | |
(done-str "Already up-to-date") | |
(len-done (length done-str)) | |
(emacs-dir (merge-pathnames "oss_src/emacs" (user-homedir-pathname))) | |
(force-build (string= "--force" (second sb-ext:*posix-argv*)))) | |
(with-output-to-string (s git-out-string) | |
;; Update Git repo | |
(run-program "git" (list "pull") | |
:search t :output s :input t :error :output :wait t :directory emacs-dir)) | |
;; Check if a rebuild is necessary | |
(when (not (or force-build (not (string= done-str (subseq git-out-string 0 len-done))))) | |
(format t "Already up to date!~%") | |
(quit)) | |
;; Clean | |
(run-program "make" '("maintainer-clean") :search t :output t :input t :error :output :wait t :directory emacs-dir) | |
;; Configure | |
(run-program (format nil "~a/configure" emacs-dir) | |
(list "--with-sound=no" "--with-wide-int" "--enable-link-time-optimization") | |
:search t :output t :input t :error :output :wait t :directory emacs-dir) | |
;; Build | |
(run-program "make" '() | |
:search t :output t :input t :error :output :wait t :directory emacs-dir) | |
;; Install | |
(run-program "sudo" (list "make" "install") | |
:search t :output t :input t :error :output :wait t :directory emacs-dir)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment