Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added ClojureScript formula #16976

Closed
wants to merge 1 commit into from

2 participants

@toroidal-code

I attempted to replicate the features of the clojurescript bootstrap script, to setup clojurescript on a system. I'm not sure how proper this script is, so any feedback would be appreciated.

@adamv
Owner

We typically don't like downloading stuff inline via curls; can any of these be dependencies instead?

@toroidal-code

I'm going to try working on this further, but it looks like I'll have to investigate how the program is hooking into the clojure.jar file. I'll submit a new pull request when I have a cleaner version on a separate branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 10, 2013
  1. @toroidal-code
This page is out of date. Refresh to see the latest.
Showing with 71 additions and 0 deletions.
  1. +71 −0 Library/Formula/clojurescript.rb
View
71 Library/Formula/clojurescript.rb
@@ -0,0 +1,71 @@
+require 'formula'
+
+# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
+# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
+
+class Clojurescript < Formula
+ homepage 'https://github.com/clojure/clojurescript/wiki'
+ url 'https://github.com/clojure/clojurescript/archive/r1552.tar.gz'
+ version '1552'
+ sha1 'b1d46005cfaf5edc941e9f19169401b63e4e1c44'
+
+
+ def install
+ system "mkdir -p lib"
+ install_clojure
+ install_library
+ install_compiler
+ install_rhino_js
+ system "cp closure/compiler/compiler.jar lib"
+ system "cp -R ./ #{prefix}"
+ end
+
+ def install_clojure
+ ohai "Fetching clojure"
+ system "curl -O -s http://repo1.maven.org/maven2/org/clojure/clojure/1.4.0/clojure-1.4.0.zip"
+ system "unzip -qu clojure-1.4.0.zip"
+ ohai "copying clojure.jar"
+ system "cp clojure-1.4.0/clojure-1.4.0.jar lib/clojure.jar"
+ ohai "cleaning up clojure"
+ system "rm -rf clojure-1.4.0"
+ system "rm clojure-1.4.0.zip"
+ end
+
+ def install_library
+ system "mkdir -p closure/library"
+ Dir.chdir("closure/library") do
+ ohai "Fetching Closure library"
+ closure_library = "closure-library-20120710-r2029.zip"
+ system "curl -O -s 'http://closure-library.googlecode.com/files/#{closure_library}'"
+ system "unzip -qu #{closure_library}"
+ ohai "Cleaning up Closure library"
+ system "rm #{closure_library}"
+ end
+ end
+
+ def install_compiler
+ system "mkdir -p closure/compiler"
+ Dir.chdir("closure/compiler") do
+ ohai "Fetching Closure compiler"
+ system "curl -O -s http://closure-compiler.googlecode.com/files/compiler-latest.zip"
+ system "unzip -qu compiler-latest.zip"
+ ohai "Cleaning up the compiler"
+ system "rm compiler-latest.zip"
+ end
+ ohai "Building the compiler"
+ system "jar cf ./lib/goog.jar -C closure/library/closure/ goog"
+ end
+
+ def install_rhino_js
+ ohai "Fetching Rhino"
+ system "curl -O -s http://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R3.zip"
+ system "unzip -qu rhino1_7R3.zip"
+ system "cp rhino1_7R3/js.jar lib/js.jar"
+ ohai "Cleaning up Rhino"
+ system "rm -rf rhino1_7R3"
+ system "rm rhino1_7R3.zip"
+ end
+
+ def test
+ end
+end
Something went wrong with that request. Please try again.