Skip to content

Commit

Permalink
Windows: update to libpq 11.1.0 (r-dbi#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen authored Jan 2, 2019
1 parent cda6cc5 commit b64d367
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# RPostgres 1.1.1.9002

- Windows: update libpq to 11.1.0
- Add user interrupt check while waiting for query results to be ready. Allows safe interruption of long-running queries (#193, @zozlak).


Expand Down
1 change: 1 addition & 0 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
PKG_CPPFLAGS= -I../windows/libpq-9.5.2/include -DSTRICT_R_HEADERS
PKG_LIBS= -L../windows/libpq-9.5.2/lib${R_ARCH} \
VERSION = 11.1.0
RWINLIB = ../windows/libpq-$(VERSION)
PKG_CPPFLAGS = -I$(RWINLIB)/include -DSTRICT_R_HEADERS
PKG_LIBS = -L$(RWINLIB)/lib${R_ARCH} \
-lpq -lssl -lcrypto -lwsock32 -lsecur32 -lws2_32 -lgdi32 -lcrypt32 -lwldap32
CXX_STD=CXX11
CXX_STD = CXX11

$(SHLIB):

Expand All @@ -11,4 +13,4 @@ clean:
rm -f $(SHLIB) $(OBJECTS)

winlibs:
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R"
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION)
7 changes: 4 additions & 3 deletions tools/winlibs.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Build against static libpq
if(!file.exists("../windows/libpq-9.5.2/include/libpq-fe.h")){
# Link against libpq static libraries
VERSION <- commandArgs(TRUE)
if(!file.exists(sprintf("../windows/libpq-%s/include/libpq-fe.h", VERSION))){
if(getRversion() < "3.3.0") setInternet2()
download.file("https://github.com/rwinlib/libpq/archive/v9.5.2.zip", "lib.zip", quiet = TRUE)
download.file(sprintf("https://github.com/rwinlib/libpq/archive/v%s.zip", VERSION), "lib.zip", quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unlink("lib.zip")
Expand Down

0 comments on commit b64d367

Please sign in to comment.