Skip to content

Commit

Permalink
Release 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
daviesrob committed Feb 21, 2023
2 parents 4e61c12 + 0ad23b0 commit 6143086
Show file tree
Hide file tree
Showing 59 changed files with 3,750 additions and 320 deletions.
22 changes: 16 additions & 6 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ libdeflate_template: &LIBDEFLATE
pushd "$HOME"
git clone --depth 1 https://github.com/ebiggers/libdeflate.git
pushd libdeflate
make -j 4 CFLAGS='-fPIC -O3' libdeflate.a
cmake -B build -DLIBDEFLATE_BUILD_SHARED_LIB=OFF -DLIBDEFLATE_BUILD_GZIP=OFF -DCMAKE_C_FLAGS='-g -O3 -fPIC'
cmake --build build --verbose
popd
popd
fi
Expand All @@ -27,7 +28,7 @@ compile_template: &COMPILE
compile_script: |
git submodule update --init --recursive
if test "x$USE_LIBDEFLATE" = "xyes"; then
CONFIG_OPTS='CPPFLAGS="-I$HOME/libdeflate" LDFLAGS="$LDFLAGS -L$HOME/libdeflate" --with-libdeflate'
CONFIG_OPTS='CPPFLAGS="-I$HOME/libdeflate" LDFLAGS="$LDFLAGS -L$HOME/libdeflate/build" --with-libdeflate'
else
CONFIG_OPTS='--without-libdeflate'
fi
Expand Down Expand Up @@ -75,6 +76,13 @@ gcc_task:
CFLAGS: -std=c99 -pedantic -Wformat=2
USE_LIBDEFLATE: yes

install_script: |
apt-get update
apt-get install -y --no-install-suggests --no-install-recommends \
ca-certificates libc-dev make git autoconf automake \
zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev \
cmake
<< : *LIBDEFLATE
<< : *COMPILE
<< : *TEST
Expand Down Expand Up @@ -129,6 +137,7 @@ rocky_task:
LC_ALL: C
CIRRUS_CLONE_DEPTH: 1
USE_CONFIG: yes
CFLAGS: -std=gnu90

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

macosx_task:
name: macosx + clang
osx_instance:
image: monterey-base
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest

environment:
CC: clang
Expand All @@ -187,8 +196,9 @@ macosx_task:
USE_CONFIG: yes
USE_LIBDEFLATE: yes

package_install_script:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool xz git
package_install_script: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install autoconf automake libtool xz git \
cmake
<< : *LIBDEFLATE
<< : *COMPILE
Expand Down
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ README.md export-ignore
# Remove the text attribute from index_dos.sam, so that the line separators
# for the test file don't get converted into Unix format.
test/index_dos.sam -text

