homebrew-core/Formula/igv.rb

36 lines
1.2 KiB
Ruby

class Igv < Formula
desc "Interactive Genomics Viewer"
homepage "https://www.broadinstitute.org/software/igv"
url "https://data.broadinstitute.org/igv/projects/downloads/2.16/IGV_2.16.0.zip"
sha256 "7fe76a793b1aa9ac90a1733acfe4ea01fd8e7e42729e9daee84e79e1f43b2a26"
license "MIT"
livecheck do
url "https://software.broadinstitute.org/software/igv/download"
regex(/href=.*?IGV[._-]v?(\d+(?:\.\d+)+)\.zip/i)
end
bottle do
sha256 cellar: :any_skip_relocation, all: "b5297ca8388b61fa449736209a60c93925cab0ff16bc1dd42b1d495a2f7e6a58"
end
depends_on "openjdk"
def install
inreplace ["igv.sh", "igvtools"], /^prefix=.*/, "prefix=#{libexec}"
bin.install "igv.sh" => "igv"
bin.install "igvtools"
libexec.install "igv.args", "lib"
bin.env_script_all_files libexec, Language::Java.overridable_java_home_env
end
test do
assert_match "Usage:", shell_output("#{bin}/igvtools")
assert_match "org/broad/igv/ui/IGV.class", shell_output("#{Formula["openjdk"].bin}/jar tf #{libexec}/lib/igv.jar")
ENV.append "_JAVA_OPTIONS", "-Duser.home=#{testpath}"
(testpath/"script").write "exit"
assert_match "Using system JDK.", shell_output("#{bin}/igv -b script")
end
end