Skip to content

Commit

Permalink
fixed scripts for ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
null-nick authored Nov 12, 2024
1 parent 91c1c82 commit 8ccccaf
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions setup/android_build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,43 @@

LATEST_MAKE_VERSION="4.3"
UBUNTU_16_PACKAGES="libesd0-dev"
UBUNTU_20_PACKAGES="libncurses5 curl python-is-python3"
UBUNTU_20_PACKAGES="libncurses5 curl python3"
UBUNTU_24_PACKAGES="libncurses-dev curl python3-dev"
DEBIAN_10_PACKAGES="libncurses5"
DEBIAN_11_PACKAGES="libncurses5"
PACKAGES=""

sudo apt install software-properties-common -y
# Ensure that apt is up to date
sudo apt update

# Install lsb-core packages
sudo apt install lsb-core -y
# Install common dependencies
sudo apt install software-properties-common -y

# Detect the Ubuntu version and set appropriate package list
LSB_RELEASE="$(lsb_release -d | cut -d ':' -f 2 | sed -e 's/^[[:space:]]*//')"

if [[ ${LSB_RELEASE} =~ "Mint 18" || ${LSB_RELEASE} =~ "Ubuntu 16" ]]; then
PACKAGES="${UBUNTU_16_PACKAGES}"
elif [[ ${LSB_RELEASE} =~ "Ubuntu 20" || ${LSB_RELEASE} =~ "Ubuntu 21" || ${LSB_RELEASE} =~ "Ubuntu 22" || ${LSB_RELEASE} =~ 'Pop!_OS 2' ]]; then
PACKAGES="${UBUNTU_20_PACKAGES}"
elif [[ ${LSB_RELEASE} =~ "Ubuntu 24" ]]; then
PACKAGES="${UBUNTU_24_PACKAGES}"
elif [[ ${LSB_RELEASE} =~ "Debian GNU/Linux 10" ]]; then
PACKAGES="${DEBIAN_10_PACKAGES}"
elif [[ ${LSB_RELEASE} =~ "Debian GNU/Linux 11" ]]; then
PACKAGES="${DEBIAN_11_PACKAGES}"
fi

# Install the necessary packages
sudo DEBIAN_FRONTEND=noninteractive \
apt install \
adb autoconf automake axel bc bison build-essential \
ccache clang cmake curl expat fastboot flex g++ \
g++-multilib gawk gcc gcc-multilib git git-lfs gnupg gperf \
htop imagemagick lib32ncurses5-dev lib32z1-dev libtinfo5 libc6-dev libcap-dev \
libexpat1-dev libgmp-dev '^liblz4-.*' '^liblzma.*' libmpc-dev libmpfr-dev libncurses5-dev \
htop imagemagick lib32z1-dev libmpc-dev libmpfr-dev libncurses6-dev \
libsdl1.2-dev libssl-dev libtool libxml2 libxml2-utils '^lzma.*' lzop \
maven ncftp ncurses-dev patch patchelf pkg-config pngcrush \
pngquant python2.7 python3-pyelftools python-all-dev re2c schedtool squashfs-tools subversion \
pngquant python3-pyelftools re2c schedtool squashfs-tools subversion \
texinfo unzip w3m xsltproc zip zlib1g-dev lzip \
libxml-simple-perl libswitch-perl apt-utils rsync \
${PACKAGES} -y
Expand All @@ -53,7 +57,7 @@ sudo apt update
sudo apt install -y gh

echo -e "Setting up udev rules for adb!"
sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/M0Rf30/android-udev-rules/master/51-android.rules
sudo curl -L https://raw.githubusercontent.com/M0Rf30/android-udev-rules/master/51-android.rules -o /etc/udev/rules.d/51-android.rules
sudo chmod 644 /etc/udev/rules.d/51-android.rules
sudo chown root /etc/udev/rules.d/51-android.rules
sudo systemctl restart udev
Expand All @@ -66,6 +70,6 @@ if [[ "$(command -v make)" ]]; then
fi
fi

echo "Installing repo"
sudo curl --create-dirs -L -o /usr/local/bin/repo -O -L https://storage.googleapis.com/git-repo-downloads/repo
echo -e "Installing repo"
sudo curl -L https://storage.googleapis.com/git-repo-downloads/repo -o /usr/local/bin/repo
sudo chmod a+rx /usr/local/bin/repo

0 comments on commit 8ccccaf

Please sign in to comment.