Skip to content

Commit

Permalink
Windows: use ffmpeg from Rtools when available
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 14, 2024
1 parent 70c2ce5 commit cc8c117
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- {os: macos-14, r: 'release'}
- {os: windows-latest, r: '4.1'}
- {os: windows-latest, r: '4.2'}
- {os: windows-latest, r: '4.3'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-24.04, r: 'release'}
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.9.4
- Windows: use ffmpeg from Rtools when available

0.9.3
- Fixes for ffmpeg 7.1
- Cleanup configure script
Expand Down
19 changes: 15 additions & 4 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
PKG_CONFIG_NAME = libavfilter
PKG_CONFIG ?= $(BINPREF)pkg-config
PKG_LIBS := $(shell $(PKG_CONFIG) --libs $(PKG_CONFIG_NAME))

ifneq ($(PKG_LIBS),)
$(info using ffmpeg from Rtools)
PKG_CPPFLAGS := $(shell $(PKG_CONFIG) --cflags $(PKG_CONFIG_NAME))
else
RWINLIB = ../windows/ffmpeg
PKG_CPPFLAGS = -I$(RWINLIB)/include -D__USE_MINGW_ANSI_STDIO=1 -DR_NO_REMAP -DSTRICT_R_HEADERS
PKG_LIBS = -L$(RWINLIB)/lib${subst gcc,,$(COMPILED_BY)}$(R_ARCH) \
Expand All @@ -6,11 +14,14 @@ PKG_LIBS = -L$(RWINLIB)/lib${subst gcc,,$(COMPILED_BY)}$(R_ARCH) \
-lvorbis -lvorbisenc -logg -lvpx \
-lbz2 -lsecur32 -lws2_32 -liconv -lz -lmp3lame -lx264 \
-lxvidcore -pthread -lole32 -lm -luser32 -lbcrypt -lmfplat -lmfuuid -lstrmiids
endif

all: winlibs clean
all: $(SHLIB)

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

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

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

0 comments on commit cc8c117

Please sign in to comment.