diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 6d76530..2a5eadb 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -18,8 +18,9 @@ jobs: config: - {os: macOS-latest, r: 'release'} - {os: windows-latest, r: 'devel'} + - {os: windows-latest, r: 'release'} + - {os: windows-latest, r: '4.2'} - {os: windows-latest, r: '4.1'} - - {os: windows-latest, r: '3.6'} - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - {os: ubuntu-latest, r: 'release'} - {os: ubuntu-latest, r: 'oldrel-1'} diff --git a/DESCRIPTION b/DESCRIPTION index 09f8c1d..adc5d2e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: pdftools Type: Package Title: Text Extraction, Rendering and Converting of PDF Documents -Version: 3.3.3 +Version: 3.4.0 Authors@R: person("Jeroen", "Ooms", role = c("aut", "cre"), email = "jeroen@berkeley.edu", comment = c(ORCID = "0000-0002-4035-0289")) Description: Utilities based on 'libpoppler' for extracting text, fonts, attachments and diff --git a/NEWS b/NEWS index ba20438..953cc95 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +3.4.0 + - Windows: update to poppler 23.08.0 + deps + 3.3.3 - Fix a bug in the version checking macro - Remove CXX11 from Makevars.win diff --git a/src/Makevars.win b/src/Makevars.win index 9f72c49..b1a22f9 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,23 +1,14 @@ -VERSION=22.04.0 POPPLERDATA=share/poppler - -# Need older poppler for R < 4.0 -ifeq ($(R_COMPILED_BY),gcc 4.9.3) -VERSION=0.73.0 -POPPLERDATA=poppler-data-0.4.9 -LIBHARFBUZZ=-lharfbuzz -endif - -RWINLIB=../windows/poppler-$(VERSION) +RWINLIB=../windows/poppler PKG_CXXFLAGS=-Dpoppler_cpp_EXPORTS -DBUNDLE_POPPLER_DATA 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${R_ARCH} \ + -L$(RWINLIB)/lib \ -lpoppler-cpp -lpoppler -llcms2 -ljpeg -lpng16 -ltiff -lopenjp2 \ - -lfreetype $(LIBHARFBUZZ) -lfreetype -lbz2 -liconv -lz + -lfreetype -lfreetype -lbz2 -liconv -lz all: clean winlibs @@ -25,7 +16,7 @@ clean: rm -f $(OBJECTS) $(SHLIB) winlibs: - "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION) + "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" rm -Rf ../inst/share && mkdir -p ../inst/share cp -Rf $(RWINLIB)/$(POPPLERDATA) ../inst/share/poppler diff --git a/tools/winlibs.R b/tools/winlibs.R index ab50277..98703f1 100644 --- a/tools/winlibs.R +++ b/tools/winlibs.R @@ -1,17 +1,16 @@ -# Build against mingw-w64 build of poppler 0.57.0 -VERSION <- commandArgs(TRUE) -if(!file.exists(sprintf("../windows/poppler-%s/include/poppler/cpp/poppler-document.h", VERSION))){ - if(getRversion() < "3.3.0") setInternet2() - download.file(sprintf("https://github.com/rwinlib/poppler/archive/v%s.zip", VERSION), - "lib.zip", quiet = TRUE) +if(!file.exists("../windows/poppler/include/poppler/cpp/poppler-document.h")){ + unlink("../windows", recursive = TRUE) + url <- if(grepl("aarch", R.version$platform)){ + "https://github.com/r-windows/bundles/releases/download/poppler-23.08.0/poppler-23.08.0-clang-aarch64.tar.xz" + } else if(getRversion() >= "4.2") { + "https://github.com/r-windows/bundles/releases/download/poppler-23.08.0/poppler-23.08.0-ucrt-x86_64.tar.xz" + } else { + "https://github.com/rwinlib/poppler/archive/v22.04.0.tar.gz" + } + download.file(url, basename(url), quiet = TRUE) dir.create("../windows", showWarnings = FALSE) - unzip("lib.zip", exdir = "../windows") - unlink("lib.zip") + untar(basename(url), exdir = "../windows", tar = 'internal') + unlink(basename(url)) + setwd("../windows") + file.rename(list.files(), 'poppler') } - -# Download extra poppler data -#if(!file.exists("../windows/poppler-data-0.4.8")){ -# download.file("https://poppler.freedesktop.org/poppler-data-0.4.8.tar.gz", "data.tar.gz", quiet = TRUE) -# untar("data.tar.gz", exdir = "../windows") -# unlink("data.tar.gz") -#}