From af26abcaad645f153951fd103f505d01d7b35ad5 Mon Sep 17 00:00:00 2001 From: John Marshall Date: Thu, 5 Nov 2020 16:36:27 +0000 Subject: [PATCH] Apply HTSlib patches to fix https/S3/GCS/etc plugins Backport symbol name typo fix; apply simplified form of upcoming fix for samtools/htslib#1176. Patches applicable to HTSlib 1.11; will not be needed for future upstream versions. --- recipes/htslib/meta.yaml | 4 +++- recipes/htslib/plugin-fixes.patch | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 recipes/htslib/plugin-fixes.patch diff --git a/recipes/htslib/meta.yaml b/recipes/htslib/meta.yaml index d4a163527c2f0..8924147653613 100644 --- a/recipes/htslib/meta.yaml +++ b/recipes/htslib/meta.yaml @@ -5,13 +5,15 @@ package: version: {{ version }} build: - number: 0 + number: 1 run_exports: - {{ pin_subpackage('htslib', max_pin='x.x') }} source: url: https://github.com/samtools/htslib/releases/download/{{ version }}/htslib-{{ version }}.tar.bz2 sha256: cffadd9baa6fce27b8fe0b01a462b489f06a5433dfe92121f667f40f632538d7 + patches: + - plugin-fixes.patch requirements: build: diff --git a/recipes/htslib/plugin-fixes.patch b/recipes/htslib/plugin-fixes.patch new file mode 100644 index 0000000000000..adec848d5b11a --- /dev/null +++ b/recipes/htslib/plugin-fixes.patch @@ -0,0 +1,31 @@ +Backport variable name used in dlsym typo correction. +Revert "Link libhts.so into plugins on Unix&macOS" on macOS. + +diff --git a/plugin.c b/plugin.c +index dbbe03e..d5c1981 100644 +--- a/plugin.c ++++ b/plugin.c +@@ -153,7 +153,7 @@ plugin_void_func *load_plugin(void **pluginp, const char *filename, const char * + const char *basename = slash? slash+1 : filename; + kputsn(basename, strcspn(basename, ".-+"), &symbolg); + +- *(void **) &sym = dlsym(lib, symbol); ++ *(void **) &sym = dlsym(lib, symbolg.s); + free(symbolg.s); + if (sym == NULL) goto error; + } +diff --git a/Makefile b/Makefile +index 245b7a1..3bb21ad 100644 +--- a/Makefile ++++ b/Makefile +@@ -310,8 +310,8 @@ hts-object-files: $(LIBHTS_OBJS) + %.so: %.pico libhts.so + $(CC) -shared -Wl,-E $(LDFLAGS) -o $@ $< libhts.so $(LIBS) -lpthread + +-%.bundle: %.o libhts.dylib +- $(CC) -bundle -Wl,-undefined,dynamic_lookup $(LDFLAGS) -o $@ $< libhts.dylib $(LIBS) ++%.bundle: %.o ++ $(CC) -bundle -Wl,-undefined,dynamic_lookup $(LDFLAGS) -o $@ $< $(LIBS) + + %.cygdll: %.o libhts.dll.a + $(CC) -shared $(LDFLAGS) -o $@ $< libhts.dll.a $(LIBS)