Skip to content

Commit

Permalink
Apply HTSlib patches to fix https/S3/GCS/etc plugins
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jmarshall committed Nov 5, 2020
1 parent 20be378 commit af26abc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
4 changes: 3 additions & 1 deletion recipes/htslib/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
31 changes: 31 additions & 0 deletions recipes/htslib/plugin-fixes.patch
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit af26abc

Please sign in to comment.