Skip to content

Commit

Permalink
bundle libxmls for win to address CI build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejiang committed Nov 18, 2020
1 parent 465ad19 commit 024097c
Show file tree
Hide file tree
Showing 56 changed files with 14,484 additions and 24 deletions.
29 changes: 5 additions & 24 deletions src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@
CXX_STD = CXX11
#libxml is an odd ball with extra nested path(libxml2/libxml/xxx) that doesn't conform to the include path as the rest
#so can't use the default libs shipped with Rtools4
PKG_CPPFLAGS =-DROUT -I../inst/include/ -I$(LIB_XML2)/$(R_ARCH)/include/libxml2 -DLIBXML_STATIC -fpermissive -DRCPP_PARALLEL_USE_TBB=1
VERSION=2.9.8
RWINLIB=../windows/libxml2-$(VERSION)
PKG_CPPFLAGS =-DROUT -I../inst/include/ -I$(RWINLIB)/include/libxml2 -DLIBXML_STATIC -fpermissive -DRCPP_PARALLEL_USE_TBB=1

#needs to wrap in $(shell) to strip the quotes returned by rhdf5lib::pkgconfig
RHDF5_LIBS= $(shell "${R_HOME}/bin/Rscript" -e "Rhdf5lib::pkgconfig('PKG_CXX_LIBS')")
libxmllibs=-L$(RWINLIB)/lib${R_ARCH} -lxml2 -llzma -liconv -lz

PKG_LIBS += $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(LIB_XML2)/$(R_ARCH)/lib/libxml2.a `${R_HOME}/bin/Rscript -e "cytolib:::cytolib_LdFlags();cat(' ');RProtoBufLib:::LdFlags();cat(' ');RcppParallel::RcppParallelLibs()"` ${RHDF5_LIBS} -lws2_32

USERDIR = ${R_PACKAGE_DIR}/lib${R_ARCH}
PKGLIB = ${USERDIR}/libflowWorkspace.a


all: $(SHLIB)

$(SHLIB): $(PKGLIB)


#expose static lib for other package to link to
$(PKGLIB): $(OBJECTS)
mkdir -p "${USERDIR}"
$(AR) rs "${PKGLIB}" $(OBJECTS)


.PHONY: all clean

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


PKG_LIBS += $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(libxmllibs) `${R_HOME}/bin/Rscript -e "cytolib:::cytolib_LdFlags();cat(' ');RProtoBufLib:::LdFlags();cat(' ');RcppParallel::RcppParallelLibs()"` ${RHDF5_LIBS} -lws2_32

96 changes: 96 additions & 0 deletions windows/libxml2-2.9.4/include/libxml2/libxml/DOCBparser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
* Summary: old DocBook SGML parser
* Description: interface for a DocBook SGML non-verifying parser
* This code is DEPRECATED, and should not be used anymore.
*
* Copy: See Copyright for the status of this software.
*
* Author: Daniel Veillard
*/

#ifndef __DOCB_PARSER_H__
#define __DOCB_PARSER_H__
#include <libxml/xmlversion.h>

#ifdef LIBXML_DOCB_ENABLED

#include <libxml/parser.h>
#include <libxml/parserInternals.h>

#ifndef IN_LIBXML
#ifdef __GNUC__
#warning "The DOCBparser module has been deprecated in libxml2-2.6.0"
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

/*
* Most of the back-end structures from XML and SGML are shared.
*/
typedef xmlParserCtxt docbParserCtxt;
typedef xmlParserCtxtPtr docbParserCtxtPtr;
typedef xmlSAXHandler docbSAXHandler;
typedef xmlSAXHandlerPtr docbSAXHandlerPtr;
typedef xmlParserInput docbParserInput;
typedef xmlParserInputPtr docbParserInputPtr;
typedef xmlDocPtr docbDocPtr;

/*
* There is only few public functions.
*/
XMLPUBFUN int XMLCALL
docbEncodeEntities(unsigned char *out,
int *outlen,
const unsigned char *in,
int *inlen, int quoteChar);

XMLPUBFUN docbDocPtr XMLCALL
docbSAXParseDoc (xmlChar *cur,
const char *encoding,
docbSAXHandlerPtr sax,
void *userData);
XMLPUBFUN docbDocPtr XMLCALL
docbParseDoc (xmlChar *cur,
const char *encoding);
XMLPUBFUN docbDocPtr XMLCALL
docbSAXParseFile (const char *filename,
const char *encoding,
docbSAXHandlerPtr sax,
void *userData);
XMLPUBFUN docbDocPtr XMLCALL
docbParseFile (const char *filename,
const char *encoding);

/**
* Interfaces for the Push mode.
*/
XMLPUBFUN void XMLCALL
docbFreeParserCtxt (docbParserCtxtPtr ctxt);
XMLPUBFUN docbParserCtxtPtr XMLCALL
docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
void *user_data,
const char *chunk,
int size,
const char *filename,
xmlCharEncoding enc);
XMLPUBFUN int XMLCALL
docbParseChunk (docbParserCtxtPtr ctxt,
const char *chunk,
int size,
int terminate);
XMLPUBFUN docbParserCtxtPtr XMLCALL
docbCreateFileParserCtxt(const char *filename,
const char *encoding);
XMLPUBFUN int XMLCALL
docbParseDocument (docbParserCtxtPtr ctxt);

#ifdef __cplusplus
}
#endif

#endif /* LIBXML_DOCB_ENABLED */

#endif /* __DOCB_PARSER_H__ */
Loading

0 comments on commit 024097c

Please sign in to comment.