├── LICENSE ├── apply-patches.py ├── category-cachy-browser.svg ├── gentoo-patch-blacklist.txt ├── helpers └── tridactyl-install.sh ├── lw-cachy-logo-devtools.patch ├── manage-librewolf-patchlist.py ├── patches ├── about-dialog.patch ├── add-mold-linker.patch ├── browser-confvars.patch ├── dbus_name.patch ├── devtools-bypass.patch ├── fix-psutil-dev.patch ├── fix-psutil.patch ├── gentoo │ ├── 0001-Fortify-sources-properly.patch │ ├── 0002-bmo-847568-support-system-harfbuzz-graphite2.patch │ ├── 0003-musl-Add-alternate-name-for-private-siginfo-struct-m.patch │ ├── 0004-musl-Fix-syscall-wrappers.patch │ ├── 0005-musl-Only-use-system-heap-reporter-with-glibc.patch │ ├── 0006-musl-Set-pthread-name-for-non-glibc-systems.patch │ ├── 0007-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch │ ├── 0008-build-Disable-Werror.patch │ ├── 0009-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch │ ├── 0010-bgo-816975-fix-build-on-x86.patch │ ├── 0011-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch │ ├── 0012-bmo-1754469-memory_mozalloc_throw.patch │ ├── 0013-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch │ ├── 0014-gcc-lto-pgo-gentoo.patch │ ├── 0015-bgo-748849-RUST_TARGET_override.patch │ ├── 0016-bmo-1874059-fix-libcxx-18.patch │ ├── 0017-dont-use-build-id.patch │ ├── 0018-bgo-929967-fix-pgo-on-musl.patch │ ├── 0019-gcc-always-inline-from-fedora.patch │ ├── 0020-bmo-1657849-musl-sandbox-sched_setscheduler.patch │ ├── 0021-bgo-940031-wasm-support.patch │ ├── 0022-bmo-1790526-check-for-propagated-BrowsingContext-in-SessionStoreParent.patch │ └── 0023-bmo-1961610-dont-advertise-hdr-support-on-wayland.patch ├── glibc236.patch ├── kde │ ├── 0001-kde-unity.patch │ ├── firefox-kde.patch │ ├── mozilla-kde.patch │ ├── mozilla-kde_after_unity.patch │ └── mozilla-nongnome-proxies.patch ├── librewolf-patchset.txt ├── librewolf-ui │ ├── allow_cookies_for_site.patch │ ├── firefox-view.patch │ ├── handlers.patch │ ├── hide-default-browser.patch │ ├── lw-logo-devtools.patch │ ├── pref-naming.patch │ ├── privacy-preferences.patch │ ├── remove-cfrprefs.patch │ ├── remove-organization-policy-banner.patch │ └── website-appearance-ui-rfp.patch ├── librewolf │ ├── 1550_1549.diff │ ├── JXL_enable_by_default.patch │ ├── JXL_improved_support.patch │ ├── allow-JXL-in-non-nightly-browser.patch │ ├── allow-ubo-private-mode.patch │ ├── arm.patch │ ├── bootstrap-without-vcs.patch │ ├── bootstrap.patch │ ├── context-menu.patch │ ├── custom-ubo-assets-bootstrap-location.patch │ ├── dbus_name.patch │ ├── devtools-bypass.patch │ ├── disable-data-reporting-at-compile-time.patch │ ├── flatpak-autoconf.patch │ ├── fullpage-translations-customization.patch │ ├── fullpage-translations.patch │ ├── hide-passwordmgr.patch │ ├── moz-configure.patch │ ├── mozilla_dirs.patch │ ├── msix.patch │ ├── pack_vs.py │ ├── remove_addons.patch │ ├── rs-blocker.patch │ ├── rust-gentoo-musl.patch │ ├── rust-unaligned-access-backport.patch │ ├── tumbleweed-bootstrap.patch │ ├── urlbarprovider-interventions.patch │ ├── windows-theming-bug.patch │ └── xmas.patch ├── lw-logo-devtools-cachy.patch ├── moz-configure.patch ├── mozilla_dirs.patch ├── pref-pane │ ├── cachy-browser.css │ ├── cachy-browser.inc.xhtml │ ├── cachy-browser.js │ ├── category-cachy-browser.svg │ └── pref-pane-small.patch ├── rust163.patch ├── sanitizing-description.patch ├── sed-patches │ ├── allow-searchengines-non-esr.patch │ ├── disable-pocket.patch │ ├── remove-internal-plugin-certs.patch │ └── stop-undesired-requests.patch ├── unity_kde │ ├── firefox-kde.patch │ ├── mozilla-kde.patch │ └── unity-menubar.patch ├── use-mcpu-native-with-lto-pgo.patch └── zstandard-0.18.0.patch ├── rebase-patches.sh ├── rename-files.py ├── source_files ├── browser │ └── branding │ │ └── cachy │ │ ├── VisualElements_150.png │ │ ├── VisualElements_70.png │ │ ├── background.png │ │ ├── bgstub.jpg │ │ ├── bgstub_2x.jpg │ │ ├── branding.nsi │ │ ├── configure.sh │ │ ├── content │ │ ├── about-logo.png │ │ ├── about-logo.svg │ │ ├── about-logo@2x.png │ │ ├── about-wordmark.svg │ │ ├── about.png │ │ ├── aboutDialog.css │ │ ├── aboutlogins.svg │ │ ├── firefox-wordmark.svg │ │ ├── jar.mn │ │ └── moz.build │ │ ├── default128.png │ │ ├── default16.png │ │ ├── default32.png │ │ ├── default48.png │ │ ├── default64.png │ │ ├── disk.icns │ │ ├── document.icns │ │ ├── document.ico │ │ ├── dsstore │ │ ├── firefox.VisualElementsManifest.xml │ │ ├── firefox.icns │ │ ├── firefox.ico │ │ ├── firefox64.ico │ │ ├── locales │ │ ├── en-US │ │ │ ├── brand.dtd │ │ │ ├── brand.ftl │ │ │ └── brand.properties │ │ ├── jar.mn │ │ └── moz.build │ │ ├── moz.build │ │ ├── newtab.ico │ │ ├── newwindow.ico │ │ ├── noise-512x512.png │ │ ├── pbmode.ico │ │ ├── pref │ │ └── firefox-branding.js │ │ ├── stubinstaller │ │ ├── bgstub.jpg │ │ ├── installing_page.css │ │ └── profile_cleanup_page.css │ │ ├── wizHeader.bmp │ │ ├── wizHeaderRTL.bmp │ │ └── wizWatermark.bmp └── search-config.json ├── test-patches.sh ├── update-gentoo-patchset.sh └── update-patches.sh /apply-patches.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # 4 | # The script that patches the firefox source into the librewolf source. 5 | # fork of librewolf's script librewolf-patches.py 6 | # 7 | 8 | import sys 9 | import os 10 | import optparse 11 | import time 12 | from os.path import isfile, join 13 | 14 | # 15 | # general functions, skip these, they are not that interesting 16 | # 17 | 18 | start_time = time.time() 19 | parser = optparse.OptionParser() 20 | parser.add_option('-n', '--no-execute', dest='no_execute', default=False, action="store_true") 21 | options, args = parser.parse_args() 22 | 23 | def script_exit(statuscode): 24 | if (time.time() - start_time) > 60: 25 | # print elapsed time 26 | elapsed = time.strftime("%H:%M:%S", time.gmtime(time.time() - start_time)) 27 | print("\n\aElapsed time: {elapsed}") 28 | sys.stdout.flush() 29 | 30 | sys.exit(statuscode) 31 | 32 | def exec(cmd, exit_on_fail = True, do_print = True): 33 | if cmd != '': 34 | if do_print: 35 | print(cmd) 36 | sys.stdout.flush() 37 | if not options.no_execute: 38 | retval = os.system(cmd) 39 | if retval != 0 and exit_on_fail: 40 | print(f"fatal error: command '{cmd}' failed") 41 | sys.stdout.flush() 42 | script_exit(1) 43 | return retval 44 | return None 45 | 46 | def patch(patchfile: str): 47 | cmd = f"patch -Np1 -i {patchfile}" 48 | print(f"\n*** -> {cmd}") 49 | sys.stdout.flush() 50 | if not options.no_execute: 51 | retval = os.system(cmd) 52 | if retval != 0: 53 | print(f"fatal error: patch '{patchfile}' failed") 54 | sys.stdout.flush() 55 | script_exit(1) 56 | 57 | def enter_srcdir(directory: str): 58 | print(f"cd {directory}") 59 | sys.stdout.flush() 60 | if not options.no_execute: 61 | try: 62 | os.chdir(directory) 63 | except Exception: 64 | print(f"fatal error: can't change to '{directory}' folder.") 65 | sys.stdout.flush() 66 | script_exit(1) 67 | 68 | def leave_srcdir(): 69 | print("cd ..") 70 | sys.stdout.flush() 71 | if not options.no_execute: 72 | os.chdir("..") 73 | 74 | def gentoo_patches(firefox_folder: str, common_srcdir: str): 75 | 76 | enter_srcdir(firefox_folder) 77 | 78 | gentoo_path = join(common_srcdir, 'patches/gentoo') 79 | patch_files = [f for f in os.listdir(gentoo_path) if isfile(join(gentoo_path, f))] 80 | 81 | blacklist_patches = [] 82 | blacklist_filepath = join(common_srcdir, 'gentoo-patch-blacklist.txt') 83 | if isfile(blacklist_filepath): 84 | with open(blacklist_filepath, 'r') as f: 85 | blacklist_patches = f.read().splitlines() 86 | 87 | for patch_file in patch_files: 88 | if any(denied_patch in patch_file for denied_patch in blacklist_patches): 89 | continue 90 | patch_filename = join(gentoo_path, patch_file) 91 | patch(patch_filename) 92 | 93 | leave_srcdir() 94 | 95 | def cachy_patches(firefox_folder: str, common_srcdir: str, settings_srcdir: str): 96 | 97 | enter_srcdir(firefox_folder) 98 | 99 | # copy branding files.. 100 | exec('cp -r {0} .'.format(join(common_srcdir, 'source_files/browser'))) 101 | 102 | # copy the right search-config.json file 103 | exec('cp -v {0} services/settings/dumps/main/search-config.json'.format(join(common_srcdir, 'source_files/search-config.json'))) 104 | 105 | # apply dbus names patch, to have dbus name exposed as cachy instead of mozilla 106 | patch(join(common_srcdir, 'patches/dbus_name.patch')) 107 | 108 | # apply patch to have correct profiles folder name 109 | patch(join(common_srcdir, 'patches/mozilla_dirs.patch')) 110 | 111 | # apply patch to fix wrong profile dir on Firefox 137 112 | # see https://codeberg.org/librewolf/source/commit/0ce00ca673e7311f2ce35d4815d5a1bb2db3bbce 113 | patch(join(common_srcdir, 'patches/moz-configure.patch')) 114 | 115 | # 116 | # Apply most recent `settings` repository files. 117 | # 118 | 119 | exec('mkdir -p lw') 120 | enter_srcdir('lw') 121 | exec('cp -v {0} .'.format(join(settings_srcdir, 'cachyos.cfg'))) 122 | exec('cp -v {0} .'.format(join(settings_srcdir, 'distribution/policies.json'))) 123 | exec('cp -v {0} .'.format(join(settings_srcdir, 'defaults/pref/local-settings.js'))) 124 | leave_srcdir() 125 | 126 | 127 | 128 | # 129 | # pref-pane patches 130 | # 131 | 132 | # 2) new files 133 | exec('cp {0} browser/themes/shared/preferences/category-cachy-browser.svg'.format(join(common_srcdir, 'patches/pref-pane/category-cachy-browser.svg'))) 134 | exec('cp {0} browser/themes/shared/preferences/cachy-browser.css'.format(join(common_srcdir, 'patches/pref-pane/cachy-browser.css'))) 135 | exec('cp {0} browser/components/preferences/cachy-browser.inc.xhtml'.format(join(common_srcdir, 'patches/pref-pane/cachy-browser.inc.xhtml'))) 136 | exec('cp {0} browser/components/preferences/cachy-browser.js'.format(join(common_srcdir, 'patches/pref-pane/cachy-browser.js'))) 137 | # 3) append our locale string values to preferences.ftl 138 | # exec('cat browser/locales/en-US/browser/preferences/preferences.ftl {0} > preferences.ftl'.format(join(common_srcdir, 'patches/pref-pane/preferences.ftl'))) 139 | # exec('mv preferences.ftl browser/locales/en-US/browser/preferences/preferences.ftl') 140 | 141 | # generate locales 142 | #exec("bash ../scripts/generate-locales.sh") 143 | 144 | leave_srcdir() 145 | 146 | # 147 | # Main functionality in this script.. 148 | # 149 | 150 | if len(args) != 3: 151 | sys.stderr.write(f'Invalid usage! {sys.argv[0]} \n') 152 | sys.exit(1) 153 | 154 | firefox_folder = args[0] 155 | cachy_common_folder = args[1] 156 | cachy_settings_folder = args[2] 157 | 158 | if not os.path.exists(join(firefox_folder, 'configure.py')): 159 | sys.stderr.write('error: folder doesn\'t look like a Firefox folder.\n') 160 | sys.exit(1) 161 | 162 | print('---- Gentoo patches') 163 | gentoo_patches(firefox_folder, cachy_common_folder) 164 | 165 | print('---- Cachy patches') 166 | cachy_patches(firefox_folder, cachy_common_folder, cachy_settings_folder) 167 | 168 | sys.exit(0) # ensure 0 exit code 169 | 170 | -------------------------------------------------------------------------------- /category-cachy-browser.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /gentoo-patch-blacklist.txt: -------------------------------------------------------------------------------- 1 | 0003-bmo-847568-Support-system-graphite2.patch 2 | 0032-bmo-1773259-cbindgen-root_clip_chain-fix.patch 3 | 0023-bgo-919418-ppc64-flac-decoder-unsupported.patch 4 | 0021-bgo-940031-wasm-support.patch 5 | 0025-bmo-1559213-support-system-av1-and-libvpx.patch 6 | -------------------------------------------------------------------------------- /helpers/tridactyl-install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | echoerr() { 4 | red="\\033[31m" 5 | normal="\\e[0m" 6 | printf "%b\n" "$red$*$normal" >&2 7 | } 8 | 9 | sedEscape() { 10 | printf "%s" "$@" | sed 's/[&/\]/\\&/g' 11 | } 12 | 13 | # To install, curl -fsSl 'url to this script' | sh 14 | 15 | run() { 16 | set -e 17 | 18 | XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/tridactyl" 19 | XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/tridactyl" 20 | 21 | # Decide where to put the manifest based on OS 22 | # Get OSTYPE from bash if it's installed. If it's not, then this will 23 | # default to the Linux location as OSTYPE will be empty 24 | OSTYPE="$(command -v bash >/dev/null && bash -c 'echo $OSTYPE')" 25 | case "$OSTYPE" in 26 | linux-gnu|linux-musl|linux|freebsd*) 27 | manifest_home="$HOME/.cachy/native-messaging-hosts/" 28 | binary_suffix="Linux" 29 | ;; 30 | linux-gnueabihf) 31 | manifest_home="$HOME/.cachy/native-messaging-hosts/" 32 | binary_suffix="armhf-Linux" 33 | ;; 34 | darwin*) 35 | manifest_home="$HOME/Library/Application Support/CachyOS/NativeMessagingHosts/" 36 | binary_suffix="macOS" 37 | ;; 38 | *) 39 | # Fallback to default Linux location for unknown OSTYPE 40 | # TODO: fall back to old Python messenger 41 | manifest_home="$HOME/.cachy/native-messaging-hosts/" 42 | binary_suffix="Linux" 43 | ;; 44 | esac 45 | 46 | if [ -n "$1" ] ; then 47 | native_version="$(curl -sSL https://raw.githubusercontent.com/tridactyl/tridactyl/"$1"/native/current_native_version 2>/dev/null)" 48 | else 49 | native_version="$(curl -sSL https://api.github.com/repos/tridactyl/native_messenger/releases/latest | grep "tag_name" | cut -d':' -f2- | sed 's|[^0-9\.]||g')" 50 | fi 51 | manifest_loc="https://raw.githubusercontent.com/tridactyl/native_messenger/$native_version/tridactyl.json" 52 | native_loc="https://github.com/tridactyl/native_messenger/releases/download/$native_version/native_main-$binary_suffix" 53 | 54 | 55 | mkdir -p "$manifest_home" "$XDG_DATA_HOME" 56 | 57 | manifest_file="$manifest_home/tridactyl.json" 58 | native_file="$XDG_DATA_HOME/native_main" 59 | 60 | echo "Installing manifest here: $manifest_home" 61 | echo "Installing script here: XDG_DATA_HOME: $XDG_DATA_HOME" 62 | 63 | 64 | curl -sSL --create-dirs -o "$manifest_file" "$manifest_loc" 65 | curl -sSL --create-dirs -o "$native_file" "$native_loc" 66 | 67 | if [ ! -f "$manifest_file" ] ; then 68 | echoerr "Failed to create '$manifest_file'. Please make sure that the directories exist and that you have the necessary permissions." 69 | exit 1 70 | fi 71 | 72 | if [ ! -f "$native_file" ] ; then 73 | echoerr "Failed to create '$native_file'. Please make sure that the directories exist and that you have the necessary permissions." 74 | exit 1 75 | fi 76 | 77 | sed -i.bak "s/REPLACE_ME_WITH_SED/$(sedEscape "$native_file")/" "$manifest_file" 78 | chmod +x "$native_file" 79 | 80 | ## Apparently `curl`'d things don't get quarantined, so maybe we don't need this after all? 81 | # case "$OSTYPE" in 82 | # darwin*) 83 | # echo 84 | # echo "Please log in as an administrator to give Tridactyl's messenger permission to run:" 85 | # sudo xattr -d com.apple.quarantine "$native_file" 86 | # ;; 87 | # esac 88 | 89 | echo 90 | echo "Successfully installed Tridactyl native messenger!" 91 | echo "Run ':native' in Firefox to check." 92 | } 93 | 94 | # Run the run function in a subshell so that it can be exited early if an error 95 | # occurs 96 | if ret="$(run "$@")"; then 97 | # Print captured output 98 | printf "%b\n" "$ret" 99 | else 100 | # Print captured output, ${ret:+\n} adds a newline only if ret isn't empty 101 | printf "%b" "$ret${ret:+\n}" 102 | echoerr 'Failed to install!' 103 | fi 104 | -------------------------------------------------------------------------------- /manage-librewolf-patchlist.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import optparse 4 | from os.path import join 5 | 6 | parser = optparse.OptionParser() 7 | parser.add_option("-f", "--file", 8 | dest = "filename", 9 | help = "patch list file", 10 | metavar = "FILE") 11 | parser.add_option('--exclude', dest = 'exclude', help='exclude needle strings', default=None) 12 | options, args = parser.parse_args() 13 | 14 | needle_list = [] if not options.exclude else options.exclude.split(',') 15 | file_lines = [] 16 | 17 | with open(options.filename, 'r') as f: 18 | file_lines = f.read().splitlines() 19 | 20 | new_lines = [] 21 | for line in file_lines: 22 | if any(needle in line for needle in needle_list): 23 | continue 24 | 25 | filename_split = line.split('/') 26 | if len(filename_split) == 2: 27 | new_filename = join('patches/librewolf', filename_split[1]) 28 | new_lines.append(new_filename) 29 | continue 30 | if filename_split[1] == 'ui-patches': 31 | new_filename = join('patches/librewolf-ui', '/'.join(filename_split[2:])) 32 | new_lines.append(new_filename) 33 | continue 34 | 35 | new_lines.append(line) 36 | 37 | with open(options.filename, 'w') as f: 38 | f.write('\n'.join(new_lines) + '\n') 39 | -------------------------------------------------------------------------------- /patches/about-dialog.patch: -------------------------------------------------------------------------------- 1 | diff --git a/browser/base/content/aboutDialog.xhtml b/browser/base/content/aboutDialog.xhtml 2 | --- a/browser/base/content/aboutDialog.xhtml 3 | +++ b/browser/base/content/aboutDialog.xhtml 4 | @@ -147,7 +147,7 @@ 5 | 6 | 7 | 8 | - 12 | 13 | -------------------------------------------------------------------------------- /patches/add-mold-linker.patch: -------------------------------------------------------------------------------- 1 | diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure 2 | --- a/build/moz.configure/toolchain.configure 3 | +++ b/build/moz.configure/toolchain.configure 4 | @@ -2156,11 +2156,11 @@ 5 | 6 | 7 | option( 8 | "--enable-linker", 9 | nargs=1, 10 | - help="Select the linker {bfd, gold, ld64, lld, lld-*}{|}", 11 | + help="Select the linker {bfd, gold, ld64, lld, lld-*, mold}{|}", 12 | default=enable_linker_default, 13 | when=is_linker_option_enabled, 14 | ) 15 | 16 | 17 | @@ -2194,11 +2194,11 @@ 18 | 19 | def is_valid_linker(linker): 20 | if target.kernel == "Darwin": 21 | valid_linkers = ("ld64", "lld") 22 | else: 23 | - valid_linkers = ("bfd", "gold", "lld") 24 | + valid_linkers = ("bfd", "gold", "lld", "mold") 25 | if linker in valid_linkers: 26 | return True 27 | if "lld" in valid_linkers and linker.startswith("lld-"): 28 | return True 29 | return False 30 | @@ -2239,10 +2239,13 @@ 31 | kind = "ld64" 32 | 33 | elif retcode != 0: 34 | return None 35 | 36 | + elif "mold" in stdout: 37 | + kind = "mold" 38 | + 39 | elif "GNU ld" in stdout: 40 | # We are using the normal linker 41 | kind = "bfd" 42 | 43 | elif "GNU gold" in stdout: 44 | @@ -2323,11 +2326,11 @@ 45 | # There's a wrinkle with MinGW: linker configuration is not enabled, so 46 | # `select_linker` is never invoked. Hard-code around it. 47 | @depends(select_linker, target, c_compiler) 48 | def gcc_use_gnu_ld(select_linker, target, c_compiler): 49 | if select_linker is not None and target.kernel != "Darwin": 50 | - return select_linker.KIND in ("bfd", "gold", "lld") 51 | + return select_linker.KIND in ("bfd", "gold", "lld", "mold") 52 | if target.kernel == "WINNT" and c_compiler.type == "clang": 53 | return True 54 | return None 55 | 56 | 57 | -------------------------------------------------------------------------------- /patches/browser-confvars.patch: -------------------------------------------------------------------------------- 1 | diff --git a/browser/confvars.sh b/browser/confvars.sh 2 | index 92871c9516..1e151180dd 100644 3 | --- a/browser/confvars.sh 4 | +++ b/browser/confvars.sh 5 | @@ -3,8 +3,10 @@ 6 | # License, v. 2.0. If a copy of the MPL was not distributed with this 7 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | -MOZ_APP_VENDOR=Mozilla 10 | -MOZ_UPDATER=1 11 | +MOZ_APP_BASENAME=Cachy 12 | +MOZ_APP_VENDOR="CachyOS" 13 | + 14 | +MOZ_UPDATER=0 15 | 16 | if test "$OS_ARCH" = "WINNT"; then 17 | if ! test "$HAVE_64BIT_BUILD"; then 18 | @@ -34,8 +36,8 @@ BROWSER_CHROME_URL=chrome://browser/content/browser.xhtml 19 | # For mozilla-beta, mozilla-release, or mozilla-central repositories, use 20 | # "unofficial" branding. 21 | # For the mozilla-aurora repository, use "aurora". 22 | -MOZ_BRANDING_DIRECTORY=browser/branding/unofficial 23 | -MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official 24 | +MOZ_BRANDING_DIRECTORY=browser/branding/cachy 25 | +MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/cachy 26 | MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384} 27 | 28 | MOZ_PROFILE_MIGRATOR=1 29 | -------------------------------------------------------------------------------- /patches/dbus_name.patch: -------------------------------------------------------------------------------- 1 | diff --git a/toolkit/components/remote/nsDBusRemoteClient.cpp b/toolkit/components/remote/nsDBusRemoteClient.cpp 2 | index aad9d7054af8..a926d8b6abdc 100644 3 | --- a/toolkit/components/remote/nsDBusRemoteClient.cpp 4 | +++ b/toolkit/components/remote/nsDBusRemoteClient.cpp 5 | @@ -76,7 +76,7 @@ bool nsDBusRemoteClient::GetRemoteDestinationName(const char* aProgram, 6 | mozilla::XREAppData::SanitizeNameForDBus(profileName); 7 | 8 | aDestinationName = 9 | - nsPrintfCString("org.mozilla.%s.%s", aProgram, profileName.get()); 10 | + nsPrintfCString("org.cachyos.%s.%s", aProgram, profileName.get()); 11 | if (aDestinationName.Length() > DBUS_MAXIMUM_NAME_LENGTH) 12 | aDestinationName.Truncate(DBUS_MAXIMUM_NAME_LENGTH); 13 | 14 | @@ -90,7 +90,7 @@ bool nsDBusRemoteClient::GetRemoteDestinationName(const char* aProgram, 15 | if (!sDBusValidateBusName(aDestinationName.get(), nullptr)) { 16 | // We don't have a valid busName yet - try to create a default one. 17 | aDestinationName = 18 | - nsPrintfCString("org.mozilla.%s.%s", aProgram, "default"); 19 | + nsPrintfCString("org.cachyos.%s.%s", aProgram, "default"); 20 | if (!sDBusValidateBusName(aDestinationName.get(), nullptr)) { 21 | // We failed completelly to get a valid bus name - just quit 22 | // to prevent crash at dbus_bus_request_name(). 23 | @@ -117,7 +117,7 @@ nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProfile, 24 | } 25 | 26 | nsAutoCString pathName; 27 | - pathName = nsPrintfCString("/org/mozilla/%s/Remote", appName.get()); 28 | + pathName = nsPrintfCString("/org/cachyos/%s/Remote", appName.get()); 29 | 30 | static auto sDBusValidatePathName = (bool (*)(const char*, DBusError*))dlsym( 31 | RTLD_DEFAULT, "dbus_validate_path"); 32 | @@ -128,7 +128,7 @@ nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char* aProfile, 33 | } 34 | 35 | nsAutoCString remoteInterfaceName; 36 | - remoteInterfaceName = nsPrintfCString("org.mozilla.%s", appName.get()); 37 | + remoteInterfaceName = nsPrintfCString("org.cachyos.%s", appName.get()); 38 | 39 | LOG(" DBus destination: %s\n", destinationName.get()); 40 | LOG(" DBus path: %s\n", pathName.get()); 41 | diff --git a/toolkit/components/remote/nsDBusRemoteServer.cpp b/toolkit/components/remote/nsDBusRemoteServer.cpp 42 | index 4afb8381d0bc..bd927334b817 100644 43 | --- a/toolkit/components/remote/nsDBusRemoteServer.cpp 44 | +++ b/toolkit/components/remote/nsDBusRemoteServer.cpp 45 | @@ -29,7 +29,7 @@ static const char* introspect_template = 46 | "1.0//EN\"\n" 47 | "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n" 48 | "\n" 49 | - " \n" 50 | + " \n" 51 | " \n" 52 | " \n" 53 | " \n" 54 | @@ -39,7 +39,7 @@ static const char* introspect_template = 55 | bool nsDBusRemoteServer::HandleOpenURL(const gchar* aInterfaceName, 56 | const gchar* aMethodName, 57 | Span aParam) { 58 | - nsPrintfCString ourInterfaceName("org.mozilla.%s", mAppName.get()); 59 | + nsPrintfCString ourInterfaceName("org.cachyos.%s", mAppName.get()); 60 | 61 | if ((strcmp("OpenURL", aMethodName) != 0) || 62 | (strcmp(ourInterfaceName.get(), aInterfaceName) != 0)) { 63 | @@ -132,7 +132,7 @@ static const GDBusInterfaceVTable gInterfaceVTable = { 64 | HandleMethodCall, HandleGetProperty, HandleSetProperty}; 65 | 66 | void nsDBusRemoteServer::OnBusAcquired(GDBusConnection* aConnection) { 67 | - mPathName = nsPrintfCString("/org/mozilla/%s/Remote", mAppName.get()); 68 | + mPathName = nsPrintfCString("/org/cachyos/%s/Remote", mAppName.get()); 69 | static auto sDBusValidatePathName = (bool (*)(const char*, DBusError*))dlsym( 70 | RTLD_DEFAULT, "dbus_validate_path"); 71 | if (!sDBusValidatePathName || 72 | @@ -206,8 +206,7 @@ nsresult nsDBusRemoteServer::Startup(const char* aAppName, 73 | 74 | mozilla::XREAppData::SanitizeNameForDBus(profileName); 75 | 76 | - nsPrintfCString busName("org.mozilla.%s.%s", mAppName.get(), 77 | - profileName.get()); 78 | + nsPrintfCString busName("org.cachyos.%s.%s", mAppName.get(), profileName.get()); 79 | if (busName.Length() > DBUS_MAXIMUM_NAME_LENGTH) { 80 | busName.Truncate(DBUS_MAXIMUM_NAME_LENGTH); 81 | } 82 | @@ -221,7 +220,7 @@ nsresult nsDBusRemoteServer::Startup(const char* aAppName, 83 | 84 | // We don't have a valid busName yet - try to create a default one. 85 | if (!sDBusValidateBusName(busName.get(), nullptr)) { 86 | - busName = nsPrintfCString("org.mozilla.%s.%s", mAppName.get(), "default"); 87 | + busName = nsPrintfCString("org.cachyos.%s.%s", mAppName.get(), "default"); 88 | if (!sDBusValidateBusName(busName.get(), nullptr)) { 89 | // We failed completelly to get a valid bus name - just quit 90 | // to prevent crash at dbus_bus_request_name(). 91 | -------------------------------------------------------------------------------- /patches/devtools-bypass.patch: -------------------------------------------------------------------------------- 1 | # HG changeset patch 2 | # Parent 1db03a08d0e48db0da9b3b2cc54f74b46255c5b4 3 | 4 | diff -r 1db03a08d0e4 -r 3cf19811d37e browser/app/profile/firefox.js 5 | --- a/browser/app/profile/firefox.js Mon Nov 07 20:14:13 2022 +0200 6 | +++ b/browser/app/profile/firefox.js Tue Nov 08 00:54:30 2022 +0530 7 | @@ -20,6 +20,9 @@ 8 | #endif 9 | 10 | pref("browser.hiddenWindowChromeURL", "chrome://browser/content/hiddenWindowMac.xhtml"); 11 | +// Bypasses 12 | +pref("devtools.console.bypass", false); 13 | +pref("devtools.debugger.bypass", false); 14 | 15 | // Enables some extra Extension System Logging (can reduce performance) 16 | pref("extensions.logging.enabled", false); 17 | diff -r 1db03a08d0e4 -r 3cf19811d37e devtools/server/actors/thread.js 18 | --- a/devtools/server/actors/thread.js Mon Nov 07 20:14:13 2022 +0200 19 | +++ b/devtools/server/actors/thread.js Tue Nov 08 00:54:30 2022 +0530 20 | @@ -392,11 +392,9 @@ 21 | 22 | // Request handlers 23 | attach(options) { 24 | - // Note that the client avoids trying to call attach if already attached. 25 | - // But just in case, avoid any possible duplicate call to attach. 26 | - if (this.alreadyAttached) { 27 | - return; 28 | - } 29 | + let devtoolsBypass = Services.prefs.getBoolPref("devtools.debugger.bypass", true); 30 | + if (devtoolsBypass) 31 | + return; 32 | 33 | if (this.state === STATES.EXITED) { 34 | throw { 35 | diff -r 1db03a08d0e4 -r 3cf19811d37e devtools/server/actors/webconsole/listeners/console-api.js 36 | --- a/devtools/server/actors/webconsole/listeners/console-api.js Mon Nov 07 20:14:13 2022 +0200 37 | +++ b/devtools/server/actors/webconsole/listeners/console-api.js Tue Nov 08 00:54:30 2022 +0530 38 | @@ -89,6 +89,12 @@ 39 | ); 40 | } 41 | 42 | + observe(message, topic) { 43 | + let devtoolsBypass = Services.prefs.getBoolPref("devtools.console.bypass", true); 44 | + if (!this.handler || devtoolsBypass) { 45 | + return; 46 | + } 47 | + 48 | /** 49 | * The console API message listener. When messages are received from the 50 | * ConsoleAPIStorage service we forward them to the remote Web Console instance. 51 | -------------------------------------------------------------------------------- /patches/fix-psutil-dev.patch: -------------------------------------------------------------------------------- 1 | diff --git a/python/sites/mach.txt b/python/sites/mach.txt 2 | --- a/python/sites/mach.txt 3 | +++ b/python/sites/mach.txt 4 | @@ -133,5 +133,5 @@ 5 | # Mach gracefully handles the case where `psutil` is unavailable. 6 | # We aren't (yet) able to pin packages in automation, so we have to 7 | # support down to the oldest locally-installed version (5.4.2). 8 | -pypi-optional:psutil>=5.4.2,<=5.8.0:telemetry will be missing some data 9 | +pypi-optional:psutil>=5.4.2,<=5.9.1:telemetry will be missing some data 10 | pypi-optional:zstandard>=0.11.1,<=0.18.0:zstd archives will not be possible to extract 11 | -------------------------------------------------------------------------------- /patches/fix-psutil.patch: -------------------------------------------------------------------------------- 1 | diff --git a/build/mach_virtualenv_packages.txt b/build/mach_virtualenv_packages.txt 2 | index 57d7e2af8c..68928017fb 100644 3 | --- a/build/mach_virtualenv_packages.txt 4 | +++ b/build/mach_virtualenv_packages.txt 5 | @@ -5,5 +5,5 @@ pypi-optional:glean-sdk==40.0.0:telemetry will not be collected 6 | # Mach gracefully handles the case where `psutil` is unavailable. 7 | # We aren't (yet) able to pin packages in automation, so we have to 8 | # support down to the oldest locally-installed version (5.4.2). 9 | -pypi-optional:psutil>=5.4.2,<=5.8.0:telemetry will be missing some data 10 | +pypi-optional:psutil>=5.4.2,<=5.9.0:telemetry will be missing some data 11 | pypi-optional:zstandard>=0.11.1,<=0.17.0:zstd archives will not be possible to extract 12 | diff --git a/build/psutil_requirements.in b/build/psutil_requirements.in 13 | index 25a1813a4b..389957c9d6 100644 14 | --- a/build/psutil_requirements.in 15 | +++ b/build/psutil_requirements.in 16 | @@ -1,2 +1,2 @@ 17 | -psutil==5.8.0 18 | +psutil==5.9.0 19 | 20 | diff --git a/build/psutil_virtualenv_packages.txt b/build/psutil_virtualenv_packages.txt 21 | index 1fdad6983d..c14ad05226 100644 22 | --- a/build/psutil_virtualenv_packages.txt 23 | +++ b/build/psutil_virtualenv_packages.txt 24 | @@ -1 +1 @@ 25 | -pypi:psutil==5.8.0 26 | +pypi:psutil==5.9.0 27 | -------------------------------------------------------------------------------- /patches/gentoo/0001-Fortify-sources-properly.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/config/system-headers.mozbuild b/config/system-headers.mozbuild 2 | --- a/config/system-headers.mozbuild 2023-07-04 13:57:53.418421221 +0300 3 | +++ b/config/system-headers.mozbuild 2023-07-04 13:58:41.177179152 +0300 4 | @@ -227,7 +227,6 @@ 5 | "execinfo.h", 6 | "extras.h", 7 | "fcntl.h", 8 | - "features.h", 9 | "fenv.h", 10 | "ffi.h", 11 | "fibdef.h", 12 | -------------------------------------------------------------------------------- /patches/gentoo/0003-musl-Add-alternate-name-for-private-siginfo-struct-m.patch: -------------------------------------------------------------------------------- 1 | From d8ec0bd6f3b0ad2dfd8a97a864f08decaafdea69 Mon Sep 17 00:00:00 2001 2 | From: Samuel Holland 3 | Date: Sun, 8 Jan 2017 19:16:38 -0600 4 | Subject: [PATCH 10/30] musl: Add alternate name for private siginfo struct 5 | member 6 | 7 | musl does not provide a macro for detecting its presence. For now, 8 | assume that it is the only non-glibc-based libc on Linux systems. 9 | 10 | Signed-off-by: Samuel Holland 11 | Signed-off-by: Thomas Deutschmann 12 | --- 13 | security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc | 6 +++++- 14 | 1 file changed, 5 insertions(+), 1 deletion(-) 15 | 16 | diff --git a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc 17 | index 9884be8bb2..86d8f88e30 100644 18 | --- a/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc 19 | +++ b/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc 20 | @@ -174,7 +174,11 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) { 21 | // If the version of glibc doesn't include this information in 22 | // siginfo_t (older than 2.17), we need to explicitly copy it 23 | // into an arch_sigsys structure. 24 | - memcpy(&sigsys, &info->_sifields, sizeof(sigsys)); 25 | +#if defined(__GLIBC__) 26 | + memcpy(&sigsys, &info->_sifields, sizeof(sigsys)); 27 | +#else 28 | + memcpy(&sigsys, &info->__si_fields, sizeof(sigsys)); 29 | +#endif 30 | #endif 31 | 32 | #if defined(__mips__) 33 | -- 34 | 2.34.1 35 | 36 | -------------------------------------------------------------------------------- /patches/gentoo/0004-musl-Fix-syscall-wrappers.patch: -------------------------------------------------------------------------------- 1 | From 1b46c0fc085fe93c36320d7ac1004c83efccdccc Mon Sep 17 00:00:00 2001 2 | From: Samuel Holland 3 | Date: Sun, 8 Jan 2017 19:19:23 -0600 4 | Subject: [PATCH 11/30] musl: Fix syscall wrappers 5 | 6 | musl defines p{read,write}64 to their non-suffixed equivalents to avoid 7 | duplication in its syscall wrappers. This breaks macro expansion here, 8 | leading to errors such as: 9 | 10 | In function size_t sys_pread64(int, void*, size_t, off_t): 11 | error: '__NR_pread' was not declared in this scope 12 | 13 | The fix here is to undefine the p{read,write}64 macros, so the syscall 14 | expands to (e.g.) __NR_pread64 instead. 15 | 16 | Signed-off-by: Samuel Holland 17 | Signed-off-by: Thomas Deutschmann 18 | --- 19 | .../src/third_party/lss/linux_syscall_support.h | 7 +++++++ 20 | 1 file changed, 7 insertions(+) 21 | 22 | diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 23 | index 1abe0ba5b0..d6087a1674 100644 24 | --- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 25 | +++ b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h 26 | @@ -173,6 +173,13 @@ extern "C" { 27 | # undef __NR_waitpid 28 | #endif 29 | 30 | +#ifdef pread64 31 | +#undef pread64 32 | +#endif 33 | +#ifdef pwrite64 34 | +#undef pwrite64 35 | +#endif 36 | + 37 | /* As glibc often provides subtly incompatible data structures (and implicit 38 | * wrapper functions that convert them), we provide our own kernel data 39 | * structures for use by the system calls. 40 | -- 41 | 2.34.1 42 | 43 | -------------------------------------------------------------------------------- /patches/gentoo/0005-musl-Only-use-system-heap-reporter-with-glibc.patch: -------------------------------------------------------------------------------- 1 | From 68dd87a3dc06cf59396dccc3e031761f7237656e Mon Sep 17 00:00:00 2001 2 | From: "Jory A. Pratt" 3 | Date: Mon, 6 Apr 2020 20:09:26 +0200 4 | Subject: [PATCH 12/30] musl: Only use system heap reporter with glibc 5 | 6 | Signed-off-by: Thomas Deutschmann 7 | --- 8 | xpcom/base/nsMemoryReporterManager.cpp | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp 12 | index bd4629c785..b513f81216 100644 13 | --- a/xpcom/base/nsMemoryReporterManager.cpp 14 | +++ b/xpcom/base/nsMemoryReporterManager.cpp 15 | @@ -647,6 +647,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr, cpu_type_t aType) { 16 | return NS_OK; 17 | } 18 | 19 | +#ifdef __GLIBC__ 20 | # define HAVE_SYSTEM_HEAP_REPORTER 1 21 | // Windows can have multiple separate heaps, but we should not touch non-default 22 | // heaps because they may be destroyed at anytime while we hold a handle. So we 23 | @@ -679,6 +680,7 @@ static bool InSharedRegion(mach_vm_address_t aAddr, cpu_type_t aType) { 24 | *aSizeOut = heapSize; 25 | return NS_OK; 26 | } 27 | +#endif 28 | 29 | struct SegmentKind { 30 | DWORD mState; 31 | -- 32 | 2.34.1 33 | 34 | -------------------------------------------------------------------------------- /patches/gentoo/0006-musl-Set-pthread-name-for-non-glibc-systems.patch: -------------------------------------------------------------------------------- 1 | From 70d47d18420fe9e3de8f896c08f97ef2596c9c84 Mon Sep 17 00:00:00 2001 2 | From: "Jory A. Pratt" 3 | Date: Mon, 6 Apr 2020 20:10:03 +0200 4 | Subject: [PATCH 13/30] musl: Set pthread name for non glibc systems 5 | 6 | Signed-off-by: Thomas Deutschmann 7 | --- 8 | js/src/threading/posix/PosixThread.cpp | 4 +++- 9 | 1 file changed, 3 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/js/src/threading/posix/PosixThread.cpp b/js/src/threading/posix/PosixThread.cpp 12 | index 35532e375b..983da45326 100644 13 | --- a/js/src/threading/posix/PosixThread.cpp 14 | +++ b/js/src/threading/posix/PosixThread.cpp 15 | @@ -115,8 +115,10 @@ void ThisThread::SetName(const char* name) { 16 | rv = 0; 17 | #elif defined(__NetBSD__) 18 | rv = pthread_setname_np(pthread_self(), "%s", (void*)name); 19 | -#else 20 | +#elif defined(__GLIBC__) 21 | rv = pthread_setname_np(pthread_self(), name); 22 | +#else 23 | + rv = 0; 24 | #endif 25 | MOZ_RELEASE_ASSERT(!rv); 26 | } 27 | -- 28 | 2.34.1 29 | 30 | -------------------------------------------------------------------------------- /patches/gentoo/0007-musl-sys-auvx.h-avaliable-on-more-then-just-glibc-sy.patch: -------------------------------------------------------------------------------- 1 | From beed745f96bbc18a3c22a728095c9a2eef7435ee Mon Sep 17 00:00:00 2001 2 | From: "Jory A. Pratt" 3 | Date: Mon, 6 Apr 2020 20:12:09 +0200 4 | Subject: [PATCH 15/30] musl: sys/auvx.h avaliable on more then just glibc 5 | systems 6 | 7 | Signed-off-by: Thomas Deutschmann 8 | --- 9 | .../system_wrappers/source/cpu_features_linux.cc | 12 +++--------- 10 | 1 file changed, 3 insertions(+), 9 deletions(-) 11 | 12 | diff --git a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc 13 | index 335bed4da3..c2c98dae8a 100644 14 | --- a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc 15 | +++ b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc 16 | @@ -12,13 +12,7 @@ 17 | #include 18 | #include 19 | 20 | -#ifdef __GLIBC_PREREQ 21 | -#define WEBRTC_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b) 22 | -#else 23 | -#define WEBRTC_GLIBC_PREREQ(a, b) 0 24 | -#endif 25 | - 26 | -#if WEBRTC_GLIBC_PREREQ(2, 16) 27 | +#if defined(__linux__) 28 | #include 29 | #else 30 | #include 31 | @@ -40,7 +34,7 @@ uint64_t GetCPUFeaturesARM(void) { 32 | int architecture = 0; 33 | uint64_t hwcap = 0; 34 | const char* platform = NULL; 35 | -#if WEBRTC_GLIBC_PREREQ(2, 16) 36 | +#if defined(__linux__) 37 | hwcap = getauxval(AT_HWCAP); 38 | platform = (const char*)getauxval(AT_PLATFORM); 39 | #else 40 | @@ -64,7 +58,7 @@ uint64_t GetCPUFeaturesARM(void) { 41 | } 42 | close(fd); 43 | } 44 | -#endif // WEBRTC_GLIBC_PREREQ(2, 16) 45 | +#endif // (__linux__) 46 | #if defined(__aarch64__) 47 | architecture = 8; 48 | if ((hwcap & HWCAP_FP) != 0) 49 | -- 50 | 2.34.1 51 | 52 | -------------------------------------------------------------------------------- /patches/gentoo/0008-build-Disable-Werror.patch: -------------------------------------------------------------------------------- 1 | diff -Naur a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure 2 | --- a/build/moz.configure/warnings.configure 2022-10-10 19:05:25.000000000 +0300 3 | +++ b/build/moz.configure/warnings.configure 2022-10-18 13:59:24.514026407 +0300 4 | @@ -160,6 +160,9 @@ 5 | # false positives depending on optimization 6 | check_and_add_warning("-Wno-error=array-bounds") 7 | 8 | +# can't get rid of those PGO warnings 9 | +check_and_add_warning("-Wno-error=coverage-mismatch") 10 | + 11 | # false positives depending on optimizations 12 | check_and_add_warning("-Wno-error=free-nonheap-object") 13 | 14 | @@ -279,8 +282,8 @@ 15 | # build, but we're not sure why. 16 | check_and_add_warning("-Wno-enum-compare") 17 | 18 | -# Make it an error to be missing function declarations for C code. 19 | -check_and_add_warning("-Werror=implicit-function-declaration", c_compiler) 20 | +check_and_add_warning("-Werror=implicit-function-declaration", 21 | + when="--enable-warnings-as-errors") 22 | 23 | # New in clang 11. We can't really do anything about this warning. 24 | check_and_add_warning("-Wno-psabi") 25 | -------------------------------------------------------------------------------- /patches/gentoo/0009-LTO-Only-enable-LTO-for-Rust-when-complete-build-use.patch: -------------------------------------------------------------------------------- 1 | From 685e82ac82921720c6cd9c6c45703ff034f081e7 Mon Sep 17 00:00:00 2001 2 | From: Thomas Deutschmann 3 | Date: Sat, 29 Aug 2020 22:30:59 +0200 4 | Subject: [PATCH 25/30] LTO: Only enable LTO for Rust when complete build uses 5 | LTO 6 | 7 | Signed-off-by: Thomas Deutschmann 8 | --- 9 | config/makefiles/rust.mk | 2 ++ 10 | 1 file changed, 2 insertions(+) 11 | 12 | diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk 13 | index 75570d32b9..924722a506 100644 14 | --- a/config/makefiles/rust.mk 15 | +++ b/config/makefiles/rust.mk 16 | @@ -87,6 +87,7 @@ endif 17 | # These flags are passed via `cargo rustc` and only apply to the final rustc 18 | # invocation (i.e., only the top-level crate, not its dependencies). 19 | cargo_rustc_flags = $(CARGO_RUSTCFLAGS) 20 | +ifdef MOZ_LTO 21 | ifndef DEVELOPER_OPTIONS 22 | ifndef MOZ_DEBUG_RUST 23 | # Enable link-time optimization for release builds, but not when linking 24 | @@ -106,6 +107,7 @@ endif 25 | endif 26 | endif 27 | endif 28 | +endif 29 | 30 | ifdef CARGO_INCREMENTAL 31 | export CARGO_INCREMENTAL 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /patches/gentoo/0010-bgo-816975-fix-build-on-x86.patch: -------------------------------------------------------------------------------- 1 | diff --git a/modules/fdlibm/src/math_private.h b/modules/fdlibm/src/math_private.h 2 | index 51d79f9c2ec59..fafd7d6fc1e0d 100644 3 | --- a/modules/fdlibm/src/math_private.h 4 | +++ b/modules/fdlibm/src/math_private.h 5 | @@ -30,7 +30,11 @@ 6 | * Adapted from https://github.com/freebsd/freebsd-src/search?q=__double_t 7 | */ 8 | 9 | +#if defined __FLT_EVAL_METHOD__ && (__FLT_EVAL_METHOD__ == 2) 10 | +typedef long double __double_t; 11 | +#else 12 | typedef double __double_t; 13 | +#endif 14 | typedef __double_t double_t; 15 | 16 | /* 17 | -------------------------------------------------------------------------------- /patches/gentoo/0011-bmo-1196777-Set-GDK_FOCUS_CHANGE_MASK.patch: -------------------------------------------------------------------------------- 1 | diff -up firefox-133.0/widget/gtk/nsWindow.cpp.1196777 firefox-133.0/widget/gtk/nsWindow.cpp 2 | --- firefox-133.0/widget/gtk/nsWindow.cpp.1196777 2024-11-22 09:32:52.293470407 +0100 3 | +++ firefox-133.0/widget/gtk/nsWindow.cpp 2024-11-22 10:21:54.996441520 +0100 4 | @@ -191,7 +191,7 @@ constexpr gint kEvents = 5 | GDK_VISIBILITY_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | 6 | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_SMOOTH_SCROLL_MASK | 7 | GDK_TOUCH_MASK | GDK_SCROLL_MASK | GDK_POINTER_MOTION_MASK | 8 | - GDK_PROPERTY_CHANGE_MASK; 9 | + GDK_PROPERTY_CHANGE_MASK | GDK_FOCUS_CHANGE_MASK; 10 | 11 | /* utility functions */ 12 | static bool is_mouse_in_window(GdkWindow* aWindow, gdouble aMouseX, 13 | -------------------------------------------------------------------------------- /patches/gentoo/0012-bmo-1754469-memory_mozalloc_throw.patch: -------------------------------------------------------------------------------- 1 | --- a/memory/mozalloc/throw_gcc.h 2022-02-02 17:33:38 UTC 2 | +++ b/memory/mozalloc/throw_gcc.h 3 | @@ -74,50 +74,66 @@ __throw_bad_function_call(void) { 4 | mozalloc_abort("fatal: STL threw bad_function_call"); 5 | } 6 | 7 | +#if !defined(_LIBCPP_VERSION) 8 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_logic_error( 9 | const char* msg) { 10 | mozalloc_abort(msg); 11 | } 12 | +#endif // _LIBCPP_VERSION 13 | 14 | +#if !defined(_LIBCPP_VERSION) 15 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_domain_error( 16 | const char* msg) { 17 | mozalloc_abort(msg); 18 | } 19 | +#endif // _LIBCPP_VERSION 20 | 21 | +#if !defined(_LIBCPP_VERSION) 22 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void 23 | __throw_invalid_argument(const char* msg) { 24 | mozalloc_abort(msg); 25 | } 26 | +#endif // _LIBCPP_VERSION 27 | 28 | +#if !defined(_LIBCPP_VERSION) 29 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_length_error( 30 | const char* msg) { 31 | mozalloc_abort(msg); 32 | } 33 | +#endif // _LIBCPP_VERSION 34 | 35 | +#if !defined(_LIBCPP_VERSION) 36 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_out_of_range( 37 | const char* msg) { 38 | mozalloc_abort(msg); 39 | } 40 | +#endif // _LIBCPP_VERSION 41 | 42 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_runtime_error( 43 | const char* msg) { 44 | mozalloc_abort(msg); 45 | } 46 | 47 | +#if !defined(_LIBCPP_VERSION) 48 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_range_error( 49 | const char* msg) { 50 | mozalloc_abort(msg); 51 | } 52 | +#endif // _LIBCPP_VERSION 53 | 54 | +#if !defined(_LIBCPP_VERSION) 55 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void 56 | __throw_overflow_error(const char* msg) { 57 | mozalloc_abort(msg); 58 | } 59 | +#endif // _LIBCPP_VERSION 60 | 61 | +#if !defined(_LIBCPP_VERSION) 62 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void 63 | __throw_underflow_error(const char* msg) { 64 | mozalloc_abort(msg); 65 | } 66 | +#endif // _LIBCPP_VERSION 67 | 68 | MOZ_THROW_NORETURN MOZ_THROW_EXPORT MOZ_THROW_INLINE void __throw_ios_failure( 69 | const char* msg) { 70 | -------------------------------------------------------------------------------- /patches/gentoo/0013-bgo-910309-dont-link-widevineplugin-to-libgcc_s.patch: -------------------------------------------------------------------------------- 1 | --- a/security/sandbox/linux/Sandbox.cpp 2023-07-10 20:29:48.000000000 +0100 2 | +++ b/security/sandbox/linux/Sandbox.cpp 2023-07-15 09:13:43.561724668 +0100 3 | @@ -18,6 +18,8 @@ 4 | #include 5 | #ifdef NIGHTLY_BUILD 6 | # include "dlfcn.h" 7 | +#else 8 | +# include 9 | #endif 10 | #include 11 | #include 12 | @@ -685,7 +687,7 @@ 13 | files->Add("/proc/stat", SandboxOpenedFile::Error{}); 14 | files->Add("/proc/net/unix", SandboxOpenedFile::Error{}); 15 | files->Add("/proc/self/maps", SandboxOpenedFile::Error{}); 16 | - 17 | + Unused << dlopen("libgcc_s.so.1", RTLD_GLOBAL|RTLD_LAZY); 18 | // Finally, start the sandbox. 19 | SetCurrentProcessSandbox(GetMediaSandboxPolicy(files)); 20 | } -------------------------------------------------------------------------------- /patches/gentoo/0015-bgo-748849-RUST_TARGET_override.patch: -------------------------------------------------------------------------------- 1 | From: Sam James 2 | Subject: Allow RUST_TARGET override for detected Rust triplet (fixes musl build) 3 | 4 | Respect RUST_TARGET from the environment to override Mozilla's 5 | own triplet detection. 6 | 7 | If the variable is unset, the old logic is used. 8 | 9 | The issue is that Gentoo supports both, say: 10 | - x86_64-unknown-linux-musl, and 11 | - x86-64-gentoo-linux-musl 12 | 13 | Our Rust is built to understand 14 | -gentoo- as a vendor target, but 15 | our Rust only actually includes 16 | -unknown-. 17 | 18 | Mozilla's configure sees -gentoo- 19 | in CHOST and that Rust _understands_ 20 | -gentoo- and tries to use it, without 21 | verifying that we actually have 22 | -gentoo- installed as a Rust target. 23 | 24 | This requires exporting RUST_TARGET 25 | in the ebuild, possibly like: 26 | ```` 27 | inherit rust-toolchain 28 | 29 | src_configure() { 30 | [...] 31 | export RUST_TARGET=$(rust_abi) 32 | [...] 33 | } 34 | ```` 35 | 36 | Inspired by Alpine's patch at 37 | https://git.alpinelinux.org/aports/tree/community/firefox/fix-rust-target.patch?id=740922900cf8042be6751fcfcccdd3fc11bd77d3. 38 | 39 | Bug: https://bugs.gentoo.org/748849 40 | Bug: https://bugs.gentoo.org/779178 41 | Bug: https://bugs.gentoo.org/836226 42 | Thanks-to: Georgy Yakovlev 43 | --- a/build/moz.configure/rust.configure 44 | +++ b/build/moz.configure/rust.configure 45 | @@ -275,6 +275,7 @@ def rust_supported_targets(rustc): 46 | return data 47 | 48 | 49 | +@imports('os') 50 | def detect_rustc_target( 51 | host_or_target, compiler_info, arm_target, rust_supported_targets 52 | ): 53 | @@ -396,7 +397,7 @@ def detect_rustc_target( 54 | 55 | return None 56 | 57 | - rustc_target = find_candidate(candidates) 58 | + rustc_target = os.environ.get('RUST_TARGET', find_candidate(candidates)) 59 | 60 | if rustc_target is None: 61 | die("Don't know how to translate {} for rustc".format(host_or_target.alias)) 62 | -------------------------------------------------------------------------------- /patches/gentoo/0016-bmo-1874059-fix-libcxx-18.patch: -------------------------------------------------------------------------------- 1 | --- a/build/moz.configure/toolchain.configure 2024-03-16 22:53:15.409390707 +0000 2 | +++ b/build/moz.configure/toolchain.configure 2024-03-16 22:57:02.661805132 +0000 3 | @@ -2183,10 +2183,10 @@ 4 | set_define("_LIBCPP_HIDE_FROM_ABI", libcxx_override_visibility.hide_from_abi) 5 | 6 | 7 | -@depends(target, build_environment) 8 | -def visibility_flags(target, env): 9 | +@depends(target, build_environment, c_compiler) 10 | +def visibility_flags(target, env, c_compiler): 11 | if target.os != "WINNT": 12 | - if target.kernel == "Darwin": 13 | + if target.kernel == "Darwin" or (c_compiler.type == "clang" and c_compiler.version >= "17.0.0"): 14 | return ("-fvisibility=hidden", "-fvisibility-inlines-hidden") 15 | return ( 16 | "-I%s/system_wrappers" % os.path.join(env.dist), -------------------------------------------------------------------------------- /patches/gentoo/0017-dont-use-build-id.patch: -------------------------------------------------------------------------------- 1 | diff '--color=auto' -Naur a/build/moz.configure/flags.configure b/build/moz.configure/flags.configure 2 | --- a/build/moz.configure/flags.configure 2024-07-08 20:04:44.944708403 +0300 3 | +++ b/build/moz.configure/flags.configure 2024-07-08 20:13:30.867064722 +0300 4 | @@ -197,9 +197,6 @@ 5 | 6 | check_and_add_flag("-pipe", when=building_with_gcc) 7 | 8 | -check_and_add_linker_flag("-Wl,--build-id=uuid", when=check_build_id_uuid) 9 | -check_and_add_linker_flag("-Wl,--build-id=sha1", when=check_build_id_sha1) 10 | - 11 | check_and_add_asm_flag("-Wa,--noexecstack", when=building_with_gnu_compatible_cc) 12 | check_and_add_linker_flag("-Wl,-z,noexecstack", when=building_with_gnu_compatible_cc) 13 | check_and_add_linker_flag("-Wl,-z,text", when=building_with_gnu_compatible_cc) 14 | -------------------------------------------------------------------------------- /patches/gentoo/0018-bgo-929967-fix-pgo-on-musl.patch: -------------------------------------------------------------------------------- 1 | diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py 2 | index 7354714..0385792 100755 3 | --- a/build/pgo/profileserver.py 4 | +++ b/build/pgo/profileserver.py 5 | @@ -171,6 +171,9 @@ if __name__ == "__main__": 6 | env["UPLOAD_PATH"], "profile-run-1.log" 7 | ) 8 | 9 | + # Workaround for https://bugs.gentoo.org/929967 10 | + env["LD_LIBRARY_PATH"] = os.path.join(os.getcwd(), "dist", "bin") 11 | + 12 | # Run Firefox a first time to initialize its profile 13 | runner = FirefoxRunner( 14 | profile=profile, 15 | -------------------------------------------------------------------------------- /patches/gentoo/0019-gcc-always-inline-from-fedora.patch: -------------------------------------------------------------------------------- 1 | diff -up firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2 | --- firefox-114.0.2/gfx/wr/swgl/src/gl.cc.inline 2023-06-22 11:08:53.294593327 +0200 3 | +++ firefox-114.0.2/gfx/wr/swgl/src/gl.cc 2023-06-22 11:12:43.663486734 +0200 4 | @@ -58,9 +58,7 @@ WINBASEAPI BOOL WINAPI QueryPerformanceF 5 | } 6 | 7 | #else 8 | -// GCC is slower when dealing with always_inline, especially in debug builds. 9 | -// When using Clang, use always_inline more aggressively. 10 | -# if defined(__clang__) || defined(NDEBUG) 11 | +# if defined(__clang__) || defined (__GNUC__) || defined(NDEBUG) 12 | # define ALWAYS_INLINE __attribute__((always_inline)) inline 13 | # else 14 | # define ALWAYS_INLINE inline 15 | -------------------------------------------------------------------------------- /patches/gentoo/0020-bmo-1657849-musl-sandbox-sched_setscheduler.patch: -------------------------------------------------------------------------------- 1 | diff --git a/security/sandbox/linux/SandboxFilter.cpp b/security/sandbox/linux/SandboxFilter.cpp 2 | --- a/security/sandbox/linux/SandboxFilter.cpp 3 | +++ b/security/sandbox/linux/SandboxFilter.cpp 4 | @@ -1759,16 +1759,24 @@ 5 | return Allow(); 6 | case __NR_sched_get_priority_min: 7 | case __NR_sched_get_priority_max: 8 | return Allow(); 9 | case __NR_sched_getparam: 10 | - case __NR_sched_getscheduler: 11 | - case __NR_sched_setscheduler: { 12 | +#if defined(LIBC_GLIBC) 13 | + case __NR_sched_setscheduler: 14 | +#endif 15 | + case __NR_sched_getscheduler: { 16 | Arg pid(0); 17 | return If(pid == 0, Allow()).Else(Trap(SchedTrap, nullptr)); 18 | } 19 | 20 | +#if !defined(LIBC_GLIBC) 21 | + // For pthread_create(3) on musl; bug 1657849. 22 | + case __NR_sched_setscheduler: 23 | + return Allow(); 24 | +#endif 25 | + 26 | // For clock(3) on older glibcs; bug 1304220. 27 | case __NR_times: 28 | return Allow(); 29 | 30 | // Bug 1372428 31 | @@ -1950,17 +1958,25 @@ 32 | case __NR_sched_getaffinity: 33 | case __NR_sched_setaffinity: 34 | case __NR_sched_getparam: 35 | case __NR_sched_setparam: 36 | case __NR_sched_getscheduler: 37 | +#if defined(LIBC_GLIBC) 38 | case __NR_sched_setscheduler: 39 | +#endif 40 | case __NR_sched_getattr: 41 | case __NR_sched_setattr: { 42 | Arg pid(0); 43 | return If(pid == 0, Allow()).Else(Trap(SchedTrap, nullptr)); 44 | } 45 | 46 | +#if !defined(LIBC_GLIBC) 47 | + // For pthread_create(3) on musl; bug 1657849. 48 | + case __NR_sched_setscheduler: 49 | + return Allow(); 50 | +#endif 51 | + 52 | // The priority bounds are also used, sometimes (bug 1838675): 53 | case __NR_sched_get_priority_min: 54 | case __NR_sched_get_priority_max: 55 | return Allow(); 56 | 57 | 58 | -------------------------------------------------------------------------------- /patches/gentoo/0021-bgo-940031-wasm-support.patch: -------------------------------------------------------------------------------- 1 | diff -up a/toolkit/moz.configure.wasi b/toolkit/moz.configure 2 | --- a/toolkit/moz.configure.wasi 3 | +++ b/toolkit/moz.configure 4 | @@ -2663,7 +2663,7 @@ with only_when(requires_wasm_sandboxing 5 | def wasi_sysroot_flags(wasi_sysroot): 6 | if wasi_sysroot: 7 | log.info("Using wasi sysroot in %s", wasi_sysroot) 8 | - return ["--sysroot=%s" % wasi_sysroot] 9 | + return ["--sysroot=%s" % wasi_sysroot, "-nodefaultlibs", "-lc", "-lwasi-emulated-process-clocks", "-lc++", "-lc++abi", "%%PORTAGE_WORKDIR%%/wasi-sdk-%%WASI_SDK_VER%%-%%WASI_ARCH%%-linux/lib/clang/%%WASI_SDK_LLVM_VER%%/lib/wasi/libclang_rt.builtins-wasm32.a"] 10 | return [] 11 | 12 | set_config("WASI_SYSROOT", wasi_sysroot) 13 | -------------------------------------------------------------------------------- /patches/gentoo/0022-bmo-1790526-check-for-propagated-BrowsingContext-in-SessionStoreParent.patch: -------------------------------------------------------------------------------- 1 | 2 | # HG changeset patch 3 | # User Eden Chuang 4 | # Date 1744130274 0 5 | # Node ID 4159736c2897215a6d22fc33272e05e370d50f5c 6 | # Parent 11dc373cc55d14b1ca924ae63703cab228e8b1e1 7 | Bug 1790526 - Handle the discarded BrowsingContext that propagated to SessionStoreParent. r=smaug 8 | 9 | According to the Pernosco trace, https://static.pernos.co/server/7c640bc4ed587e824fab0ca8aa44f41d1b5595b5/rebuilding.html?redirect=https%3A%2F%2Fpernos.co%2Fdebug%2FAKTDVC62g_oHMo8GmtoA1g%2Findex.html, this is a case that the propagated BrowingContext has been discarded already, so it causes aBrowsingContext.GetMaybeDiscarded() get a nullptr. 10 | 11 | This patch just check if the propageted BrowsingContext is discarded. 12 | For the discarded BrowsingContext, try to use its BrowsingContextId to get the corresponding CanonicalBrowsingContext instead of using the propagated one. 13 | 14 | Differential Revision: https://phabricator.services.mozilla.com/D237702 15 | 16 | diff --git a/toolkit/components/sessionstore/SessionStoreParent.cpp b/toolkit/components/sessionstore/SessionStoreParent.cpp 17 | --- a/toolkit/components/sessionstore/SessionStoreParent.cpp 18 | +++ b/toolkit/components/sessionstore/SessionStoreParent.cpp 19 | @@ -194,36 +194,57 @@ mozilla::ipc::IPCResult SessionStorePare 20 | return IPC_OK(); 21 | } 22 | 23 | mozilla::ipc::IPCResult SessionStoreParent::RecvIncrementalSessionStoreUpdate( 24 | const MaybeDiscarded& aBrowsingContext, 25 | const Maybe& aFormData, const Maybe& aScrollPosition, 26 | uint32_t aEpoch) { 27 | if (!aBrowsingContext.IsNull()) { 28 | + // The passed in BrowsingContext maybe already discarded and its mRawPtr is 29 | + // nullptr here. Let try to use the BrowsingContextId to get its 30 | + // Canonical one in the parent process for SessionStore update. 31 | + RefPtr bc; 32 | + if (aBrowsingContext.IsDiscarded()) { 33 | + bc = CanonicalBrowsingContext::Get(aBrowsingContext.ContextId()); 34 | + } else { 35 | + bc = aBrowsingContext.GetMaybeDiscarded()->Canonical(); 36 | + } 37 | + if (!bc) { 38 | + return IPC_OK(); 39 | + } 40 | if (aFormData.isSome()) { 41 | mHasNewFormData = true; 42 | } 43 | if (aScrollPosition.isSome()) { 44 | mHasNewScrollPosition = true; 45 | } 46 | 47 | - mSessionStore->UpdateSessionStore( 48 | - aBrowsingContext.GetMaybeDiscarded()->Canonical(), aFormData, 49 | - aScrollPosition, aEpoch); 50 | + mSessionStore->UpdateSessionStore(bc, aFormData, aScrollPosition, aEpoch); 51 | } 52 | 53 | return IPC_OK(); 54 | } 55 | 56 | mozilla::ipc::IPCResult SessionStoreParent::RecvResetSessionStore( 57 | const MaybeDiscarded& aBrowsingContext, uint32_t aEpoch) { 58 | if (!aBrowsingContext.IsNull()) { 59 | - mSessionStore->RemoveSessionStore( 60 | - aBrowsingContext.GetMaybeDiscarded()->Canonical()); 61 | + // The passed in BrowsingContext maybe already discarded and its mRawPtr is 62 | + // nullptr here. Let try to use the BrowsingContextId to get its 63 | + // Canonical one in the parent process for SessionStore update. 64 | + RefPtr bc; 65 | + if (aBrowsingContext.IsDiscarded()) { 66 | + bc = CanonicalBrowsingContext::Get(aBrowsingContext.ContextId()); 67 | + } else { 68 | + bc = aBrowsingContext.GetMaybeDiscarded()->Canonical(); 69 | + } 70 | + if (!bc) { 71 | + return IPC_OK(); 72 | + } 73 | + mSessionStore->RemoveSessionStore(bc); 74 | } 75 | return IPC_OK(); 76 | } 77 | 78 | void SessionStoreParent::SessionStoreUpdate( 79 | const Maybe& aDocShellCaps, const Maybe& aPrivatedMode, 80 | const MaybeSessionStoreZoom& aZoom, const bool aNeedCollectSHistory, 81 | const uint32_t& aEpoch) { 82 | 83 | -------------------------------------------------------------------------------- /patches/gentoo/0023-bmo-1961610-dont-advertise-hdr-support-on-wayland.patch: -------------------------------------------------------------------------------- 1 | 2 | # HG changeset patch 3 | # User stransky 4 | # Date 1745405483 0 5 | # Node ID 8a05f6d8590d38c93e2564f58700e0d917260eab 6 | # Parent 429f61ecd03243598cc15ffadd4a9d7262dceff6 7 | Bug 1961610 [Wayland] Don't advertise HDR support on Wayland r=emilio 8 | 9 | Differential Revision: https://phabricator.services.mozilla.com/D246394 10 | 11 | diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml 12 | --- a/modules/libpref/init/StaticPrefList.yaml 13 | +++ b/modules/libpref/init/StaticPrefList.yaml 14 | @@ -10561,17 +10561,17 @@ 15 | type: RelaxedAtomicBool 16 | value: false 17 | mirror: always 18 | rust: true 19 | 20 | # Is matching video-dynamic-range: high allowed? 21 | - name: layout.css.video-dynamic-range.allows-high 22 | type: RelaxedAtomicBool 23 | -#if defined(XP_MACOSX) || defined(MOZ_WAYLAND) 24 | +#if defined(XP_MACOSX) 25 | value: true 26 | #else 27 | value: false 28 | #endif 29 | mirror: always 30 | 31 | # Whether frame visibility tracking is enabled globally. 32 | - name: layout.framevisibility.enabled 33 | 34 | -------------------------------------------------------------------------------- /patches/glibc236.patch: -------------------------------------------------------------------------------- 1 | diff --git i/ipc/chromium/src/third_party/libevent/linux/event2/event-config.h w/ipc/chromium/src/third_party/libevent/linux/event2/event-config.h 2 | index 101d39d455107..3764806240f9f 100644 3 | --- i/ipc/chromium/src/third_party/libevent/linux/event2/event-config.h 4 | +++ w/ipc/chromium/src/third_party/libevent/linux/event2/event-config.h 5 | @@ -30,13 +30,13 @@ 6 | /* #undef EVENT__HAVE_AFUNIX_H 1 */ 7 | 8 | /* Define to 1 if you have the `arc4random' function. */ 9 | -/* #undef EVENT__HAVE_ARC4RANDOM */ 10 | +#define EVENT__HAVE_ARC4RANDOM 1 11 | 12 | /* Define to 1 if you have the `arc4random_addrandom' function. */ 13 | /* #undef EVENT__HAVE_ARC4RANDOM_ADDRANDOM */ 14 | 15 | /* Define to 1 if you have the `arc4random_buf' function. */ 16 | -/* #undef EVENT__HAVE_ARC4RANDOM_BUF */ 17 | +#define EVENT__HAVE_ARC4RANDOM_BUF 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define EVENT__HAVE_ARPA_INET_H 1 21 | diff --git i/toolkit/crashreporter/client/ping.cpp w/toolkit/crashreporter/client/ping.cpp 22 | index 57cf85de80b79..93a2f6e80ad0b 100644 23 | --- i/toolkit/crashreporter/client/ping.cpp 24 | +++ w/toolkit/crashreporter/client/ping.cpp 25 | @@ -53,7 +53,7 @@ static string GenerateUUID() { 26 | 27 | CFRelease(uuid); 28 | #elif defined(HAVE_ARC4RANDOM_BUF) // Android, BSD, ... 29 | - arc4random_buf(id, sizeof(UUID)); 30 | + arc4random_buf(&id, sizeof(UUID)); 31 | #else // Linux 32 | int fd = open("/dev/urandom", O_RDONLY); 33 | 34 | -------------------------------------------------------------------------------- /patches/kde/mozilla-nongnome-proxies.patch: -------------------------------------------------------------------------------- 1 | # HG changeset patch 2 | # User Wolfgang Rosenauer 3 | # Date 1558442915 -7200 4 | # Tue May 21 14:48:35 2019 +0200 5 | # Node ID 6bcf2dfebc1ea2aa34e5cc61152709fc8e409dc5 6 | # Parent bd5d1f49975deb730064a16b3079edb53c4a5f84 7 | Do not use gconf for proxy settings if not running within Gnome 8 | Index: toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 9 | =================================================================== 10 | RCS file: /cvsroot/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp,v 11 | retrieving revision 1.1 12 | 13 | diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 14 | --- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 15 | +++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp 16 | @@ -49,20 +49,24 @@ NS_IMETHODIMP 17 | nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) { 18 | // dbus prevents us from being threadsafe, but this routine should not block 19 | // anyhow 20 | *aMainThreadOnly = true; 21 | return NS_OK; 22 | } 23 | 24 | void nsUnixSystemProxySettings::Init() { 25 | - mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); 26 | - if (mGSettings) { 27 | - mGSettings->GetCollectionForSchema("org.gnome.system.proxy"_ns, 28 | - getter_AddRefs(mProxySettings)); 29 | + const char* sessionType = PR_GetEnv("DESKTOP_SESSION"); 30 | + if (sessionType && !strcmp(sessionType, "gnome")) { 31 | + mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); 32 | + if (mGSettings) { 33 | + mGSettings->GetCollectionForSchema( 34 | + "org.gnome.system.proxy"_ns, 35 | + getter_AddRefs(mProxySettings)); 36 | + } 37 | } 38 | } 39 | 40 | nsresult nsUnixSystemProxySettings::GetPACURI(nsACString& aResult) { 41 | if (mProxySettings) { 42 | nsCString proxyMode; 43 | // Check if mode is auto 44 | nsresult rv = mProxySettings->GetString("mode"_ns, proxyMode); 45 | -------------------------------------------------------------------------------- /patches/librewolf-patchset.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CachyOS/CachyOS-Browser-Common/3e1aae166cac70948d7c0b50e0eb1210c39d1e07/patches/librewolf-patchset.txt -------------------------------------------------------------------------------- /patches/librewolf-ui/allow_cookies_for_site.patch: -------------------------------------------------------------------------------- 1 | diff --git a/browser/base/content/browser-siteIdentity.js b/browser/base/content/browser-siteIdentity.js 2 | index d0ba6ac670f4..a7dc8393e9de 100644 3 | --- a/browser/base/content/browser-siteIdentity.js 4 | +++ b/browser/base/content/browser-siteIdentity.js 5 | @@ -204,6 +204,9 @@ var gIdentityHandler = { 6 | "identity-popup-clear-sitedata-button": event => { 7 | this.clearSiteData(event); 8 | }, 9 | + "identity-popup-allow-sitedata-button": () => { 10 | + this.toggleSiteData(); 11 | + }, 12 | "identity-popup-remove-cert-exception": () => { 13 | this.removeCertException(); 14 | }, 15 | @@ -457,6 +460,33 @@ var gIdentityHandler = { 16 | event.stopPropagation(); 17 | }, 18 | 19 | + async refreshSiteData() { 20 | + document.getElementById("identity-popup-allow-sitedata-toggle").toggleAttribute( 21 | + "pressed", 22 | + Services.perms.testExactPermissionFromPrincipal( 23 | + gBrowser.contentPrincipal, 24 | + "cookie" 25 | + ) === Services.perms.ALLOW_ACTION 26 | + ); 27 | + }, 28 | + 29 | + async toggleSiteData() { 30 | + const pressed = document.getElementById("identity-popup-allow-sitedata-toggle").toggleAttribute( 31 | + "pressed" 32 | + ); 33 | + 34 | + if (pressed) { 35 | + Services.perms.addFromPrincipal( 36 | + gBrowser.contentPrincipal, 37 | + "cookie", 38 | + Services.perms.ALLOW_ACTION, 39 | + Services.perms.EXPIRE_NEVER 40 | + ); 41 | + } else { 42 | + Services.perms.removeFromPrincipal(gBrowser.contentPrincipal, "cookie"); 43 | + } 44 | + }, 45 | + 46 | /** 47 | * Handler for mouseclicks on the "More Information" button in the 48 | * "identity-popup" panel. 49 | @@ -1217,6 +1247,8 @@ var gIdentityHandler = { 50 | this._identityPopupContentOwner.textContent = owner; 51 | this._identityPopupContentSupp.textContent = supplemental; 52 | this._identityPopupContentVerif.textContent = verifier; 53 | + 54 | + this.refreshSiteData(); 55 | }, 56 | 57 | setURI(uri) { 58 | diff --git a/browser/components/controlcenter/content/identityPanel.inc.xhtml b/browser/components/controlcenter/content/identityPanel.inc.xhtml 59 | index 768768c7d448..08602d9460c6 100644 60 | --- a/browser/components/controlcenter/content/identityPanel.inc.xhtml 61 | +++ b/browser/components/controlcenter/content/identityPanel.inc.xhtml 62 | @@ -98,6 +98,11 @@ 63 | 66 | + 68 | + 69 | + 70 | + 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /patches/librewolf-ui/firefox-view.patch: -------------------------------------------------------------------------------- 1 | diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/content/navigator-toolbox.inc.xhtml 2 | index eb2d8670874b..e57694a72bd3 100644 3 | --- a/browser/base/content/navigator-toolbox.inc.xhtml 4 | +++ b/browser/base/content/navigator-toolbox.inc.xhtml 5 | @@ -35,14 +35,6 @@ 6 | 7 | 8 | 9 | - 16 | - 17 | 24 | + 25 | + 32 | 33 | 34 | diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs 35 | index 45d0e0e4872e..4ed336da6bb5 100644 36 | --- a/browser/components/customizableui/CustomizableUI.sys.mjs 37 | +++ b/browser/components/customizableui/CustomizableUI.sys.mjs 38 | @@ -347,7 +347,6 @@ var CustomizableUIInternal = { 39 | { 40 | type: CustomizableUI.TYPE_TOOLBAR, 41 | defaultPlacements: [ 42 | - "firefox-view-button", 43 | "tabbrowser-tabs", 44 | "new-tab-button", 45 | "alltabs-button", 46 | @@ -707,18 +706,6 @@ var CustomizableUIInternal = { 47 | } 48 | } 49 | 50 | - // Add firefox-view if not present 51 | - if (currentVersion < 18) { 52 | - let tabstripPlacements = 53 | - gSavedState.placements[CustomizableUI.AREA_TABSTRIP]; 54 | - if ( 55 | - tabstripPlacements && 56 | - !tabstripPlacements.includes("firefox-view-button") 57 | - ) { 58 | - tabstripPlacements.unshift("firefox-view-button"); 59 | - } 60 | - } 61 | - 62 | // Unified Extensions addon button migration, which puts any browser action 63 | // buttons in the overflow menu into the addons panel instead. 64 | if (currentVersion < 19) { 65 | -------------------------------------------------------------------------------- /patches/librewolf-ui/handlers.patch: -------------------------------------------------------------------------------- 1 | diff --git a/uriloader/exthandler/HandlerList.sys.mjs b/uriloader/exthandler/HandlerList.sys.mjs 2 | index e95d627..cd0096e 100644 3 | --- a/uriloader/exthandler/HandlerList.sys.mjs 4 | +++ b/uriloader/exthandler/HandlerList.sys.mjs 5 | @@ -9,196 +9,7 @@ export const kHandlerList = { 6 | schemes: { 7 | mailto: { 8 | handlers: [ 9 | - { 10 | - name: "Gmail", 11 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 12 | - }, 13 | - ], 14 | - }, 15 | - }, 16 | - }, 17 | - cs: { 18 | - schemes: { 19 | - mailto: { 20 | - handlers: [ 21 | - { 22 | - name: "Seznam", 23 | - uriTemplate: "https://email.seznam.cz/newMessageScreen?mailto=%s", 24 | - }, 25 | - { 26 | - name: "Gmail", 27 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 28 | - }, 29 | - ], 30 | - }, 31 | - }, 32 | - }, 33 | - "es-CL": { 34 | - schemes: { 35 | - mailto: { 36 | - handlers: [ 37 | - { 38 | - name: "Gmail", 39 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 40 | - }, 41 | - { 42 | - name: "Outlook", 43 | - uriTemplate: 44 | - "https://outlook.live.com/default.aspx?rru=compose&to=%s", 45 | - }, 46 | - ], 47 | - }, 48 | - }, 49 | - }, 50 | - "ja-JP-mac": { 51 | - schemes: { 52 | - mailto: { 53 | - handlers: [ 54 | - { 55 | - name: "Yahoo!メール", 56 | - uriTemplate: "https://mail.yahoo.co.jp/compose/?To=%s", 57 | - }, 58 | - { 59 | - name: "Gmail", 60 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 61 | - }, 62 | - ], 63 | - }, 64 | - }, 65 | - }, 66 | - ja: { 67 | - schemes: { 68 | - mailto: { 69 | - handlers: [ 70 | - { 71 | - name: "Yahoo!メール", 72 | - uriTemplate: "https://mail.yahoo.co.jp/compose/?To=%s", 73 | - }, 74 | - { 75 | - name: "Gmail", 76 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 77 | - }, 78 | - ], 79 | - }, 80 | - }, 81 | - }, 82 | - kk: { 83 | - schemes: { 84 | - mailto: { 85 | - handlers: [ 86 | - { 87 | - name: "Яндекс.Почта", 88 | - uriTemplate: "https://mail.yandex.ru/compose?mailto=%s", 89 | - }, 90 | - { 91 | - name: "Mail.Ru", 92 | - uriTemplate: "https://e.mail.ru/cgi-bin/sentmsg?mailto=%s", 93 | - }, 94 | - { 95 | - name: "Gmail", 96 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 97 | - }, 98 | - ], 99 | - }, 100 | - }, 101 | - }, 102 | - ltg: { 103 | - schemes: { 104 | - mailto: { 105 | - handlers: [ 106 | - { 107 | - name: "Gmail", 108 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 109 | - }, 110 | - { 111 | - name: "inbox.lv mail", 112 | - uriTemplate: "https://mail.inbox.lv/compose?to=%s", 113 | - }, 114 | - ], 115 | - }, 116 | - }, 117 | - }, 118 | - lv: { 119 | - schemes: { 120 | - mailto: { 121 | - handlers: [ 122 | - { 123 | - name: "Gmail", 124 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 125 | - }, 126 | - { 127 | - name: "inbox.lv mail", 128 | - uriTemplate: "https://mail.inbox.lv/compose?to=%s", 129 | - }, 130 | - ], 131 | - }, 132 | - }, 133 | - }, 134 | - pl: { 135 | - schemes: { 136 | - mailto: { 137 | - handlers: [ 138 | - { 139 | - name: "Poczta Interia.pl", 140 | - uriTemplate: "https://poczta.interia.pl/mh/?mailto=%s", 141 | - }, 142 | - { 143 | - name: "Gmail", 144 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 145 | - }, 146 | - ], 147 | - }, 148 | - }, 149 | - }, 150 | - ru: { 151 | - schemes: { 152 | - mailto: { 153 | - handlers: [ 154 | - { 155 | - name: "Яндекс.Почту", 156 | - uriTemplate: "https://mail.yandex.ru/compose?mailto=%s", 157 | - }, 158 | - { 159 | - name: "Mail.Ru", 160 | - uriTemplate: "https://e.mail.ru/cgi-bin/sentmsg?mailto=%s", 161 | - }, 162 | - { 163 | - name: "Gmail", 164 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 165 | - }, 166 | - ], 167 | - }, 168 | - }, 169 | - }, 170 | - uk: { 171 | - schemes: { 172 | - mailto: { 173 | - handlers: [ 174 | - { 175 | - name: "Gmail", 176 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 177 | - }, 178 | - { 179 | - name: "Outlook", 180 | - uriTemplate: 181 | - "https://outlook.live.com/default.aspx?rru=compose&to=%s", 182 | - }, 183 | - ], 184 | - }, 185 | - }, 186 | - }, 187 | - uz: { 188 | - schemes: { 189 | - mailto: { 190 | - handlers: [ 191 | - { 192 | - name: "Gmail", 193 | - uriTemplate: "https://mail.google.com/mail/?extsrc=mailto&url=%s", 194 | - }, 195 | - { 196 | - name: "Mail.Ru", 197 | - uriTemplate: "https://e.mail.ru/cgi-bin/sentmsg?mailto=%s", 198 | - }, 199 | + {}, 200 | ], 201 | }, 202 | }, 203 | -------------------------------------------------------------------------------- /patches/librewolf-ui/hide-default-browser.patch: -------------------------------------------------------------------------------- 1 | diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml 2 | index 8485423..b007b96 100644 3 | --- a/browser/components/preferences/main.inc.xhtml 4 | +++ b/browser/components/preferences/main.inc.xhtml 5 | @@ -29,6 +29,8 @@ 6 | 7 | 9 | + 10 | + 11 | #ifdef XP_WIN 12 | 9 | - 23 | 72 | 73 |