htslib: import from homebrew/science

Closes #18733.

Signed-off-by: JCount <JCount42@gmail.com>
This commit is contained in:
Michka Popoff 2017-09-29 22:58:34 +02:00 committed by JCount
parent 07fae22968
commit 3b1e811f4c

24
Formula/htslib.rb Normal file
View file

@ -0,0 +1,24 @@
class Htslib < Formula
desc "C library for high-throughput sequencing data formats"
homepage "http://www.htslib.org/"
url "https://github.com/samtools/htslib/releases/download/1.6/htslib-1.6.tar.bz2"
sha256 "9588be8be0c2390a87b7952d644e7a88bead2991b3468371347965f2e0504ccb"
revision 1
depends_on "xz"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
pkgshare.install "test"
end
test do
sam = pkgshare/"test/ce#1.sam"
assert_match "SAM", shell_output("#{bin}/htsfile #{sam}")
system "#{bin}/bgzip -c #{sam} > sam.gz"
assert_predicate testpath/"sam.gz", :exist?
system "#{bin}/tabix", "-p", "sam", "sam.gz"
assert_predicate testpath/"sam.gz.tbi", :exist?
end
end