Skip to content

Commit bd4a876

Browse files
committed
htslib: update to 1.22.1
Signed-off-by: Rosen Penev <[email protected]>
1 parent 8ccf8ad commit bd4a876

File tree

7 files changed

+140
-44
lines changed

7 files changed

+140
-44
lines changed

releases.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,7 @@
15151515
"htslib"
15161516
],
15171517
"versions": [
1518+
"1.22.1-1",
15181519
"1.22-1",
15191520
"1.21-2",
15201521
"1.21-1",

subprojects/htslib.wrap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[wrap-file]
2-
directory = htslib-1.22
3-
source_url = https://github.com/samtools/htslib/releases/download/1.22/htslib-1.22.tar.bz2
4-
source_filename = htslib-1.22.tar.bz2
5-
source_hash = 6250c1df297db477516e60ac8df45ed75a652d1f25b0f37f12f5b17269eafde9
2+
directory = htslib-1.22.1
3+
source_url = https://github.com/samtools/htslib/releases/download/1.22.1/htslib-1.22.1.tar.bz2
4+
source_filename = htslib-1.22.1.tar.bz2
5+
source_hash = 3dfa6eeb71db719907fe3ef7c72cb2ec9965b20b58036547c858c89b58c342f7
66
patch_directory = htslib
77

88
[provide]
9-
htslib = htslib_dep
9+
dependency_names = htslib
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
install_headers(
2+
'bgzf.h',
3+
'cram.h',
4+
'faidx.h',
5+
'hfile.h',
6+
'hts_defs.h',
7+
'hts_endian.h',
8+
'hts_expr.h',
9+
'hts.h',
10+
'hts_log.h',
11+
'hts_os.h',
12+
'kbitset.h',
13+
'kfunc.h',
14+
'khash.h',
15+
'khash_str2int.h',
16+
'klist.h',
17+
'knetfile.h',
18+
'kroundup.h',
19+
'kseq.h',
20+
'ksort.h',
21+
'kstring.h',
22+
'regidx.h',
23+
'sam.h',
24+
'synced_bcf_reader.h',
25+
'tbx.h',
26+
'thread_pool.h',
27+
'vcf.h',
28+
'vcf_sweep.h',
29+
'vcfutils.h',
30+
subdir: 'htslib',
31+
)

subprojects/packagefiles/htslib/meson.build

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,46 @@
11
project(
22
'htslib',
33
'c',
4-
version: '1.22',
5-
default_options: ['warning_level=0', 'c_std=c99', 'b_ndebug=if-release'],
4+
version: '1.22.1',
65
license: 'MIT',
7-
meson_version: '>= 0.50.0',
6+
meson_version: '>= 0.54.0',
87
)
98

109
cc = meson.get_compiler('c')
1110
if cc.get_argument_syntax() == 'msvc'
1211
error('MSVC is unsupported. Only MinGW.')
1312
endif
1413

15-
# htslib uses
16-
# - usleep()
17-
# - strdup()
18-
# - M_LN10/M_LN2
19-
add_project_arguments(
20-
'-D_XOPEN_SOURCE=600',
21-
language: 'c',
22-
)
14+
thread_dep = dependency('threads')
15+
zlib_dep = dependency('zlib')
2316

2417
if meson.version().version_compare('>= 0.62')
2518
dl_dep = dependency('dl')
2619
else
2720
dl_dep = cc.find_library('dl')
2821
endif
29-
libm_dep = cc.find_library(
30-
'm',
31-
required: false,
32-
)
33-
regex_dep = dependency(
34-
'regex',
35-
required: host_machine.system() == 'windows',
36-
)
37-
thread_dep = dependency('threads')
38-
ws_dep = cc.find_library(
39-
'ws2_32',
40-
required: host_machine.system() == 'windows',
41-
)
42-
zlib_dep = dependency('zlib')
22+
23+
if cc.links('#include <math.h>\nint main(){log(0);}')
24+
libm_dep = declare_dependency()
25+
else
26+
libm_dep = cc.find_library('m')
27+
endif
28+
29+
if cc.links('#include <regex.h>\nint main(){regfree(0);}')
30+
regex_dep = declare_dependency()
31+
else
32+
regex_dep = dependency('regex')
33+
endif
34+
35+
if host_machine.system() == 'windows'
36+
ws_dep = cc.find_library('ws2_32')
37+
else
38+
if cc.has_function('recv')
39+
ws_dep = declare_dependency()
40+
else
41+
ws_dep = cc.find_library('socket')
42+
endif
43+
endif
4344

4445
htslib_sources = files(
4546
'bcf_sr_sort.c',
@@ -130,22 +131,23 @@ configure_file(
130131
configuration: htslib_version_h_config,
131132
)
132133

133-
# install library if
134-
# - either running as a proper project
135-
# - or linking to shared libraries
136-
htslib_lib_install = (not meson.is_subproject()) or (get_option(
137-
'default_library',
138-
) != 'static')
139-
140134
htslib_lib = library(
141135
'hts',
142136
htslib_sources,
137+
c_args: '-D_XOPEN_SOURCE=600',
143138
soversion: 3,
144139
version: meson.project_version(),
145-
install: htslib_lib_install,
140+
install: true,
146141
dependencies: [dl_dep, libm_dep, regex_dep, thread_dep, ws_dep, zlib_dep],
147142
gnu_symbol_visibility: 'hidden',
148-
override_options: ['warning_level=0', 'c_std=c99'],
143+
override_options: 'c_std=c99',
144+
)
145+
146+
pc = import('pkgconfig')
147+
pc.generate(
148+
htslib_lib,
149+
name: 'htslib',
150+
description: 'C library for high-throughput sequencing data format',
149151
)
150152

151153
###################
@@ -155,14 +157,28 @@ htslib_lib = library(
155157
htslib_dep = declare_dependency(
156158
include_directories: '.',
157159
link_with: htslib_lib,
158-
version: meson.project_version(),
159160
)
160161

162+
meson.override_dependency('htslib', htslib_dep)
163+
164+
subdir('htslib')
165+
166+
foreach e : ['annot-tsv', 'bgzip', 'htsfile', 'tabix']
167+
executable(
168+
e,
169+
'@[email protected]'.format(e),
170+
dependencies: htslib_dep,
171+
install: true,
172+
)
173+
endforeach
174+
175+
subdir('ref_cache')
176+
177+
#mangix/usr/local/bin/ref-cache
178+
161179
#########
162180
# tests #
163181
#########
164182

165-
if get_option('tests')
166-
htslib_source_root = meson.current_source_dir()
167-
subdir('test')
168-
endif
183+
htslib_source_root = meson.current_source_dir()
184+
subdir('test')

subprojects/packagefiles/htslib/meson_options.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
option(
2+
'raf-cache',
3+
type: 'feature',
4+
description: 'raf-cache utility',
5+
)
6+
17
option(
28
'tests',
39
type: 'boolean',
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
socket = cc.has_header(
2+
'sys/socket.h',
3+
required: get_option('raf-cache'),
4+
)
5+
6+
if not socket
7+
subdir_done()
8+
endif
9+
10+
curl_dep = dependency(
11+
'libcurl',
12+
required: get_option('raf-cache'),
13+
)
14+
15+
if not curl_dep.found()
16+
subdir_done()
17+
endif
18+
19+
executable(
20+
'ref-cache',
21+
'cmsg_wrap.c',
22+
'http_parser.c',
23+
'listener.c',
24+
'log_files.c',
25+
'main.c',
26+
'misc.c',
27+
'ping.c',
28+
'poll_wrap_epoll.c',
29+
'poll_wrap_poll.c',
30+
'ref_files.c',
31+
'request_handler.c',
32+
'sendfile_wrap.c',
33+
'server.c',
34+
'transaction.c',
35+
'upstream.c',
36+
'../cram/pooled_alloc.c',
37+
dependencies: [curl_dep, htslib_dep],
38+
)

subprojects/packagefiles/htslib/test/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if not get_option('tests')
2+
subdir_done()
3+
endif
4+
15
# tests rely on -fvisibility=hidden symbols
26
htslib_test_lib = static_library(
37
'statichts',

0 commit comments

Comments
 (0)