Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chromium: enable ffmpeg #178

Merged
merged 4 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
135 changes: 134 additions & 1 deletion .github/workflows/package_continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,143 @@ jobs:
name: build-status-${{ matrix.target_arch }}-${{ github.sha }}
path: ./build-status

build-6:
runs-on: ubuntu-22.04
needs: build-5
env:
ANDROID_HOME: "/opt/termux/android-sdk"
NDK: "/opt/termux/android-ndk"
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TUR_CONTINUOUS_FLAG: true
strategy:
matrix:
target_arch: [aarch64, arm, i686, x86_64]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 1000
submodules: true
- name: Merge repos
run: ./setup-environment.sh
- name: Free additional disk space
run: |
sudo apt purge -yq $(dpkg -l | grep '^ii' | awk '{ print $2 }' | grep -P '(cabal-|dotnet-|ghc-|libmono|php|aspnetcore)') \
mono-runtime-common monodoc-manual ruby
sudo apt autoremove -yq
sudo rm -rf /opt/hostedtoolcache /usr/local /usr/share/dotnet /usr/share/swift
- name: Download build deps
uses: actions/download-artifact@v3
with:
name: build-deps-${{ matrix.target_arch }}-${{ github.sha }}
path: ./build-deps
- name: Download build status
uses: actions/download-artifact@v3
with:
name: build-status-${{ matrix.target_arch }}-${{ github.sha }}
path: ./build-status
- name: Extract build status
run: |
tar xf build-status/${{ matrix.target_arch }}-${{ github.sha }}.tar
rm -f build-status/${{ matrix.target_arch }}-${{ github.sha }}.tar
- name: Build packages
run: |
if [ "$(cat ./build-status/tur-continuous-finished-flag)" = "true" ]; then
exit 0
fi
declare -a packages
for repo_path in $(jq --raw-output 'keys | .[]' repo.json); do
repo=$(jq --raw-output '.["'${repo_path}'"].name' repo.json)
if [ -f ./built_${repo}_packages.txt ]; then
packages="$packages $(cat ./built_${repo}_packages.txt)"
fi
done
if [ ! -z "$packages" ]; then
./continuous-build-wrapper.sh ./build-package.sh -I -a ${{ matrix.target_arch }} $packages
fi
- name: Waiting for debugger
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
- name: Generate build status
run: |
tar cf build-status/${{ matrix.target_arch }}-${{ github.sha }}.tar ./*.txt ./debs ./artifacts ./output
- name: Upload build status
uses: actions/upload-artifact@v3
with:
name: build-status-${{ matrix.target_arch }}-${{ github.sha }}
path: ./build-status

build-7:
runs-on: ubuntu-22.04
needs: build-6
env:
ANDROID_HOME: "/opt/termux/android-sdk"
NDK: "/opt/termux/android-ndk"
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
TUR_CONTINUOUS_FLAG: true
strategy:
matrix:
target_arch: [aarch64, arm, i686, x86_64]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 1000
submodules: true
- name: Merge repos
run: ./setup-environment.sh
- name: Free additional disk space
run: |
sudo apt purge -yq $(dpkg -l | grep '^ii' | awk '{ print $2 }' | grep -P '(cabal-|dotnet-|ghc-|libmono|php|aspnetcore)') \
mono-runtime-common monodoc-manual ruby
sudo apt autoremove -yq
sudo rm -rf /opt/hostedtoolcache /usr/local /usr/share/dotnet /usr/share/swift
- name: Download build deps
uses: actions/download-artifact@v3
with:
name: build-deps-${{ matrix.target_arch }}-${{ github.sha }}
path: ./build-deps
- name: Download build status
uses: actions/download-artifact@v3
with:
name: build-status-${{ matrix.target_arch }}-${{ github.sha }}
path: ./build-status
- name: Extract build status
run: |
tar xf build-status/${{ matrix.target_arch }}-${{ github.sha }}.tar
rm -f build-status/${{ matrix.target_arch }}-${{ github.sha }}.tar
- name: Build packages
run: |
if [ "$(cat ./build-status/tur-continuous-finished-flag)" = "true" ]; then
exit 0
fi
declare -a packages
for repo_path in $(jq --raw-output 'keys | .[]' repo.json); do
repo=$(jq --raw-output '.["'${repo_path}'"].name' repo.json)
if [ -f ./built_${repo}_packages.txt ]; then
packages="$packages $(cat ./built_${repo}_packages.txt)"
fi
done
if [ ! -z "$packages" ]; then
./continuous-build-wrapper.sh ./build-package.sh -I -a ${{ matrix.target_arch }} $packages
fi
- name: Waiting for debugger
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
- name: Generate build status
run: |
tar cf build-status/${{ matrix.target_arch }}-${{ github.sha }}.tar ./*.txt ./debs ./artifacts ./output
- name: Upload build status
uses: actions/upload-artifact@v3
with:
name: build-status-${{ matrix.target_arch }}-${{ github.sha }}
path: ./build-status

finished-build:
runs-on: ubuntu-22.04
needs: build-5
needs: build-7
env:
ANDROID_HOME: "/opt/termux/android-sdk"
NDK: "/opt/termux/android-ndk"
Expand Down
17 changes: 12 additions & 5 deletions continuous-build-wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@


: "${TUR_CONTINUOUS_FLAG:=false}"
: "${TUR_CONTINUOUS_TIMEOUT:=240m}"
: "${TUR_CONTINUOUS_TIMEOUT:=200m}"

# XXX: For the CI, we always pass the packages as the last param.
TUR_CONTINUOUS_PACKAGE="${@: -1}"

echo "==> Package to be built: $TUR_CONTINUOUS_PACKAGE"

# Get the builder docker image if necessary.
./scripts/run-docker.sh bash -c "exit 0"
Expand Down Expand Up @@ -83,10 +88,12 @@ elif [[ $EXIT_CODE == 124 ]]; then # https://www.gnu.org/software/coreutils/manu
echo "==> Generating the build status..."
df -h
# XXX: This will create a pretty large file, hope that Github Action has enough space.
# XXX: I think the build status is just the `build`, `src` and `tmp` folder. `cache`
# XXX: often contains the source tar ball and will not be modified.
# TODO: Parse the package name from command line.
time ./scripts/run-docker.sh bash -c 'sudo tar -I zstd --remove-files -cf ./build-status/tur-continuous-status.tar.zst /home/builder/.termux-build/chromium/{build,src,tmp}'
# XXX: I think the build status is just the `build` folder. If this package performs
# XXX: an in-source building, please move the origin `src` folder to `build` folder
# XXX: and use symlinks to provide `src` folder. Folder like `src`, `cache`, or `tmp`
# XXX: often contains the source files or scripts and will not be modified during
# XXX: the building process.
time ./scripts/run-docker.sh bash -c 'sudo tar -I zstd --remove-files -cf ./build-status/tur-continuous-status.tar.zst /home/builder/.termux-build/'"$TUR_CONTINUOUS_PACKAGE"'/build'
echo "==> Successfully generate build status."
# Create the deps file if the package is built the first time.
if [ "$TUR_CONTINUOUS_FLAG" = "false" ]; then
Expand Down
2 changes: 1 addition & 1 deletion tur-continuous/chromium/0011-chromium-impl-sysinfo.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
+
+#include "base/logging.h"
+
+#if (__ANDROID_API__ >= 21 /* 5.0 - Lollipop */)
+#if 0 // (__ANDROID_API__ >= 21 /* 5.0 - Lollipop */)
+
+namespace {
+
Expand Down
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());

Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
--- 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());

--- a/ui/ozone/platform/wayland/host/wayland_connection.cc
+++ b/ui/ozone/platform/wayland/host/wayland_connection.cc
@@ -139,14 +139,22 @@
Expand Down
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;
}

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
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
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);
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();
}
}