Skip to content

Commit b182bd7

Browse files
chenrui333cho-m
authored andcommitted
freebayes 1.3.9
autobump: add freebayes Signed-off-by: Rui Chen <[email protected]>
1 parent a4dd203 commit b182bd7

File tree

2 files changed

+59
-53
lines changed

2 files changed

+59
-53
lines changed

.github/autobump.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ fping
10701070
fplll
10711071
fq
10721072
fred
1073+
freebayes
10731074
freeciv
10741075
freeglut
10751076
freeipmi

Formula/f/freebayes.rb

Lines changed: 58 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,13 @@
11
class Freebayes < Formula
22
desc "Bayesian haplotype-based genetic polymorphism discovery and genotyping"
33
homepage "https://github.com/freebayes/freebayes"
4+
# pull from git tag to get submodules
5+
url "https://github.com/freebayes/freebayes.git",
6+
tag: "v1.3.9",
7+
revision: "ab36d1f789c039ba872f5d911ce6ff09952dc329"
48
license "MIT"
59
head "https://github.com/freebayes/freebayes.git", branch: "master"
610

7-
stable do
8-
# Use tarball and resources as workaround for https://github.com/freebayes/freebayes/pull/799
9-
url "https://github.com/freebayes/freebayes/archive/refs/tags/v1.3.8.tar.gz"
10-
sha256 "d1c24b1d1b35277e7403cd67063557998218a105c916b01a745e7704715fce67"
11-
12-
depends_on "cmake" => :build
13-
depends_on "pybind11" => :build
14-
depends_on "simde" => :build
15-
16-
on_macos do
17-
depends_on "libomp" => :build
18-
end
19-
20-
resource "contrib/smithwaterman" do
21-
url "https://github.com/ekg/smithwaterman/archive/2610e259611ae4cde8f03c72499d28f03f6d38a7.tar.gz"
22-
sha256 "8e1b37ab0e8cd9d3d5cbfdba80258c0ebd0862749b531e213f44cdfe2fc541d8"
23-
end
24-
25-
resource "contrib/fastahack" do
26-
url "https://github.com/ekg/fastahack/archive/bb332654766c2177d6ec07941fe43facf8483b1d.tar.gz"
27-
sha256 "552a1b261ea90023de7048a27c53a425a1bc21c3fb172b3c8dc9f585f02f6c43"
28-
end
29-
30-
resource "contrib/multichoose" do
31-
url "https://github.com/vcflib/multichoose/archive/255192edd49cfe36557f7f4f0d2d6ee1c702ffbb.tar.gz"
32-
sha256 "0045051ee85d36435582151830efe0eefb466be0ec9aedbbc4465dca30d22102"
33-
end
34-
35-
resource "contrib/vcflib" do
36-
url "https://github.com/vcflib/vcflib.git",
37-
tag: "v1.0.10",
38-
revision: "2ad261860807e66dbd9bcb07fee1af47b9930d70"
39-
end
40-
end
41-
4211
# The Git repository contains a few older tags that erroneously omit a
4312
# leading zero in the version (e.g., `v9.9.2` should have been `v0.9.9.2`)
4413
# and these would appear as the newest versions until the current version
@@ -58,40 +27,76 @@ class Freebayes < Formula
5827
sha256 x86_64_linux: "056ef004633b4ad83902199054e990313f0e2654455ebe17f822b28d5a7add9a"
5928
end
6029

30+
depends_on "cmake" => :build # for vcflib
6131
depends_on "meson" => :build
6232
depends_on "ninja" => :build
6333
depends_on "pkgconf" => :build
34+
depends_on "pybind11" => :build # for vcflib
35+
depends_on "simde" => :build
36+
depends_on "wfa2-lib" => :build # for vcflib
37+
depends_on "xz" => :build # for vcflib
6438
depends_on "htslib"
65-
depends_on "xz"
6639

