BotBrew - *nix tools and package management for Android
This project compiles various *nix tools and makes Opkg packages suitable for installation on ARM devices running Android.
If you just want to use prebuilt binaries, try the BotBrew GUI; or get a shell on your rooted Android device and run:
wget http://repo.botbrew.com/anise/bootstrap/install.sh -O- | su
Otherwise, keep reading to roll your own.
The following Debian packages are required for using BotBrew. Actually, there may be more or fewer requirements depending on the software is to be built, but this is a reasonable starting point. If the build process halts for some reason, it might be calling for additional packages.
- python-xcbgen 1.7
In addition, the Android NDK (r7b recommended) is required.
BotBrew knows how to make
- ... and more (have a look at the cookbook)
Some projects do not generate packages at all; instead, they provide libraries that allow other projects to be built. These may eventually be packaged as well, to facilitate on-board software development.
Create a new file
config.sh to define a couple of variables
- G_MAINTAINER=your name and <email address> in RFC822 format
- G_NDKPATH=absolute path to the NDK
config.sh is sourced by the
botbrew script during execution.
First, navigate to BotBrew's top-most directory and extract a standalone toolchain from the NDK.
Then, navigate to the project directory of interest, within the cookbook.
../../botbrew recipe # just shows basic information ../../botbrew recipe build # builds the project, satisfying dependencies in the process ../../botbrew recipe package # packages the project, building it first if necessary ../../botbrew recipe clean # removes object files ../../botbrew recipe distclean # removes object files, makefiles, and imports ../../botbrew recipe clobber # removes everything
BotBrew could also generate a makefile. First, navigate to BotBrew's top-most directory.
./botbrew makefile > Makefile # generates the makefile make <project> # builds <project> make package-<project> # packages <project> make clean-<project> # cleans <project> make distclean-<project> # distcleans <project> make clobber-<project> # clobbers <project> make build-all # builds all projects make package-all # packages all projects
With a makefile, it is possible to specify multiple targets at once and avoid manually changing directories. Since the makefile is basically an index of the BotBrew cookbook, it should be re-generated when projects are added to or removed from BotBrew. Makefile usage is optional.
BotBrew is able to generate graphviz-formatted dependency graphs.
./botbrew graphbuild > graph.dot # generates a graph of build-time dependencies ./botbrew graphinstall > graph.dot # generates a graph of install-time dependencies
BotBrew takes cues from Arch Linux. Just as Arch's PKGBUILD scripts direct the assembly of its packages, BotBrew's recipes (
cookbook/*/recipe) control how its projects are built, cleaned, and packaged. Each method is handled by a shell function. In most cases, the maintainer only needs to override the build function. Defaults are used whenever there is no override. BotBrew provides functions that assist in downloading/unpacking/patching source code, and functions that apply various fixes and make cross-compilation easier. The Opkg packages themselves are controlled by YAML files (
cookbook/*/package/*). Please have a look at some of the projects for packaging hints.
agcc.bash is a wrapper around the NDK that behaves as gcc when invoked as agcc.bash or g++ when invoked as agcc-bash-g++. It is deprecated in favor of the standalone toolchain generated by the NDK.