Package: libbiod / 0.2.3+git20191120.b8eecef-2

03_add-meson-build.patch Patch series | download
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
From 6a5a4710d4600b939e7d3ef183be73756326b4b5 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp <matthias@tenstral.net>
Date: Sun, 15 Dec 2019 00:45:59 +0100
Subject: [PATCH] Add Meson build definition

---
 meson.build       | 184 ++++++++++++++++++++++++++++++++++++++++++++++
 meson_options.txt |   1 +
 2 files changed, 185 insertions(+)
 create mode 100644 meson.build
 create mode 100644 meson_options.txt

diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..4408520
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,184 @@
+project('BioD', 'd',
+    meson_version : '>=0.48',
+    license : 'MIT',
+    version : '0.2.3',
+    default_options : ['buildtype=debugoptimized']
+)
+
+project_soversion = '0'
+
+src_dir = include_directories('.')
+pkgc = import('pkgconfig')
+
+extra_dflags = []
+if get_option('optimize_strong')
+    if meson.get_compiler('d').get_id() == 'gcc'
+        message('No custom strong optimization flags are defined for GDC yet.')
+    endif
+    extra_dflags = ['-O3', '-release', '-enable-inlining', '-boundscheck=off']
+endif
+
+#
+# Dependencies
+#
+zlib_dep = dependency('zlib')
+
+#
+# Sources
+#
+undead_src = [
+    'contrib/undead/cstream.d',
+    'contrib/undead/doformat.d',
+    'contrib/undead/internal/file.d',
+    'contrib/undead/stream.d',
+    'contrib/undead/utf.d'
+]
+
+biod_src = [
+    'bio/core/base.d',
+    'bio/core/bgzf/block.d',
+    'bio/core/bgzf/chunk.d',
+    'bio/core/bgzf/compress.d',
+    'bio/core/bgzf/constants.d',
+    'bio/core/bgzf/inputstream.d',
+    'bio/core/bgzf/outputstream.d',
+    'bio/core/bgzf/virtualoffset.d',
+    'bio/core/call.d',
+    'bio/core/decompress.d',
+    'bio/core/genotype.d',
+    'bio/core/kmer.d',
+    'bio/core/region.d',
+    'bio/core/sequence.d',
+    'bio/core/tinymap.d',
+    'bio/core/utils/algo.d',
+    'bio/core/utils/bylinefast.d',
+    'bio/core/utils/exception.d',
+    'bio/core/utils/format.d',
+    'bio/core/utils/memoize.d',
+    'bio/core/utils/outbuffer.d',
+    'bio/core/utils/range.d',
+    'bio/core/utils/roundbuf.d',
+    'bio/core/utils/stream.d',
+    'bio/core/utils/switchendianness.d',
+    'bio/core/utils/tmpfile.d',
+    'bio/core/utils/zlib.d',
+    'bio/std/experimental/hts/bam/header.d',
+    'bio/std/experimental/hts/bam/reader.d',
+    'bio/std/experimental/hts/bam/writer.d',
+    'bio/std/experimental/hts/bgzf.d',
+    'bio/std/experimental/hts/bgzf_writer.d',
+    'bio/std/experimental/hts/constants.d',
+    'bio/std/experimental/hts/hashing.d',
+    'bio/std/experimental/hts/logger.d',
+    'bio/std/experimental/hts/pileup.d',
+    'bio/std/experimental/hts/reads.d',
+    'bio/std/experimental/hts/unpack.d',
+    'bio/std/file/fai.d',
+    'bio/std/file/fasta.d',
+    'bio/std/file/fastq.d',
+    'bio/std/genotype/maf.d',
+    'bio/std/genotype/snp.d',
+    'bio/std/hts/bam/abstractreader.d',
+    'bio/std/hts/bam/bai/bin.d',
+    'bio/std/hts/bam/baifile.d',
+    'bio/std/hts/bam/bai/indexing.d',
+    'bio/std/hts/bam/baseinfo.d',
+    'bio/std/hts/bam/cigar.d',
+    'bio/std/hts/bam/constants.d',
+    'bio/std/hts/bam/md/core.d',
+    'bio/std/hts/bam/md/operation.d',
+    'bio/std/hts/bam/md/parse.d',
+    'bio/std/hts/bam/md/reconstruct.d',
+    'bio/std/hts/bam/multireader.d',
+    'bio/std/hts/bam/pileup.d',
+    'bio/std/hts/bam/randomaccessmanager.d',
+    'bio/std/hts/bam/read.d',
+    'bio/std/hts/bam/reader.d',
+    'bio/std/hts/bam/readrange.d',
+    'bio/std/hts/bam/reference.d',
+    'bio/std/hts/bam/referenceinfo.d',
+    'bio/std/hts/bam/region.d',
+    'bio/std/hts/bam/splitter.d',
+    'bio/std/hts/bam/tagvalue.d',
+    'bio/std/hts/bam/validation/alignment.d',
+    'bio/std/hts/bam/validation/samheader.d',
+    'bio/std/hts/bam/writer.d',
+    'bio/std/hts/iontorrent/flowcall.d',
+    'bio/std/hts/iontorrent/flowindex.d',
+    'bio/std/hts/sam/header.d',
+    'bio/std/hts/sam/reader.d',
+    'bio/std/hts/sam/utils/fastrecordparser.d',
+    'bio/std/hts/sam/utils/recordparser.d',
+    'bio/std/hts/snpcallers/maq.d',
+    'bio/std/hts/snpcallers/simple.d',
+    'bio/std/hts/thirdparty/msgpack.d',
+    'bio/std/hts/utils/array.d',
+    'bio/std/hts/utils/graph.d',
+    'bio/std/hts/utils/samheadermerger.d',
+    'bio/std/hts/utils/value.d',
+    'bio/std/maf/block.d',
+    'bio/std/maf/parser.d',
+    'bio/std/maf/reader.d',
+    'bio/std/range/splitter.d',
+    'bio/std/sff/constants.d',
+    'bio/std/sff/index.d',
+    'bio/std/sff/read.d',
+    'bio/std/sff/reader.d',
+    'bio/std/sff/readrange.d',
+    'bio/std/sff/utils/roundup.d',
+    'bio/std/sff/writer.d'
+]
+
+tests_src = [
+    'test/unittests.d'
+]
+
+#
+# Includes
+#
+install_subdir('bio/', install_dir: 'include/d/bio/')
+install_subdir('contrib/undead', install_dir: 'include/d/bio/contrib/')
+
+#
+# Library and pkg-config
+#
+biod_lib = both_libraries('biod',
+        [undead_src, biod_src],
+        dependencies: [zlib_dep],
+        install: true,
+        version: meson.project_version(),
+        soversion: project_soversion,
+        d_args: extra_dflags
+)
+pkgc.generate(name: 'biod',
+              libraries: biod_lib,
+              subdirs: 'd/bio/',
+              version: meson.project_version(),
+              description: 'D library for computational biology and bioinformatics'
+)
+
+#
+# Tests
+#
+
+# workaround for GDC having no -main switch
+test_main_src = join_paths(meson.build_root(), 'utmain.d')
+run_command('sh',
+            ['-c', 'echo "void main () {}" > ' + test_main_src],
+            check: true)
+
+biod_test_exe = executable('biod_test',
+    [undead_src,
+     biod_src,
+     tests_src,
+     test_main_src],
+    dependencies: [zlib_dep],
+    d_unittest: true,
+    d_args: extra_dflags
+)
+test('biod_tests',
+     biod_test_exe,
+     args: ['--DRT-gcopt=gc:precise disable:1 cleanup:none'],
+     workdir: join_paths(meson.source_root(), 'test'),
+     is_parallel: false
+)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..607da9a
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('optimize_strong', type : 'boolean', value: false)
-- 
2.24.0