Skip to content

Commit

Permalink
Windows: upgrade to libxml2 2.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Apr 21, 2018
1 parent bb6efb2 commit ba3511f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ src/Makevars
inst/doc
script.R
TODO.md
windows
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* xml2 now has a pkgdown site! <http://xml2.r-lib.org> (@jayhesselberth, #211).

* Windows: upgrade to libxml2 2.9.8

## Bugfixes

* Generic xml2 error are now forwarded as R errors. Previously these errors
Expand Down
8 changes: 5 additions & 3 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
PKG_CPPFLAGS=-I../inst/include -I../windows/libxml2-2.9.4/include/libxml2 \
VERSION=2.9.8
RWINLIB=../windows/libxml2-$(VERSION)
PKG_CPPFLAGS=-I../inst/include -I$(RWINLIB)/include/libxml2 \
-DLIBXML_STATIC

PKG_LIBS=-L../windows/libxml2-2.9.4/lib${R_ARCH} -lxml2 -llzma -liconv -lz -lws2_32
PKG_LIBS=-L$(RWINLIB)/lib${R_ARCH} -lxml2 -llzma -liconv -lz -lws2_32

all: clean winlibs

clean:
rm -f $(OBJECTS) $(SHLIB)

winlibs:
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" --vanilla "../tools/winlibs.R"
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" --vanilla "../tools/winlibs.R" $(VERSION)

.PHONY: all winlibs clean
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 libxml2 from Rtools
if (!file.exists("../windows/libxml2-2.9.4/include/libxml2/libxml/parser.h")) {
# Build against static libraries from rwinlib
VERSION <- commandArgs(TRUE)
if(!file.exists(sprintf("../windows/libxml2-%s/include/libxml2/libxml/parser.h", VERSION))){
if(getRversion() < "3.3.0") setInternet2()
download.file("https://github.com/rwinlib/libxml2/archive/v2.9.4.zip", "lib.zip", quiet = TRUE)
download.file(sprintf("https://github.com/rwinlib/libxml2/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 ba3511f

Please sign in to comment.