Source + Patches for Android Ports

Package Source and Patches

Older packages (mecurial's MQ):
curl
openssh
libpcap
protobuf
ttcp
radvd
sftp-server
mosh
ncurses
dropbear
mtr
rsync
traceroute
opkg
bind
libres
openssl
binutils
miredo
strace
busybox
socat
bash
gdb
vim
linker
tcpdump
libgnustl-shared

Newer packages (on github):

To setup the build environment

See android-cross-compile-environment

To build a package

Each package has an original (upstream) source, along with a set of patches. The file "series" gives the order in which to apply the patches. The MQ extension to mecurial can handle these files, or you can apply the patches by hand.
For developers/porters: Each patch has a short description of what it does

An example session building the traceroute package

Italic text - type this
gray text - notes, don't type this
[~]$ mkdir pkg
[~]$ cd pkg
[pkg]$ lftp http://dan.drown.org/android/src/traceroute/
cd ok, cwd=/android/src/traceroute                                 
lftp dan.drown.org:/android/src/traceroute> mget *
70829 bytes transferred                                    
Total 7 files transferred
lftp dan.drown.org:/android/src/traceroute> quit
[pkg]$ ls
disable-idn  headers  makefile  opkg  picky-getnameinfo  series  traceroute-2.0.16.tar.gz
[pkg]$ tar zxf traceroute-2.0.16.tar.gz 
[pkg]$ cd traceroute-2.0.16
[traceroute-2.0.16]$ cat ../series 
headers
disable-idn
makefile
opkg
picky-getnameinfo
[traceroute-2.0.16]$ while read patch; do patch -p1 <../$patch; done <../series 
patching file traceroute/mod-icmp.c
patching file traceroute/mod-tcp.c
patching file traceroute/mod-tcpconn.c
patching file traceroute/traceroute.c
patching file traceroute/traceroute.c
patching file Make.defines
patching file Make.rules
patching file opkg/control
patching file opkg/rules
patching file traceroute/traceroute.c
[traceroute-2.0.16]$ chmod 755 opkg/rules  
# when using the patch command, it does not apply file permissions
[traceroute-2.0.16]$ opkg-buildpackage 
Package = traceroute
... [build output]
[traceroute-2.0.16]$ ls -l ../traceroute_2.0.16_arm.ipk 
-rw-rw-r-- 1 build build 24634 Jun 28 18:59 ../traceroute_2.0.16_arm.ipk

An example session using hg's MQ instead of patch

Italic text - type this
gray text - notes, don't type this
(this example uses the same lftp command as the previous one)
[pkg]$ hg help qinit
'qinit' is provided by the following extension:

    mq  manage a stack of patches

use "hg help extensions" for information on enabling extensions
# MQ extension not enabled yet
[pkg]$ ( echo [extensions]; echo mq = ) >>~/.hgrc
[pkg]$ tar zxf traceroute-2.0.16.tar.gz 
[pkg]$ cd traceroute-2.0.16
[traceroute-2.0.16]$ hg init
[traceroute-2.0.16]$ hg add .
adding COPYING
... [list of all unmodified files]
[traceroute-2.0.16]$ hg commit -m "initial import"
[traceroute-2.0.16]$ mkdir .hg/patches
[traceroute-2.0.16]$ cd ..
[pkg]$ mv series `cat series ` traceroute-2.0.16/.hg/patches/
[pkg]$ cd traceroute-2.0.16
[traceroute-2.0.16]$ hg qunapplied
headers
... [list of unapplied patches]
[traceroute-2.0.16]$ hg qpush -a
applying headers
... [list of patches as they are applied]
now at: picky-getnameinfo
(now you can use opkg-buildpackage to build the package)

Build Environment Changelog

2014-06-28 - switch to docker VM
v6 - 2014-01-04 - switch to github
v5 - 2012-06-25 - add ag++
v4 - 2012-01-17 - change agcc to check the environment variable GOOGLE_PLATFORM, clear out some headers that are no longer needed
v3 - 2011-11-16 - switch to version-agnostic android-ndk dir, add tools to build packages for an apk
v2 - 2011-07-05 - program to install devel packages locally, switch to using -isystem for the system headers
v1 - 2011-06-28 - initial version