# Remove the text attribute from various faidx test files
test/faidx/faidx*.fa* -text
test/faidx/fastqs*.fq* -text
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ shlib-exports-*.txt
/bgzip
/htsfile
/tabix
/test/faidx/*.tmp*
/test/faidx/FAIL*
/test/fieldarith
/test/hfile
/test/hts_endian
Expand All @@ -59,6 +61,7 @@ shlib-exports-*.txt
/test/test-bcf_set_variant_type
/test/test_bgzf
/test/test_expr
/test/test_faidx
/test/test_index
/test/test_introspection
/test/test_kfunc
Expand Down
11 changes: 11 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ The 'make install' command installs the libraries, library header files,
utilities, several manual pages, and a pkgconfig file to /usr/local.
The installation location can be changed by configuring with --prefix=DIR
or via 'make prefix=DIR install' (see Installation Locations below).
Shared library permissions can be set via e.g. 'make install LIB_PERM=755'.


Configuration
Expand Down Expand Up @@ -291,3 +292,13 @@ mingw-w64-x86_64-xz mingw-w64-x86_64-curl mingw-w64-x86_64-autotools
mingw-w64-x86_64-tools-git

(The last is only needed for building libraries compatible with MSVC.)

HP-UX
-----

HP-UX requires that shared libraries have execute permission. The
default for HTSlib is to install with permission 644 (read-write for
owner and read-only for group / other). This can be overridden by
setting the LIB_PERM variable at install time with:

make install LIB_PERM=755
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ according to the terms of the following MIT/Expat license.]

The MIT/Expat License

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

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

The Modified-BSD License

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

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
71 changes: 57 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for htslib, a C library for high-throughput sequencing data formats.
#
# Copyright (C) 2013-2022 Genome Research Ltd.
# Copyright (C) 2013-2023 Genome Research Ltd.
#
# Author: John Marshall <jm18@sanger.ac.uk>
#
Expand Down Expand Up @@ -39,6 +39,7 @@ CFLAGS = -g -Wall -O2 -fvisibility=hidden
EXTRA_CFLAGS_PIC = -fpic
TARGET_CFLAGS =
LDFLAGS = -fvisibility=hidden
VERSION_SCRIPT_LDFLAGS = -Wl,-version-script,$(srcprefix)htslib.map
LIBS = $(htslib_default_libs)

prefix = /usr/local
Expand All @@ -58,7 +59,8 @@ MKDIR_P = mkdir -p
INSTALL = install -p
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(MKDIR_P) -m 755
INSTALL_LIB = $(INSTALL_DATA)
LIB_PERM = 644
INSTALL_LIB = $(INSTALL) -m $(LIB_PERM)
INSTALL_MAN = $(INSTALL_DATA)
INSTALL_PROGRAM = $(INSTALL)

Expand All @@ -80,6 +82,7 @@ BUILT_TEST_PROGRAMS = \
test/sam \
test/test_bgzf \
test/test_expr \
test/test_faidx \
test/test_kfunc \
test/test_kstring \
test/test_mod \
Expand Down Expand Up @@ -140,8 +143,8 @@ LIBHTS_SOVERSION = 3
# is not strictly necessary and should be removed the next time
# LIBHTS_SOVERSION is bumped (see #1144 and
# https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW23)
MACH_O_COMPATIBILITY_VERSION = 3.1.16
MACH_O_CURRENT_VERSION = 3.1.16
MACH_O_COMPATIBILITY_VERSION = 3.1.17
MACH_O_CURRENT_VERSION = 3.1.17

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

config_vars.h: override escape=$(subst ',\x27,$(subst ",\",$(subst \,\\,$(1))))
config_vars.h: override hts_cc_escaped=$(call escape,$(CC))
config_vars.h: override hts_cppflags_escaped=$(call escape,$(CPPFLAGS))
config_vars.h: override hts_cflags_escaped=$(call escape,$(CFLAGS))
config_vars.h: override hts_ldflags_escaped=$(call escape,$(LDFLAGS))
config_vars.h: override hts_libs_escaped=$(call escape,$(LIBS))

config_vars.h:
echo '#define HTS_CC "$(CC)"' > $@
echo '#define HTS_CPPFLAGS "$(CPPFLAGS)"' >> $@
echo '#define HTS_CFLAGS "$(CFLAGS)"' >> $@
echo '#define HTS_LDFLAGS "$(LDFLAGS)"' >> $@
echo '#define HTS_LIBS "$(LIBS)"' >> $@
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' \
'$(hts_cc_escaped)' \
'$(hts_cppflags_escaped)' \
'$(hts_cflags_escaped)' \
'$(hts_ldflags_escaped)' \
'$(hts_libs_escaped)' > $@

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

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

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

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

bgzip.o: bgzip.c config.h $(htslib_bgzf_h) $(htslib_hts_h)
bgzip.o: bgzip.c config.h $(htslib_bgzf_h) $(htslib_hts_h) $(htslib_hfile_h)
htsfile.o: htsfile.c config.h $(htslib_hfile_h) $(htslib_hts_h) $(htslib_sam_h) $(htslib_vcf_h)
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)

Expand Down Expand Up @@ -583,12 +594,13 @@ check test: all $(HTSCODECS_TEST_TARGETS)
fi
test/test_bgzf test/bgziptest.txt
test/test-parse-reg -t test/colons.bam
cd test/faidx && ./test-faidx.sh faidx.tst
cd test/sam_filter && ./filter.sh filter.tst
cd test/tabix && ./test-tabix.sh tabix.tst
cd test/mpileup && ./test-pileup.sh mpileup.tst
cd test/fastq && ./test-fastq.sh
cd test/base_mods && ./base-mods.sh base-mods.tst
REF_PATH=: test/sam test/ce.fa test/faidx.fa test/fastqs.fq
REF_PATH=: test/sam test/ce.fa test/faidx/faidx.fa test/faidx/fastqs.fq
test/test-regidx
cd test && REF_PATH=: ./test.pl $${TEST_OPTS:-}

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

test/test_faidx: test/test_faidx.o libhts.a
$(CC) $(LDFLAGS) -o $@ test/test_faidx.o libhts.a -lz $(LIBS) -lpthread

test/test_kfunc: test/test_kfunc.o libhts.a
$(CC) $(LDFLAGS) -o $@ test/test_kfunc.o libhts.a -lz $(LIBS) -lpthread

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

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

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

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

$(srcprefix)htslib.map: libhts.so
LC_ALL=C ; export LC_ALL; \
curr_vers=`expr 'X$(PACKAGE_VERSION)' : 'X\([0-9]*\.[0-9.]*\)'` ; \
last_vers=`awk '/^HTSLIB_[0-9](\.[0-9]+)+/ { lv = $$1 } END { print lv }' htslib.map` ; \
if test "x$$curr_vers" = 'x' || test "x$$last_vers" = 'x' ; then \
echo "Version check failed : $$curr_vers / $$las_vers" 1>&2 ; \
exit 1 ; \
fi && \
if test "HTSLIB_$$curr_vers" = "$$last_vers" ; then \
echo "Refusing to update $@ - HTSlib version not changed" 1>&2 ; \
exit 1 ; \
fi && \
nm --with-symbol-versions -D -g libhts.so | awk '$$2 ~ /^[DGRT]$$/ && $$3 ~ /@@Base$$/ && $$3 !~ /^(_init|_fini|_edata)@@/ { sub(/@@Base$$/, ";", $$3); print " " $$3 }' > $@.tmp && \
if [ -s $@.tmp ] ; then \
cat $@ > $@.new.tmp && \
printf '\n%s {\n' "HTSLIB_$$curr_vers" >> $@.new.tmp && \
cat $@.tmp >> $@.new.tmp && \
printf '} %s;\n' "$$last_vers" >> $@.new.tmp && \
rm -f $@.tmp && \
mv $@.new.tmp $@ ; \
fi ; \
else \
rm -f $@.tmp ; \
fi

install: libhts.a $(BUILT_PROGRAMS) $(BUILT_PLUGINS) installdirs install-$(SHLIB_FLAVOUR) install-pkgconfig
$(INSTALL_PROGRAM) $(BUILT_PROGRAMS) $(DESTDIR)$(bindir)
if test -n "$(BUILT_PLUGINS)"; then $(INSTALL_PROGRAM) $(BUILT_PLUGINS) $(DESTDIR)$(plugindir); fi
Expand Down Expand Up @@ -845,7 +886,9 @@ htslib-uninstalled.pc: htslib.pc.tmp


testclean:
-rm -f test/*.tmp test/*.tmp.* test/longrefs/*.tmp.* test/tabix/*.tmp.* test/tabix/FAIL* header-exports.txt shlib-exports-$(SHLIB_FLAVOUR).txt
-rm -f test/*.tmp test/*.tmp.* test/faidx/*.tmp* test/faidx/FAIL* \
test/longrefs/*.tmp.* test/tabix/*.tmp.* test/tabix/FAIL* \
header-exports.txt shlib-exports-$(SHLIB_FLAVOUR).txt
-rm -rf htscodecs/tests/test.out

# Only remove this in git checkouts
Expand Down
Loading

0 comments on commit 6143086

Please sign in to comment.