brew install homebrew/science/htslib
- Get to version 1.3
brew switch htslib 1.3
- Download/compile
htslib
version 1.3 - Install
htslib
with prefix/usr/local/
See jstjohn/swift-c-htslib-example
- No swift wrappers around the C objects returned by htslib functions, they are all of type
UnsafeMutablePointer<T>
- No swift support for C macros. Many functions like
sam_open
are actually macros that call other functions. You need to call the underlying function that the macro calls in swift. The workaround would be to reimplement allhtslib
macros as swift functions that replicate the behavior of the macro. - Non-flexible requirement that
htslib
is installed to/usr/local/[include,lib,share]
. The current swift package system does not have a nice way to package c libraries in a portable way Support for Other Build Systems