libspectre 0.2.7 (new formula)
This commit is contained in:
parent
5c783c157a
commit
800b50711a
1 changed files with 36 additions and 0 deletions
36
Formula/libspectre.rb
Normal file
36
Formula/libspectre.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue