forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bamtools.rb
72 lines (62 loc) · 2.52 KB
/
bamtools.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require 'formula'
class Bamtools < Formula
homepage 'https://github.com/pezmaster31/bamtools'
url 'https://github.com/pezmaster31/bamtools/archive/v2.2.3.tar.gz'
sha1 '130c20f13948e007516d2d0ec068bcb9685fc8d4'
head 'https://github.com/pezmaster31/bamtools.git'
depends_on 'cmake' => :build
# Install libbamtools in /usr/local/lib.
# Link statically with libbamtools-util and libjsoncpp, since
# they're not installed by default. Sent upstream:
# https://github.com/pezmaster31/bamtools/pull/55
def patches
DATA
end
def install
mkdir 'default' do
system "cmake", "..", *std_cmake_args
system "make install"
end
end
def test
system "#{bin}/bamtools", "--version"
end
end
__END__
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index 66eb35f..c4df349 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -54,8 +54,8 @@ target_link_libraries( BamTools ${APILibs} )
target_link_libraries( BamTools-static ${APILibs} )
# set library install destinations
-install( TARGETS BamTools LIBRARY DESTINATION "lib/bamtools" RUNTIME DESTINATION "bin")
-install( TARGETS BamTools-static ARCHIVE DESTINATION "lib/bamtools")
+install( TARGETS BamTools LIBRARY DESTINATION "lib" RUNTIME DESTINATION "bin")
+install( TARGETS BamTools-static ARCHIVE DESTINATION "lib")
# export API headers
include(../ExportHeader.cmake)
diff --git a/src/third_party/jsoncpp/CMakeLists.txt b/src/third_party/jsoncpp/CMakeLists.txt
index 03c091b..cf95791 100644
--- a/src/third_party/jsoncpp/CMakeLists.txt
+++ b/src/third_party/jsoncpp/CMakeLists.txt
@@ -10,7 +10,7 @@ add_definitions( -DBAMTOOLS_JSONCPP_LIBRARY ) # (for proper exporting of library
add_definitions( -fPIC ) # (attempt to force PIC compiling on CentOS, not being set on shared libs by CMake)
# create jsoncpp library
-add_library( jsoncpp SHARED
+add_library( jsoncpp STATIC
json_reader.cpp
json_value.cpp
json_writer.cpp
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
index 2d91ca3..b38859c 100644
--- a/src/utils/CMakeLists.txt
+++ b/src/utils/CMakeLists.txt
@@ -13,7 +13,7 @@ add_definitions( -DBAMTOOLS_UTILS_LIBRARY ) # (for proper exporting of library s
add_definitions( -fPIC ) # (attempt to force PIC compiling on CentOS, not being set on shared libs by CMake)
# create BamTools utils library
-add_library( BamTools-utils SHARED
+add_library( BamTools-utils STATIC
bamtools_fasta.cpp
bamtools_options.cpp
bamtools_pileup_engine.cpp