From 334d59ba874a185344ea0af0c05ca5458ce43b16 Mon Sep 17 00:00:00 2001 From: Arthur Liu Date: Tue, 20 Jan 2015 19:01:20 +1100 Subject: libgxps 0.2.2 (new formula) A GObject based library and utilities for handling and rendering XPS documents. Closes #36053. Signed-off-by: Mike McQuaid --- Library/Formula/libgxps.rb | 86 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 Library/Formula/libgxps.rb (limited to 'Library') diff --git a/Library/Formula/libgxps.rb b/Library/Formula/libgxps.rb new file mode 100644 index 000000000..29a8f1ca4 --- /dev/null +++ b/Library/Formula/libgxps.rb @@ -0,0 +1,86 @@ +class Libgxps < Formula + homepage "https://live.gnome.org/libgxps" + url "http://ftp.gnome.org/pub/gnome/sources/libgxps/0.2/libgxps-0.2.2.tar.xz" + sha256 "39d104739bf0db43905c315de1d8002460f1a098576f4418f69294013a5820be" + + head do + url "https://github.com/GNOME/libgxps.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + depends_on "gnome-common" => :build + depends_on "gtk-doc" => :build + end + depends_on "pkg-config" => :build + depends_on "cairo" + depends_on "libarchive" + depends_on "freetype" + depends_on "libpng" + depends_on "jpeg" => :recommended + depends_on "libtiff" => :recommended + depends_on "little-cms2" => :recommended + depends_on "gtk+" => :optional + + def install + args = [ + "--disable-debug", + "--disable-dependency-tracking", + "--disable-silent-rules", + "--enable-man", + "--prefix=#{prefix}", + ] + + args << "--without-libjpeg" if build.without? "libjpeg" + args << "--without-libtiff" if build.without? "libtiff" + args << "--without-liblcms2" if build.without? "lcms2" + + if build.head? + ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" + system "./autogen.sh", *args + else + system "./configure", *args + end + system "make", "install" + end + + test do + mkdir_p [ + (testpath/"Documents/1/Pages/_rels/"), + (testpath/"_rels/"), + ] + + (testpath/"FixedDocumentSequence.fdseq").write <<-EOS.undent + + + + EOS + (testpath/"Documents/1/FixedDocument.fdoc").write <<-EOS.undent + + + + EOS + (testpath/"Documents/1/Pages/1.fpage").write <<-EOS.undent + + EOS + (testpath/"_rels/.rels").write <<-EOS.undent + + + + EOS + [ + "_rels/FixedDocumentSequence.fdseq.rels", + "Documents/1/_rels/FixedDocument.fdoc.rels", + "Documents/1/Pages/_rels/1.fpage.rels", + ].each do |f| + (testpath/f).write <<-EOS.undent + + EOS + end + + Dir.chdir(testpath) do + system "/usr/bin/zip", "-qr", (testpath/"test.xps"), "_rels", "Documents", "FixedDocumentSequence.fdseq" + end + system "#{bin}/xpstopdf", (testpath/"test.xps") + end +end -- cgit v1.2.3