Skip to content

Commit b8650c7

Browse files
committed
Windows: upgrade to gifski 1.6.6
1 parent aec5c84 commit b8650c7

File tree

5 files changed

+43
-38
lines changed

5 files changed

+43
-38
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ jobs:
1010
R-CMD-check:
1111
runs-on: ${{ matrix.config.os }}
1212

13-
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
13+
name: ${{ matrix.config.os }} (${{ matrix.config.r }}${{ matrix.config.static }})
1414

1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
config:
19-
- {os: windows-latest, r: '3.6'}
19+
- {os: windows-latest, r: '3.6', static: '-rwinlib'}
20+
- {os: windows-latest, r: '4.1', static: '-rwinlib'}
21+
- {os: windows-latest, r: 'next', static: '-rwinlib'}
2022
- {os: windows-latest, r: '4.1'}
2123
- {os: windows-latest, r: 'next'}
2224
- {os: macOS-latest, r: 'release'}
@@ -47,7 +49,10 @@ jobs:
4749
run: |
4850
rustup target add i686-pc-windows-gnu
4951
rustup target add x86_64-pc-windows-gnu
50-
Copy-Item src\Makevars.win.rust src\Makevars.win
52+
53+
- name: Use precompiled libgifski
54+
if: runner.os == 'Windows' && matrix.config.static
55+
run: Copy-Item src\Makevars.win.static src\Makevars.win
5156

5257
- uses: r-lib/actions/setup-r@v2
5358
with:

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: gifski
22
Type: Package
33
Title: Highest Quality GIF Encoder
4-
Version: 1.4.3-1
4+
Version: 1.6.6
55
Authors@R: c(
66
person("Jeroen", "Ooms", ,"jeroen@berkeley.edu", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0002-4035-0289")),

src/Makevars.win

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
VERSION = 1.4.3
2-
RWINLIB = ../windows/gifski-$(VERSION)
3-
PKG_CPPFLAGS = -I$(RWINLIB)/include
4-
PKG_LIBS = -L$(RWINLIB)/lib${R_ARCH}${CRT} \
5-
-lgifski -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt
1+
TARGET = $(subst 64,x86_64,$(subst 32,i686,$(WIN)))-pc-windows-gnu
2+
LIBDIR = myrustlib/target/$(TARGET)/release
3+
STATLIB = $(LIBDIR)/libmyrustlib.a
4+
PKG_LIBS = -L$(LIBDIR) -lmyrustlib -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt
65

7-
all: clean winlibs
6+
# These can also be set in ~/.cargo/config
7+
#export CARGO_TARGET_I686_PC_WINDOWS_GNU_LINKER=C:\\rtools40\\mingw$(WIN)\\bin\\gcc
8+
#export CC=$(CC)
9+
#export AR=$(AR)
810

9-
winlibs:
10-
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION)
11+
# This bypasses the exception stuff
12+
#export CARGO_TARGET_I686_PC_WINDOWS_GNU_RUSTFLAGS=-C panic=abort
13+
ifeq ($(R_COMPILED_BY),gcc 8.3.0)
14+
GCCPATH=$(subst C:\,/c/,$(RTOOLS40_HOME))/mingw$(WIN)/bin
15+
endif
16+
17+
all: clean
18+
19+
$(SHLIB): $(STATLIB)
20+
21+
$(STATLIB):
22+
PATH="$(GCCPATH):$(PATH)" cargo build --target=$(TARGET) --release --manifest-path=myrustlib/Cargo.toml
1123

1224
clean:
13-
rm -f $(SHLIB) $(OBJECTS)
25+
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) myrustlib/target

src/Makevars.win.rust

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Makevars.win.static

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
VERSION = 1.6.6
2+
RWINLIB = ../windows/gifski-$(VERSION)
3+
PKG_CPPFLAGS = -I$(RWINLIB)/include
4+
PKG_LIBS = -L$(RWINLIB)/lib${R_ARCH}${CRT} \
5+
-lgifski -lws2_32 -ladvapi32 -luserenv -ldbghelp -lbcrypt
6+
7+
all: clean winlibs
8+
9+
winlibs:
10+
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" "../tools/winlibs.R" $(VERSION)
11+
12+
clean:
13+
rm -f $(SHLIB) $(OBJECTS)

0 commit comments

Comments
 (0)