-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chromium: enable ffmpeg and link more system libraries
- Loading branch information
Showing
15 changed files
with
408 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tur-continuous/chromium/0043-x11-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- a/ui/base/x/x11_cursor_loader.cc | ||
+++ b/ui/base/x/x11_cursor_loader.cc | ||
@@ -139,7 +139,11 @@ | ||
void operator()(void* ptr) const { dlclose(ptr); } | ||
}; | ||
|
||
+#ifdef __TERMUX__ | ||
+ std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so", RTLD_LAZY)); | ||
+#else | ||
std::unique_ptr<void, DlCloser> lib(dlopen("libXcursor.so.1", RTLD_LAZY)); | ||
+#endif | ||
if (!lib) | ||
return ""; | ||
|
||
--- a/ui/gfx/x/xlib_support.cc | ||
+++ b/ui/gfx/x/xlib_support.cc | ||
@@ -41,7 +41,11 @@ | ||
CHECK(xlib_loader->Load("libX11.so.6")); | ||
|
||
auto* xlib_xcb_loader = GetXlibXcbLoader(); | ||
+#ifndef __TERMUX__ | ||
CHECK(xlib_xcb_loader->Load("libX11-xcb.so.1")); | ||
+#else | ||
+ CHECK(xlib_xcb_loader->Load("libX11-xcb.so")); | ||
+#endif | ||
|
||
CHECK(xlib_loader->XInitThreads()); | ||
|
14 changes: 0 additions & 14 deletions
14
...m/0043-fix-dynamic-loaded-libraries.patch → ...-ozone-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
tur-continuous/chromium/0045-gtk-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- a/ui/gtk/gtk_compat.cc | ||
+++ b/ui/gtk/gtk_compat.cc | ||
@@ -62,27 +62,47 @@ | ||
} | ||
|
||
void* GetLibGio() { | ||
+#ifdef __TERMUX__ | ||
+ static void* libgio = DlOpen("libgio-2.0.so"); | ||
+#else | ||
static void* libgio = DlOpen("libgio-2.0.so.0"); | ||
+#endif | ||
return libgio; | ||
} | ||
|
||
void* GetLibGdkPixbuf() { | ||
+#ifdef __TERMUX__ | ||
+ static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so"); | ||
+#else | ||
static void* libgdk_pixbuf = DlOpen("libgdk_pixbuf-2.0.so.0"); | ||
+#endif | ||
return libgdk_pixbuf; | ||
} | ||
|
||
void* GetLibGdk3() { | ||
+#ifdef __TERMUX__ | ||
+ static void* libgdk3 = DlOpen("libgdk-3.so"); | ||
+#else | ||
static void* libgdk3 = DlOpen("libgdk-3.so.0"); | ||
+#endif | ||
return libgdk3; | ||
} | ||
|
||
void* GetLibGtk3(bool check = true) { | ||
+#ifdef __TERMUX__ | ||
+ static void* libgtk3 = DlOpen("libgtk-3.so", check); | ||
+#else | ||
static void* libgtk3 = DlOpen("libgtk-3.so.0", check); | ||
+#endif | ||
return libgtk3; | ||
} | ||
|
||
void* GetLibGtk4(bool check = true) { | ||
+#ifdef __TERMUX__ | ||
+ static void* libgtk4 = DlOpen("libgtk-4.so", check); | ||
+#else | ||
static void* libgtk4 = DlOpen("libgtk-4.so.1", check); | ||
+#endif | ||
return libgtk4; | ||
} | ||
|
29 changes: 29 additions & 0 deletions
29
tur-continuous/chromium/0046-pulse-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- a/media/audio/pulse/pulse_util.cc | ||
+++ b/media/audio/pulse/pulse_util.cc | ||
@@ -44,8 +44,12 @@ | ||
|
||
#if defined(DLOPEN_PULSEAUDIO) | ||
static const base::FilePath::CharType kPulseLib[] = | ||
+#ifdef __TERMUX__ | ||
+ FILE_PATH_LITERAL("libpulse.so"); | ||
+#else | ||
FILE_PATH_LITERAL("libpulse.so.0"); | ||
#endif | ||
+#endif | ||
|
||
void DestroyMainloop(pa_threaded_mainloop* mainloop) { | ||
pa_threaded_mainloop_stop(mainloop); | ||
--- a/third_party/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc | ||
+++ b/third_party/webrtc/modules/audio_device/linux/pulseaudiosymboltable_linux.cc | ||
@@ -30,7 +30,11 @@ | ||
namespace webrtc { | ||
namespace adm_linux_pulse { | ||
|
||
+#ifdef __TERMUX__ | ||
+LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so") | ||
+#else | ||
LATE_BINDING_SYMBOL_TABLE_DEFINE_BEGIN(PulseAudioSymbolTable, "libpulse.so.0") | ||
+#endif | ||
#define X(sym) \ | ||
LATE_BINDING_SYMBOL_TABLE_DEFINE_ENTRY(PulseAudioSymbolTable, sym) | ||
PULSE_AUDIO_SYMBOLS_LIST |
28 changes: 28 additions & 0 deletions
28
tur-continuous/chromium/0047-crypt-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- a/components/os_crypt/keyring_util_linux.cc | ||
+++ b/components/os_crypt/keyring_util_linux.cc | ||
@@ -68,7 +68,11 @@ | ||
if (keyring_loaded) | ||
return true; | ||
|
||
+#ifdef __TERMUX__ | ||
+ void* handle = dlopen("libgnome-keyring.so", RTLD_NOW | RTLD_GLOBAL); | ||
+#else | ||
void* handle = dlopen("libgnome-keyring.so.0", RTLD_NOW | RTLD_GLOBAL); | ||
+#endif | ||
if (!handle) { | ||
// We wanted to use GNOME Keyring, but we couldn't load it. Warn, because | ||
// either the user asked for this, or we autodetected it incorrectly. (Or | ||
--- a/components/os_crypt/libsecret_util_linux.cc | ||
+++ b/components/os_crypt/libsecret_util_linux.cc | ||
@@ -102,7 +102,11 @@ | ||
if (libsecret_loaded_) | ||
return true; | ||
|
||
+#ifdef __TERMUX__ | ||
+ static void* handle = dlopen("libsecret-1.so", RTLD_NOW | RTLD_GLOBAL); | ||
+#else | ||
static void* handle = dlopen("libsecret-1.so.0", RTLD_NOW | RTLD_GLOBAL); | ||
+#endif | ||
if (!handle) { | ||
// We wanted to use libsecret, but we couldn't load it. Warn, because | ||
// either the user asked for this, or we autodetected it incorrectly. (Or |
40 changes: 40 additions & 0 deletions
40
tur-continuous/chromium/0048-swiftshader-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- a/third_party/swiftshader/src/WSI/libWaylandClient.cpp | ||
+++ b/third_party/swiftshader/src/WSI/libWaylandClient.cpp | ||
@@ -56,7 +56,11 @@ | ||
} | ||
else | ||
{ | ||
+#ifdef __TERMUX__ | ||
+ libwl = loadLibrary("libwayland-client.so"); | ||
+#else | ||
libwl = loadLibrary("libwayland-client.so.0"); | ||
+#endif | ||
} | ||
|
||
return LibWaylandClientExports(libwl); | ||
--- a/third_party/swiftshader/src/WSI/libXCB.cpp | ||
+++ b/third_party/swiftshader/src/WSI/libXCB.cpp | ||
@@ -55,7 +55,11 @@ | ||
} | ||
else | ||
{ | ||
+#ifdef __TERMUX__ | ||
+ libxcb = loadLibrary("libxcb.so"); | ||
+#else | ||
libxcb = loadLibrary("libxcb.so.1"); | ||
+#endif | ||
} | ||
|
||
if(getProcAddress(RTLD_DEFAULT, "xcb_shm_query_version")) // Search the global scope for pre-loaded XCB library. | ||
@@ -64,7 +68,11 @@ | ||
} | ||
else | ||
{ | ||
+#ifdef __TERMUX__ | ||
+ libshm = loadLibrary("libxcb-shm.so"); | ||
+#else | ||
libshm = loadLibrary("libxcb-shm.so.0"); | ||
+#endif | ||
} | ||
|
||
return LibXcbExports(libxcb, libshm); |
14 changes: 14 additions & 0 deletions
14
tur-continuous/chromium/0049-dawn-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- a/third_party/dawn/src/dawn/native/XlibXcbFunctions.cpp | ||
+++ b/third_party/dawn/src/dawn/native/XlibXcbFunctions.cpp | ||
@@ -17,7 +17,11 @@ | ||
namespace dawn::native { | ||
|
||
XlibXcbFunctions::XlibXcbFunctions() { | ||
+#ifdef __TERMUX__ | ||
+ if (!mLib.Open("libX11-xcb.so") || !mLib.GetProc(&xGetXCBConnection, "XGetXCBConnection")) { | ||
+#else | ||
if (!mLib.Open("libX11-xcb.so.1") || !mLib.GetProc(&xGetXCBConnection, "XGetXCBConnection")) { | ||
+#endif | ||
mLib.Close(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tur-continuous/chromium/0050-weston-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- a/third_party/weston/src/libweston/backend-drm/drm-gbm.c | ||
+++ b/third_party/weston/src/libweston/backend-drm/drm-gbm.c | ||
@@ -61,7 +61,11 @@ | ||
* only the gl-renderer module links to it, the call above won't make | ||
* these symbols globally available, and loading the DRI driver fails. | ||
* Workaround this by dlopen()'ing libglapi with RTLD_GLOBAL. */ | ||
+#ifdef __TERMUX__ | ||
+ dlopen("libglapi.so", RTLD_LAZY | RTLD_GLOBAL); | ||
+#else | ||
dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL); | ||
+#endif | ||
|
||
gbm = gbm_create_device(fd); | ||
|
11 changes: 11 additions & 0 deletions
11
tur-continuous/chromium/0051-unity-fix-dynamic-loaded-libraries.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/chrome/browser/download/download_status_updater_linux.cc | ||
+++ b/chrome/browser/download/download_status_updater_linux.cc | ||
@@ -77,6 +77,8 @@ | ||
if (!unity_lib) | ||
unity_lib = dlopen("libunity.so.9", RTLD_LAZY); | ||
if (!unity_lib) | ||
+ unity_lib = dlopen("libunity.so", RTLD_LAZY); | ||
+ if (!unity_lib) | ||
return; | ||
|
||
unity_inspector_get_default_func inspector_get_default = |
11 changes: 11 additions & 0 deletions
11
tur-continuous/chromium/0052-v8-disable-trap-handler.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/v8/src/trap-handler/trap-handler.h | ||
+++ b/v8/src/trap-handler/trap-handler.h | ||
@@ -19,7 +19,7 @@ | ||
|
||
// X64 on Linux, Windows, MacOS, FreeBSD. | ||
#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \ | ||
- ((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \ | ||
+ (V8_OS_LINUX || V8_OS_WIN || V8_OS_DARWIN || \ | ||
V8_OS_FREEBSD) | ||
#define V8_TRAP_HANDLER_SUPPORTED true | ||
// Arm64 (non-simulator) on Mac. |
12 changes: 12 additions & 0 deletions
12
tur-continuous/chromium/0053-breakpad-include-cstring.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
To solve error like | ||
../../third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc:200:10: error: no member named 'strcmp' in namespace 'std'; did you mean simply 'strcmp'? | ||
--- a/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc | ||
+++ b/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc | ||
@@ -39,6 +39,7 @@ | ||
#include <unistd.h> | ||
|
||
#include <algorithm> | ||
+#include <cstring> | ||
#include <map> | ||
#include <string> | ||
#include <vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- a/media/filters/audio_file_reader.cc | ||
+++ b/media/filters/audio_file_reader.cc | ||
@@ -243,10 +243,10 @@ | ||
// silence from being output. In the case where we are also discarding some | ||
// portion of the packet (as indicated by a negative pts), we further want to | ||
// adjust the duration downward by however much exists before zero. | ||
- if (audio_codec_ == AudioCodec::kAAC && frame->duration) { | ||
+ if (audio_codec_ == AudioCodec::kAAC && frame->pkt_duration) { | ||
const base::TimeDelta pkt_duration = ConvertFromTimeBase( | ||
glue_->format_context()->streams[stream_index_]->time_base, | ||
- frame->duration + std::min(static_cast<int64_t>(0), frame->pts)); | ||
+ frame->pkt_duration + std::min(static_cast<int64_t>(0), frame->pts)); | ||
const base::TimeDelta frame_duration = | ||
base::Seconds(frames_read / static_cast<double>(sample_rate_)); | ||
|
||
Remove this if termux/termux-packages#13743 is merged | ||
--- a/media/filters/ffmpeg_demuxer.cc | ||
+++ b/media/filters/ffmpeg_demuxer.cc | ||
@@ -91,6 +91,10 @@ | ||
sample_rate); | ||
} | ||
|
||
+static inline int64_t av_stream_get_first_dts(const AVStream*) { | ||
+ return kNoFFmpegTimestamp; | ||
+} | ||
+ | ||
static base::TimeDelta ExtractStartTime(AVStream* stream) { | ||
// The default start time is zero. | ||
base::TimeDelta start_time; |
Oops, something went wrong.