fix: rename 'paths_*.sh' to 'env_*.sh'

env_*.sh names are better suited since the scripts are used to set up environment variables
This commit is contained in:
Akash Yadav
2025-01-09 00:14:37 +05:30
parent c8100a9f08
commit 911ff0d79c
9 changed files with 32 additions and 22 deletions

View File

@@ -10,7 +10,9 @@ container:
build_task:
name: Build IronFox
only_if: $CIRRUS_BRANCH == "main"
only_if: >
$CIRRUS_BRANCH == "main" ||
$CIRRUS_BRANCH =~ ".*--ci-incl$"
timeout_in: 120m
env:
SB_GAPI_KEY: ENCRYPTED[!3da25d528d0c34be6d3f3bbe73d2cbce960b8e55ed7b54906a1140b4929032b026a1ea5f0876fe46b0f0044711cc08bd!]

2
.gitignore vendored
View File

@@ -7,4 +7,4 @@ __pycache__
/appservices
/gmscore
/wasi-sdk
/scripts/paths_local.sh
/scripts/env_local.sh

View File

@@ -188,10 +188,10 @@ Next, you need to download the source files to build. The `scripts/get_sources.s
If you need to fetch sources for a different version of Firefox than the one IronFox is currently based on, you'll have to modify the script directly.
Once the source files are downloaded and extracted, you need to source the
`scripts/paths_local.sh` script *(generated by `get_sources.sh`)* to set up the required environment variables:
`scripts/env_local.sh` script *(generated by `get_sources.sh`)* to set up the required environment variables:
```sh
source scripts/paths_local.sh
source scripts/env_local.sh
```
Next, you need to patch the files with:

View File

@@ -21,12 +21,12 @@ set -e
if [[ -n ${FDROID_BUILD+x} ]]; then
source "$(dirname "$0")/paths_fdroid.sh"
source "$(dirname "$0")/env_fdroid.sh"
fi
# shellcheck disable=SC2154
if [[ "$paths_source" != "true" ]]; then
echo "Use 'source scripts/paths_local.sh' before calling prebuild or build"
if [[ "$env_source" != "true" ]]; then
echo "Use 'source scripts/env_local.sh' before calling prebuild or build"
exit 1
fi
@@ -90,8 +90,6 @@ popd
# shellcheck disable=SC2154
pushd "$application_services"
export NSS_DIR="$application_services/libs/desktop/linux-x86-64/nss"
export NSS_STATIC=1
./libs/verify-android-environment.sh
gradle :tooling-nimbus-gradle:publishToMavenLocal
popd
@@ -99,9 +97,6 @@ popd
# shellcheck disable=SC2154
pushd "$mozilla_release"
# shellcheck disable=SC2154
MOZ_CHROME_MULTILOCALE=$(<"$patches/locales")
export MOZ_CHROME_MULTILOCALE
./mach build
gradle :geckoview:publishReleasePublicationToMavenLocal
gradle :exoplayer2:publishReleasePublicationToMavenLocal

View File

@@ -10,7 +10,7 @@ rootdir="$(dirname "$0")/.."
rootdir=$(realpath "$rootdir")
# Setup paths
source "$rootdir/scripts/paths_local.sh"
source "$rootdir/scripts/env_local.sh"
# Patch
"$rootdir/scripts/prebuild.sh" "${VERSION_NAME}" "${VERSION_CODE}"
@@ -23,7 +23,7 @@ echo "########################"
echo ""
# Build
bash "$rootdir/scripts/build.sh"
source "$rootdir/scripts/build.sh"
# Build AAB
pushd "$rootdir/gecko/mobile/android/fenix"

12
scripts/env_common.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Caution: Should not be sourced directly!
# Use 'env_local.sh' or 'env_fdroid.sh' instead.
MOZ_CHROME_MULTILOCALE=$(<"$patches/locales")
export MOZ_CHROME_MULTILOCALE
export NSS_DIR="$application_services/libs/desktop/linux-x86-64/nss"
export NSS_STATIC=1
export env_source="true"

View File

@@ -35,4 +35,4 @@ export llvm="$FDROID_SRCLIB/llvm"
export llvm_android="$FDROID_SRCLIB/llvm_android"
export toolchain_utils="$FDROID_SRCLIB/toolchain-utils"
export paths_source="true"
source "\$rootdir/scripts/env_common.sh"

View File

@@ -10,7 +10,7 @@ APPSERVICES_TAG="v134.0"
# Configuration
ROOTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PATHS_SH="${ROOTDIR}/scripts/paths_local.sh"
ENV_SH="${ROOTDIR}/scripts/env_local.sh"
BUILDDIR="${ROOTDIR}/build"
PATCHDIR="${ROOTDIR}/patches"
GECKODIR="${ROOTDIR}/gecko"
@@ -128,8 +128,8 @@ git clone --branch "$APPSERVICES_TAG" --depth=1 "https://github.com/mozilla/appl
do_download "gecko" "https://hg.mozilla.org/releases/mozilla-release/archive/${FIREFOX_TAG}.zip"
echo "Writing ${PATHS_SH}..."
cat > "$PATHS_SH" << EOF
echo "Writing ${ENV_SH}..."
cat > "$ENV_SH" << EOF
export patches=${PATCHDIR}
export rootdir=${ROOTDIR}
export builddir="\$rootdir/build"
@@ -140,5 +140,6 @@ export fenix=${FENIX}
export mozilla_release=${GECKODIR}
export gmscore=${GMSCOREDIR}
export wasi=${WASISDKDIR}
export paths_source="true"
source "\$rootdir/scripts/env_common.sh"
EOF

View File

@@ -38,12 +38,12 @@ fi
if [[ -n ${FDROID_BUILD+x} ]]; then
source "$(dirname "$0")/setup-android-sdk.sh"
source "$(dirname "$0")/paths_fdroid.sh"
source "$(dirname "$0")/env_fdroid.sh"
fi
# shellcheck disable=SC2154
if [[ "$paths_source" != "true" ]]; then
echo "Use 'source scripts/paths_local.sh' before calling prebuild or build"
if [[ "$env_source" != "true" ]]; then
echo "Use 'source scripts/env_local.sh' before calling prebuild or build"
exit 1
fi