diff options
| author | Drew Wells | 2014-12-23 09:30:04 -0600 |
|---|---|---|
| committer | Mike McQuaid | 2015-01-05 19:15:47 +0000 |
| commit | 47754577744ac6614c090de1fb9c8d6938de53a1 (patch) | |
| tree | dfdd9c416649e97f7dc843573249541df24003a7 /Library/Formula | |
| parent | 0376382ce1bf2028c068b32ce61ec3e6dcae69d6 (diff) | |
| download | homebrew-47754577744ac6614c090de1fb9c8d6938de53a1.tar.bz2 | |
wellington 0.6.0 formula
* based off libsass 3.1.0
* specify c++11 linker in clang via CGO_LDFLAG
Closes #35214.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/wellington.rb | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Library/Formula/wellington.rb b/Library/Formula/wellington.rb new file mode 100644 index 000000000..8dc91aff3 --- /dev/null +++ b/Library/Formula/wellington.rb @@ -0,0 +1,56 @@ +require "language/go" + +class Wellington < Formula + homepage "https://github.com/wellington/wellington" + url "https://github.com/wellington/wellington/archive/0.6.0.tar.gz" + sha1 "c7d1c391f9e929796f92c4496f011c62546a12cd" + head "https://github.com/wellington/wellington.git" + + needs :cxx11 + + depends_on "go" => :build + depends_on "pkg-config" => :build + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + + go_resource "github.com/wellington/spritewell" do + url "https://github.com/wellington/spritewell.git", + :revision => "748bfe956f31c257605c304b41a0525a4487d17d" + end + + go_resource "github.com/go-fsnotify/fsnotify" do + url "https://github.com/go-fsnotify/fsnotify.git", + :revision => "f582d920d11386e8ae15227bb5933a8f9b4c3dec" + end + + def install + ENV.cxx11 + # go_resource doesn't support gopkg, do it manually then symlink + mkdir_p buildpath/"src/gopkg.in" + ln_s buildpath/"src/github.com/go-fsnotify/fsnotify", + buildpath/"src/gopkg.in/fsnotify.v1" + ENV["PKG_CONFIG_PATH"] = buildpath/"libsass/lib/pkgconfig" + mkdir_p buildpath/"src/github.com/wellington" + ln_s buildpath, buildpath/"src/github.com/wellington/wellington" + Language::Go.stage_deps resources, buildpath/"src" + ENV["GOPATH"] = buildpath + ENV.append "CGO_LDFLAGS", "-stdlib=libc++" if ENV.compiler == :clang + system "make", "deps" + system "go", "build", "-x", "-v", "-o", "dist/wt", "wt/main.go" + + bin.install "dist/wt" + end + + test do + s = "div { p { color: red; } }" + expected = <<-EOS.undent + Reading from stdin, -h for help + /* line 6, stdin */ + div p { + color: red; } + EOS + output = `echo '#{s}' | #{bin}/wt` + assert_equal(expected, output) + end +end |
