Skip to content

Instantly share code, notes, and snippets.

@jl2
Created January 7, 2016 00:54
Show Gist options
  • Save jl2/3a0a90d72e8245ba0964 to your computer and use it in GitHub Desktop.
Save jl2/3a0a90d72e8245ba0964 to your computer and use it in GitHub Desktop.
Update and build Emacs from Git.
;; Requires Emacs cloned from git://git.savannah.gnu.org/emacs.git
(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 "/home/jeremiah/oss_src/emacs")
(force-build (string= "--force" (second sb-ext:*posix-argv*))))
(with-output-to-string (s git-out-string)
(run-program "git" (list "pull") :search t :output s :input t :error :output :wait t :directory emacs-dir))
(if (or force-build (not (string= done-str (subseq git-out-string 0 len-done))))
(progn
(run-program "make" '("maintainer-clean") :search t :output t :input t :error :output :wait t :directory emacs-dir)
(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)
(run-program "make" '() :search t :output t :input t :error :output :wait t :directory emacs-dir)
(run-program "sudo" (list "make" "install") :search t :output t :input t :error :output :wait t :directory emacs-dir))
(format t "Already up to date!~%")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment