Building custom Android ROMs on Arch Linux requires a specific set of packages. You'll need core build tools, Java Development Kit (JDK), and Android-specific tools like the Android SDK and Platform-Tools. Some dependencies may vary slightly depending on the specific Android version and ROM you intend to build, and whether you are building AOSP (Android Open Source Project) or a custom ROM like LineageOS.
Here's a comprehensive list of packages you'll likely need:
Core Build Tools:
git: For managing source code[1][2].
gnupg: For verifying signatures[1][2].
flex: A fast lexical analyzer generator[1][2].
bison: A general-purpose parser generator[1][2].
gperf: A perfect hash function generator[1][2].
squashfs-tools: Tools for working with SquashFS filesystems[1].
curl: For transferring data with URLs[1][2].
ncurses: For terminal handling[1][2].
zlib: A compression library[1].
schedtool: A tool for scheduling processes[1].
perl-switch: A Perl module for switch statements[1][2].
zip: A file archiver[1].
unzip: A file unarchiver[1].
libxslt: A library for transforming XML[2].
bc: An arbitrary precision calculator language[2].
inetutils: A collection of network programs[2].
64-bit System Dependencies (if applicable, ensure multilib is enabled in /etc/pacman.conf):[3][1]
lib32-zlib[1][2]
lib32-ncurses[1][2]
lib32-readline[1][2]
gcc-libs-multilib[1][2]
gcc-multilib[1]
lib32-gcc-libs[1]
libxcrypt-compat[2]
ncurses5-compat-libs (AUR)[2]
lib32-ncurses5-compat-libs (AUR)[2]
Java Development Kit (JDK):
The required JDK version depends on the Android version you are building.
- For Android 9 and up, Java is included with the source code[3].
- For Android 7 and 8,
jdk8-openjdk is required[3].
- Older Android versions may require OpenJDK 7 or 6[4].
Android Specific Tools:
repo: A tool built on top of Git that simplifies managing many Git repositories. It is available in the AUR[1][2].
- Android SDK packages: These can be installed via Android Studio's SDK Manager or the
sdkmanager command-line tool. Some are also available in the AUR[3].
android-tools: Provides adb, fastboot, e2fsdroid, and mke2fs[3].
android-sdk: The Android SDK itself (available in AUR)[5].
android-udev: For proper device access through ADB[5].
Optional/Other potentially useful packages:
ttf-dejavu: A TTF font may be needed for building AOSP 13[3].
ccache: A compiler cache that can speed up recompilation[4].
imagemagick: For image manipulation[4].
liblz4-tool: Tool for LZ4 compression[4].
lzop: A compression tool[4].
pngcrush: A PNG optimizer[4].
rsync: A file synchronization tool[4].
xsltproc: A command-line tool for applying XSLT stylesheets[4].
wxgtk or wxgtk2 (depending on Android version and Ubuntu version equivalence in guides you might follow): Required by some build processes[2][4].
Metapackages (AUR):
There are metapackages in the AUR that aim to include many of the necessary dependencies:
aosp-devel (AUR): Includes dependencies for building AOSP.
lineageos-devel (AUR): Includes dependencies for building LineageOS[3].
Important Considerations:
- Enable Multilib: Ensure the
multilib repository is enabled in /etc/pacman.conf for 32-bit libraries[3][1].
- AUR Helper: You will likely need an AUR helper (like
yay or pamac) to install packages from the Arch User Repository[6].
- Java Version: Pay close attention to the specific Java Development Kit (JDK) version required for the Android version you are building[3][4].
- Disk Space: Building Android ROMs requires a significant amount of disk space (over 100GB for AOSP source)[6].
- Guides: Refer to the ArchWiki and specific ROM building guides (like those on XDA Forums or LineageOS Wiki) for the most up-to-date and detailed instructions[3][1][5]. Dependencies can change, so it's good to cross-reference.
- Docker: Some users opt to use Docker images with pre-installed dependencies to avoid potential conflicts with their host Arch Linux system[8].
This list should give you a solid starting point for setting up your Arch Linux environment to build custom Android ROMs. Always check the specific requirements of the ROM you intend to build for the most accurate dependency list.