Description: Avoid rpath issue by avoiding library
 .
 r-cran-readr (1.2.1-2) unstable; urgency=medium
 .
   * src/Makevars: Build without rcon to avoid rpath dance (Closes: #914633)
Author: Dirk Eddelbuettel <edd@debian.org>
Bug-Debian: https://bugs.debian.org/914633
Last-Update: 2018-11-25

--- r-cran-readr-1.2.1.orig/src/Makevars
+++ r-cran-readr-1.2.1/src/Makevars
@@ -1,9 +1,12 @@
 PKG_CXXFLAGS = -I. -Ircon
-PKG_LIBS = -L. -lrcon -L../inst/rcon -Wl,-rpath,$(R_PACKAGE_DIR)/rcon
+PKG_CPPFLAGS = -I. -Ircon
+#PKG_LIBS = -L. -lrcon -L../inst/rcon -Wl,-rpath,$(R_PACKAGE_DIR)/rcon
+PKG_LIBS = -L. 
 
 all: $(SHLIB)
 
-$(SHLIB): ../inst/rcon/librcon.so
+#$(SHLIB): ../inst/rcon/librcon.so
+$(SHLIB): 
 
 UNAME:=$(shell uname -s)
 ifeq ($(UNAME), Darwin)
--- /dev/null
+++ r-cran-readr-1.2.1/src/baseRconnection.c
@@ -0,0 +1,19 @@
+#include "connection.h"
+
+#if R_CONNECTIONS_VERSION != 1
+#error "Missing or unsupported connection API in R"
+#endif
+
+#if defined(R_VERSION) && R_VERSION >= R_Version(3, 3, 0)
+Rconnection get_connection(SEXP con) { return R_GetConnection(con); }
+size_t write_connection(Rconnection con, void* data, size_t n) {
+  return R_WriteConnection(con, data, n);
+}
+#else
+extern Rconnection getConnection(int);
+Rconnection get_connection(SEXP con) {
+  if (!Rf_inherits(con, "connection"))
+    Rf_error("invalid connection");
+  return getConnection(Rf_asInteger(con));
+}
+#endif
