2014-02-06 16:16:28 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class NewEnoughEmacs < Requirement
|
|
|
|
fatal true
|
|
|
|
default_formula "emacs"
|
|
|
|
|
|
|
|
def satisfied?
|
|
|
|
major_version = `emacs --batch --eval "(princ emacs-major-version)"`.to_i
|
|
|
|
major_version >= 23
|
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
"Emacs 23 or later is required to run cask."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Cask < Formula
|
2014-07-18 20:04:50 +00:00
|
|
|
homepage "http://cask.readthedocs.org/"
|
2014-09-23 05:49:03 +00:00
|
|
|
url "https://github.com/cask/cask/archive/v0.7.2.tar.gz"
|
|
|
|
sha1 "2c8012487f06c6b4f47ce56bd021bb71753f1bd0"
|
2014-02-06 16:16:28 +00:00
|
|
|
head "https://github.com/cask/cask.git"
|
|
|
|
|
|
|
|
depends_on NewEnoughEmacs
|
|
|
|
|
|
|
|
def install
|
|
|
|
zsh_completion.install "etc/cask_completion.zsh"
|
|
|
|
bin.install "bin/cask"
|
|
|
|
prefix.install Dir["*.el"]
|
|
|
|
prefix.install "templates"
|
2014-04-01 12:36:31 +00:00
|
|
|
(share/"emacs/site-lisp").install_symlink "#{prefix}/cask-bootstrap.el"
|
|
|
|
(share/"emacs/site-lisp").install_symlink "#{prefix}/cask.el"
|
2014-02-06 16:16:28 +00:00
|
|
|
# Stop cask performing self-upgrades.
|
|
|
|
touch prefix/".no-upgrade"
|
|
|
|
end
|
|
|
|
end
|