mirror of
https://github.com/ironfox-oss/IronFox.git
synced 2026-04-19 14:40:21 -04:00
ironfox-oss/IronFox!85 ____ ## Changes - Enabled [display of built-in add-ons at the `Extensions` fragment](2f382311f9) *(As a result, users can now easily see/control built-in extensions, and disable them if desired)*. - Ensured that [Android's `Credential Manager` API is always prioritized over Google Play Services/microG on supported devices](9c6bd05707). - [Exposed `about:translations` at `about:about`](94b73a9ffc). - [Implemented enterprise policies](304c4e088c) to control various features/functionality in Gecko. - Rebased onto Firefox [`143.0.3`](https://firefox.com/firefox/android/143.0.3/releasenotes/). - Removed [the `Mozilla Ad Routing Service` *(`MARS`)* library](b88a4db302). - Removed [privileged add-on signing status from external Mozilla add-ons](76a6e95f32). - Updated the default Rust version to [`1.90.0`](https://doc.rust-lang.org/stable/releases.html#version-190-2025-09-18). - [Updated the setting to enable/disable installation of add-ons](4dc340b4aa) to leverage policies - making it more effective/comprehensive, and improved UX by displaying a pop-up when a user attempts to install an add-on while the setting is disabled. - [Other minor tweaks and adjustments](https://gitlab.com/ironfox-oss/IronFox/-/merge_requests/85/diffs). MR-author: celenity <celenity@celenity.dev> Co-authored-by: Weblate <hosted@weblate.org> Co-authored-by: Akash Yadav <itsaky01@gmail.com> Approved-by: Akash Yadav <itsaky01@gmail.com> Merged-by: celenity <celenity@celenity.dev>
178 lines
5.0 KiB
Bash
Executable File
178 lines
5.0 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Fennec build scripts
|
|
# Copyright (C) 2020-2024 Matías Zúñiga, Andrew Nayenko, Tavi
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
# License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Usage: $0 apk|bundle" >&1
|
|
exit 1
|
|
fi
|
|
|
|
set -euo pipefail
|
|
|
|
# Set platform
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
PLATFORM=macos
|
|
else
|
|
PLATFORM=linux
|
|
fi
|
|
|
|
build_type="$1"
|
|
|
|
if [ "$build_type" != "apk" ] && [ "$build_type" != "bundle" ]; then
|
|
echo "Unknown build type: '$build_type'" >&1
|
|
echo "Usage: $0 apk|bundle" >&1
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -n ${FDROID_BUILD+x} ]]; then
|
|
source "$(dirname "$0")/env_fdroid.sh"
|
|
fi
|
|
|
|
# shellcheck disable=SC2154
|
|
if [[ "$env_source" != "true" ]]; then
|
|
echo "Use 'source scripts/env_local.sh' before calling prebuild or build"
|
|
exit 1
|
|
fi
|
|
|
|
source "$CARGO_HOME/env"
|
|
|
|
# We publish the artifacts into a local Maven repository instead of using the
|
|
# auto-publication workflow because the latter does not work for Gradle
|
|
# plugins (Glean).
|
|
|
|
if [[ -n ${FDROID_BUILD+x} ]]; then
|
|
|
|
# Build LLVM
|
|
# shellcheck disable=SC2154
|
|
pushd "$llvm"
|
|
|
|
pushd "$bundletool"
|
|
gradle assemble
|
|
popd
|
|
|
|
# shellcheck disable=SC2154
|
|
llvmtarget=$(cat "$builddir/targets_to_build")
|
|
echo "building llvm for $llvmtarget"
|
|
cmake -S llvm -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out -DCMAKE_C_COMPILER=clang-16 \
|
|
-DCMAKE_CXX_COMPILER=clang++-16 -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_TARGETS_TO_BUILD="$llvmtarget" \
|
|
-DLLVM_USE_LINKER=lld -DLLVM_BINUTILS_INCDIR=/usr/include -DLLVM_ENABLE_PLUGINS=FORCE_ON \
|
|
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-unknown-linux-gnu"
|
|
cmake --build build -j"$(nproc)"
|
|
cmake --build build --target install -j"$(nproc)"
|
|
popd
|
|
fi
|
|
|
|
if [[ -n ${FDROID_BUILD+x} ]]; then
|
|
# Build WASI SDK
|
|
# shellcheck disable=SC2154
|
|
pushd "$wasi"
|
|
|
|
mkdir -vp build/install/wasi
|
|
touch build/compiler-rt.BUILT # fool the build system
|
|
$MAKE_LIB \
|
|
PREFIX=/wasi \
|
|
build/wasi-libc.BUILT \
|
|
build/libcxx.BUILT \
|
|
-j"$($NPROC_LIB)"
|
|
popd
|
|
fi
|
|
|
|
if [[ -n ${FDROID_BUILD+x} ]]; then
|
|
# Build uniffi-bindgen
|
|
pushd "$uniffi"
|
|
|
|
cargo build --release
|
|
|
|
popd
|
|
fi
|
|
|
|
if [[ -n ${FDROID_BUILD+x} ]]; then
|
|
# Build uniffi-bindgen
|
|
pushd "$uniffi"
|
|
|
|
cargo build --release
|
|
|
|
popd
|
|
fi
|
|
|
|
# Build microG libraries
|
|
# shellcheck disable=SC2154
|
|
pushd "$gmscore"
|
|
if ! [[ -n ${FDROID_BUILD+x} ]]; then
|
|
export GRADLE_MICROG_VERSION_WITHOUT_GIT=1
|
|
fi
|
|
gradle -x javaDocReleaseGeneration \
|
|
:play-services-ads-identifier:publishToMavenLocal \
|
|
:play-services-base:publishToMavenLocal \
|
|
:play-services-basement:publishToMavenLocal \
|
|
:play-services-fido:publishToMavenLocal \
|
|
:play-services-tasks:publishToMavenLocal
|
|
popd
|
|
|
|
# shellcheck disable=SC2154
|
|
pushd "$glean"
|
|
export TARGET_CFLAGS=-DNDEBUG
|
|
gradle publishToMavenLocal
|
|
popd
|
|
|
|
# shellcheck disable=SC2154
|
|
pushd "$application_services"
|
|
|
|
# When 'CI' environment variable is set to a non-zero value, the 'libs/verify-ci-android-environment.sh' script
|
|
# skips building the libraries as they are expected to be already downloaded in a CI environment
|
|
# However, we want build those libraries always, so we set CI='' before invoking the script
|
|
CI='' bash -c './libs/verify-android-environment.sh && gradle :tooling-nimbus-gradle:publishToMavenLocal'
|
|
popd
|
|
|
|
# shellcheck disable=SC2154
|
|
pushd "$mozilla_release"
|
|
|
|
# shellcheck disable=SC2086
|
|
echo "Running ./mach build..."
|
|
./mach build
|
|
echo "Running ./mach package..."
|
|
./mach package
|
|
echo "Running ./mach package-multi-locale..."
|
|
./mach package-multi-locale --locales ${IRONFOX_LOCALES}
|
|
|
|
MOZ_CHROME_MULTILOCALE="${IRONFOX_LOCALES}"
|
|
export MOZ_CHROME_MULTILOCALE
|
|
|
|
echo "Running gradle -x javadocRelease :geckoview:publishReleasePublicationToMavenLocal..."
|
|
gradle -x javadocRelease :geckoview:publishReleasePublicationToMavenLocal
|
|
popd
|
|
|
|
# shellcheck disable=SC2154
|
|
pushd "$android_components"
|
|
# Publish concept-fetch (required by A-S) with auto-publication disabled,
|
|
# otherwise automatically triggered publication of A-S will fail
|
|
gradle :components:concept-fetch:publishToMavenLocal
|
|
# Enable the auto-publication workflow now that concept-fetch is published
|
|
echo "autoPublish.application-services.dir=$application_services" >>local.properties
|
|
gradle publishToMavenLocal
|
|
popd
|
|
|
|
# shellcheck disable=SC2154
|
|
pushd "$fenix"
|
|
if [[ "$build_type" == "apk" ]]; then
|
|
gradle :app:assembleRelease
|
|
elif [[ "$build_type" == "bundle" ]]; then
|
|
gradle :app:bundleRelease -Paab
|
|
fi
|
|
popd
|