Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: use poppler from Rtools if found #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ jobs:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: '4.4'}
- {os: windows-latest, r: '4.3'}
- {os: windows-latest, r: '4.2'}
- {os: windows-latest, r: '4.1'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
Expand Down
42 changes: 25 additions & 17 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
POPPLERDATA=share/poppler
RWINLIB=../windows/poppler
PKG_CXXFLAGS=-Dpoppler_cpp_EXPORTS -DBUNDLE_POPPLER_DATA
PKG_CPPFLAGS=-I$(RWINLIB)/include/poppler/cpp \
-I$(RWINLIB)/include/poppler \
-DSTRICT_R_HEADERS -DR_NO_REMAP
PKG_CONFIG_NAME = poppler-cpp
PKG_CONFIG ?= $(BINPREF)pkg-config
PKG_CXXFLAGS = -Dpoppler_cpp_EXPORTS -DBUNDLE_POPPLER_DATA -DSTRICT_R_HEADERS -DR_NO_REMAP
PKG_LIBS := $(shell $(PKG_CONFIG) --libs $(PKG_CONFIG_NAME))

PKG_LIBS= \
-L$(RWINLIB)/lib${subst gcc,,${COMPILED_BY}}${R_ARCH} \
-L$(RWINLIB)/lib \
-lpoppler-cpp -lpoppler -llcms2 -ljpeg -lpng16 -ltiff -lopenjp2 \
-lfreetype -lfreetype -lbz2 -liconv -lz
ifneq ($(PKG_LIBS),)
$(info using $(PKG_CONFIG_NAME) from Rtools)
PKG_CPPFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_NAME))
POPPLERDATA := $(shell pkg-config --variable=poppler_datadir poppler-data)
else
RWINLIB = ../windows/poppler
PKG_CPPFLAGS = -I$(RWINLIB)/include/poppler/cpp -I$(RWINLIB)/include/poppler
PKG_LIBS = -L$(RWINLIB)/lib${subst gcc,,${COMPILED_BY}}${R_ARCH} -L$(RWINLIB)/lib \
-lpoppler-cpp -lpoppler -llcms2 -ljpeg -lpng16 -ltiff -lopenjp2 -lfreetype -lfreetype -lbz2 -liconv -lz
POPPLERDATA = $(RWINLIB)/share/poppler
endif

all: clean winlibs
all: $(SHLIB) copydata

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

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

copydata:
rm -Rf ../inst/share && mkdir -p ../inst/share
cp -Rf $(RWINLIB)/$(POPPLERDATA) ../inst/share/poppler
cp -Rf $(POPPLERDATA) ../inst/share/

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


.PHONY: all winlibs clean
Loading