Skip to content

Commit 6143086

Browse files
committed
Release 1.17
2 parents 4e61c12 + 0ad23b0 commit 6143086

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3750
-320
lines changed

.cirrus.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ libdeflate_template: &LIBDEFLATE
1515
pushd "$HOME"
1616
git clone --depth 1 https://github.com/ebiggers/libdeflate.git
1717
pushd libdeflate
18-
make -j 4 CFLAGS='-fPIC -O3' libdeflate.a
18+
cmake -B build -DLIBDEFLATE_BUILD_SHARED_LIB=OFF -DLIBDEFLATE_BUILD_GZIP=OFF -DCMAKE_C_FLAGS='-g -O3 -fPIC'
19+
cmake --build build --verbose
1920
popd
2021
popd
2122
fi
@@ -27,7 +28,7 @@ compile_template: &COMPILE
2728
compile_script: |
2829
git submodule update --init --recursive
2930
if test "x$USE_LIBDEFLATE" = "xyes"; then
30-
CONFIG_OPTS='CPPFLAGS="-I$HOME/libdeflate" LDFLAGS="$LDFLAGS -L$HOME/libdeflate" --with-libdeflate'
31+
CONFIG_OPTS='CPPFLAGS="-I$HOME/libdeflate" LDFLAGS="$LDFLAGS -L$HOME/libdeflate/build" --with-libdeflate'
3132
else
3233
CONFIG_OPTS='--without-libdeflate'
3334
fi
@@ -75,6 +76,13 @@ gcc_task:
7576
CFLAGS: -std=c99 -pedantic -Wformat=2
7677
USE_LIBDEFLATE: yes
7778

79+
install_script: |
80+
apt-get update
81+
apt-get install -y --no-install-suggests --no-install-recommends \
82+
ca-certificates libc-dev make git autoconf automake \
83+
zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev \
84+
cmake
85+
7886
<< : *LIBDEFLATE
7987
<< : *COMPILE
8088
<< : *TEST
@@ -129,6 +137,7 @@ rocky_task:
129137
LC_ALL: C
130138
CIRRUS_CLONE_DEPTH: 1
131139
USE_CONFIG: yes
140+
CFLAGS: -std=gnu90
132141

133142
# NB: we could consider building a docker image with these
134143
# preinstalled and specifying that instead, to speed up testing.
@@ -172,8 +181,8 @@ arm_ubuntu_task:
172181

173182
macosx_task:
174183
name: macosx + clang
175-
osx_instance:
176-
image: monterey-base
184+
macos_instance:
185+
image: ghcr.io/cirruslabs/macos-ventura-base:latest
177186

178187
environment:
179188
CC: clang
@@ -187,8 +196,9 @@ macosx_task:
187196
USE_CONFIG: yes
188197
USE_LIBDEFLATE: yes
189198

