Skip to content

Commit

Permalink
libspectre 0.2.7 (new formula)
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoonj authored and DomT4 committed Sep 5, 2015
1 parent 5c783c1 commit 800b507
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Formula/libspectre.rb
@@ -0,0 +1,36 @@
class Libspectre < Formula
desc "Small library for rendering Postscript documents"
homepage "https://wiki.freedesktop.org/www/Software/libspectre/"
url "http://libspectre.freedesktop.org/releases/libspectre-0.2.7.tar.gz"
sha256 "e81b822a106beed14cf0fec70f1b890c690c2ffa150fa2eee41dc26518a6c3ec"

depends_on "ghostscript"

def install
ENV.append "CFLAGS", "-I#{Formula["ghostscript"].opt_include}/ghostscript"
ENV.append "LIBS", "-L#{Formula["ghostscript"].opt_lib}"
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end

test do
(testpath/"test.c").write <<-EOS.undent
#include <libspectre/spectre.h>
int main(int argc, char *argv[]) {
const char *text = spectre_status_to_string(SPECTRE_STATUS_SUCCESS);
return 0;
}
EOS
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
flags += %W[
-I#{include}
-L#{lib}
-lspectre
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end

0 comments on commit 800b507

Please sign in to comment.