Skip to content

Commit fd7c94c

Browse files
committed
Add fix for winpthreads breakage
A regression in winpthreads is causing `libvpx` to fails. Until the fix reaches the `msys2` packages, apply the fix ourselves.
1 parent 561cc7d commit fd7c94c

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

.github/workflows/build-ffmpeg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
run: |
5555
brew update
5656
brew unlink gettext libidn2 libpng libtiff libunistring libx11 libxau libxcb libxdmcp little-cms2 unbound
57-
- uses: msys2/setup-msys2@c52d1fa9c7492275e60fe763540fb601f5f232a1
57+
- uses: msys2/setup-msys2@v2
5858
if: matrix.os == 'windows-latest'
5959
with:
6060
install: base-devel mingw-w64-x86_64-gcc mingw-w64-x86_64-gperf mingw-w64-x86_64-nasm openssl-devel

patches/winpthreads.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Temporary patch for this issue:
2+
3+
https://sourceforge.net/p/mingw-w64/mailman/message/59184409/
4+
5+
This patch can be removed once msys2's packages have been updated.
6+
7+
--- a/mingw-w64-libraries/winpthreads/include/pthread_time.h
8+
+++ b/mingw-w64-libraries/winpthreads/include/pthread_time.h
9+
@@ -23,6 +23,7 @@
10+
#ifndef WIN_PTHREADS_TIME_H
11+
#define WIN_PTHREADS_TIME_H
12+
13+
+#include <sys/timeb.h>
14+
#include "pthread_compat.h"
15+
16+
/* Posix timers are supported */
17+
--- a/mingw-w64-libraries/winpthreads/include/semaphore.h
18+
+++ b/mingw-w64-libraries/winpthreads/include/semaphore.h
19+
@@ -23,6 +23,7 @@
20+
#ifndef WIN_PTHREADS_SEMAPHORE_H
21+
#define WIN_PTHREADS_SEMAPHORE_H
22+
23+
+#include <sys/timeb.h>
24+
#include "pthread_compat.h"
25+
26+
#ifdef __cplusplus

scripts/build-ffmpeg.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ def main():
335335
builder = Builder(dest_dir=dest_dir)
336336
builder.create_directories()
337337

338+
# Fix winpthreads breakage until the fix reaches msys2 repos.
339+
if plat == "Windows":
340+
run(["patch", "-d", "C:/msys64/mingw64", "-i", os.path.join(builder.patch_dir, "winpthreads.patch"), "-p3"])
341+
338342
# install packages
339343
available_tools = set()
340344
if plat == "Windows":

0 commit comments

Comments
 (0)