73 lines
2.3 KiB
Ruby
73 lines
2.3 KiB
Ruby
class Libgxps < Formula
|
|
desc "GObject based library for handling and rendering XPS documents"
|
|
homepage "https://wiki.gnome.org/Projects/libgxps"
|
|
url "https://download.gnome.org/sources/libgxps/0.3/libgxps-0.3.1.tar.xz"
|
|
sha256 "1a939fc8fcea9471b7eca46b1ac90cff89a30d26f65c7c9a375a4bf91223fa94"
|
|
|
|
bottle do
|
|
sha256 "f2a0b5d1e9d85ad84ab041381c3c0bdd8f6f98d2be8586cdf48958e4a85aab27" => :mojave
|
|
sha256 "ef0b670a2dcbbbc2e42e6dd9ada96353fad1d039c42d8a41ef5271b8370bdd25" => :high_sierra
|
|
sha256 "949980a659fa2c301992af86c54a91e47a9721e372348bb1e5b49891d55b5285" => :sierra
|
|
end
|
|
|
|
head do
|
|
url "https://gitlab.gnome.org/GNOME/libgxps.git"
|
|
end
|
|
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "meson-internal" => :build
|
|
depends_on "ninja" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "glib"
|
|
depends_on "gtk+3"
|
|
depends_on "libarchive"
|
|
depends_on "little-cms2"
|
|
|
|
def install
|
|
mkdir "build" do
|
|
system "meson", "--prefix=#{prefix}", ".."
|
|
system "ninja", "-v"
|
|
system "ninja", "install", "-v"
|
|
end
|
|
end
|
|
|
|
test do
|
|
mkdir_p [
|
|
(testpath/"Documents/1/Pages/_rels/"),
|
|
(testpath/"_rels/"),
|
|
]
|
|
|
|
(testpath/"FixedDocumentSequence.fdseq").write <<~EOS
|
|
<FixedDocumentSequence>
|
|
<DocumentReference Source="/Documents/1/FixedDocument.fdoc"/>
|
|
</FixedDocumentSequence>
|
|
EOS
|
|
(testpath/"Documents/1/FixedDocument.fdoc").write <<~EOS
|
|
<FixedDocument>
|
|
<PageContent Source="/Documents/1/Pages/1.fpage"/>
|
|
</FixedDocument>
|
|
EOS
|
|
(testpath/"Documents/1/Pages/1.fpage").write <<~EOS
|
|
<FixedPage Width="1" Height="1" xml:lang="und" />
|
|
EOS
|
|
(testpath/"_rels/.rels").write <<~EOS
|
|
<Relationships>
|
|
<Relationship Target="/FixedDocumentSequence.fdseq" Type="http://schemas.microsoft.com/xps/2005/06/fixedrepresentation"/>
|
|
</Relationships>
|
|
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
|
|
<Relationships />
|
|
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
|