diff options
| -rw-r--r-- | www-client/icecat/Manifest | 5 | ||||
| -rw-r--r-- | www-client/icecat/files/0013-gcc-lto-pgo-gentoo.patch | 150 | ||||
| -rw-r--r-- | www-client/icecat/files/0016-bgo-929967-fix-pgo-on-musl.patch | 14 | ||||
| -rw-r--r-- | www-client/icecat/files/0018-gcc-lto-gentoo.patch | 160 | ||||
| -rw-r--r-- | www-client/icecat/files/README.gentoo | 17 | ||||
| -rw-r--r-- | www-client/icecat/files/disable-auto-update.policy.json | 5 | ||||
| -rw-r--r-- | www-client/icecat/files/distribution.ini | 9 | ||||
| -rw-r--r-- | www-client/icecat/files/firefox-146.0.1-icu78.patch | 18 | ||||
| -rw-r--r-- | www-client/icecat/files/gentoo-default-prefs.js | 12 | ||||
| -rw-r--r-- | www-client/icecat/files/gentoo-hwaccel-prefs.js-r2 | 5 | ||||
| -rw-r--r-- | www-client/icecat/files/icecat-128.12.0-clang21.patch | 123 | ||||
| -rw-r--r-- | www-client/icecat/files/icecat-r1.sh | 116 | ||||
| -rw-r--r-- | www-client/icecat/files/icon/icecat-r3.desktop | 236 | ||||
| -rw-r--r-- | www-client/icecat/files/icon/icecat-symbolic.svg | 1 | ||||
| -rw-r--r-- | www-client/icecat/icecat-140.6.0.ebuild | 1265 | ||||
| -rw-r--r-- | www-client/icecat/metadata.xml | 34 |
16 files changed, 2170 insertions, 0 deletions
diff --git a/www-client/icecat/Manifest b/www-client/icecat/Manifest new file mode 100644 index 0000000..8f0a259 --- /dev/null +++ b/www-client/icecat/Manifest @@ -0,0 +1,5 @@ +DIST firefox-139-loong-patches-02.tar.xz 3096 BLAKE2B 2e9c0f3dac780c808a13f70fe3808df9976898360b55113def97bf3594893166e0647c70ebc389b2d14fa2c2453fc1dd68aba20d92178670ef97d70c34205e1c SHA512 e1244007290e2e15d14cf519e3ade6a4da06abe41c416de60569a11396609661cb62fb5b592e763cc079406699dc33d6a34851f71068f4d09bdf34021b035a59 +DIST firefox-140esr-patches-04.tar.xz 124424 BLAKE2B 89fd2cedb67a9d82c339fed01b79c9c4b3f58051b68764121f982d4eba04d979c9d16238a7599fbab4f9d3965253f3ec4886f2da590b05116bc6ea0ee027e935 SHA512 b8c268fd5118007490edb7ef99f90148af4fa88ec7cdec03d028630476c85862e896b1ad3a6964215835f6f442aa71df96d6dd9aab632802773792bced8dc17b +DIST icecat-140.6.0-1gnu1.tar.zst 915461781 BLAKE2B 8f8bcba4fda47eb894d7a63ec099389c4eb654597b482cba7bac83c8e523bee504d8d4905200f9ac193deb2f4811ab63e89d3fe6507c4584588d612cbcd49bcd SHA512 a934bc5bd529488149a0502d777c92edd80cdba7543d24ea1f3744803cbd4f139bd105bd95125206a528b281b20d32118df4fcbc35915475a109453e9475c901 +DIST wasi-sdk-28.0-arm64-linux.tar.gz 121761064 BLAKE2B 044a93cf1790dd652a86927bd74cf2a8b081a8db1261c2879d7fa72d5efde6a1ef65be63ff94c94d1e39d179ab829eded95121e2f6fd6c8f83374690763d532a SHA512 5ed16fdcdfa573630a75986cddde5ddc6a7e010ad9ad20cfa939becb78c1cbb0740fd1a53064e3d358b929b7b9ef6264612644293a1840c54a3e1868b4c15d7b +DIST wasi-sdk-28.0-x86_64-linux.tar.gz 121193888 BLAKE2B eaefdd7f0432b3a2432e09fce659282e1e1a515a0b31f63cc2d48953e180229fe494deff2e1019f60ab38179f7f93e6dd13d4763355b706e5f447efac1e5f08c SHA512 805412c73b4b2d3c9df9af25b95dd2ed7625dd1b4424bbf07286caf24fc87e54aee1fbb4fbe3904f180a7cca9decf00177915860ca216e87421d8c91a0693875 diff --git a/www-client/icecat/files/0013-gcc-lto-pgo-gentoo.patch b/www-client/icecat/files/0013-gcc-lto-pgo-gentoo.patch new file mode 100644 index 0000000..4b873f9 --- /dev/null +++ b/www-client/icecat/files/0013-gcc-lto-pgo-gentoo.patch @@ -0,0 +1,150 @@ +--- a/build/moz.configure/lto-pgo.configure.pgo ++++ b/build/moz.configure/lto-pgo.configure +@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi + + @depends( + "--enable-profile-use", ++ c_compiler, + pgo_profile_path, + llvm_profdata, + llvm_profdata_order, + build_environment, + ) +-def orderfile_path(profile_use, path, profdata, profdata_order, build_env): ++def orderfile_path(profile_use, compiler, path, profdata, profdata_order, build_env): ++ if compiler.type == "gcc": ++ return None ++ + if not profile_use: + return None + +@@ -133,7 +137,7 @@ def pgo_flags( + return namespace( + gen_cflags=["-fprofile-generate"], + gen_ldflags=["-fprofile-generate"], +- use_cflags=["-fprofile-use", "-fprofile-correction", "-Wcoverage-mismatch"], ++ use_cflags=["-fprofile-use", "-fprofile-correction", "-Wno-coverage-mismatch"], + use_ldflags=["-fprofile-use"], + ) + +--- a/build/pgo/profileserver.py 2025-05-26 17:14:58.234802697 +0300 ++++ b/build/pgo/profileserver.py 2025-05-26 17:18:38.000686313 +0300 +@@ -97,9 +97,22 @@ if __name__ == "__main__": + locations = ServerLocations() + locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") + +- old_profraw_files = glob.glob("*.profraw") +- for f in old_profraw_files: +- os.remove(f) ++ using_gcc = False ++ try: ++ if build.config_environment.substs.get('CC_TYPE') == 'gcc': ++ using_gcc = True ++ except BuildEnvironmentNotFoundException: ++ pass ++ ++ if using_gcc: ++ for dirpath, _, filenames in os.walk('.'): ++ for f in filenames: ++ if f.endswith('.gcda'): ++ os.remove(os.path.join(dirpath, f)) ++ else: ++ old_profraw_files = glob.glob('*.profraw') ++ for f in old_profraw_files: ++ os.remove(f) + + with TemporaryDirectory() as profilePath: + # TODO: refactor this into mozprofile +@@ -222,16 +235,21 @@ + + # Try to move the crash reports to the artifacts even if IceCat appears + # to exit successfully, in case there's a crash that doesn't set the + # return code to non-zero for some reason. + if get_crashreports(profilePath, name="IceCat exited successfully?") != 0: + print("IceCat exited successfully, but produced a crashreport") + sys.exit(1) + ++ if using_gcc: ++ print('Copying profile data....') ++ os.system('pwd'); ++ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;'); ++ + llvm_profdata = env.get("LLVM_PROFDATA") + if llvm_profdata: + profraw_files = glob.glob("*.profraw") + if not profraw_files: + print( + "Could not find profraw files in the current directory: %s" + % os.getcwd() + ) +--- a/gfx/2d/moz.build.pgo ++++ b/gfx/2d/moz.build +@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: + # The file uses SSE2 intrinsics, so it needs special compile flags on some + # compilers. + SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] +- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] +- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] + elif CONFIG["TARGET_CPU"].startswith("mips"): +--- a/gfx/skia/generate_mozbuild.py.pgo ++++ b/gfx/skia/generate_mozbuild.py +@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +--- a/gfx/skia/moz.build.pgo ++++ b/gfx/skia/moz.build +@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +--- a/toolkit/components/terminator/nsTerminator.cpp.pgo ++++ b/toolkit/components/terminator/nsTerminator.cpp +@@ -332,6 +332,11 @@ void nsTerminator::StartWatchdog() { + } + #endif + ++ // Disable watchdog for PGO train builds - writting profile information at ++ // exit may take time and it is better to make build hang rather than ++ // silently produce poorly performing binary. ++ crashAfterMS = INT32_MAX; ++ + UniquePtr<Options> options(new Options()); + // crashAfterTicks is guaranteed to be > 0 as + // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS +--- a/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 ++++ b/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 +@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") + # gcc lto likes to put the top level asm in syscall.cc in a different partition + # from the function using it which breaks the build. Work around that by + # forcing there to be only one partition. +-for f in CONFIG["OS_CXXFLAGS"]: +- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": +- LDFLAGS += ["--param lto-partitions=1"] ++if CONFIG['CC_TYPE'] != 'clang': ++ LDFLAGS += ['--param', 'lto-partitions=1'] + + DEFINES["NS_NO_XPCOM"] = True + DisableStlWrapping() + diff --git a/www-client/icecat/files/0016-bgo-929967-fix-pgo-on-musl.patch b/www-client/icecat/files/0016-bgo-929967-fix-pgo-on-musl.patch new file mode 100644 index 0000000..afe5d2a --- /dev/null +++ b/www-client/icecat/files/0016-bgo-929967-fix-pgo-on-musl.patch @@ -0,0 +1,14 @@ +diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py +index 7354714..0385792 100755 +--- a/build/pgo/profileserver.py ++++ b/build/pgo/profileserver.py +@@ -171,6 +171,9 @@ if __name__ == "__main__": + env["UPLOAD_PATH"], "profile-run-1.log" + ) + ++ # Workaround for https://bugs.gentoo.org/929967 ++ env["LD_LIBRARY_PATH"] = os.path.join(os.getcwd(), "dist", "bin") ++ + # Run IceCat a first time to initialize its profile + runner = IceCatRunner( + profile=profile, diff --git a/www-client/icecat/files/0018-gcc-lto-gentoo.patch b/www-client/icecat/files/0018-gcc-lto-gentoo.patch new file mode 100644 index 0000000..34e03a2 --- /dev/null +++ b/www-client/icecat/files/0018-gcc-lto-gentoo.patch @@ -0,0 +1,160 @@ +--- a/build/moz.configure/lto-pgo.configure.pgo ++++ b/build/moz.configure/lto-pgo.configure +@@ -90,12 +90,16 @@ set_config("PGO_PROFILE_PATH", pgo_profi + + @depends( + "--enable-profile-use", ++ c_compiler, + pgo_profile_path, + llvm_profdata, + llvm_profdata_order, + build_environment, + ) +-def orderfile_path(profile_use, path, profdata, profdata_order, build_env): ++def orderfile_path(profile_use, compiler, path, profdata, profdata_order, build_env): ++ if compiler.type == "gcc": ++ return None ++ + if not profile_use: + return None + +@@ -133,7 +137,7 @@ def pgo_flags( + return namespace( + gen_cflags=["-fprofile-generate"], + gen_ldflags=["-fprofile-generate"], +- use_cflags=["-fprofile-use", "-fprofile-correction", "-Wcoverage-mismatch"], ++ use_cflags=["-fprofile-use", "-fprofile-correction", "-Wno-coverage-mismatch"], + use_ldflags=["-fprofile-use"], + ) + +--- a/build/pgo/profileserver.py ++++ b/build/pgo/profileserver.py +@@ -93,19 +93,32 @@ + ), + path_mappings=path_mappings, + ) + sp3_httpd.start(block=False) + print("started SP3 server on port 8000") + locations = ServerLocations() + locations.add_host(host="127.0.0.1", port=PORT, options="primary,privileged") + +- old_profraw_files = glob.glob("*.profraw") +- for f in old_profraw_files: +- os.remove(f) ++ using_gcc = False ++ try: ++ if build.config_environment.substs.get('CC_TYPE') == 'gcc': ++ using_gcc = True ++ except BuildEnvironmentNotFoundException: ++ pass ++ ++ if using_gcc: ++ for dirpath, _, filenames in os.walk('.'): ++ for f in filenames: ++ if f.endswith('.gcda'): ++ os.remove(os.path.join(dirpath, f)) ++ else: ++ old_profraw_files = glob.glob('*.profraw') ++ for f in old_profraw_files: ++ os.remove(f) + + with TemporaryDirectory() as profilePath: + # TODO: refactor this into mozprofile + profile_data_dir = os.path.join(build.topsrcdir, "testing", "profiles") + with open(os.path.join(profile_data_dir, "profiles.json"), "r") as fh: + base_profiles = json.load(fh)["profileserver"] + + prefpaths = [ +@@ -222,16 +235,21 @@ + + # Try to move the crash reports to the artifacts even if IceCat appears + # to exit successfully, in case there's a crash that doesn't set the + # return code to non-zero for some reason. + if get_crashreports(profilePath, name="IceCat exited successfully?") != 0: + print("IceCat exited successfully, but produced a crashreport") + sys.exit(1) + ++ if using_gcc: ++ print('Copying profile data....') ++ os.system('pwd'); ++ os.system('tar cf profdata.tar.gz `find . -name "*.gcda"`; cd ..; tar xf instrumented/profdata.tar.gz;'); ++ + llvm_profdata = env.get("LLVM_PROFDATA") + if llvm_profdata: + profraw_files = glob.glob("*.profraw") + if not profraw_files: + print( + "Could not find profraw files in the current directory: %s" + % os.getcwd() + ) +--- a/gfx/2d/moz.build.pgo ++++ b/gfx/2d/moz.build +@@ -135,11 +135,11 @@ if CONFIG["INTEL_ARCHITECTURE"]: + # The file uses SSE2 intrinsics, so it needs special compile flags on some + # compilers. + SOURCES["BlurSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] +- SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["ConvolutionFilterAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["ConvolutionFilterSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["FilterProcessingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["ImageScalingSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] +- SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2"] ++ SOURCES["SwizzleAVX2.cpp"].flags += ["-mavx2", "-fno-lto"] + SOURCES["SwizzleSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] + SOURCES["SwizzleSSSE3.cpp"].flags += CONFIG["SSSE3_FLAGS"] + elif CONFIG["TARGET_CPU"].startswith("mips"): +--- a/gfx/skia/generate_mozbuild.py.pgo ++++ b/gfx/skia/generate_mozbuild.py +@@ -54,8 +54,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +--- a/gfx/skia/moz.build.pgo ++++ b/gfx/skia/moz.build +@@ -582,8 +582,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind + if CONFIG['INTEL_ARCHITECTURE']: + SOURCES['skia/modules/skcms/skcms.cc'].flags += ['-DSKCMS_DISABLE_SKX'] + skia_ssse3_flags = ['-Dskvx=skvx_ssse3', '-mssse3'] +- skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx'] +- skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma'] ++ skia_avx_flags = ['-Dskvx=skvx_avx', '-mavx', '-fno-lto'] ++ skia_hsw_flags = ['-Dskvx=skvx_hsw', '-mavx2', '-mf16c', '-mfma', '-fno-lto'] + SOURCES['skia/src/core/SkBitmapProcState_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkBlitMask_opts_ssse3.cpp'].flags += skia_ssse3_flags + SOURCES['skia/src/core/SkSwizzler_opts_ssse3.cpp'].flags += ['-Dskvx=skvx_ssse3'] +--- a/toolkit/components/terminator/nsTerminator.cpp.pgo ++++ b/toolkit/components/terminator/nsTerminator.cpp +@@ -332,6 +332,11 @@ void nsTerminator::StartWatchdog() { + } + #endif + ++ // Disable watchdog for PGO train builds - writting profile information at ++ // exit may take time and it is better to make build hang rather than ++ // silently produce poorly performing binary. ++ crashAfterMS = INT32_MAX; ++ + UniquePtr<Options> options(new Options()); + // crashAfterTicks is guaranteed to be > 0 as + // crashAfterMS >= ADDITIONAL_WAIT_BEFORE_CRASH_MS >> HEARTBEAT_INTERVAL_MS +--- a/security/sandbox/linux/moz.build.1516803 2020-12-10 16:17:55.425139545 +0100 ++++ b/security/sandbox/linux/moz.build 2020-12-10 16:29:21.945860841 +0100 +@@ -114,9 +114,8 @@ if CONFIG["CC_TYPE"] in ("clang", "gcc") + # gcc lto likes to put the top level asm in syscall.cc in a different partition + # from the function using it which breaks the build. Work around that by + # forcing there to be only one partition. +-for f in CONFIG["OS_CXXFLAGS"]: +- if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang": +- LDFLAGS += ["--param lto-partitions=1"] ++if CONFIG['CC_TYPE'] != 'clang': ++ LDFLAGS += ['--param', 'lto-partitions=1'] + + DEFINES["NS_NO_XPCOM"] = True + DisableStlWrapping() + diff --git a/www-client/icecat/files/README.gentoo b/www-client/icecat/files/README.gentoo new file mode 100644 index 0000000..3f6ca98 --- /dev/null +++ b/www-client/icecat/files/README.gentoo @@ -0,0 +1,17 @@ + +## DoH +Note regarding Trusted Recursive Resolver aka DNS-over-HTTPS (DoH): +Due to privacy concerns (encrypting DNS might be a good thing, sending all DNS +traffic to Cloudflare by default is not a good idea and applications should +respect OS configured settings), "network.trr.mode" was set to 5 ("Off by +choice") by default. +You can enable DNS-over-HTTPS in Firefox's preferences. + + +## Firefox >100 compatibility +Unfortunately Firefox-100.0 breaks compatibility with some sites using +useragent checks. To temporarily fix this, enter about:config and modify +network.http.useragent.forceVersion preference to "99" Or install an addon to +change your useragent. +See: https://support.mozilla.org/en-US/kb/difficulties-opening-or-using-website-firefox-100 + diff --git a/www-client/icecat/files/disable-auto-update.policy.json b/www-client/icecat/files/disable-auto-update.policy.json new file mode 100644 index 0000000..f366220 --- /dev/null +++ b/www-client/icecat/files/disable-auto-update.policy.json @@ -0,0 +1,5 @@ +{ + "policies": { + "DisableAppUpdate": true + } +} diff --git a/www-client/icecat/files/distribution.ini b/www-client/icecat/files/distribution.ini new file mode 100644 index 0000000..0f8aa15 --- /dev/null +++ b/www-client/icecat/files/distribution.ini @@ -0,0 +1,9 @@ +[Global] +id=gentoo +version=1.0 +about=GNU IceCat for Gentoo + +[Preferences] +app.distributor="src_prepare-overlay" +app.distributor.channel="src_prepare-overlay" +startup.homepage_welcome_url="https://gitlab.com/src_prepare/src_prepare-overlay" diff --git a/www-client/icecat/files/firefox-146.0.1-icu78.patch b/www-client/icecat/files/firefox-146.0.1-icu78.patch new file mode 100644 index 0000000..4d8785f --- /dev/null +++ b/www-client/icecat/files/firefox-146.0.1-icu78.patch @@ -0,0 +1,18 @@ +https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1291790c3dc24d3b9921bb10330201b8c1fa5983 + +diff --git a/intl/lwbrk/LineBreaker.cpp b/intl/lwbrk/LineBreaker.cpp +--- a/intl/lwbrk/LineBreaker.cpp ++++ b/intl/lwbrk/LineBreaker.cpp +@@ -451,10 +451,11 @@ + /* AKSARA = 43, [AK] */ CLASS_CHARACTER, + /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER, + /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER, + /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER, + /* VIRAMA = 47, [VI] */ CLASS_CHARACTER, ++ /* UNAMBIGUOUS_HYPHEN = 48 [HH] */ CLASS_BREAKABLE, + }; + + static_assert(U_LB_COUNT == std::size(sUnicodeLineBreakToClass), + "Gecko vs ICU LineBreak class mismatch"); + + diff --git a/www-client/icecat/files/gentoo-default-prefs.js b/www-client/icecat/files/gentoo-default-prefs.js new file mode 100644 index 0000000..4b60828 --- /dev/null +++ b/www-client/icecat/files/gentoo-default-prefs.js @@ -0,0 +1,12 @@ +pref("app.update.autoInstallEnabled", false); +pref("browser.display.use_system_colors", true); +pref("browser.link.open_external", 3); +pref("general.smoothScroll", true); +pref("general.autoScroll", false); +pref("browser.tabs.tabMinWidth", 15); +pref("browser.backspace_action", 0); +pref("browser.urlbar.hideGoButton", true); +pref("accessibility.typeaheadfind", true); +pref("intl.locale.requested", ""); +pref("layout.css.dpi", 0); +pref("network.trr.mode", 5); diff --git a/www-client/icecat/files/gentoo-hwaccel-prefs.js-r2 b/www-client/icecat/files/gentoo-hwaccel-prefs.js-r2 new file mode 100644 index 0000000..48025ca --- /dev/null +++ b/www-client/icecat/files/gentoo-hwaccel-prefs.js-r2 @@ -0,0 +1,5 @@ +/* Force hardware accelerated rendering due to USE=hwaccel */ +pref("gfx.webrender.all", true); +pref("layers.acceleration.force-enabled", true); +pref("media.hardware-video-decoding.enabled", true); +pref("webgl.force-enabled", true); diff --git a/www-client/icecat/files/icecat-128.12.0-clang21.patch b/www-client/icecat/files/icecat-128.12.0-clang21.patch new file mode 100644 index 0000000..961e25d --- /dev/null +++ b/www-client/icecat/files/icecat-128.12.0-clang21.patch @@ -0,0 +1,123 @@ +https://bugzilla.mozilla.org/show_bug.cgi?id=1954003 +https://phabricator.services.mozilla.com/D241583 +https://github.com/mozilla-firefox/firefox/commit/6d368d85ef52ce67141f44f3fdbfd51ef23f14e6 +From 02f94f3cdc97fc3b2bc4654658230c2d896417ae Mon Sep 17 00:00:00 2001 +From: Mike Hommey <mh+mozilla@glandium.org> +Date: Mon, 17 Mar 2025 23:31:43 +0000 +Subject: [PATCH] Bug 1954003 - Fix new implicit-int-conversion warnings from + clang 21. r=spidermonkey-reviewers,arai + +/builds/worker/workspace/obj-build/dist/include/js/Conversions.h:364:70: error: implicit conversion loses integer precision: 'int' to 'unsigned char' [-Werror,-Wimplicit-int-conversion] + 364 | return (bits & mozilla::FloatingPoint<double>::kSignBit) ? ~result + 1 + | ~~~~~~ ~~~~~~~~^~~ +/builds/worker/workspace/obj-build/dist/include/js/Conversions.h:544:42: note: in instantiation of function template specialization 'JS::ToUnsignedInteger<unsigned char>' requested here + 544 | inline int8_t ToUint8(double d) { return ToUnsignedInteger<uint8_t>(d); } + | ^ +/builds/worker/workspace/obj-build/dist/include/js/Conversions.h:364:70: error: implicit conversion loses integer precision: 'int' to 'unsigned short' [-Werror,-Wimplicit-int-conversion] + 364 | return (bits & mozilla::FloatingPoint<double>::kSignBit) ? ~result + 1 + | ~~~~~~ ~~~~~~~~^~~ +/builds/worker/workspace/obj-build/dist/include/js/Conversions.h:549:45: note: in instantiation of function template specialization 'JS::ToUnsignedInteger<unsigned short>' requested here + 549 | inline uint16_t ToUint16(double d) { return ToUnsignedInteger<uint16_t>(d); } + | ^ + +Differential Revision: https://phabricator.services.mozilla.com/D241584 +--- a/js/public/Conversions.h ++++ b/js/public/Conversions.h +@@ -361,8 +361,9 @@ inline UnsignedInteger ToUnsignedInteger(double d) { + } + + // Compute the congruent value in the signed range. +- return (bits & mozilla::FloatingPoint<double>::kSignBit) ? ~result + 1 +- : result; ++ return (bits & mozilla::FloatingPoint<double>::kSignBit) ++ ? UnsignedInteger(~result) + 1 ++ : result; + } + + template <typename SignedInteger> + +https://phabricator.services.mozilla.com/D241582 +https://github.com/mozilla-firefox/firefox/commit/3053f782bbb35895d632855bb5007282d7ec45e2 + +From 3053f782bbb35895d632855bb5007282d7ec45e2 Mon Sep 17 00:00:00 2001 +From: Mike Hommey <mh+mozilla@glandium.org> +Date: Mon, 17 Mar 2025 23:31:42 +0000 +Subject: [PATCH] Bug 1954003 - Fix new implicit-int-conversion warnings from + clang 21. r=dom-core,mccr8 + +/builds/worker/checkouts/gecko/dom/base/nsINode.h:2055:32: error: implicit conversion loses integer precision: 'int' to 'uint32_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] + 2055 | mBoolFlags = (mBoolFlags & ~(1 << name)) | (value << name); + | ~ ^~~~~~~~~~~~ +/builds/worker/checkouts/gecko/dom/base/nsINode.h:2067:19: error: implicit conversion loses integer precision: 'int' to 'uint32_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] + 2067 | mBoolFlags &= ~(1 << name); + | ~~ ^~~~~~~~~~~~ + +Differential Revision: https://phabricator.services.mozilla.com/D241582 +--- a/dom/base/nsINode.h ++++ b/dom/base/nsINode.h +@@ -2065,25 +2065,25 @@ class nsINode : public mozilla::dom::EventTarget { + void SetBoolFlag(BooleanFlag name, bool value) { + static_assert(BooleanFlagCount <= 8 * sizeof(mBoolFlags), + "Too many boolean flags"); +- mBoolFlags = (mBoolFlags & ~(1 << name)) | (value << name); ++ mBoolFlags = (mBoolFlags & ~(1U << name)) | (value << name); + } + + void SetBoolFlag(BooleanFlag name) { + static_assert(BooleanFlagCount <= 8 * sizeof(mBoolFlags), + "Too many boolean flags"); +- mBoolFlags |= (1 << name); ++ mBoolFlags |= (1U << name); + } + + void ClearBoolFlag(BooleanFlag name) { + static_assert(BooleanFlagCount <= 8 * sizeof(mBoolFlags), + "Too many boolean flags"); +- mBoolFlags &= ~(1 << name); ++ mBoolFlags &= ~(1U << name); + } + + bool GetBoolFlag(BooleanFlag name) const { + static_assert(BooleanFlagCount <= 8 * sizeof(mBoolFlags), + "Too many boolean flags"); +- return mBoolFlags & (1 << name); ++ return mBoolFlags & (1U << name); + } + + public: + +https://phabricator.services.mozilla.com/D241584 +https://github.com/mozilla-firefox/firefox/commit/02f94f3cdc97fc3b2bc4654658230c2d896417ae + +From 6d368d85ef52ce67141f44f3fdbfd51ef23f14e6 Mon Sep 17 00:00:00 2001 +From: Mike Hommey <mh+mozilla@glandium.org> +Date: Mon, 17 Mar 2025 23:31:43 +0000 +Subject: [PATCH] Bug 1954003 - Fix new implicit-int-conversion warnings from + clang 21. r=gfx-reviewers,lsalzman + +/builds/worker/checkouts/gecko/dom/canvas/CanvasRenderingContext2D.cpp:6284:9: error: implicit conversion loses integer precision: 'int32_t' (aka 'int') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] + 6284 | w = -aSw; + | ~ ^~~~ +/builds/worker/checkouts/gecko/dom/canvas/CanvasRenderingContext2D.cpp:6290:9: error: implicit conversion loses integer precision: 'int32_t' (aka 'int') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wimplicit-int-conversion] + 6290 | h = -aSh; + | ~ ^~~~ + +Differential Revision: https://phabricator.services.mozilla.com/D241583 +--- a/dom/canvas/CanvasRenderingContext2D.cpp ++++ b/dom/canvas/CanvasRenderingContext2D.cpp +@@ -6281,13 +6281,13 @@ already_AddRefed<ImageData> CanvasRenderingContext2D::GetImageData( + // relevant direction. + uint32_t w, h; + if (aSw < 0) { +- w = -aSw; ++ w = uint32_t(-aSw); + aSx -= w; + } else { + w = aSw; + } + if (aSh < 0) { +- h = -aSh; ++ h = uint32_t(-aSh); + aSy -= h; + } else { + h = aSh; diff --git a/www-client/icecat/files/icecat-r1.sh b/www-client/icecat/files/icecat-r1.sh new file mode 100644 index 0000000..a24ba28 --- /dev/null +++ b/www-client/icecat/files/icecat-r1.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +## +## Usage: +## +## $ icecat +## +## This script is meant to run GNU IceCat in Gentoo. + +cmdname=$(basename "$0") + +## +## Variables +## +MOZ_ARCH=$(uname -m) +case ${MOZ_ARCH} in + x86_64|s390x|sparc64) + MOZ_LIB_DIR="@PREFIX@/lib64" + SECONDARY_LIB_DIR="@PREFIX@/lib" + ;; + *) + MOZ_LIB_DIR="@PREFIX@/lib" + SECONDARY_LIB_DIR="@PREFIX@/lib64" + ;; +esac + +MOZ_FIREFOX_FILE="icecat" + +if [[ ! -r ${MOZ_LIB_DIR}/icecat/${MOZ_FIREFOX_FILE} ]]; then + if [[ ! -r ${SECONDARY_LIB_DIR}/icecat/${MOZ_FIREFOX_FILE} ]]; then + echo "Error: ${MOZ_LIB_DIR}/icecat/${MOZ_FIREFOX_FILE} not found" >&2 + if [[ -d ${SECONDARY_LIB_DIR} ]]; then + echo " ${SECONDARY_LIB_DIR}/icecat/${MOZ_FIREFOX_FILE} not found" >&2 + fi + exit 1 + fi + MOZ_LIB_DIR="${SECONDARY_LIB_DIR}" +fi +MOZILLA_FIVE_HOME="${MOZ_LIB_DIR}/icecat" +MOZ_EXTENSIONS_PROFILE_DIR="${HOME}/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" +MOZ_PROGRAM="${MOZILLA_FIVE_HOME}/${MOZ_FIREFOX_FILE}" + +## +## Enable Wayland backend? +## +if @DEFAULT_WAYLAND@ && [[ -z ${MOZ_DISABLE_WAYLAND} ]]; then + if [[ -n "${WAYLAND_DISPLAY}" ]]; then + export MOZ_ENABLE_WAYLAND=1 + fi +fi + +## +## Use D-Bus remote exclusively when there's Wayland display. +## +if [[ -n "${WAYLAND_DISPLAY}" ]]; then + export MOZ_DBUS_REMOTE=1 +fi + +## +## Make sure that we set the plugin path +## +MOZ_PLUGIN_DIR="plugins" + +if [[ -n "${MOZ_PLUGIN_PATH}" ]]; then + MOZ_PLUGIN_PATH=${MOZ_PLUGIN_PATH}:${MOZ_LIB_DIR}/mozilla/${MOZ_PLUGIN_DIR} +else + MOZ_PLUGIN_PATH=${MOZ_LIB_DIR}/mozilla/${MOZ_PLUGIN_DIR} +fi + +if [[ -d "${SECONDARY_LIB_DIR}/mozilla/${MOZ_PLUGIN_DIR}" ]]; then + MOZ_PLUGIN_PATH=${MOZ_PLUGIN_PATH}:${SECONDARY_LIB_DIR}/mozilla/${MOZ_PLUGIN_DIR} +fi + +export MOZ_PLUGIN_PATH + +## +## Set MOZ_APP_LAUNCHER for gnome-session +## +export MOZ_APP_LAUNCHER="@PREFIX@/bin/${cmdname}" + +## +## Disable the GNOME crash dialog, Mozilla has its own +## +if [[ "${XDG_CURRENT_DESKTOP}" == "GNOME" ]]; then + GNOME_DISABLE_CRASH_DIALOG=1 + export GNOME_DISABLE_CRASH_DIALOG +fi + +## +## Enable Xinput2 (#617344) +## + +# respect user settings +MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2:-auto} + +if [[ ${MOZ_USE_XINPUT2} == auto && -n ${WAYLAND_DISPLAY} ]]; then + # enabling XINPUT2 should be safe for all wayland users + MOZ_USE_XINPUT2=1 +elif [[ ${MOZ_USE_XINPUT2} == auto && ${XDG_CURRENT_DESKTOP^^} == KDE ]]; then + # XINPUT2 is known to cause problems for KWin users + MOZ_USE_XINPUT2=0 +elif [[ ${MOZ_USE_XINPUT2} == auto && ${XDG_CURRENT_DESKTOP^^} == LXQT ]]; then + # LXQt uses KWin + MOZ_USE_XINPUT2=0 +elif [[ ${MOZ_USE_XINPUT2} == auto ]]; then + # should work on Mate, Xfce, FluxBox, OpenBox and all the others ... + MOZ_USE_XINPUT2=1 +fi + +[[ ${MOZ_USE_XINPUT2} != 0 ]] && export MOZ_USE_XINPUT2=${MOZ_USE_XINPUT2} + +# Don't throw "old profile" dialog box. +export MOZ_ALLOW_DOWNGRADE=1 + +# Run the browser +exec ${MOZ_PROGRAM} "${@}" diff --git a/www-client/icecat/files/icon/icecat-r3.desktop b/www-client/icecat/files/icon/icecat-r3.desktop new file mode 100644 index 0000000..8219e93 --- /dev/null +++ b/www-client/icecat/files/icon/icecat-r3.desktop @@ -0,0 +1,236 @@ +[Desktop Entry] +Version=1.0 +Name=@NAME@ +GenericName=Web Browser +Comment=Browse the Web +Exec=@EXEC@ %u +Icon=@ICON@ +Terminal=false +Type=Application +MimeType=application/pdf;application/vnd.mozilla.xul+xml;application/xhtml+xml;text/html;text/mml;text/xml;x-scheme-handler/http;x-scheme-handler/https; +StartupNotify=true +Categories=Network;WebBrowser; +Keywords=web;browser;internet; +Actions=new-window;new-private-window;profile-manager-window; + +[Desktop Action new-window] +Name=Open a New Window +Name[ach]=Dirica manyen +Name[af]=Nuwe venster +Name[an]=Nueva finestra +Name[ar]=نافذة جديدة +Name[as]=নতুন উইন্ডো +Name[ast]=Ventana nueva +Name[az]=Yeni Pəncərə +Name[be]=Новае акно +Name[bg]=Нов прозорец +Name[bn_BD]=নতুন উইন্ডো (N) +Name[bn_IN]=নতুন উইন্ডো +Name[br]=Prenestr nevez +Name[brx]=गोदान उइन्ड'(N) +Name[bs]=Novi prozor +Name[ca]=Finestra nova +Name[cak]=K'ak'a' tzuwäch +Name[cs]=Nové okno +Name[cy]=Ffenestr Newydd +Name[da]=Nyt vindue +Name[de]=Neues Fenster +Name[dsb]=Nowe wokno +Name[el]=Νέο παράθυρο +Name[en_GB]=New Window +Name[en_US]=New Window +Name[en_ZA]=New Window +Name[eo]=Nova fenestro +Name[es_AR]=Nueva ventana +Name[es_CL]=Nueva ventana +Name[es_ES]=Nueva ventana +Name[es_MX]=Nueva ventana +Name[et]=Uus aken +Name[eu]=Leiho berria +Name[fa]=پنجره جدید +Name[ff]=Henorde Hesere +Name[fi]=Uusi ikkuna +Name[fr]=Nouvelle fenêtre +Name[fy_NL]=Nij finster +Name[ga_IE]=Fuinneog Nua +Name[gd]=Uinneag ùr +Name[gl]=Nova xanela +Name[gn]=Ovetã pyahu +Name[gu_IN]=નવી વિન્ડો +Name[he]=חלון חדש +Name[hi_IN]=नया विंडो +Name[hr]=Novi prozor +Name[hsb]=Nowe wokno +Name[hu]=Új ablak +Name[hy_AM]=Նոր Պատուհան +Name[id]=Jendela Baru +Name[is]=Nýr gluggi +Name[it]=Nuova finestra +Name[ja]=新しいウィンドウ +Name[ja_JP-mac]=新規ウインドウ +Name[ka]=ახალი ფანჯარა +Name[kk]=Жаңа терезе +Name[km]=បង្អួចថ្មី +Name[kn]=ಹೊಸ ಕಿಟಕಿ +Name[ko]=새 창 +Name[kok]=नवें जनेल +Name[ks]=نئئ وِنڈو +Name[lij]=Neuvo barcon +Name[lo]=ຫນ້າຕ່າງໃຫມ່ +Name[lt]=Naujas langas +Name[ltg]=Jauns lūgs +Name[lv]=Jauns logs +Name[mai]=नव विंडो +Name[mk]=Нов прозорец +Name[ml]=പുതിയ ജാലകം +Name[mr]=नवीन पटल +Name[ms]=Tetingkap Baru +Name[my]=ဝင်းဒိုးအသစ် +Name[nb_NO]=Nytt vindu +Name[ne_NP]=नयाँ सञ्झ्याल +Name[nl]=Nieuw venster +Name[nn_NO]=Nytt vindauge +Name[or]=ନୂତନ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਵਿੰਡੋ +Name[pl]=Nowe okno +Name[pt_BR]=Nova janela +Name[pt_PT]=Nova janela +Name[rm]=Nova fanestra +Name[ro]=Fereastră nouă +Name[ru]=Новое окно +Name[sat]=नावा विंडो (N) +Name[si]=නව කවුළුවක් +Name[sk]=Nové okno +Name[sl]=Novo okno +Name[son]=Zanfun taaga +Name[sq]=Dritare e Re +Name[sr]=Нови прозор +Name[sv_SE]=Nytt fönster +Name[ta]=புதிய சாளரம் +Name[te]=కొత్త విండో +Name[th]=หน้าต่างใหม่ +Name[tr]=Yeni pencere +Name[tsz]=Eraatarakua jimpani +Name[uk]=Нове вікно +Name[ur]=نیا دریچہ +Name[uz]=Yangi oyna +Name[vi]=Cửa sổ mới +Name[wo]=Palanteer bu bees +Name[xh]=Ifestile entsha +Name[zh_CN]=新建窗口 +Name[zh_TW]=開新視窗 +Exec=@EXEC@ --new-window %u + +[Desktop Action new-private-window] +Name=Open a New Private Window +Name[ach]=Dirica manyen me mung +Name[af]=Nuwe privaatvenster +Name[an]=Nueva finestra privada +Name[ar]=نافذة خاصة جديدة +Name[as]=নতুন ব্যক্তিগত উইন্ডো +Name[ast]=Ventana privada nueva +Name[az]=Yeni Məxfi Pəncərə +Name[be]=Новае акно адасаблення +Name[bg]=Нов прозорец за поверително сърфиране +Name[bn_BD]=নতুন ব্যক্তিগত উইন্ডো +Name[bn_IN]=নতুন ব্যক্তিগত উইন্ডো +Name[br]=Prenestr merdeiñ prevez nevez +Name[brx]=गोदान प्राइभेट उइन्ड' +Name[bs]=Novi privatni prozor +Name[ca]=Finestra privada nova +Name[cak]=K'ak'a' ichinan tzuwäch +Name[cs]=Nové anonymní okno +Name[cy]=Ffenestr Breifat Newydd +Name[da]=Nyt privat vindue +Name[de]=Neues privates Fenster +Name[dsb]=Nowe priwatne wokno +Name[el]=Νέο παράθυρο ιδιωτικής περιήγησης +Name[en_GB]=New Private Window +Name[en_US]=New Private Window +Name[en_ZA]=New Private Window +Name[eo]=Nova privata fenestro +Name[es_AR]=Nueva ventana privada +Name[es_CL]=Nueva ventana privada +Name[es_ES]=Nueva ventana privada +Name[es_MX]=Nueva ventana privada +Name[et]=Uus privaatne aken +Name[eu]=Leiho pribatu berria +Name[fa]=پنجره ناشناس جدید +Name[ff]=Henorde Suturo Hesere +Name[fi]=Uusi yksityinen ikkuna +Name[fr]=Nouvelle fenêtre de navigation privée +Name[fy_NL]=Nij priveefinster +Name[ga_IE]=Fuinneog Nua Phríobháideach +Name[gd]=Uinneag phrìobhaideach ùr +Name[gl]=Nova xanela privada +Name[gn]=Ovetã ñemi pyahu +Name[gu_IN]=નવી ખાનગી વિન્ડો +Name[he]=חלון פרטי חדש +Name[hi_IN]=नयी निजी विंडो +Name[hr]=Novi privatni prozor +Name[hsb]=Nowe priwatne wokno +Name[hu]=Új privát ablak +Name[hy_AM]=Սկսել Գաղտնի դիտարկում +Name[id]=Jendela Mode Pribadi Baru +Name[is]=Nýr huliðsgluggi +Name[it]=Nuova finestra anonima +Name[ja]=新しいプライベートウィンドウ +Name[ja_JP-mac]=新規プライベートウインドウ +Name[ka]=ახალი პირადი ფანჯარა +Name[kk]=Жаңа жекелік терезе +Name[km]=បង្អួចឯកជនថ្មី +Name[kn]=ಹೊಸ ಖಾಸಗಿ ಕಿಟಕಿ +Name[ko]=새 사생활 보호 모드 +Name[kok]=नवो खाजगी विंडो +Name[ks]=نْو پرایوٹ وینڈو& +Name[lij]=Neuvo barcon privou +Name[lo]=ເປີດຫນ້າຕ່າງສວນຕົວຂື້ນມາໃຫມ່ +Name[lt]=Naujas privataus naršymo langas +Name[ltg]=Jauns privatais lūgs +Name[lv]=Jauns privātais logs +Name[mai]=नया निज विंडो (W) +Name[mk]=Нов приватен прозорец +Name[ml]=പുതിയ സ്വകാര്യ ജാലകം +Name[mr]=नवीन वैयक्तिक पटल +Name[ms]=Tetingkap Persendirian Baharu +Name[my]=New Private Window +Name[nb_NO]=Nytt privat vindu +Name[ne_NP]=नयाँ निजी सञ्झ्याल +Name[nl]=Nieuw privévenster +Name[nn_NO]=Nytt privat vindauge +Name[or]=ନୂତନ ବ୍ୟକ୍ତିଗତ ୱିଣ୍ଡୋ +Name[pa_IN]=ਨਵੀਂ ਪ੍ਰਾਈਵੇਟ ਵਿੰਡੋ +Name[pl]=Nowe okno prywatne +Name[pt_BR]=Nova janela privativa +Name[pt_PT]=Nova janela privada +Name[rm]=Nova fanestra privata +Name[ro]=Fereastră privată nouă +Name[ru]=Новое приватное окно +Name[sat]=नावा निजेराक् विंडो (W ) +Name[si]=නව පුද්ගලික කවුළුව (W) +Name[sk]=Nové okno v režime Súkromné prehliadanie +Name[sl]=Novo zasebno okno +Name[son]=Sutura zanfun taaga +Name[sq]=Dritare e Re Private +Name[sr]=Нови приватан прозор +Name[sv_SE]=Nytt privat fönster +Name[ta]=புதிய தனிப்பட்ட சாளரம் +Name[te]=కొత్త ఆంతరంగిక విండో +Name[th]=หน้าต่างส่วนตัวใหม่ +Name[tr]=Yeni gizli pencere +Name[tsz]=Juchiiti eraatarakua jimpani +Name[uk]=Приватне вікно +Name[ur]=نیا نجی دریچہ +Name[uz]=Yangi maxfiy oyna +Name[vi]=Cửa sổ riêng tư mới +Name[wo]=Panlanteeru biir bu bees +Name[xh]=Ifestile yangasese entsha +Name[zh_CN]=新建隐私浏览窗口 +Name[zh_TW]=新增隱私視窗 +Exec=@EXEC@ --private-window %u + +[Desktop Action profile-manager-window] +Name=Open the Profile Manager +Name[de]=Profilverwaltung öffnen +Name[cs]=Správa profilů +Exec=@EXEC@ --ProfileManager diff --git a/www-client/icecat/files/icon/icecat-symbolic.svg b/www-client/icecat/files/icon/icecat-symbolic.svg new file mode 100644 index 0000000..723eb69 --- /dev/null +++ b/www-client/icecat/files/icon/icecat-symbolic.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><linearGradient id="a"><stop offset="0" stop-color="#d4e3eb" stop-opacity=".5"/><stop offset="1" stop-color="#d4e3eb" stop-opacity="0"/></linearGradient><linearGradient xlink:href="#a" id="b" x1="64.8" y1="175.6" x2="114.7" y2="175.6" gradientUnits="userSpaceOnUse"/></defs><path d="M255 179a107 100 0 11-213 0 107 100 0 11213 0z" transform="matrix(1.08865 0 0 1.12618 -15 -32)" fill="#002452" stroke="#000"/><path d="M35 141l7-9c6 1 10 4 13 8l3 3h2l5 3-1-2 2 3 3 1h1l7 3 4-5-1-1h4l1-6-3 3-5-1v-2h-1l-2-4h-2v3h-2l1-6-4-1-2-2 3-1v-1l-3-1 3-4v-5h-3l2-5 1-6h-2v-2l2-1v-7c2-6 4-6 6-8v-6a95 95 0 00-39 59z" fill="#8ac2ff"/><path d="M102 139l3 5 1 5 7-1c12 9 7 11 6 14l11 1v-2h5l-1-3 1-2v-3l2-2v-1h-4l-1-5 4-4 2-6v-3l45 6 3 3-1 6 3 2v5h-7l-3 1 9 2c3 5 5 6 7 7v17l-18 24-7 1-5 2-8-1c-5-2-4-4-1-7 3-2 0-5-3-8 2-2 2-4 1-6l-11-9-2 8h-3v3l1 1v5l-4-3-2-1v3l-2 1-9-6-1-4h-1l-2-3 2-3-3-4-2 3h-3l-1-3 1-2h2l1-3-2-4 3-1v-8l-5-3-4-1 7 5-1 3h-1c-2-2-1-4-7-6v-4l-3-2 1-9z" fill="#5ea9fe"/><path d="M39 122c-1-60 35-98 94-108 44-2 66 18 89 28l6-13 3 1 6 7 7 1 13 9 39-3-1 11c-5 4-11 9-12 12s-2 4-4 5c0 6 1 9-2 13l-3 21c-5 4-10 8-14 14l-1 5c1 1-2 1-4 4-3 3-5 3-9 2l-8-1-2-3-10-1h-2l-7-7c-10-1-8-11-12-18l-9-10c-6 2-10 7-17 18-1 11-4 13-2 32l2 9 4 16c3 5 7 10 7 16 4 6 4 11 4 16 4 4 5 8 5 11-1 3-1 8-5 9l-8-1-1-2-6-1-4-6c1-6-4-12-11-18-1-2-6-6-4-7 2-2 1-8-3-11-3-2-4-6-7-9 1 2-6-14-5-16 1-5-4-18-6-18v-26c-4-19-10-44-47-30-8 2-27 10-53 49z" fill="#f1f6f8" stroke="#000"/><path d="M146 152c18-21 33-48 50-63 4 7 7 7 10 13s1 14 6 15c5 2 7 6 12 9l13 1c1-1 0 2 1 2 3 2 12 3 13 2l15-28-20-50-40-18L71 59 43 86l-5 39c8-13 20-32 32-39 57-42 68 5 67 9l7 41 2 16z" fill="#d0e0e9"/><path d="M191 258l3-4v-5s9-9 10-8h10v-3l5-1 5-5h2v-3l2-2v-4l3-5 1-5 3-3 3 2 7-1 1 9-3 6-1 7-2 1v4l-6 4 1 1c-8 12-23 16-44 15z" fill="#056eff"/><path d="M210 257c22-23 18-29 18-29h-2v4l-2 1-6 4-4 1-1 3-10 1-9 7v6l-3 3c8 2 13 0 19-1z" fill="#00c5ff"/><path d="M91 157c25 55 40 83 103 101 33 2 51-25 62-47 2 12 1 24 0 36-12 19-24 34-49 35-29 4-61 1-102-29-48-47-38-72-40-94 7-19 16-16 26-2z" fill="#aad4ff" stroke="#000"/><path d="M69 195c16-1 34 6 46 10-7-10-15-26-23-43-3-7-8-16-18-16-7 5-11 16-9 30 1 6 1 14 4 19z" fill="#f2f2f2" stroke="url(#b)"/><path d="M65 175c9 2 14-6 20-14v12l-19 11-1-9z" fill="#002655"/><path d="M72 208l24-14-3-7c-7 5-11 13-25 13l4 8z" fill="#00244f"/><path d="M77 217c9-3 18-7 25-13l3 5c-9 5-17 11-23 18l-5-10z" fill="#002045"/><path d="M89 236c9-5 19-10 25-17l5 5c-4 10-13 16-21 22l-9-10z" fill="#002655"/><path d="M106 253c31-16 25-19 25-19v1c2 4-1 13-13 26-5-2-10-4-12-8z" fill="#002a5d"/><path d="M130 267l14-22c0 4-1 9 2 12l2 1c-1 6-4 11-3 17-10-3-12-5-15-8z" fill="#00346f"/><path d="M156 278c8-3 4-24 4-24l13 14c-2 7-2 13 3 15-7-1-13 1-20-5z" fill="#003e84"/><path d="M188 263c20 6 13 12 20 19-6 1-11 2-20 1 7-4 4-12-1-20z" fill="#004fa5"/><path d="M225 262c4 5 8 8 11 9-5 4-10 7-16 9 2-4 1-10-1-16-1-2 5-2 6-2z" fill="#005cc1"/><path d="M213 79c-2-7-1-16 7-33 1-2 2-2 2-5l6-12 4 1c2 3 3 6 5 7l6 1 14 9 38-2 1 11-11 8-4 7-2 1v8l-1 3-1 1-4 22c-5 5-13 8-14 19l-3 3-3 3h-4c-1-8-4-7-3-11l7-10 5-1 3-2-12-2-3 5-14-16 1 16-8-1c-3-5-12-8-14-14-2-3-1-8 3-13l7 5 7 1 8-4v-8l-5-19-4-9c-5 11-3 24-14 31z" fill="#6db5ff"/><path d="M40 103l13-26 16-10 54-1c9 1 11 7 13 13 8 1 9 5 8 9l-6 9 2 32 5 8 1-21c0-13 3-16 6-19 33 0 33-25 35-50 1-1 2-3 5-4l23-4C113-3 54 32 40 103z" fill="#5babfe"/><path d="M62 50l7 2 3-3 4 8 3 1v-3l-7-13c6 2 11 8 14 9V40l2-2 3 9c5 6 6 10 8 14 3 1 5 0 6-1-2 0-4-1-5-6v-7l-3-1-1-11h3l7 21 14 8 4 1v-2c-6-2-11-9-16-13-4-9-1-10-2-15l4 7 10 11v-4c-9-12-4-13-6-19l3 1 1 9c5 5 14 8 14 17 2-2 7 4 9 14V60c-6-5-12-14-17-23-3-5-2-9-1-13 2 2 6 2 7 5l11 23c8 6 9 12 8 19 6 4 6 11 7 17l-1-13-12-43h5l2 6 5 3 4 13 1 23 1 1v14l3-14-2-3V51c-3-3-2-7-3-10l2-7h3v12l2 6V41l8-5-2 20 4-19 6 1c0 16-3 28-4 41 5-6 4-22 6-34l10-11 2 2-7 18-4 18 1 1 8-21v-4l4-9 7 5 11-5c-32-21-96-50-154 11z" fill="#004ca0"/><path d="M226 68l1-14 6-13v-3l6 2 18 10h25l-22 8h-7l-17-13c-6 7-8 15-10 23z" fill="#003a7b"/><path d="M237 98c10 9 9 11 9 11v-7c-3-3-6-3-9-4zM248 127l3-3 5 1-4 4-4-2z" fill="#001c41"/><g><path d="M240 120h-8c-1-1-4 0-7 2l-7 6 7-7 6-3h9v2zM234 117l-10 1-11 4 9-5c5-2 9-1 13-1l-1 1z" fill="#9fceff"/><path d="M241 122l-12 3c-5 1-8 6-12 9l6-7c4-4 7-4 10-5h9-1z" fill="#9fceff"/><path d="M221 131h0z" fill="none" stroke="#000"/></g></svg>
\ No newline at end of file diff --git a/www-client/icecat/icecat-140.6.0.ebuild b/www-client/icecat/icecat-140.6.0.ebuild new file mode 100644 index 0000000..624d5d5 --- /dev/null +++ b/www-client/icecat/icecat-140.6.0.ebuild @@ -0,0 +1,1265 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Ebuild is based on the Firefox ebuilds in the main repo + +EAPI=8 + +# Using Gentoos firefox patches as system libraries and lto are quite nice +FIREFOX_PATCHSET="firefox-140esr-patches-04.tar.xz" +FIREFOX_LOONG_PATCHSET="firefox-139-loong-patches-02.tar.xz" + +LLVM_COMPAT=( 19 20 21 ) + +# This will also filter rust versions that don't match LLVM_COMPAT in the non-clang path; this is fine. +RUST_NEEDS_LLVM=1 +# If not building with clang we need at least rust 1.76 +RUST_MIN_VER=1.82.0 + +PYTHON_COMPAT=( python3_{11..14} ) +PYTHON_REQ_USE="ncurses,sqlite,ssl" + +VIRTUALX_REQUIRED="manual" + +# Information about the bundled wasi toolchain from +# https://github.com/WebAssembly/wasi-sdk/ +WASI_SDK_VER=28.0 +WASI_SDK_LLVM_VER=21 + +inherit check-reqs desktop flag-o-matic gnome2-utils linux-info llvm-r1 multiprocessing \ + optfeature pax-utils python-any-r1 readme.gentoo-r1 rust toolchain-funcs unpacker virtualx xdg + +DESCRIPTION="GNU IceCat Web Browser" +HOMEPAGE="https://www.gnu.org/software/gnuzilla/" + +PATCH_URIS=( + https://dev.gentoo.org/~juippis/mozilla/patchsets/${FIREFOX_PATCHSET} +) + +# Icecat tarball generated from https://cgit.git.savannah.gnu.org/cgit/gnuzilla.git +# Script modified to output zstd tarballs due to size and unpacking speed considerations. +ICECAT_REV="1gnu1" + +SRC_URI=" + https://gitlab.com/api/v4/projects/32909921/packages/generic/${PN}/${PV}-${ICECAT_REV}/${P}-${ICECAT_REV}.tar.zst + ${PATCH_URIS[@]} + loong? ( + https://dev.gentoo.org/~xen0n/distfiles/www-client/firefox/${FIREFOX_LOONG_PATCHSET} + ) + wasm-sandbox? ( + amd64? ( https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VER/.*/}/wasi-sdk-${WASI_SDK_VER}-x86_64-linux.tar.gz ) + arm64? ( https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VER/.*/}/wasi-sdk-${WASI_SDK_VER}-arm64-linux.tar.gz ) + )" +S="${WORKDIR}/${PN}-${PV%_*}" +LICENSE="MPL-2.0 GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64" + +IUSE="+clang dbus debug hardened hwaccel jack libproxy pgo pulseaudio selinux sndio" +IUSE+=" +system-av1 +system-harfbuzz +system-icu +system-jpeg +system-libevent +system-libvpx" +IUSE+=" system-pipewire system-png +system-webp test wayland wifi +X" + +# Firefox-only IUSE +IUSE+=" gnome-shell +jumbo-build openh264 wasm-sandbox" + +REQUIRED_USE="|| ( X wayland ) + debug? ( !system-av1 ) + pgo? ( jumbo-build ) + wayland? ( dbus ) + wifi? ( dbus ) +" + +RESTRICT="!test? ( test )" + +FF_ONLY_DEPEND="selinux? ( sec-policy/selinux-mozilla )" +BDEPEND="${PYTHON_DEPS} + $(unpacker_src_uri_depends) + $(llvm_gen_dep ' + llvm-core/clang:${LLVM_SLOT} + llvm-core/llvm:${LLVM_SLOT} + clang? ( + llvm-core/lld:${LLVM_SLOT} + pgo? ( llvm-runtimes/compiler-rt-sanitizers:${LLVM_SLOT}[profile] ) + ) + wasm-sandbox? ( llvm-core/lld:${LLVM_SLOT} ) + ') + app-alternatives/awk + app-arch/unzip + app-arch/zip + >=dev-util/cbindgen-0.27.0 + net-libs/nodejs + virtual/pkgconfig + amd64? ( >=dev-lang/nasm-2.14 ) + x86? ( >=dev-lang/nasm-2.14 ) + pgo? ( + X? ( + sys-devel/gettext + x11-base/xorg-server[xvfb] + x11-apps/xhost + ) + !X? ( + gui-wm/tinywl + x11-misc/xkeyboard-config + ) + )" +COMMON_DEPEND="${FF_ONLY_DEPEND} + >=app-accessibility/at-spi2-core-2.46.0:2 + dev-libs/expat + dev-libs/glib:2 + dev-libs/libffi:= + >=dev-libs/nss-3.112.2 + >=dev-libs/nspr-4.36 + media-libs/alsa-lib + media-libs/fontconfig + media-libs/freetype + media-libs/mesa + media-video/ffmpeg + virtual/zlib:= + virtual/freedesktop-icon-theme + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/libdrm + x11-libs/pango + x11-libs/pixman + dbus? ( + sys-apps/dbus + ) + jack? ( virtual/jack ) + pulseaudio? ( + || ( + media-libs/libpulse + >=media-sound/apulse-0.1.12-r4[sdk] + ) + ) + libproxy? ( net-libs/libproxy ) + selinux? ( sec-policy/selinux-mozilla ) + sndio? ( >=media-sound/sndio-1.8.0-r1 ) + system-av1? ( + >=media-libs/dav1d-1.0.0:= + >=media-libs/libaom-3.10.0:= + ) + system-harfbuzz? ( + >=media-libs/harfbuzz-2.8.1:0= + !wasm-sandbox? ( >=media-gfx/graphite2-1.3.13 ) + ) + system-icu? ( >=dev-libs/icu-76.1:= ) + system-jpeg? ( >=media-libs/libjpeg-turbo-1.2.1:= ) + system-libevent? ( >=dev-libs/libevent-2.1.12:0=[threads(+)] ) + system-libvpx? ( >=media-libs/libvpx-1.8.2:0=[postproc] ) + system-pipewire? ( >=media-video/pipewire-1.4.7-r2:= ) + system-png? ( >=media-libs/libpng-1.6.45:0=[apng] ) + system-webp? ( >=media-libs/libwebp-1.1.0:0= ) + wayland? ( + >=media-libs/libepoxy-1.5.10-r1 + x11-libs/gtk+:3[wayland] + ) + wifi? ( + kernel_linux? ( + || ( + net-misc/networkmanager + net-misc/connman[networkmanager] + ) + sys-apps/dbus + ) + ) + X? ( + virtual/opengl + x11-libs/cairo[X] + x11-libs/gtk+:3[X] + x11-libs/libX11 + x11-libs/libXcomposite + x11-libs/libXdamage + x11-libs/libXext + x11-libs/libXfixes + x11-libs/libXrandr + x11-libs/libxcb:= + )" +RDEPEND="${COMMON_DEPEND} + hwaccel? ( + media-video/libva-utils + sys-apps/pciutils + ) + jack? ( virtual/jack ) + openh264? ( media-libs/openh264:*[plugin] )" +DEPEND="${COMMON_DEPEND} + X? ( + x11-base/xorg-proto + x11-libs/libICE + x11-libs/libSM + )" + +llvm_check_deps() { + if ! has_version -b "llvm-core/clang:${LLVM_SLOT}" ; then + einfo "llvm-core/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2 + return 1 + fi + + if use clang && ! tc-ld-is-mold ; then + if ! has_version -b "llvm-core/lld:${LLVM_SLOT}" ; then + einfo "llvm-core/lld:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2 + return 1 + fi + fi + + if use pgo ; then + if ! has_version -b "=llvm-runtimes/compiler-rt-sanitizers-${LLVM_SLOT}*[profile]" ; then + einfo "=llvm-runtimes/compiler-rt-sanitizers-${LLVM_SLOT}*[profile] is missing!" >&2 + einfo "Cannot use LLVM slot ${LLVM_SLOT} ..." >&2 + return 1 + fi + fi + + einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2 +} + +MOZ_LANGS=( + af ar ast be bg br ca cak cs cy da de dsb + el en-CA en-GB en-US es-AR es-ES et eu + fi fr fy-NL ga-IE gd gl he hr hsb hu + id is it ja ka kab kk ko lt lv ms nb-NO nl nn-NO + pa-IN pl pt-BR pt-PT rm ro ru + sk sl sq sr sv-SE th tr uk uz vi zh-CN zh-TW +) + +# Firefox-only LANGS +MOZ_LANGS+=( ach ) +MOZ_LANGS+=( an ) +MOZ_LANGS+=( az ) +MOZ_LANGS+=( bn ) +MOZ_LANGS+=( bs ) +MOZ_LANGS+=( ca-valencia ) +MOZ_LANGS+=( eo ) +MOZ_LANGS+=( es-CL ) +MOZ_LANGS+=( es-MX ) +MOZ_LANGS+=( fa ) +MOZ_LANGS+=( ff ) +MOZ_LANGS+=( fur ) +MOZ_LANGS+=( gn ) +MOZ_LANGS+=( gu-IN ) +MOZ_LANGS+=( hi-IN ) +MOZ_LANGS+=( hy-AM ) +MOZ_LANGS+=( ia ) +MOZ_LANGS+=( km ) +MOZ_LANGS+=( kn ) +MOZ_LANGS+=( lij ) +MOZ_LANGS+=( mk ) +MOZ_LANGS+=( mr ) +MOZ_LANGS+=( my ) +MOZ_LANGS+=( ne-NP ) +MOZ_LANGS+=( oc ) +MOZ_LANGS+=( sc ) +MOZ_LANGS+=( sco ) +MOZ_LANGS+=( si ) +MOZ_LANGS+=( skr ) +MOZ_LANGS+=( son ) +MOZ_LANGS+=( szl ) +MOZ_LANGS+=( ta ) +MOZ_LANGS+=( te ) +MOZ_LANGS+=( tl ) +MOZ_LANGS+=( trs ) +MOZ_LANGS+=( ur ) +MOZ_LANGS+=( xh ) + +mozilla_set_globals() { + # https://bugs.gentoo.org/587334 + local MOZ_TOO_REGIONALIZED_FOR_L10N=( + fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE + ) + + local lang xflag + for lang in "${MOZ_LANGS[@]}" ; do + # en and en_US are handled internally + if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then + continue + fi + + # strip region subtag if $lang is in the list + if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then + xflag=${lang%%-*} + else + xflag=${lang} + fi + + IUSE+=" l10n_${xflag/[_@]/-}" + done +} +mozilla_set_globals + +moz_clear_vendor_checksums() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ${#} -ne 1 ]] ; then + die "${FUNCNAME} requires exact one argument" + fi + + einfo "Clearing cargo checksums for ${1} ..." + + sed -i \ + -e 's/\("files":{\)[^}]*/\1/' \ + "${S}"/third_party/rust/${1}/.cargo-checksum.json || die +} + +moz_build_xpi() { + debug-print-function ${FUNCNAME} "$@" + + local MOZ_TOO_REGIONALIZED_FOR_L10N=( + fy-NL ga-IE gu-IN hi-IN hy-AM nb-NO ne-NP nn-NO pa-IN sv-SE + ) + + cd "${BUILD_DIR}"/browser/locales || die + local lang xflag + for lang in "${MOZ_LANGS[@]}"; do + # en and en_US are handled internally + if [[ ${lang} == en ]] || [[ ${lang} == en-US ]] ; then + continue + fi + + # strip region subtag if $lang is in the list + if has ${lang} "${MOZ_TOO_REGIONALIZED_FOR_L10N[@]}" ; then + xflag=${lang%%-*} + else + xflag=${lang} + fi + + if use l10n_"${xflag}"; then + emake langpack-"${lang}" LOCALE_MERGEDIR=. + fi + done +} + +moz_install_xpi() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ${#} -lt 2 ]] ; then + die "${FUNCNAME} requires at least two arguments" + fi + + local DESTDIR=${1} + shift + + insinto "${DESTDIR}" + + local emid xpi_file xpi_tmp_dir + for xpi_file in "${@}" ; do + emid= + xpi_tmp_dir=$(mktemp -d --tmpdir="${T}") + + # Unpack XPI + unzip -qq "${xpi_file}" -d "${xpi_tmp_dir}" || die + + # Determine extension ID + if [[ -f "${xpi_tmp_dir}/install.rdf" ]] ; then + emid=$(sed -n -e '/install-manifest/,$ { /em:id/!d; s/.*[\">]\([^\"<>]*\)[\"<].*/\1/; p; q }' "${xpi_tmp_dir}/install.rdf") + [[ -z "${emid}" ]] && die "failed to determine extension id from install.rdf" + elif [[ -f "${xpi_tmp_dir}/manifest.json" ]] ; then + emid=$(sed -n -e 's/.*"id": "\([^"]*\)".*/\1/p' "${xpi_tmp_dir}/manifest.json") + [[ -z "${emid}" ]] && die "failed to determine extension id from manifest.json" + else + die "failed to determine extension id" + fi + + einfo "Installing ${emid}.xpi into ${ED}${DESTDIR} ..." + newins "${xpi_file}" "${emid}.xpi" + done +} + +mozconfig_add_options_ac() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ${#} -lt 2 ]] ; then + die "${FUNCNAME} requires at least two arguments" + fi + + local reason=${1} + shift + + local option + for option in ${@} ; do + echo "ac_add_options ${option} # ${reason}" >>${MOZCONFIG} + done +} + +mozconfig_add_options_mk() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ${#} -lt 2 ]] ; then + die "${FUNCNAME} requires at least two arguments" + fi + + local reason=${1} + shift + + local option + for option in ${@} ; do + echo "mk_add_options ${option} # ${reason}" >>${MOZCONFIG} + done +} + +mozconfig_use_enable() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ${#} -lt 1 ]] ; then + die "${FUNCNAME} requires at least one arguments" + fi + + local flag=$(use_enable "${@}") + mozconfig_add_options_ac "$(use ${1} && echo +${1} || echo -${1})" "${flag}" +} + +mozconfig_use_with() { + debug-print-function ${FUNCNAME} "$@" + + if [[ ${#} -lt 1 ]] ; then + die "${FUNCNAME} requires at least one arguments" + fi + + local flag=$(use_with "${@}") + mozconfig_add_options_ac "$(use ${1} && echo +${1} || echo -${1})" "${flag}" +} + +virtwl() { + debug-print-function ${FUNCNAME} "$@" + + [[ $# -lt 1 ]] && die "${FUNCNAME} needs at least one argument" + [[ -n $XDG_RUNTIME_DIR ]] || die "${FUNCNAME} needs XDG_RUNTIME_DIR to be set; try xdg_environment_reset" + tinywl -h >/dev/null || die 'tinywl -h failed' + + local VIRTWL VIRTWL_PID + coproc VIRTWL { WLR_BACKENDS=headless exec tinywl -s 'echo $WAYLAND_DISPLAY; read _; kill $PPID'; } + local -x WAYLAND_DISPLAY + read WAYLAND_DISPLAY <&${VIRTWL[0]} + + debug-print "${FUNCNAME}: $@" + "$@" + local r=$? + + [[ -n $VIRTWL_PID ]] || die "tinywl exited unexpectedly" + exec {VIRTWL[0]}<&- {VIRTWL[1]}>&- + return $r +} + +pkg_pretend() { + if [[ ${MERGE_TYPE} != binary ]] ; then + # Ensure we have enough disk space to compile + if use pgo || use debug ; then + CHECKREQS_DISK_BUILD="14300M" + elif tc-is-lto ; then + CHECKREQS_DISK_BUILD="10600M" + else + CHECKREQS_DISK_BUILD="7400M" + fi + + check-reqs_pkg_pretend + fi +} + +pkg_setup() { + + # Get LTO from environment; export after this phase for use in src_configure (etc) + use_lto=no + + if [[ ${MERGE_TYPE} != binary ]] ; then + + if tc-is-lto; then + use_lto=yes + # LTO is handled via configure + filter-lto + fi + + if use pgo ; then + if ! has userpriv ${FEATURES} ; then + eerror "Building ${PN} with USE=pgo and FEATURES=-userpriv is not supported!" + fi + fi + + if [[ ${use_lto} = yes ]]; then + # -Werror=lto-type-mismatch -Werror=odr are going to fail with GCC, + # bmo#1516758, bgo#942288 + filter-flags -Werror=lto-type-mismatch -Werror=odr + fi + + # Ensure we have enough disk space to compile + if use pgo || use debug ; then + CHECKREQS_DISK_BUILD="14300M" + elif [[ ${use_lto} == "yes" ]] ; then + CHECKREQS_DISK_BUILD="10600M" + else + CHECKREQS_DISK_BUILD="7400M" + fi + + check-reqs_pkg_setup + llvm-r1_pkg_setup + rust_pkg_setup + python-any-r1_pkg_setup + + # Avoid PGO profiling problems due to enviroment leakage + # These should *always* be cleaned up anyway + unset \ + DBUS_SESSION_BUS_ADDRESS \ + DISPLAY \ + ORBIT_SOCKETDIR \ + SESSION_MANAGER \ + XAUTHORITY \ + XDG_CACHE_HOME \ + XDG_SESSION_COOKIE + + # Build system is using /proc/self/oom_score_adj, bug #604394 + addpredict /proc/self/oom_score_adj + + if use pgo ; then + # Update 105.0: "/proc/self/oom_score_adj" isn't enough anymore with pgo, but not sure + # whether that's due to better OOM handling by Firefox (bmo#1771712), or portage + # (PORTAGE_SCHEDULING_POLICY) update... + addpredict /proc + + # Clear tons of conditions, since PGO is hardware-dependant. + addpredict /dev + fi + + if ! mountpoint -q /dev/shm ; then + # If /dev/shm is not available, configure is known to fail with + # a traceback report referencing /usr/lib/pythonN.N/multiprocessing/synchronize.py + ewarn "/dev/shm is not mounted -- expect build failures!" + fi + + # Ensure we use C locale when building, bug #746215 + export LC_ALL=C + fi + + export use_lto + + CONFIG_CHECK="~SECCOMP" + WARNING_SECCOMP="CONFIG_SECCOMP not set! This system will be unable to play DRM-protected content." + linux-info_pkg_setup +} + +src_prepare() { + if [[ ${use_lto} == "yes" ]]; then + rm -v "${WORKDIR}"/firefox-patches/*-LTO-Only-enable-LTO-*.patch || die + fi + + # Workaround for bgo#915651 on musl + if use elibc_glibc ; then + rm -v "${WORKDIR}"/firefox-patches/*bgo-748849-RUST_TARGET_override.patch || die + fi + + # Use modified patch that isn't mangled + for patch in 0013-gcc-lto-pgo-gentoo.patch 0016-bgo-929967-fix-pgo-on-musl.patch; do + cp "${FILESDIR}/${patch}" "${WORKDIR}/firefox-patches/${patch}" || die + done + + eapply "${WORKDIR}/firefox-patches" + use loong && eapply "${WORKDIR}/firefox-loong-patches" + + if use system-icu && has_version ">=dev-libs/icu-78.1"; then + eapply "${FILESDIR}/firefox-146.0.1-icu78.patch" # in 147, bug #967261 + fi + + # Allow user to apply any additional patches without modifing ebuild + eapply_user + + # Make cargo respect MAKEOPTS + export CARGO_BUILD_JOBS="$(makeopts_jobs)" + + # Workaround for bgo#915651 + if ! use elibc_glibc ; then + if use amd64 ; then + export RUST_TARGET="x86_64-unknown-linux-musl" + elif use x86 ; then + export RUST_TARGET="i686-unknown-linux-musl" + elif use arm64 ; then + export RUST_TARGET="aarch64-unknown-linux-musl" + elif use loong; then + # Only the LP64D ABI of LoongArch64 is actively supported among + # the wider Linux ecosystem, so the assumption is safe. + export RUST_TARGET="loongarch64-unknown-linux-musl" + elif use ppc64 ; then + export RUST_TARGET="powerpc64le-unknown-linux-musl" + elif use riscv ; then + # We can pretty safely rule out any 32-bit riscvs, but 64-bit riscvs also have tons of + # different ABIs available. riscv64gc-unknown-linux-musl seems to be the best working + # guess right now though. + elog "riscv detected, forcing a riscv64 target for now." + export RUST_TARGET="riscv64gc-unknown-linux-musl" + else + die "Unknown musl chost, please post a new bug with your rustc -vV along with emerge --info" + fi + fi + + # Pre-built wasm-sandbox path manipulation. + if use wasm-sandbox ; then + if use amd64 ; then + export wasi_arch="x86_64" + elif use arm64 ; then + export wasi_arch="arm64" + else + die "wasm-sandbox enabled on unknown/unsupported arch!" + fi + + sed -i \ + -e "s:%%PORTAGE_WORKDIR%%:${WORKDIR}:" \ + -e "s:%%WASI_ARCH%%:${wasi_arch}:" \ + -e "s:%%WASI_SDK_VER%%:${WASI_SDK_VER}:" \ + -e "s:%%WASI_SDK_LLVM_VER%%:${WASI_SDK_LLVM_VER}:" \ + toolkit/moz.configure || die "Failed to update wasi-related paths." + fi + + # Make LTO respect MAKEOPTS + sed -i -e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \ + "${S}"/build/moz.configure/lto-pgo.configure || die "Failed sedding multiprocessing.cpu_count" + + + sed -i -e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \ + "${S}"/third_party/chromium/build/toolchain/get_cpu_count.py || die "Failed sedding multiprocessing.cpu_count" + + sed -i -e "s/multiprocessing.cpu_count()/$(makeopts_jobs)/" \ + "${S}"/third_party/python/gyp/pylib/gyp/input.py || die "Failed sedding multiprocessing.cpu_count" + + # sed-in toolchain prefix + sed -i \ + -e "s/objdump/${CHOST}-objdump/" \ + "${S}"/python/mozbuild/mozbuild/configure/check_debug_ranges.py || die "sed failed to set toolchain prefix" + + sed -i \ + -e 's/ccache_stats = None/return None/' \ + "${S}"/python/mozbuild/mozbuild/controller/building.py || die "sed failed to disable ccache stats call" + + einfo "Removing pre-built binaries ..." + + find "${S}"/third_party -type f \( -name '*.so' -o -name '*.o' \) -print -delete || die + + # Clear checksums from cargo crates we've manually patched. + # moz_clear_vendor_checksums xyz + + # Respect choice for "jumbo-build" + # Changing the value for FILES_PER_UNIFIED_FILE may not work, see #905431 + if [[ -n ${FILES_PER_UNIFIED_FILE} ]] && use jumbo-build; then + local my_files_per_unified_file=${FILES_PER_UNIFIED_FILE:=16} + elog "" + elog "jumbo-build defaults modified to ${my_files_per_unified_file}." + elog "if you get a build failure, try undefining FILES_PER_UNIFIED_FILE," + elog "if that fails try -jumbo-build before opening a bug report." + elog "" + + sed -i -e "s/\"FILES_PER_UNIFIED_FILE\", 16/\"FILES_PER_UNIFIED_FILE\", "${my_files_per_unified_file}"/" \ + python/mozbuild/mozbuild/frontend/data.py || + die "Failed to adjust FILES_PER_UNIFIED_FILE in python/mozbuild/mozbuild/frontend/data.py" + sed -i -e "s/FILES_PER_UNIFIED_FILE = 6/FILES_PER_UNIFIED_FILE = "${my_files_per_unified_file}"/" \ + js/src/moz.build || + die "Failed to adjust FILES_PER_UNIFIED_FILE in js/src/moz.build" + fi + + # Create build dir + BUILD_DIR="${WORKDIR}/${PN}_build" + mkdir -p "${BUILD_DIR}" || die + + xdg_environment_reset +} + +src_configure() { + # Show flags set at the beginning + einfo "Current BINDGEN_CFLAGS:\t${BINDGEN_CFLAGS:-no value set}" + einfo "Current CFLAGS:\t\t${CFLAGS:-no value set}" + einfo "Current CXXFLAGS:\t\t${CXXFLAGS:-no value set}" + einfo "Current LDFLAGS:\t\t${LDFLAGS:-no value set}" + einfo "Current RUSTFLAGS:\t\t${RUSTFLAGS:-no value set}" + + local have_switched_compiler= + if use clang; then + # Force clang + einfo "Enforcing the use of clang due to USE=clang ..." + + local version_clang=$(clang --version 2>/dev/null | grep -F -- 'clang version' | awk '{ print $3 }') + [[ -n ${version_clang} ]] && version_clang=$(ver_cut 1 "${version_clang}") + [[ -z ${version_clang} ]] && die "Failed to read clang version!" + + if tc-is-gcc; then + have_switched_compiler=yes + fi + + AR=llvm-ar + CC=${CHOST}-clang-${version_clang} + CXX=${CHOST}-clang++-${version_clang} + NM=llvm-nm + RANLIB=llvm-ranlib + + elif ! use clang && ! tc-is-gcc ; then + # Force gcc + have_switched_compiler=yes + einfo "Enforcing the use of gcc due to USE=-clang ..." + AR=gcc-ar + CC=${CHOST}-gcc + CXX=${CHOST}-g++ + NM=gcc-nm + RANLIB=gcc-ranlib + fi + + if [[ -n "${have_switched_compiler}" ]] ; then + # Because we switched active compiler we have to ensure + # that no unsupported flags are set + strip-unsupported-flags + fi + + # Ensure we use correct toolchain, + # AS is used in a non-standard way by upstream, #bmo1654031 + export HOST_CC="$(tc-getBUILD_CC)" + export HOST_CXX="$(tc-getBUILD_CXX)" + export AS="$(tc-getCC) -c" + + # Configuration tests expect llvm-readelf output, bug 913130 + READELF="llvm-readelf" + + tc-export CC CXX LD AR AS NM OBJDUMP RANLIB READELF PKG_CONFIG + + # Pass the correct toolchain paths through cbindgen + if tc-is-cross-compiler ; then + export BINDGEN_CFLAGS="${SYSROOT:+--sysroot=${ESYSROOT}} --target=${CHOST} ${BINDGEN_CFLAGS-}" + fi + + # Set MOZILLA_FIVE_HOME + export MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}" + + # python/mach/mach/mixin/process.py fails to detect SHELL + export SHELL="${EPREFIX}/bin/bash" + + # Set state path + export MOZBUILD_STATE_PATH="${BUILD_DIR}" + + # Set MOZCONFIG + export MOZCONFIG="${S}/.mozconfig" + + # Initialize MOZCONFIG + mozconfig_add_options_ac '' --enable-application=browser + mozconfig_add_options_ac '' --enable-project=browser + + # Set Gentoo defaults + mozconfig_add_options_ac 'Gentoo default' \ + --allow-addon-sideload \ + --disable-cargo-incremental \ + --disable-crashreporter \ + --disable-disk-remnant-avoidance \ + --disable-geckodriver \ + --disable-install-strip \ + --disable-legacy-profile-creation \ + --disable-parental-controls \ + --disable-strip \ + --disable-updater \ + --disable-wmf \ + --enable-negotiateauth \ + --enable-new-pass-manager \ + --enable-official-branding \ + --enable-packed-relative-relocs \ + --enable-release \ + --enable-system-policies \ + --host="${CBUILD:-${CHOST}}" \ + --libdir="${EPREFIX}/usr/$(get_libdir)" \ + --prefix="${EPREFIX}/usr" \ + --target="${CHOST}" \ + --without-ccache \ + --with-intl-api \ + --with-l10n-base="${S}/l10n" \ + --with-libclang-path="$(llvm-config --libdir)" \ + --with-system-ffi \ + --with-system-gbm \ + --with-system-libdrm \ + --with-system-nspr \ + --with-system-nss \ + --with-system-pixman \ + --with-system-zlib \ + --with-toolchain-prefix="${CHOST}-" \ + --with-unsigned-addon-scopes=app,system + + # Whitelist to allow unkeyworded arches to build with "--disable-rust-simd" by default. + if use amd64 || use arm64 || use ppc64 || use loong || use riscv ; then + mozconfig_add_options_ac '' --enable-rust-simd + fi + + # For future keywording: This is currently (97.0) only supported on: + # amd64, arm, arm64 & x86. + # Might want to flip the logic around if Firefox is to support more arches. + # bug 833001, bug 903411#c8 + if use loong || use ppc64 || use riscv; then + mozconfig_add_options_ac '' --disable-sandbox + else + mozconfig_add_options_ac '' --enable-sandbox + fi + + # riscv-related options, bgo#947337, bgo#947338 + if use riscv ; then + mozconfig_add_options_ac 'Disable JIT for RISC-V 64' --disable-jit + mozconfig_add_options_ac 'Disable webrtc for RISC-V' --disable-webrtc + fi + + mozconfig_use_with system-av1 + mozconfig_use_with system-harfbuzz + mozconfig_use_with system-icu + mozconfig_use_with system-jpeg + mozconfig_use_with system-libevent + mozconfig_use_with system-libvpx + mozconfig_use_with system-pipewire + mozconfig_use_with system-png + mozconfig_use_with system-webp + + mozconfig_use_enable dbus + mozconfig_use_enable libproxy + + # --disable-eme is only supported on x86 and x86-64 + if use amd64 || use x86 ; then + mozconfig_add_options_ac '' --disable-eme + fi + + if use hardened ; then + mozconfig_add_options_ac "+hardened" --enable-hardening + append-ldflags "-Wl,-z,relro -Wl,-z,now" + + # Increase the FORTIFY_SOURCE value, #910071. + sed -i -e '/-D_FORTIFY_SOURCE=/s:2:3:' "${S}"/build/moz.configure/toolchain.configure || die + fi + + local myaudiobackends="" + use jack && myaudiobackends+="jack," + use sndio && myaudiobackends+="sndio," + use pulseaudio && myaudiobackends+="pulseaudio," + ! use pulseaudio && myaudiobackends+="alsa," + + mozconfig_add_options_ac '--enable-audio-backends' --enable-audio-backends="${myaudiobackends::-1}" + + mozconfig_use_enable wifi necko-wifi + + ! use jumbo-build && mozconfig_add_options_ac '--disable-unified-build' --disable-unified-build + + if use X && use wayland ; then + mozconfig_add_options_ac '+x11+wayland' --enable-default-toolkit=cairo-gtk3-x11-wayland + elif ! use X && use wayland ; then + mozconfig_add_options_ac '+wayland' --enable-default-toolkit=cairo-gtk3-wayland-only + else + mozconfig_add_options_ac '+x11' --enable-default-toolkit=cairo-gtk3-x11-only + fi + + # wasm-sandbox + # Since graphite2 is one of the sandboxed libraries, system-graphite2 obviously can't work with +wasm-sandbox. + if use wasm-sandbox ; then + mozconfig_add_options_ac '+wasm-sandbox' --with-wasi-sysroot="${WORKDIR}/wasi-sdk-${WASI_SDK_VER}-${wasi_arch}-linux/share/wasi-sysroot/" + else + mozconfig_add_options_ac 'no wasm-sandbox' --without-wasm-sandboxed-libraries + mozconfig_use_with system-harfbuzz system-graphite2 + fi + + if [[ ${use_lto} == "yes" ]] ; then + if use clang ; then + # Upstream only supports lld or mold when using clang. + if tc-ld-is-mold ; then + # mold expects the -flto line from *FLAGS configuration, bgo#923119 + append-ldflags "-flto=thin" + mozconfig_add_options_ac "using ld=mold due to system selection" --enable-linker=mold + else + mozconfig_add_options_ac "forcing ld=lld due to USE=clang and USE=lto" --enable-linker=lld + fi + + mozconfig_add_options_ac '+lto' --enable-lto=cross + + else + # ThinLTO is currently broken, see bmo#1644409. + # mold does not support gcc+lto combination. + mozconfig_add_options_ac '+lto' --enable-lto=full + mozconfig_add_options_ac "linker is set to bfd" --enable-linker=bfd + fi + else + # Avoid auto-magic on linker + if use clang ; then + # lld is upstream's default + if tc-ld-is-mold ; then + mozconfig_add_options_ac "using ld=mold due to system selection" --enable-linker=mold + else + mozconfig_add_options_ac "forcing ld=lld due to USE=clang" --enable-linker=lld + fi + + else + if tc-ld-is-mold ; then + mozconfig_add_options_ac "using ld=mold due to system selection" --enable-linker=mold + else + mozconfig_add_options_ac "linker is set to bfd due to USE=-clang" --enable-linker=bfd + fi + fi + fi + + # PGO was moved outside lto block to allow building pgo without lto. + if use pgo ; then + mozconfig_add_options_ac '+pgo' MOZ_PGO=1 + + # Avoid compressing just-built instrumented Firefox with + # high levels of compression. Just use tar as a container + # to save >=10 minutes. + export MOZ_PKG_FORMAT=tar + + if use clang ; then + # Used in build/pgo/profileserver.py + export LLVM_PROFDATA="llvm-profdata" + fi + fi + + mozconfig_use_enable debug + if use debug ; then + mozconfig_add_options_ac '+debug' --disable-optimize + mozconfig_add_options_ac '+debug' --enable-jemalloc + mozconfig_add_options_ac '+debug' --enable-real-time-tracing + else + mozconfig_add_options_ac 'Gentoo defaults' --disable-real-time-tracing + + if is-flag '-g*' ; then + if use clang ; then + mozconfig_add_options_ac 'from CFLAGS' --enable-debug-symbols=$(get-flag '-g*') + else + mozconfig_add_options_ac 'from CFLAGS' --enable-debug-symbols + fi + else + mozconfig_add_options_ac 'Gentoo default' --disable-debug-symbols + fi + + if is-flag '-O0' ; then + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O0 + elif is-flag '-O4' ; then + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O4 + elif is-flag '-O3' ; then + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O3 + elif is-flag '-O1' ; then + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-O1 + elif is-flag '-Os' ; then + mozconfig_add_options_ac "from CFLAGS" --enable-optimize=-Os + else + mozconfig_add_options_ac "Gentoo default" --enable-optimize=-O2 + fi + fi + + # Debug flag was handled via configure + filter-flags '-g*' + + # Optimization flag was handled via configure + filter-flags '-O*' + + # elf-hack + # Filter "-z,pack-relative-relocs" and let the build system handle it instead. + if use amd64 || use x86 ; then + filter-flags "-z,pack-relative-relocs" + + if tc-ld-is-mold ; then + # relr-elf-hack is currently broken with mold, bgo#916259 + mozconfig_add_options_ac 'disable elf-hack with mold linker' --disable-elf-hack + else + mozconfig_add_options_ac 'relr elf-hack' --enable-elf-hack=relr + fi + elif use loong || use ppc64 || use riscv ; then + # '--disable-elf-hack' is not recognized on loong/ppc64/riscv, + # see bgo #917049, #930046 + :; + else + mozconfig_add_options_ac 'disable elf-hack on non-supported arches' --disable-elf-hack + fi + + if ! use elibc_glibc; then + mozconfig_add_options_ac '!elibc_glibc' --disable-jemalloc + fi + + # System-av1 fix + use system-av1 && append-ldflags "-Wl,--undefined-version" + + # Make revdep-rebuild.sh happy; Also required for musl + append-ldflags -Wl,-rpath="${MOZILLA_FIVE_HOME}",--enable-new-dtags + + # Pass $MAKEOPTS to build system + export MOZ_MAKE_FLAGS="${MAKEOPTS}" + + # Use system's Python environment + export PIP_NETWORK_INSTALL_RESTRICTED_VIRTUALENVS=mach + + export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE="none" + + mozconfig_use_enable test tests + + # Disable notification when build system has finished + export MOZ_NOSPAM=1 + + # Portage sets XARGS environment variable to "xargs -r" by default which + # breaks build system's check_prog() function which doesn't support arguments + mozconfig_add_options_ac 'Gentoo default' "XARGS=${EPREFIX}/usr/bin/xargs" + + # Set build dir + mozconfig_add_options_mk 'Gentoo default' "MOZ_OBJDIR=${BUILD_DIR}" + + # Show flags we will use + einfo "Build BINDGEN_CFLAGS:\t${BINDGEN_CFLAGS:-no value set}" + einfo "Build CFLAGS:\t\t${CFLAGS:-no value set}" + einfo "Build CXXFLAGS:\t\t${CXXFLAGS:-no value set}" + einfo "Build LDFLAGS:\t\t${LDFLAGS:-no value set}" + einfo "Build RUSTFLAGS:\t\t${RUSTFLAGS:-no value set}" + + # Handle EXTRA_CONF and show summary + local ac opt hash reason + + # Apply EXTRA_ECONF entries to $MOZCONFIG + if [[ -n ${EXTRA_ECONF} ]] ; then + IFS=\! read -a ac <<<${EXTRA_ECONF// --/\!} + for opt in "${ac[@]}"; do + mozconfig_add_options_ac "EXTRA_ECONF" --${opt#--} + done + fi + + echo + echo "==========================================================" + echo "Building ${PF} with the following configuration" + grep ^ac_add_options "${MOZCONFIG}" | while read ac opt hash reason; do + [[ -z ${hash} || ${hash} == \# ]] \ + || die "error reading mozconfig: ${ac} ${opt} ${hash} ${reason}" + printf " %-30s %s\n" "${opt}" "${reason:-mozilla.org default}" + done + echo "==========================================================" + echo + + ./mach configure || die +} + +src_compile() { + local virtx_cmd= + + if [[ ${use_lto} == "yes" ]] && tc-ld-is-mold ; then + # increase ulimit with mold+lto, bugs #892641, #907485 + if ! ulimit -n 16384 1>/dev/null 2>&1 ; then + ewarn "Unable to modify ulimits - building with mold+lto might fail due to low ulimit -n resources." + ewarn "Please see bugs #892641 & #907485." + else + ulimit -n 16384 + fi + fi + + if use pgo; then + # Reset and cleanup environment variables used by GNOME/XDG + gnome2_environment_reset + + addpredict /root + + if ! use X; then + virtx_cmd=virtwl + else + virtx_cmd=virtx + fi + fi + + if ! use X; then + local -x GDK_BACKEND=wayland + else + local -x GDK_BACKEND=x11 + fi + + ${virtx_cmd} ./mach build --verbose || die + + # Build language packs + moz_build_xpi +} + +src_test() { + # https://firefox-source-docs.mozilla.org/testing/automated-testing/index.html + local -a failures=() + + # Some tests respect this + local -x MOZ_HEADLESS=1 + + # Check testing/mach_commands.py + einfo "Testing with cppunittest ..." + ./mach cppunittest + local ret=$? + if [[ ${ret} -ne 0 ]]; then + eerror "Test suite cppunittest failed with error code ${ret}" + failures+=( cppunittest ) + fi + + if [[ ${#failures} -eq 0 ]]; then + einfo "Test suites succeeded" + else + die "Test suites failed: ${failures[@]}" + fi +} + +src_install() { + # xpcshell is getting called during install + pax-mark m \ + "${BUILD_DIR}"/dist/bin/xpcshell \ + "${BUILD_DIR}"/dist/bin/${PN} \ + "${BUILD_DIR}"/dist/bin/plugin-container + + DESTDIR="${D}" ./mach install || die + + # Upstream cannot ship symlink but we can (bmo#658850) + rm "${ED}${MOZILLA_FIVE_HOME}/${PN}-bin" || die + dosym ${PN} ${MOZILLA_FIVE_HOME}/${PN}-bin + + # Don't install llvm-symbolizer from llvm-core/llvm package + if [[ -f "${ED}${MOZILLA_FIVE_HOME}/llvm-symbolizer" ]] ; then + rm -v "${ED}${MOZILLA_FIVE_HOME}/llvm-symbolizer" || die + fi + + # Install policy (currently only used to disable application updates) + insinto "${MOZILLA_FIVE_HOME}/distribution" + newins "${FILESDIR}"/distribution.ini distribution.ini + newins "${FILESDIR}"/disable-auto-update.policy.json policies.json + + # Install system-wide preferences + local PREFS_DIR="${MOZILLA_FIVE_HOME}/browser/defaults/preferences" + insinto "${PREFS_DIR}" + newins "${FILESDIR}"/gentoo-default-prefs.js gentoo-prefs.js + + local GENTOO_PREFS="${ED}${PREFS_DIR}/gentoo-prefs.js" + + # Set dictionary path to use system hunspell + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set spellchecker.dictionary_path pref" + pref("spellchecker.dictionary_path", "${EPREFIX}/usr/share/myspell"); + EOF + + # Force hwaccel prefs if USE=hwaccel is enabled + if use hwaccel ; then + cat "${FILESDIR}"/gentoo-hwaccel-prefs.js-r2 \ + >>"${GENTOO_PREFS}" \ + || die "failed to add prefs to force hardware-accelerated rendering to all-gentoo.js" + + if use wayland; then + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set hwaccel wayland prefs" + pref("gfx.x11-egl.force-enabled", false); + EOF + else + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set hwaccel x11 prefs" + pref("gfx.x11-egl.force-enabled", true); + EOF + fi + + # Install the vaapitest binary on supported arches (122.0 supports all platforms, bmo#1865969) + exeinto "${MOZILLA_FIVE_HOME}" + doexe "${BUILD_DIR}"/dist/bin/vaapitest + + # Install the v4l2test on supported arches (+ arm, + riscv64 when keyworded) + if use arm64 ; then + exeinto "${MOZILLA_FIVE_HOME}" + doexe "${BUILD_DIR}"/dist/bin/v4l2test + fi + fi + + # Force the graphite pref if USE=system-harfbuzz is enabled, since the pref cannot disable it + if use system-harfbuzz ; then + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to set gfx.font_rendering.graphite.enabled pref" + sticky_pref("gfx.font_rendering.graphite.enabled", true); + EOF + fi + + # Install language packs + local langpacks=( $(find "${BUILD_DIR}"/dist/linux-x86_64/xpi -type f -name '*.xpi') ) + if [[ -n "${langpacks}" ]] ; then + moz_install_xpi "${MOZILLA_FIVE_HOME}/distribution/extensions" "${langpacks[@]}" + fi + + # Install icons + local icon_srcdir="${S}/browser/branding/official" + + insinto /usr/share/icons/hicolor/symbolic/apps + newins "${FILESDIR}/icon/icecat-symbolic.svg" icecat-symbolic.svg + + local icon size + for icon in "${icon_srcdir}"/default*.png ; do + size=${icon%.png} + size=${size##*/default} + + if [[ ${size} -eq 48 ]] ; then + newicon "${icon}" ${PN}.png + fi + + newicon -s ${size} "${icon}" ${PN}.png + done + + # Install menu + local app_name="GNU IceCat" + local desktop_file="${FILESDIR}/icon/${PN}-r3.desktop" + local exec_command="${PN}" + local icon="${PN}" + local use_wayland="false" + + if use wayland ; then + use_wayland="true" + fi + + cp "${desktop_file}" "${WORKDIR}/${PN}.desktop-template" || die + + sed -i \ + -e "s:@NAME@:${app_name}:" \ + -e "s:@EXEC@:${exec_command}:" \ + -e "s:@ICON@:${icon}:" \ + "${WORKDIR}/${PN}.desktop-template" || die + + newmenu "${WORKDIR}/${PN}.desktop-template" icecat.desktop + + rm "${WORKDIR}/${PN}.desktop-template" || die + + if use gnome-shell ; then + # Install search provider for Gnome + insinto /usr/share/gnome-shell/search-providers/ + doins browser/components/shell/search-provider-files/org.gnu.icecat.search-provider.ini + + insinto /usr/share/dbus-1/services/ + doins browser/components/shell/search-provider-files/org.gnu.icecat.SearchProvider.service + + # Make the dbus service aware of a previous session, bgo#939196 + sed -e \ + "s/Exec=\/usr\/bin\/icecat/Exec=\/usr\/$(get_libdir)\/icecat\/icecat --dbus-service \/usr\/bin\/icecat/g" \ + -i "${ED}/usr/share/dbus-1/services/org.gnu.icecat.SearchProvider.service" || + die "Failed to sed org.gnu.icecat.SearchProvider.service dbus file" + + # Update prefs to enable Gnome search provider + cat >>"${GENTOO_PREFS}" <<-EOF || die "failed to enable gnome-search-provider via prefs" + pref("browser.gnome-search-provider.enabled", true); + EOF + fi + + # Install wrapper script + [[ -f "${ED}/usr/bin/${PN}" ]] && rm "${ED}/usr/bin/${PN}" + newbin "${FILESDIR}/${PN}-r1.sh" ${PN} + + # Update wrapper + sed -i \ + -e "s:@PREFIX@:${EPREFIX}/usr:" \ + -e "s:@DEFAULT_WAYLAND@:${use_wayland}:" \ + "${ED}/usr/bin/${PN}" || die + + readme.gentoo_create_doc +} + +pkg_postinst() { + xdg_pkg_postinst + + elog "Cloudflare browser checks are broken with GNU IceCats anti fingerprinting measures." + elog "You can fix cloudflare browser checks by undoing them in about:config like below:" + # Specifying (X11) is necessary for it to work, even in a Wayland session + elog " general.appversion.override: ${PV%.[0-9]*} (X11)" + elog " general.oscpu.override: Linux x86_64" + elog " general.platform.override: Linux x86_64" + + # bug 835078 + if use hwaccel && has_version "x11-drivers/xf86-video-nouveau"; then + ewarn "You have nouveau drivers installed in your system and 'hwaccel' " + ewarn "enabled for Firefox. Nouveau / your GPU might not support the " + ewarn "required EGL, so either disable 'hwaccel' or try the workaround " + ewarn "explained in https://bugs.gentoo.org/835078#c5 if Firefox crashes." + fi + + readme.gentoo_print_elog + + optfeature_header "Optional programs for extra features:" + optfeature "desktop notifications" x11-libs/libnotify + optfeature "fallback mouse cursor theme e.g. on WMs" gnome-base/gsettings-desktop-schemas + optfeature "screencasting with pipewire" sys-apps/xdg-desktop-portal + if use hwaccel && has_version "x11-drivers/nvidia-drivers"; then + optfeature "hardware acceleration with NVIDIA cards" media-libs/nvidia-vaapi-driver + fi + + if ! has_version "sys-libs/glibc"; then + elog + elog "glibc not found! You won't be able to play DRM content." + elog "See Gentoo bug #910309 or upstream bug #1843683." + elog + fi +} diff --git a/www-client/icecat/metadata.xml b/www-client/icecat/metadata.xml new file mode 100644 index 0000000..d94fb6a --- /dev/null +++ b/www-client/icecat/metadata.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<use> + <flag name="clang">Use Clang compiler instead of GCC</flag> + <flag name="gnome-shell">Integrate with gnome-base/gnome-shell search</flag> + <flag name="hwaccel">Force-enable hardware-accelerated rendering (Mozilla bug 594876)</flag> + <flag name="jumbo-build">Enable unified build - combines source files to speed up build process, but requires more memory</flag> + <flag name="libproxy">Enable libproxy support</flag> + <flag name="openh264">Use <pkg>media-libs/openh264</pkg> for H.264 support + instead of downloading binary blob from Mozilla at runtime</flag> + <flag name="pgo">Add support for profile-guided optimization using gcc-4.5, + for faster binaries. This option will double the compile time.</flag> + <flag name="sndio">Enable support for the <pkg>media-sound/sndio</pkg> backend</flag> + <flag name="system-av1">Use the system-wide <pkg>media-libs/dav1d</pkg> + and <pkg>media-libs/libaom</pkg> library instead of bundled.</flag> + <flag name="system-harfbuzz">Use the system-wide <pkg>media-libs/harfbuzz</pkg> + and <pkg>media-gfx/graphite2</pkg> instead of bundled.</flag> + <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg> + instead of bundled.</flag> + <flag name="system-jpeg">Use the system-wide <pkg>media-libs/libjpeg-turbo</pkg> + instead of bundled.</flag> + <flag name="system-libevent">Use the system-wide <pkg>dev-libs/libevent</pkg> + instead of bundled.</flag> + <flag name="system-libvpx">Use the system-wide <pkg>media-libs/libvpx</pkg> + instead of bundled.</flag> + <flag name="system-pipewire">Use system <pkg>media-video/pipewire</pkg> for WebRTC and screencast instead of bundled one</flag> + <flag name="system-png">Use the system-wide <pkg>media-libs/libpng</pkg> + instead of bundled (requires APNG patches)</flag> + <flag name="system-webp">Use the system-wide <pkg>media-libs/libwebp</pkg> + instead of bundled.</flag> + <flag name="wasm-sandbox">Sandbox certain third-party libraries through WebAssembly using RLBox</flag> +</use> +</pkgmetadata> |
