forked from Danish1999/scripts-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenvsetup.sh
More file actions
executable file
·60 lines (53 loc) · 2.1 KB
/
envsetup.sh
File metadata and controls
executable file
·60 lines (53 loc) · 2.1 KB
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
#!/usr/bin/env bash
#
# Copyright (C) 2019 nysascape
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Probably the 3rd bad apple coming
# Enviroment variables
# Export KERNELDIR as en environment-wide thingy
# We start in scripts, so like, don't clone things there
KERNELDIR="$(pwd)"
SCRIPTS=${KERNELDIR}/kernelscripts
OUTDIR=${KERNELDIR}/out
# Pick your poison
if [[ "$*" =~ "clang"* ]]; then
git clone https://github.com/Danish1999/proton-clang --depth=1 "${KERNELDIR}"/clang
COMPILER_STRING='Proton Clang (latest)'
COMPILER_TYPE='clang'
elif [[ "$*" =~ "gcc9"* ]]; then
git clone https://github.com/arter97/arm64-gcc.git -b master --depth=1 "${KERNELDIR}/gcc"
git clone https://github.com/arter97/arm32-gcc.git -b master --depth=1 "${KERNELDIR}/gcc32"
COMPILER_STRING='GCC 9.x LTO'
COMPILER_TYPE='GCC19.x'
elif [[ "$*" =~ "gcc4.9"* ]]; then
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9 "${KERNELDIR}/gcc"
cd gcc || exit
# Google is a hoe
git reset --hard 75c0ace0eb9ba47c11df56971e7f63f2ebaa9fbd
cd ..
COMPILER_STRING='GCC 4.9 from Google'
COMPILER_TYPE='GCC4.9'
else
# Default to GCC from Arter
git clone https://github.com/arter97/arm64-gcc --depth=1 "${KERNELDIR}/gcc"
git clone https://github.com/arter97/arm32-gcc --depth=1 "${KERNELDIR}/gcc32"
COMPILER_STRING='GCC 9.x'
COMPILER_TYPE='GCC9.x'
fi
export COMPILER_STRING COMPILER_TYPE KERNELDIR SCRIPTS OUTDIR
git clone https://github.com/fabianonline/telegram.sh/ telegram
# Export Telegram.sh
TELEGRAM=${KERNELDIR}/telegram/telegram
# Examine our compilation threads
# 2x of our available CPUs
# Kanged from @raphielscape <3
CPU="$(grep -c '^processor' /proc/cpuinfo)"
JOBS="$(( CPU * 2 ))"
# Parse git things
PARSE_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
PARSE_ORIGIN="$(git config --get remote.origin.url)"
COMMIT_POINT="$(git log --pretty=format:'%h : %s' -1)"
export TELEGRAM JOBS