From e58f457519655a731645e3f6a5f6cbfbe5e9e139 Mon Sep 17 00:00:00 2001 From: bgme Date: Fri, 18 Aug 2023 23:03:34 +0800 Subject: [PATCH] Revert "remove firefox-vaapi" This reverts commit 2e5e877958d6a5e905deea09ebf3e2a5513a1f17. --- repo/firefox-vaapi/0001-enable-vaapi.patch | 18 + .../0002-remove-nvidia-blocklist.patch | 105 +++++ repo/firefox-vaapi/PKGBUILD | 302 ++++++++++++++ repo/firefox-vaapi/firefox.desktop | 386 ++++++++++++++++++ repo/firefox-vaapi/identity-icons-brand.svg | 3 + repo/firefox-vaapi/lilac.yaml | 15 + repo/firefox-vaapi/upload-symbol-archive | 25 ++ 7 files changed, 854 insertions(+) create mode 100644 repo/firefox-vaapi/0001-enable-vaapi.patch create mode 100644 repo/firefox-vaapi/0002-remove-nvidia-blocklist.patch create mode 100644 repo/firefox-vaapi/PKGBUILD create mode 100644 repo/firefox-vaapi/firefox.desktop create mode 100644 repo/firefox-vaapi/identity-icons-brand.svg create mode 100644 repo/firefox-vaapi/lilac.yaml create mode 100755 repo/firefox-vaapi/upload-symbol-archive diff --git a/repo/firefox-vaapi/0001-enable-vaapi.patch b/repo/firefox-vaapi/0001-enable-vaapi.patch new file mode 100644 index 0000000..6da8aa1 --- /dev/null +++ b/repo/firefox-vaapi/0001-enable-vaapi.patch @@ -0,0 +1,18 @@ +diff --color --unified --recursive --text firefox-115.0.orig/widget/gtk/GfxInfo.cpp firefox-115.0.new/widget/gtk/GfxInfo.cpp +--- firefox-115.0.orig/widget/gtk/GfxInfo.cpp 2023-07-04 22:55:57.742252422 +0200 ++++ firefox-115.0.new/widget/gtk/GfxInfo.cpp 2023-07-04 22:56:45.117367837 +0200 +@@ -970,14 +970,6 @@ + nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, + V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_R600", ""); + +- // Disable on Release/late Beta on AMD +-#if !defined(EARLY_BETA_OR_EARLIER) +- APPEND_TO_DRIVER_BLOCKLIST(OperatingSystem::Linux, DeviceFamily::AtiAll, +- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, +- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, +- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), +- "FEATURE_HARDWARE_VIDEO_DECODING_DISABLE", ""); +-#endif + //////////////////////////////////// + // FEATURE_HW_DECODED_VIDEO_ZERO_COPY - ALLOWLIST + APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Linux, DeviceFamily::All, diff --git a/repo/firefox-vaapi/0002-remove-nvidia-blocklist.patch b/repo/firefox-vaapi/0002-remove-nvidia-blocklist.patch new file mode 100644 index 0000000..674f262 --- /dev/null +++ b/repo/firefox-vaapi/0002-remove-nvidia-blocklist.patch @@ -0,0 +1,105 @@ +diff --color --unified --recursive --text firefox-115.0.orig/widget/gtk/GfxInfo.cpp firefox-115.0.new/widget/gtk/GfxInfo.cpp +--- firefox-115.0.orig/widget/gtk/GfxInfo.cpp 2023-07-04 23:03:47.333542909 +0200 ++++ firefox-115.0.new/widget/gtk/GfxInfo.cpp 2023-07-04 23:04:17.310346929 +0200 +@@ -857,37 +857,6 @@ + DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), + "FEATURE_FAILURE_WEBRENDER_MESA_VM", ""); + +- //////////////////////////////////// +- // FEATURE_WEBRENDER_COMPOSITOR +- APPEND_TO_DRIVER_BLOCKLIST( +- OperatingSystem::Linux, DeviceFamily::All, +- nsIGfxInfo::FEATURE_WEBRENDER_COMPOSITOR, +- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, +- V(0, 0, 0, 0), "FEATURE_FAILURE_WEBRENDER_COMPOSITOR_DISABLED", ""); +- +- //////////////////////////////////// +- // FEATURE_X11_EGL +- APPEND_TO_DRIVER_BLOCKLIST_EXT( +- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +- WindowProtocol::All, DriverVendor::MesaAll, DeviceFamily::All, +- nsIGfxInfo::FEATURE_X11_EGL, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, +- DRIVER_LESS_THAN, V(17, 0, 0, 0), "FEATURE_X11_EGL_OLD_MESA", +- "Mesa 17.0.0.0"); +- +- APPEND_TO_DRIVER_BLOCKLIST_EXT( +- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +- WindowProtocol::All, DriverVendor::MesaAll, DeviceFamily::NvidiaAll, +- nsIGfxInfo::FEATURE_X11_EGL, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, +- DRIVER_LESS_THAN, V(18, 2, 0, 0), "FEATURE_X11_EGL_OLD_MESA_NOUVEAU", +- "Mesa 18.2.0.0"); +- +- APPEND_TO_DRIVER_BLOCKLIST_EXT( +- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +- WindowProtocol::All, DriverVendor::NonMesaAll, DeviceFamily::NvidiaAll, +- nsIGfxInfo::FEATURE_X11_EGL, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION, +- DRIVER_LESS_THAN, V(470, 82, 0, 0), +- "FEATURE_ROLLOUT_X11_EGL_NVIDIA_BINARY", "470.82.0"); +- + // Disable on all AMD devices not using Mesa. + APPEND_TO_DRIVER_BLOCKLIST_EXT( + OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +@@ -897,16 +866,6 @@ + "FEATURE_FAILURE_X11_EGL_NO_LINUX_ATI", ""); + + //////////////////////////////////// +- // FEATURE_DMABUF +- // Disabled due to high volume crash tracked in bug 1788573. +- APPEND_TO_DRIVER_BLOCKLIST_EXT( +- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +- WindowProtocol::All, DriverVendor::NonMesaAll, DeviceFamily::NvidiaAll, +- nsIGfxInfo::FEATURE_DMABUF, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, +- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), "FEATURE_FAILURE_BUG_1788573", +- ""); +- +- //////////////////////////////////// + // FEATURE_DMABUF_SURFACE_EXPORT + // Disabled due to: + // https://gitlab.freedesktop.org/mesa/mesa/-/issues/6666 +@@ -946,14 +905,6 @@ + V(21, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_MESA", + "Mesa 21.0.0.0"); + +- // Disable on all NVIDIA hardware +- APPEND_TO_DRIVER_BLOCKLIST_EXT( +- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +- WindowProtocol::All, DriverVendor::All, DeviceFamily::NvidiaAll, +- nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING, +- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, +- V(0, 0, 0, 0), "FEATURE_HARDWARE_VIDEO_DECODING_NO_LINUX_NVIDIA", ""); +- + // Disable on all AMD devices not using Mesa. + APPEND_TO_DRIVER_BLOCKLIST_EXT( + OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +@@ -988,15 +939,6 @@ + ""); + + //////////////////////////////////// +- // FEATURE_WEBRENDER_PARTIAL_PRESENT +- APPEND_TO_DRIVER_BLOCKLIST_EXT( +- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +- WindowProtocol::X11, DriverVendor::NonMesaAll, DeviceFamily::NvidiaAll, +- nsIGfxInfo::FEATURE_WEBRENDER_PARTIAL_PRESENT, +- nsIGfxInfo::FEATURE_BLOCKED_DEVICE, DRIVER_COMPARISON_IGNORED, +- V(0, 0, 0, 0), "FEATURE_ROLLOUT_WR_PARTIAL_PRESENT_NVIDIA_BINARY", ""); +- +- //////////////////////////////////// + + APPEND_TO_DRIVER_BLOCKLIST_EXT( + OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +@@ -1004,14 +946,6 @@ + nsIGfxInfo::FEATURE_THREADSAFE_GL, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, + DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), + "FEATURE_FAILURE_THREADSAFE_GL_NOUVEAU", ""); +- +- // Disabled due to high volume crash tracked in bug 1788573. +- APPEND_TO_DRIVER_BLOCKLIST_EXT( +- OperatingSystem::Linux, ScreenSizeStatus::All, BatteryStatus::All, +- WindowProtocol::All, DriverVendor::NonMesaAll, DeviceFamily::NvidiaAll, +- nsIGfxInfo::FEATURE_THREADSAFE_GL, nsIGfxInfo::FEATURE_BLOCKED_DEVICE, +- DRIVER_COMPARISON_IGNORED, V(0, 0, 0, 0), "FEATURE_FAILURE_BUG_1788573", +- ""); + } + return *sDriverInfo; + } +Alleen in firefox-115.0.new/widget/gtk: GfxInfo.cpp.orig diff --git a/repo/firefox-vaapi/PKGBUILD b/repo/firefox-vaapi/PKGBUILD new file mode 100644 index 0000000..5f40046 --- /dev/null +++ b/repo/firefox-vaapi/PKGBUILD @@ -0,0 +1,302 @@ +# Maintainer: Ewout van Mansom +# Contributor: Jan Alexander Steffens (heftig) +# Contributor: Ionut Biru +# Contributor: Jakub Schmidtke + +pkgname=firefox-vaapi +_pkgname=firefox +pkgver=115.0.2 +pkgrel=1 +pkgdesc="Standalone web browser from mozilla.org (with VA-API patches)" +url="https://www.mozilla.org/firefox/" +arch=(x86_64) +license=( + GPL + LGPL + MPL +) +depends=( + dbus-glib + ffmpeg + gtk3 + libpulse + libxss + libxt + mime-types + nss + ttf-font +) +makedepends=( + cbindgen + clang + diffutils + dump_syms + imake + inetutils + jack + lld + llvm + mesa + nasm + nodejs + python + rust + unzip + wasi-compiler-rt + wasi-libc + wasi-libc++ + wasi-libc++abi + xorg-server-xvfb + yasm + zip +) +optdepends=( + 'hunspell-en_US: Spell checking, American English' + 'libnotify: Notification integration' + 'networkmanager: Location detection via available WiFi networks' + 'pulseaudio: Audio support' + 'speech-dispatcher: Text-to-Speech' + 'xdg-desktop-portal: Screensharing with Wayland' +) +provides=(firefox=${pkgver}) +conflicts=(firefox) +options=( + !debug + !emptydirs + !lto + !makeflags + !strip +) +source=( + https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc} + firefox.desktop + identity-icons-brand.svg + 0001-enable-vaapi.patch + 0002-remove-nvidia-blocklist.patch +) +validpgpkeys=( + '14F26682D0916CDD81E37B6D61B7B526D98F0353' # Mozilla Software Releases +) +sha256sums=('6b2844124c13b4bd9d97ac7f5840f3e957b7631659591f3bea1ac9a89bee1654' + 'SKIP' + '1f241fdc619f92a914c75aece7c7c717401d7467c9a306458e106b05f34e5044' + 'a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9' + '5b1db043ba3bce65e9fa2ba06bec73edd769ce6d5135aefa1634ed1285791db2' + 'c385b268dbbbfc56abe790a329f6ae53819b1e18ecad5dbea958cf9eaabc070d') +b2sums=('ca602d102f2b7b7fc7bebb6ca4b21e548d4542727da94410497ad6774b6dc7a9eba778c9b6e269beabdbf647e3447f621103cb68fbcac77c4beca1829cbfc535' + 'SKIP' + 'd07557840097dd48a60c51cc5111950781e1c6ce255557693bd11306c7a9258b2a82548329762148f117b2295145f9e66e0483a18e2fe09c5afcffed2e4b8628' + '63a8dd9d8910f9efb353bed452d8b4b2a2da435857ccee083fc0c557f8c4c1339ca593b463db320f70387a1b63f1a79e709e9d12c69520993e26d85a3d742e34' + '557d08096b4a1773c6c3deab578c88747e62f4e06f19cf3f1c60dac026ad4951191284a64f0b10d0c2be3d11650998eefdb3783ee4929e975cbe5c533971fc5b' + '5ab88347bf4c8f562d434eb15f274fb165f8e165bbd10937f1130a3678dbaca855ed86bee3d840be8a49c72db5bb80b7ce8c5bb027d46424e7e3c7d43fe2c8c5') + +# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) +# Note: These are for Arch Linux use ONLY. For your own distribution, please +# get your own set of keys. Feel free to contact foutrelis@archlinux.org for +# more information. +_google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM + +# Mozilla API keys (see https://location.services.mozilla.com/api) +# Note: These are for Arch Linux use ONLY. For your own distribution, please +# get your own set of keys. Feel free to contact heftig@archlinux.org for +# more information. +_mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a + +prepare() { + mkdir mozbuild + cd firefox-$pkgver + + # https://bugzilla.mozilla.org/show_bug.cgi?id=1809068 + # https://bbs.archlinux.org/viewtopic.php?id=281398 + # https://src.fedoraproject.org/rpms/firefox/blob/rawhide/f/firefox-enable-vaapi.patch + patch -Np1 -i ../0001-enable-vaapi.patch + + # Disable NVIDIA blocklists, to make it function with libva-nvidia-driver-git AUR package + patch -Np1 -i ../0002-remove-nvidia-blocklist.patch + + echo -n "$_google_api_key" >google-api-key + echo -n "$_mozilla_api_key" >mozilla-api-key + + cat >../mozconfig <.mozconfig ../mozconfig - <.mozconfig ../mozconfig - < + + diff --git a/repo/firefox-vaapi/lilac.yaml b/repo/firefox-vaapi/lilac.yaml new file mode 100644 index 0000000..73e9004 --- /dev/null +++ b/repo/firefox-vaapi/lilac.yaml @@ -0,0 +1,15 @@ +maintainers: + - github: yingziwu + email: i@bgme.me + +build_prefix: extra-x86_64 + +pre_build: aur_pre_build + +post_build: aur_post_build + +time_limit_hours: 4 + +update_on: + - source: aur + aur: firefox-vaapi diff --git a/repo/firefox-vaapi/upload-symbol-archive b/repo/firefox-vaapi/upload-symbol-archive new file mode 100755 index 0000000..059a399 --- /dev/null +++ b/repo/firefox-vaapi/upload-symbol-archive @@ -0,0 +1,25 @@ +#!/bin/bash -e + +die() { + echo >&2 "$@" + exit 1 +} + +(( $# >= 2 )) || die "Usage: $0 TOKEN-FILE SYMBOL-ARCHIVE..." +token="$1" +shift + +[[ -f $token && -s $token ]] || die "Invalid TOKEN-FILE ${token@Q}" + +for zip; do + [[ $(file -SEbi "$zip") == application/zip* ]] || die "Invalid SYMBOL-ARCHIVE ${zip@Q}" +done + +for zip; do + echo >&2 "Uploading ${zip@Q} ..." + curl -X POST -H "Auth-Token: $(<"$token")" -F "${zip##*/}=@$zip" \ + --retry 4 --retry-connrefused --connect-timeout 120 \ + https://symbols.mozilla.org/upload/ + echo + mv -v "$zip" "$zip.uploaded" +done