Skip to content

Commit

Permalink
Update Windows static binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Mar 22, 2021
1 parent 524be1a commit a07d630
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
RWINLIB = ../windows/gifski-0.8.7
PKG_CPPFLAGS= -I$(RWINLIB)/include
PKG_LIBS= -L$(RWINLIB)/lib${R_ARCH} \
VERSION = 1.4.3
RWINLIB = ../windows/gifski-$(VERSION)
PKG_CPPFLAGS = -I$(RWINLIB)/include
PKG_LIBS = -L$(RWINLIB)/lib${R_ARCH} \
-lgifski -lws2_32 -ladvapi32 -luserenv -ldbghelp

all: clean winlibs

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

clean:
rm -f $(SHLIB) $(OBJECTS)
2 changes: 1 addition & 1 deletion src/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SEXP R_png_to_gif(SEXP png_files, SEXP gif_file, SEXP width, SEXP height, SEXP d
if(gifski_add_frame_png_file(g, i, CHAR(STRING_ELT(png_files, i)), pts) != GIFSKI_OK)
REprintf("Failed to add frame %d\n", i);
if(Rf_asLogical(progress))
REprintf("\rQueuing frame %d at %.2fs (%d%%)...", (i+1), pts, (i+1) * 100 / Rf_length(png_files));
REprintf("\rInserting image %d at %.2fs (%d%%)...", (i+1), pts, (i+1) * 100 / Rf_length(png_files));
}

/* This will finalize the encoder thread as well */
Expand Down
5 changes: 3 additions & 2 deletions tools/winlibs.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Build against gifski libs compiled with the Rtools
if(!file.exists("../windows/gifski-0.8.7/include/gifski.h")){
VERSION <- commandArgs(TRUE)
if(!file.exists(sprintf("../windows/gifski-%s/include/gifski.h", VERSION))){
if(getRversion() < "3.3.0") setInternet2()
download.file("https://github.com/rwinlib/gifski/archive/v0.8.7.zip", "lib.zip", quiet = TRUE)
download.file(sprintf("https://github.com/rwinlib/gifski/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 a07d630

Please sign in to comment.