modified: diffout.py
[GalaxyCodeBases.git] / etc / Homebrew / samtools-0.1.rb
blob789840c54da9ed727528697e889e9f3e22f85b2c
1 class Samtools01 < Formula
2 #class SamtoolsAT01 < Formula
3   desc "Tools for manipulating next-generation sequencing data"
4   homepage "https://samtools.sourceforge.io/"
5   # doi "10.1093/bioinformatics/btp352"
6   # tag "bioinformatics"
7   # <http://samtools.sourceforge.net/pileup.shtml>
8   # The `pileup' command has been removed in [0.1.17](https://github.com/samtools/samtools/commits/0.1.17) in commit c350a570e955d5b4c2c13f607b7442df6d332c67.
9   # See <https://sourceforge.net/projects/samtools/files/samtools/0.1.16/> for README.
11   url "https://github.com/samtools/samtools/archive/0.1.16.tar.gz"
12   sha256 "7657e5dc66fbd1f02133349de34955a50635a9980c21ebff06c116e4e1e65986"
14   keg_only :versioned_formula
16   option "with-dwgsim", "Build with 'Whole Genome Simulation'"
17   option "without-bcftools", "Do not install BCFtools"
19   unless OS.mac?
20     depends_on "ncurses"
21     depends_on "zlib"
22   end
24   resource "dwgsim" do
25     # http://sourceforge.net/apps/mediawiki/dnaa/index.php?title=Whole_Genome_Simulation
26     url "https://downloads.sourceforge.net/project/dnaa/dwgsim/dwgsim-0.1.11.tar.gz"
27     sha256 "6ffc8a4f7d20bc7c8b3efa1d2b3ae6cbf9609a93db976d4e7ccd2a209a2305b5"
28   end
30   stable do
31     # https://github.com/lh3/samtools/issues/15
32     # diff -uN ksort.h.0 ksort.h >> ../samtools-0.1.rb
33     patch :DATA
34   end
36   def install
37     system "make"
38     system "make", "-C", "bcftools" if build.with? "bcftools"
40     if build.with? "dwgsim"
41       ohai "Building dwgsim"
42       resource("dwgsim").stage do
43         ln_s buildpath, "samtools"
44         system "make", "CC=#{ENV.cc}"
45         bin.install %w[dwgsim dwgsim_eval]
46       end
47     end
49     bin.install %w[
50       samtools bcftools/bcftools bcftools/vcfutils.pl
51       misc/maq2sam-long misc/maq2sam-short misc/md5fa misc/md5sum-lite misc/wgsim
52     ]
54     bin.install Dir["misc/*.pl"]
55     lib.install "libbam.a"
56     man1.install "samtools.1"
57     (share+"samtools").install "examples"
58     (include+"bam").install Dir["*.h"]
59   end
61   test do
62     assert_match "samtools", shell_output("#{bin}/samtools 2>&1", 1)
63   end
64 end
66 __END__
67 diff --git a/ksort.h b/ksort.h
68 index fa850ab..f8d8c4c 100644
69 --- a/ksort.h
70 +++ b/ksort.h
71 @@ -141,7 +141,7 @@
72                         tmp = *l; *l = l[i]; l[i] = tmp; ks_heapadjust_##name(0, i, l); \
73                 }                                                                                                                               \
74         }                                                                                                                                       \
75 -       inline void __ks_insertsort_##name(type_t *s, type_t *t)                        \
76 +       static inline void __ks_insertsort_##name(type_t *s, type_t *t)                 \
77         {                                                                                                                                       \
78                 type_t *i, *j, swap_tmp;                                                                                \
79                 for (i = s + 1; i < t; ++i)                                                                             \