homebrew-core/Formula/batik.rb

30 lines
941 B
Ruby

class Batik < Formula
desc "Java-based toolkit for SVG images"
homepage "https://xmlgraphics.apache.org/batik/"
url "https://www.apache.org/dyn/closer.lua?path=xmlgraphics/batik/binaries/batik-bin-1.13.tar.gz"
mirror "https://archive.apache.org/dist/xmlgraphics/batik/binaries/batik-bin-1.13.tar.gz"
sha256 "7c565899e4377a72edee216ffdf168d7b6928d5e1a8cdf477dfa1abd2c48589b"
license "Apache-2.0"
revision 1
livecheck do
url :stable
end
bottle :unneeded
def install
libexec.install "lib", Dir["*.jar"]
Dir[libexec/"*.jar"].each do |f|
bin.write_jar_script f, File.basename(f, "-#{version}.jar")
end
end
test do
font_name = (MacOS.version >= :catalina) ? "Arial Unicode.ttf" : "Arial.ttf"
system bin/"batik-ttf2svg", "/Library/Fonts/#{font_name}", "-autorange",
"-o", "Arial.svg", "-testcard"
assert_match "abcdefghijklmnopqrstuvwxyz", File.read("Arial.svg")
end
end