diff options
| author | Rowan Lewis | 2010-07-30 21:15:55 +1000 |
|---|---|---|
| committer | Adam Vandenberg | 2010-10-28 21:40:58 -0700 |
| commit | a1fe19ca3f38263beda4871f8f8489e98acb9be0 (patch) | |
| tree | ec015b311f2a5357ab7a5aa3242a522e696a6896 /Library/Formula/v8cgi.rb | |
| parent | a7a96738b4f201a55e082085ac1e6b8b256d5854 (diff) | |
| download | homebrew-a1fe19ca3f38263beda4871f8f8489e98acb9be0.tar.bz2 | |
Added experimental v8cgi Forumula.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/v8cgi.rb')
| -rw-r--r-- | Library/Formula/v8cgi.rb | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Library/Formula/v8cgi.rb b/Library/Formula/v8cgi.rb new file mode 100644 index 000000000..c8c7ce283 --- /dev/null +++ b/Library/Formula/v8cgi.rb @@ -0,0 +1,51 @@ +require 'formula' + +class V8cgi <Formula + head 'http://v8cgi.googlecode.com/svn/trunk/' + homepage 'http://code.google.com/p/v8cgi/' + + def options + [ + ["--with-dom", "Enable DOM."], + ["--with-gd", "Enable GD."], + ["--with-sqlite", "Enable SQLite."] + ] + end + + depends_on 'scons' => :build + depends_on 'v8' + depends_on 'libmemcached' + depends_on 'xerces-c' if ARGV.include? '--with-dom' + depends_on 'gd' if ARGV.include? '--with-gd' + depends_on 'sqlite' if ARGV.include? '--with-sqlite' + + def install + arch = Hardware.is_64_bit? ? 'x64' : 'ia32' + + v8_prefix = Formula.factory('v8').prefix + conf = "#{etc}/v8cgi.conf" + + inreplace 'SConstruct', '../v8', v8_prefix + + args = ["config_file=#{conf}", "v8_path=#{v8_prefix}"] + args << (ARGV.include? '--with-dom') ? 'dom=1' : 'dom=0' + args << (ARGV.include? '--with-gd') ? 'gd=1' :'gd=0' + args << (ARGV.include? '--with-sqlite') ? 'sqlite=1' : 'sqlite=0' + + system "scons", + "-j #{Hardware.processor_count}", + "arch=#{arch}", + "library=shared", + "socket=1", + "process=1", + "cgi=1", + "mysql=0", + "gl=0", + "module=0", + *args + + bin.install 'v8cgi' + lib.install 'lib' => 'v8cgi' + etc.install "v8cgi.conf.darwin" => "v8cgi.conf" + end +end |