190-
package_install_script:
191-
- HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool xz git
199+
package_install_script: |
200+
HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool xz git \
201+
cmake
192202
193203
<< : *LIBDEFLATE
194204
<< : *COMPILE

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ README.md export-ignore
2020
# Remove the text attribute from index_dos.sam, so that the line separators
2121
# for the test file don't get converted into Unix format.
2222
test/index_dos.sam -text
23+
24+
# Remove the text attribute from various faidx test files
25+
test/faidx/faidx*.fa* -text
26+
test/faidx/fastqs*.fq* -text

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ shlib-exports-*.txt
4444
/bgzip
4545
/htsfile
4646
/tabix
47+
/test/faidx/*.tmp*
48+
/test/faidx/FAIL*
4749
/test/fieldarith
4850
/test/hfile
4951
/test/hts_endian
@@ -59,6 +61,7 @@ shlib-exports-*.txt
5961
/test/test-bcf_set_variant_type
6062
/test/test_bgzf
6163
/test/test_expr
64+
/test/test_faidx
6265
/test/test_index
6366
/test/test_introspection
6467
/test/test_kfunc

INSTALL

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ The 'make install' command installs the libraries, library header files,
110110
utilities, several manual pages, and a pkgconfig file to /usr/local.
111111
The installation location can be changed by configuring with --prefix=DIR
112112
or via 'make prefix=DIR install' (see Installation Locations below).
113+
Shared library permissions can be set via e.g. 'make install LIB_PERM=755'.
113114

114115

115116
Configuration
@@ -291,3 +292,13 @@ mingw-w64-x86_64-xz mingw-w64-x86_64-curl mingw-w64-x86_64-autotools
291292
mingw-w64-x86_64-tools-git
292293

293294
(The last is only needed for building libraries compatible with MSVC.)
295+
296+
HP-UX
297+
-----
298+
299+
HP-UX requires that shared libraries have execute permission. The
300+
default for HTSlib is to install with permission 644 (read-write for
301+
owner and read-only for group / other). This can be overridden by
302+
setting the LIB_PERM variable at install time with:
303+
304+
make install LIB_PERM=755

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ according to the terms of the following MIT/Expat license.]
33

44
The MIT/Expat License
55

6-
Copyright (C) 2012-2022 Genome Research Ltd.
6+
Copyright (C) 2012-2023 Genome Research Ltd.
77

88
Permission is hereby granted, free of charge, to any person obtaining a copy
99
of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@ according to the terms of the following Modified 3-Clause BSD license.]
2929

3030
The Modified-BSD License
3131

32-
Copyright (C) 2012-2022 Genome Research Ltd.
32+
Copyright (C) 2012-2023 Genome Research Ltd.
3333

3434
Redistribution and use in source and binary forms, with or without
3535
modification, are permitted provided that the following conditions are met:

Makefile

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile for htslib, a C library for high-throughput sequencing data formats.
22
#
3-
# Copyright (C) 2013-2022 Genome Research Ltd.
3+
# Copyright (C) 2013-2023 Genome Research Ltd.
44
#
55
# Author: John Marshall <[email protected]>
66
#
@@ -39,6 +39,7 @@ CFLAGS = -g -Wall -O2 -fvisibility=hidden
3939
EXTRA_CFLAGS_PIC = -fpic
4040
TARGET_CFLAGS =
4141
LDFLAGS = -fvisibility=hidden
42+
VERSION_SCRIPT_LDFLAGS = -Wl,-version-script,$(srcprefix)htslib.map
4243
LIBS = $(htslib_default_libs)
4344

4445
prefix = /usr/local
@@ -58,7 +59,8 @@ MKDIR_P = mkdir -p
5859
INSTALL = install -p
5960
INSTALL_DATA = $(INSTALL) -m 644
6061
INSTALL_DIR = $(MKDIR_P) -m 755
61-
INSTALL_LIB = $(INSTALL_DATA)
62+
LIB_PERM = 644
63+
INSTALL_LIB = $(INSTALL) -m $(LIB_PERM)
6264
INSTALL_MAN = $(INSTALL_DATA)
6365
INSTALL_PROGRAM = $(INSTALL)
6466

@@ -80,6 +82,7 @@ BUILT_TEST_PROGRAMS = \
8082
test/sam \
8183
test/test_bgzf \
8284
test/test_expr \
85+
test/test_faidx \
8386
test/test_kfunc \
8487
test/test_kstring \
8588
test/test_mod \
@@ -140,8 +143,8 @@ LIBHTS_SOVERSION = 3
140143
# is not strictly necessary and should be removed the next time
141144
# LIBHTS_SOVERSION is bumped (see #1144 and
142145
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW23)
143-
MACH_O_COMPATIBILITY_VERSION = 3.1.16
144-
MACH_O_CURRENT_VERSION = 3.1.16
146+
MACH_O_COMPATIBILITY_VERSION = 3.1.17
147+
MACH_O_CURRENT_VERSION = 3.1.17
145148

146149
# $(NUMERIC_VERSION) is for items that must have a numeric X.Y.Z string
147150
# even if this is a dirty or untagged Git working tree.
@@ -160,12 +163,20 @@ show-version:
160163
@echo PACKAGE_VERSION = $(PACKAGE_VERSION)
161164
@echo NUMERIC_VERSION = $(NUMERIC_VERSION)
162165

166+
config_vars.h: override escape=$(subst ',\x27,$(subst ",\",$(subst \,\\,$(1))))
167+
config_vars.h: override hts_cc_escaped=$(call escape,$(CC))
168+
config_vars.h: override hts_cppflags_escaped=$(call escape,$(CPPFLAGS))
169+
config_vars.h: override hts_cflags_escaped=$(call escape,$(CFLAGS))
170+
config_vars.h: override hts_ldflags_escaped=$(call escape,$(LDFLAGS))
171+
config_vars.h: override hts_libs_escaped=$(call escape,$(LIBS))
172+
163173
config_vars.h:
164-
echo '#define HTS_CC "$(CC)"' > $@
165-
echo '#define HTS_CPPFLAGS "$(CPPFLAGS)"' >> $@
166-
echo '#define HTS_CFLAGS "$(CFLAGS)"' >> $@
167-
echo '#define HTS_LDFLAGS "$(LDFLAGS)"' >> $@
168-
echo '#define HTS_LIBS "$(LIBS)"' >> $@
174+
printf '#define HTS_CC "%s"\n#define HTS_CPPFLAGS "%s"\n#define HTS_CFLAGS "%s"\n#define HTS_LDFLAGS "%s"\n#define HTS_LIBS "%s"\n' \
175+
'$(hts_cc_escaped)' \
176+
'$(hts_cppflags_escaped)' \
177+
'$(hts_cflags_escaped)' \
178+
'$(hts_ldflags_escaped)' \
179+
'$(hts_libs_escaped)' > $@
169180

170181
.SUFFIXES: .bundle .c .cygdll .dll .o .pico .so
171182

@@ -344,7 +355,7 @@ print-config:
344355
# file used at runtime (when $LD_LIBRARY_PATH includes the build directory).
345356

346357
libhts.so: $(LIBHTS_OBJS:.o=.pico)
347-
$(CC) -shared -Wl,-soname,libhts.so.$(LIBHTS_SOVERSION) $(LDFLAGS) -o $@ $(LIBHTS_OBJS:.o=.pico) $(LIBS) -lpthread
358+
$(CC) -shared -Wl,-soname,libhts.so.$(LIBHTS_SOVERSION) $(VERSION_SCRIPT_LDFLAGS) $(LDFLAGS) -o $@ $(LIBHTS_OBJS:.o=.pico) $(LIBS) -lpthread
348359
ln -sf $@ libhts.so.$(LIBHTS_SOVERSION)
349360

350361
# Similarly this also creates libhts.NN.dylib as a byproduct, so that programs
@@ -494,7 +505,7 @@ htsfile: htsfile.o libhts.a
494505
tabix: tabix.o libhts.a
495506
$(CC) $(LDFLAGS) -o $@ tabix.o libhts.a $(LIBS) -lpthread
496507

497-
bgzip.o: bgzip.c config.h $(htslib_bgzf_h) $(htslib_hts_h)
508+
bgzip.o: bgzip.c config.h $(htslib_bgzf_h) $(htslib_hts_h) $(htslib_hfile_h)
498509
htsfile.o: htsfile.c config.h $(htslib_hfile_h) $(htslib_hts_h) $(htslib_sam_h) $(htslib_vcf_h)
499510
tabix.o: tabix.c config.h $(htslib_tbx_h) $(htslib_sam_h) $(htslib_vcf_h) $(htslib_kseq_h) $(htslib_bgzf_h) $(htslib_hts_h) $(htslib_regidx_h) $(htslib_hts_defs_h) $(htslib_hts_log_h)
500511

@@ -583,12 +594,13 @@ check test: all $(HTSCODECS_TEST_TARGETS)
583594
fi
584595
test/test_bgzf test/bgziptest.txt
585596
test/test-parse-reg -t test/colons.bam
597+
cd test/faidx && ./test-faidx.sh faidx.tst
586598
cd test/sam_filter && ./filter.sh filter.tst
587599
cd test/tabix && ./test-tabix.sh tabix.tst
588600
cd test/mpileup && ./test-pileup.sh mpileup.tst
589601
cd test/fastq && ./test-fastq.sh
590602
cd test/base_mods && ./base-mods.sh base-mods.tst
591-
REF_PATH=: test/sam test/ce.fa test/faidx.fa test/fastqs.fq
603+
REF_PATH=: test/sam test/ce.fa test/faidx/faidx.fa test/faidx/fastqs.fq
592604
test/test-regidx
593605
cd test && REF_PATH=: ./test.pl $${TEST_OPTS:-}
594606

@@ -622,6 +634,9 @@ test/test_bgzf: test/test_bgzf.o libhts.a
622634
test/test_expr: test/test_expr.o libhts.a
623635
$(CC) $(LDFLAGS) -o $@ test/test_expr.o libhts.a -lz $(LIBS) -lpthread
624636

637+
test/test_faidx: test/test_faidx.o libhts.a
638+
$(CC) $(LDFLAGS) -o $@ test/test_faidx.o libhts.a -lz $(LIBS) -lpthread
639+
625640
test/test_kfunc: test/test_kfunc.o libhts.a
626641
$(CC) $(LDFLAGS) -o $@ test/test_kfunc.o libhts.a -lz $(LIBS) -lpthread
627642

@@ -739,6 +754,7 @@ test/test-regidx.o: test/test-regidx.c config.h $(htslib_kstring_h) $(htslib_reg
739754
test/test_str2int.o: test/test_str2int.c config.h $(textutils_internal_h)
740755
test/test_time_funcs.o: test/test_time_funcs.c config.h $(hts_time_funcs_h)
741756
test/test_view.o: test/test_view.c config.h $(cram_h) $(htslib_sam_h) $(htslib_vcf_h) $(htslib_hts_log_h)
757+
test/test_faidx.o: test/test_faidx.c config.h $(htslib_faidx_h)
742758
test/test_index.o: test/test_index.c config.h $(htslib_sam_h) $(htslib_vcf_h)
743759
test/test-vcf-api.o: test/test-vcf-api.c config.h $(htslib_hts_h) $(htslib_vcf_h) $(htslib_kstring_h) $(htslib_kseq_h)
744760
test/test-vcf-sweep.o: test/test-vcf-sweep.c config.h $(htslib_vcf_sweep_h)
@@ -789,14 +805,39 @@ header-exports.txt: test/header_syms.pl htslib/*.h
789805
test/header_syms.pl htslib/*.h | sort -u -o $@
790806

791807
shlib-exports-so.txt: libhts.so
792-
nm -D -g libhts.so | awk '$$2 == "T" { print $$3 }' | sort -u -o $@
808+
nm -D -g libhts.so | awk '$$2 == "T" { sub("@.*", "", $$3); print $$3 }' | sort -u -o $@
793809

794810
shlib-exports-dylib.txt: libhts.dylib
795811
nm -Ug libhts.dylib | awk '$$2 == "T" { sub("^_", "", $$3); print $$3 }' | sort -u -o $@
796812

797813
shlib-exports-dll.txt: hts.dll.a
798814
nm -g hts.dll.a | awk '$$2 == "T" { print $$3 }' | sort -u -o $@
799815

816+
$(srcprefix)htslib.map: libhts.so
817+
LC_ALL=C ; export LC_ALL; \
818+
curr_vers=`expr 'X$(PACKAGE_VERSION)' : 'X\([0-9]*\.[0-9.]*\)'` ; \
819+
last_vers=`awk '/^HTSLIB_[0-9](\.[0-9]+)+/ { lv = $$1 } END { print lv }' htslib.map` ; \
820+
if test "x$$curr_vers" = 'x' || test "x$$last_vers" = 'x' ; then \
821+
echo "Version check failed : $$curr_vers / $$las_vers" 1>&2 ; \
822+
exit 1 ; \
823+
fi && \
824+
if test "HTSLIB_$$curr_vers" = "$$last_vers" ; then \
825+
echo "Refusing to update $@ - HTSlib version not changed" 1>&2 ; \
826+
exit 1 ; \
827+
fi && \
828+
nm --with-symbol-versions -D -g libhts.so | awk '$$2 ~ /^[DGRT]$$/ && $$3 ~ /@@Base$$/ && $$3 !~ /^(_init|_fini|_edata)@@/ { sub(/@@Base$$/, ";", $$3); print " " $$3 }' > $@.tmp && \
829+
if [ -s $@.tmp ] ; then \
830+
cat $@ > $@.new.tmp && \
831+
printf '\n%s {\n' "HTSLIB_$$curr_vers" >> $@.new.tmp && \
832+
cat $@.tmp >> $@.new.tmp && \
833+
printf '} %s;\n' "$$last_vers" >> $@.new.tmp && \
834+
rm -f $@.tmp && \
835+
mv $@.new.tmp $@ ; \
836+
fi ; \
837+
else \
838+
rm -f $@.tmp ; \
839+
fi
840+
800841
install: libhts.a $(BUILT_PROGRAMS) $(BUILT_PLUGINS) installdirs install-$(SHLIB_FLAVOUR) install-pkgconfig
801842
$(INSTALL_PROGRAM) $(BUILT_PROGRAMS) $(DESTDIR)$(bindir)
802843
if test -n "$(BUILT_PLUGINS)"; then $(INSTALL_PROGRAM) $(BUILT_PLUGINS) $(DESTDIR)$(plugindir); fi
@@ -845,7 +886,9 @@ htslib-uninstalled.pc: htslib.pc.tmp
845886

846887

847888
testclean:
848-
-rm -f test/*.tmp test/*.tmp.* test/longrefs/*.tmp.* test/tabix/*.tmp.* test/tabix/FAIL* header-exports.txt shlib-exports-$(SHLIB_FLAVOUR).txt
889+
-rm -f test/*.tmp test/*.tmp.* test/faidx/*.tmp* test/faidx/FAIL* \
890+
test/longrefs/*.tmp.* test/tabix/*.tmp.* test/tabix/FAIL* \
891+
header-exports.txt shlib-exports-$(SHLIB_FLAVOUR).txt
849892
-rm -rf htscodecs/tests/test.out
850893

851894
# Only remove this in git checkouts

0 commit comments

Comments
 (0)