diff options
-rw-r--r-- | libre/iceweasel/PKGBUILD | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD index a6b54cf47..093e9e0b8 100644 --- a/libre/iceweasel/PKGBUILD +++ b/libre/iceweasel/PKGBUILD @@ -22,7 +22,7 @@ # Contributor: grizzlyuser <grizzlyuser@protonmail.com> -# Rational for inclusion in [libre]: +# parabola changes and rationale # FSDG: # - Modify the addons pages to use GNU IceCat plugins sources, rather # than addons.mozilla.org, which hosts non-free addons @@ -60,6 +60,7 @@ makedepends=(unzip zip diffutils yasm mesa imake inetutils xorg-server-xvfb python-setuptools python-psutil python-zstandard lld) # FIXME: 'mozilla-serarchplugins' package needs re-working (see note in prepare()) makedepends+=(quilt libxslt imagemagick git jq) +makedepends+=(rust=1:1.46.0) # FIXME: FTBS with rust v1.47.0 optdepends=('networkmanager: Location detection via available WiFi networks' 'libnotify: Notification integration' 'pulseaudio: Audio support' @@ -100,9 +101,10 @@ validpgpkeys+=('BFA8008A8265677063B11BF47171986E4B745536') # Andreas Grapentin validpgpkeys+=('3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger -_should_skip_pgo_armv7h=1 -_should_skip_pgo_i686=1 -_should_skip_pgo_x86_64=0 +# PGO requires networking +_should_skip_pgo_armv7h=1 # disable for armv7h - always +_should_skip_pgo_i686=1 # disable for i686 - always +_should_skip_pgo_x86_64=0 # disable for x86_64 - libremakepkg eval "_should_skip_pgo=\$_should_skip_pgo_${CARCH}" @@ -180,8 +182,8 @@ ac_add_options --disable-elf-hack # https://bugzilla.redhat.com/show_bug.cgi?id=1641623 ac_add_options --disable-av1 ac_add_options --enable-optimize="-g0 -O2" +mk_add_options MOZ_MAKE_FLAGS='-j2' END -# mk_add_options MOZ_MAKE_FLAGS=${MAKEFLAGS} # from archlinuxarm # mozbuild.configure.options.InvalidOptionError: --disable-eme is not available in this configuration # EME is disabled anyway in the built package, but better check if it exists for ARM each new release. @@ -210,12 +212,12 @@ END # readelf: Error: Unable to seek to 0x801db328 for section headers echo "applying avoid-libxul-OOM-python-check.patch" - patch -p1 -i "$srcdir"/avoid-libxul-OOM-python-check.patch + patch -p1 -i "${srcdir}"/avoid-libxul-OOM-python-check.patch # test failure in rust code (complaining about network functions) when PGO is used, # see https://bugzilla.mozilla.org/show_bug.cgi?id=1565757 echo "applying rust-static-disable-network-test-on-static-libraries.patch" - patch -p1 -i "$srcdir"/rust-static-disable-network-test-on-static-libraries.patch + patch -p1 -i "${srcdir}"/rust-static-disable-network-test-on-static-libraries.patch ;; x86_64) ;; @@ -270,7 +272,7 @@ END # Remove remaining non-free bits echo "applying libre.patch" - patch -Np1 -i "$srcdir/libre.patch" + patch -Np1 -i "${srcdir}/libre.patch" # Disable various components at the source level sed -i 's/;1/;0/' toolkit/components/telemetry/components.conf @@ -288,24 +290,25 @@ END # Patch search-engines config # FIXME: custom searchplugins ID per new format above ("ddg" is standard) # browser/components/search/extensions/<ID>/ -# local _remove_engines_sed='s|.*oogle.*| "ddg", "duckduckgo-html", "duckduckgo-lite", "internet-archive", "parabola-labs", "parabola-packages", "parabola-wiki-en", "searx", "wikipedia", "yacy"|g' - local _remove_engines_sed='s|.*oogle.*| "ddg", "wikipedia"|g' +# local remove_engines_sed='s|.*oogle.*| "ddg", "duckduckgo-html", "duckduckgo-lite", "internet-archive", "parabola-labs", "parabola-packages", "parabola-wiki-en", "searx", "wikipedia", "yacy"|g' + local remove_engines_sed='s|.*oogle.*| "ddg", "wikipedia"|g' echo "applying libre-searchengines.patch" - patch -Np1 -i "$srcdir/libre-searchengines.patch" - + patch -Np1 -i "{$srcdir}/libre-searchengines.patch" pushd browser/components/search/extensions - sed -i "${_remove_engines_sed}" list.json + sed -i "${remove_engines_sed}" list.json sed -i 's|https://duckduckgo.com/|https://html.duckduckgo.com/html/|' ddg/manifest.json # Removing URL parameters that let DuckDuckGo know the place in UI # the search was ran from (like address bar, context menu, etc.) - jq 'del(.chrome_settings_overrides.search_provider.params)' ddg/manifest.json > manifest.json.tmp \ - && mv manifest.json.tmp ddg/manifest.json + local jq_cmd='del(.chrome_settings_overrides.search_provider.params)' + jq "${jq_cmd}" ddg/manifest.json > manifest.json.tmp + ! diff manifest.json.tmp ddg/manifest.json > /dev/null + mv manifest.json.tmp ddg/manifest.json # Sanity-check search-engines patching - _removed_engines_regex='Bing|Google|Seznam|Twitter|Yahoo|Yandex|Яндекс|amazon|bing|google|ebay|twitter' - _err_msg="search-engines patch needs re-working" - ! grep -E ${_removed_engines_regex} list.json > /dev/null || ! echo "${_err_msg}" + local removed_engines_regex='Bing|Google|Seznam|Twitter|Yahoo|Yandex|Яндекс|amazon|bing|google|ebay|twitter' + local engines_err_msg="search-engines patch needs re-working" + ! grep -E ${removed_engines_regex} list.json > /dev/null || ! echo "${engines_err_msg}" find -mindepth 1 -maxdepth 1 \ -not -name ddg \ @@ -339,8 +342,8 @@ _check_build_config() { # E.g. if the value of any key is true or null (in case the key is missing from mozinfo.json), # that means the build configuration has to be reworked. local object_directory=$(./mach environment | sed -En '/object directory:/{n;s/^\s+//;p;}') - local features_not_disabled=$(cat "$object_directory/mozinfo.json" \ - | jq -e '[.crashreporter, .datareporting, .healthreport, .normandy, .telemetry, .updater] | any(. != false)') + local jq_cmd='[.crashreporter, .datareporting, .healthreport, .normandy, .telemetry, .updater] | any(. != false)' + local features_not_disabled=$(cat "$object_directory/mozinfo.json" | jq -e "${jq_cmd}") if $features_not_disabled; then echo 'Some features are not disabled correctly in build configuration files, aborting.' return 1 @@ -452,7 +455,7 @@ ac_add_options --enable-profile-use=cross ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog END - fi # $_skip_pgo + fi # $_should_skip_pgo ## sanity checks ## @@ -461,6 +464,10 @@ END [[ ! -f .mozconfig ]] && echo ".mozconfig file not found in source root" && return 1 _check_build_config + + + ## main build ## + echo "Building optimized browser..." ./mach build } |