67-
uses_from_macos "zlib"
40+
uses_from_macos "bzip2" => :build # for vcflib
41+
uses_from_macos "zlib" => :build # for vcflib
42+
43+
on_macos do
44+
depends_on "libomp" => :build # for vcflib
45+
end
46+
47+
resource "vcflib" do
48+
url "https://github.com/vcflib/vcflib/releases/download/v1.0.12/vcflib-1.0.12-src.tar.gz"
49+
sha256 "cb1e78d675f06ae3b22ffed7e1dea317e4c7f826e51e5b5dabd80240efbe1019"
50+
51+
# Backport fix for using external `wfa2-lib`
52+
patch do
53+
url "https://github.com/vcflib/vcflib/commit/5e4edec2fba5d5a51dae7a9fe48d0252ade53857.patch?full_index=1"
54+
sha256 "e7d6d433d837dd823916ef91fe0165bf4ba4f05c52fd4c9517aef7f80653a2a8"
55+
end
56+
57+
# Apply open PR to help find `wfa2-lib` include directory
58+
# PR ref: https://github.com/vcflib/vcflib/pull/413
59+
patch do
60+
url "https://github.com/vcflib/vcflib/commit/9f9237ff0e6b4887f0edfc88587957aa736ced7b.patch?full_index=1"
61+
sha256 "bede43d22b4b47141cd90edc4df90f65b9ac41e9598c2b05b2fe7fa84ea51aa8"
62+
end
63+
end
64+
65+
# Apply open PR to help Meson locate vcflib and wfa2 libraries
66+
# PR ref: https://github.com/freebayes/freebayes/pull/822
67+
patch do
68+
url "https://github.com/freebayes/freebayes/commit/b458396e1acbad3983c70c202a6db2b3711a8eac.patch?full_index=1"
69+
sha256 "b5c7d855d4d66c6c96dada307e82ccbf0b6904a25928c4f3e163f52e178b7907"
70+
end
71+
72+
# Apply open PR to fix build when using git submodules
73+
# PR ref: https://github.com/freebayes/freebayes/pull/823
74+
patch do
75+
url "https://github.com/freebayes/freebayes/commit/35eeacb6468fdce25233a33f7216f4e776d381f9.patch?full_index=1"
76+
sha256 "1b6f0bb1e369a4b11e9a7754f3b789035b39cc5d9e3dbbac84fde21893f0d9be"
77+
end
6878

6979
def install
70-
if build.stable?
71-
resources.each { |r| (buildpath/r.name).install r }
80+
resource("vcflib").stage do
81+
rm_r(["contrib/WFA2-lib", "contrib/tabixpp/htslib"]) # avoid bundled libraries
7282

73-
system "cmake", "-S", "contrib/vcflib", "-B", "build_vcflib",
83+
system "cmake", "-S", ".", "-B", "build",
7484
"-DBUILD_DOC=OFF",
7585
"-DBUILD_ONLY_LIB=ON",
7686
"-DZIG=OFF",
7787
*std_cmake_args(install_prefix: buildpath/"vendor")
78-
system "cmake", "--build", "build_vcflib"
79-
system "cmake", "--install", "build_vcflib"
88+
system "cmake", "--build", "build"
89+
system "cmake", "--install", "build"
90+
system "make", "-C", "contrib/intervaltree", "install", "DESTDIR=", "PREFIX=#{buildpath}/vendor"
91+
(buildpath/"vendor/include").install "contrib/tabixpp/tabix.hpp"
8092

81-
# libvcflib.a is installed into CMAKE_INSTALL_BINDIR
82-
(buildpath/"vendor/bin").install "build_vcflib/contrib/WFA2-lib/libwfa2.a"
83-
inreplace "meson.build" do |s|
84-
s.sub! "find_library('libvcflib'", "\\0, dirs: ['#{buildpath}/vendor/bin']"
85-
s.sub! "find_library('libwfa2'", "\\0, dirs: ['#{buildpath}/vendor/bin']"
86-
end
93+
ENV.append_path "LIBRARY_PATH", buildpath/"vendor/bin"
8794
ENV.append_to_cflags "-I#{buildpath}/vendor/include"
95+
ENV.append_to_cflags "-I#{buildpath}/vendor/include/vcflib"
8896
end
8997

90-
# Workaround for ../src/BedReader.h:12:10: fatal error: 'IntervalTree.h' file not found
91-
# Issue ref: https://github.com/freebayes/freebayes/issues/803
92-
ENV.append_to_cflags "-I#{buildpath}/contrib/SeqLib/SeqLib"
93-
94-
system "meson", "setup", "build", "-Dcpp_std=c++14", *std_meson_args
98+
# Set prefer_system_deps=false as we don't have formulae for these and some are not versioned/tagged
99+
system "meson", "setup", "build", "-Dcpp_std=c++14", "-Dprefer_system_deps=false", *std_meson_args
95100
system "meson", "compile", "-C", "build", "--verbose"
96101
system "meson", "install", "-C", "build"
97102
pkgshare.install "test"

0 commit comments

Comments
 (0)