--- src/Makevars	2016-10-12 18:25:26.000000000 -0500
+++ src/Makevars	2017-03-09 01:00:27.000000000 -0600
@@ -1,6 +1,9 @@
-RHTSLIB_LIBS=`echo 'Rhtslib::pkgconfig("PKG_LIBS")'|\
-    "${R_HOME}/bin/R" --vanilla --slave`
-PKG_LIBS=$(RHTSLIB_LIBS)
-CXX?=g++-4.8
-CC?=gcc-4.8
-CXX_STD= CXX11
\ No newline at end of file
+# RHTSLIB_LIBS=`echo 'Rhtslib::pkgconfig("PKG_LIBS")'|\
+#    "${R_HOME}/bin/R" --vanilla --slave`
+# PKG_LIBS=$(RHTSLIB_LIBS)
+PKG_LIBS = -lz -pthread
+# CXX?=g++-4.8
+# CC?=gcc-4.8
+# CXX_STD= CXX11
+PKG_CXXFLAGS+= ${PREFIX}/lib/R/library/Rhtslib/lib/libhts.a -std=c++11 -stdlib=libc++
+

--- src/Makevars	2016-10-12 18:25:26.000000000 -0500
+++ src/Makevars	2017-03-10 13:34:07.000000000 -0600
@@ -1,6 +1,2 @@
-RHTSLIB_LIBS=`echo 'Rhtslib::pkgconfig("PKG_LIBS")'|\
-    "${R_HOME}/bin/R" --vanilla --slave`
-PKG_LIBS=$(RHTSLIB_LIBS)
-CXX?=g++-4.8		
-CC?=gcc-4.8
-CXX_STD= CXX11
\ No newline at end of file
+PKG_LIBS= ${PREFIX}/lib/R/library/Rhtslib/lib/libhts.a -lz -pthread
+PKG_CXXFLAGS+= -std=c++11 -stdlib=libc++

Fix patch content and libhts.a config
Fix patch content and libhts.a config
