forked from ironfox-oss/IronFox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub-build.sh
executable file
·94 lines (72 loc) · 2.07 KB
/
github-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
export VERSION_NAME='134.0'
export VERSION_CODE='31340000'
rootdir="$(dirname "$0")/.."
rootdir=$(realpath "$rootdir")
export TRY_FIX="$PWD"
echo "Install packages" && \
{
sudo apt update
sudo apt install -y make \
cmake \
clang-18 \
gyp \
ninja-build \
patch \
perl \
wget \
unzip \
xz-utils \
zlib1g-dev \
python3.9 \
python3.9-venv \
openjdk-8-jdk \
openjdk-17-jdk \
llvm-18 \
build-essential \
gcc \
g++ \
gcc-multilib
sudo rm -rf /var/cache/apt/archives
} || exit 1
echo "Setup F-Droids gradle script to be available in PATH" && \
{
mkdir -p "$HOME/bin"
wget https://gitlab.com/fdroid/fdroidserver/-/raw/master/gradlew-fdroid -O "$HOME/bin/gradle"
chmod +x "$HOME/bin/gradle"
export PATH="$HOME/bin:$PATH"
} || exit 1
echo "Disable Gradle Daemons and configuration cache" && \
{
mkdir -p ~/.gradle
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
echo "org.gradle.configuration-cache=false" >> ~/.gradle/gradle.properties
} || exit 1
echo "Create a new Python 3.9 virtual environment" && \
{
python3.9 -m venv env
source env/bin/activate
} || exit 1
echo "Set JDK 17" && \
{
[ -d /usr/lib/jvm/java-17-openjdk ] && export "JAVA_HOME=/usr/lib/jvm/java-17-openjdk" || \
[ -d /usr/lib/jvm/java-17-openjdk-amd64 ] && export "JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64"
} || exit 1
echo "Android SDK installation" && \
{
source ./scripts/setup-android-sdk.sh
} || exit 1
cd "$TRY_FIX"
echo "Get sources" && \
{
source ./scripts/get_sources.sh
} || exit 1
echo "Prepare build" && \
{
source scripts/paths_local.sh || echo "error: source scripts/paths_local.sh"
source ./scripts/prebuild.sh "${VERSION_NAME}" "${VERSION_CODE}"
} || exit 1
echo "Build" && \
{
source ./scripts/build.sh
} || exit 1