diff options
| author | Charlie Somerville | 2012-10-04 22:38:33 +1000 |
|---|---|---|
| committer | Adam Vandenberg | 2012-11-11 18:22:56 -0800 |
| commit | 4d2656781b6e74a16b1b3cf7eaced92380bd07c9 (patch) | |
| tree | d5b0f8b78cf85795f9f3bbe148460398f2354e04 | |
| parent | ff2f9e883a8d6c678ab20871e58bfd8c54ba6e37 (diff) | |
| download | homebrew-4d2656781b6e74a16b1b3cf7eaced92380bd07c9.tar.bz2 | |
libsass 1.0
Closes #15296.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
| -rw-r--r-- | Library/Formula/libsass.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Library/Formula/libsass.rb b/Library/Formula/libsass.rb new file mode 100644 index 000000000..7095fc0d5 --- /dev/null +++ b/Library/Formula/libsass.rb @@ -0,0 +1,36 @@ +require 'formula' + +class Libsass < Formula + homepage 'https://github.com/hcatlin/libsass' + url 'https://github.com/hcatlin/libsass/archive/RELEASE-1.0.tar.gz' + sha1 '55a8775f2ae430f24b03964b3aa8e2a3565d613a' + + def install + system "./configure", "--prefix=#{prefix}" + system "make install" + end + + def test + mktemp do + (Pathname.pwd/"test.c").write <<-EOS.undent + #include <sass_interface.h> + #include <string.h> + + int main() + { + struct sass_context* sass_ctx = sass_new_context(); + sass_ctx->source_string = "a { color:blue; &:hover { color:red; } }"; + sass_ctx->options.output_style = SASS_STYLE_NESTED; + sass_compile(sass_ctx); + if(sass_ctx->error_status) { + return 1; + } else { + return strcmp(sass_ctx->output_string, "a {\\n color: blue; }\\n a:hover {\\n color: red; }\\n") != 0; + } + } + EOS + system ENV.cc, "-o", "test", "test.c", "-lsass" + system "./test" + end + end +end |
