- Update to build on ubuntu 16.04.
- Docker: Set FORCE_UNSAFE_CONFIGURE=1. Fixes #275.
- Docker: Various fixes.
- Neovim: No longer require lua.
- Some minor package updates.
-FROM ubuntu:15.10
-MAINTAINER Alex Cornejo <acornejo@gmail.com>
+FROM ubuntu:16.04
-# to prevent dialog warnings
-ENV DEBIAN_FRONTEND noninteractive
-# to fix locale to avoid warnings
+# Fix locale to avoid warnings:
RUN locale-gen en_US.UTF-8
RUN dpkg-reconfigure locales
-RUN apt-get update && apt-get install -y \
- sudo \
- git \
- asciidoc \
- automake \
- bison \
- flex \
- cmake \
-# Used for fetching sources
- curl \
-# Provides 'msgfmt' which the apt build uses
- gettext \
- help2man \
- libacl1-dev \
-# Needed by luajit host part
- libc6-dev-i386 \
-# Needed by apt build
- libcurl4-openssl-dev \
-# Provides 'gkd-pixbuf-query-loaders' which the librsvg build uses
- libgdk-pixbuf2.0-dev \
-# Provides 'glib-genmarshal' which the glib build uses
- libglib2.0-dev \
- libncurses5-dev \
- libssl-dev \
- libtool \
- libtool-bin \
- lua-lpeg \
- luarocks \
- lzip \
- m4 \
- pkg-config \
- scons \
- subversion \
- texinfo \
- xmlto \
-# Provides u'makedepend' which the openssl build uses
- xutils-dev \
-# Needed for android-sdk
- openjdk-7-jdk
+# Add this folder to the container and set as working directory:
+ADD . /root/termux-packages
+WORKDIR /root/termux-packages
+# Allow configure to be run as root:
+ENV FORCE_UNSAFE_CONFIGURE 1
-RUN cd /tmp && \
- curl -O http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz && \
- tar xzvf /tmp/android-sdk_r24.3.4-linux.tgz && \
+RUN apt-get update && \
+ apt-get install -y sudo && \
+ USER=root /root/termux-packages/scripts/ubuntu-setup.sh && \
+ # Setup Android SDK and NDK:
+ mkdir -p /root/lib && \
+ cd /root/lib && \
+ curl -o sdk.tgz http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz && \
+ tar xzvf sdk.tgz && \
+ mv android-sdk-linux android-sdk && \
curl -o ndk.zip http://dl.google.com/android/repository/android-ndk-r11-linux-x86_64.zip && \
unzip ndk.zip && \
- mkdir /root/lib && \
- mv /tmp/android-sdk-linux /root/lib/android-sdk && \
- mv /tmp/android-ndk-r11 /root/lib/android-ndk && \
- rm -fr /tmp/*
-
-RUN mkdir -p /data/data/com.termux/files/usr && mkdir -p /root/termux-packages && \
-# Install neovim dependencies
- luarocks install lpeg && \
- luarocks install mpack && \
- luarocks install luabitop
-
-ADD scripts /root/termux-packages/scripts
-ADD *.sh /root/termux-packages/
-ADD *.spec /root/termux-packages/
-ADD packages /root/termux-packages/packages
-ADD ndk_patches /root/termux-packages/ndk_patches
+ mv android-ndk-r11 android-ndk && \
+ /root/termux-packages/scripts/install-sdk.sh
Initial setup
=============
-Building packages are for now only tested to work on Ubuntu 15.10. Perform the following
-setup steps:
+Packages are normally built using Ubuntu 16.04. Most packages should build also under
+other Linux distributions (or even on OS X), but those environments will need manual setup
+adapted from the below setup for Ubuntu:
-* Run `ubuntu-setup.sh` to install required packages and setup the `/data/` folder (see below).
+* Run `scripts/ubuntu-setup.sh` to install required packages and setup the `/data/` folder (see below).
* Install the Android SDK at `$HOME/lib/android-sdk`. Override this by setting the environment
variable `$ANDROID_HOME` to point at another location.
* Install the Android NDK, version r11, at `$HOME/lib/android-ndk`. Override this by setting
the environment variable `$NDK` to point at another location.
-Alternatively a Dockerfile is provided which sets up a pristine image
-suitable for building packages. To build the docker image, run the
-following command:
+Alternatively a Dockerfile is provided which sets up a pristine image suitable for building
+packages. To build the docker image, run the following command:
- docker build --rm=true -t termux .
+ docker build -t termux .
-After build is successful, you can open an interactive prompt inside the
-container using:
-
- docker run --rm=true -ti termux /bin/bash
+After build is successful, you can open an interactive prompt inside the container using:
+ docker run -ti termux bash
Building a package
==================
PREFIX=/data/data/com.termux/files/usr
-For simplicity while developing and building, the build scripts here assume that a /data
-folder is reserved for use on the host builder and install everything there.
+For simplicity while developing and building, the build scripts here uses a /data
+folder that is reserved for use on the host builder and install everything there.
-The basic flow is then to run "./build-package.sh $PKG", which:
-* Sets up a patched stand-alone Android NDK toolchain
+The basic flow is then to run `./build-package.sh $PKG`, which:
+* Sets up a patched stand-alone Android NDK toolchain if necessary.
* Reads packages/$PKG/build.sh to find out where to find the source code of the package and how to build it.
-* Applies all patches in packages/$PKG/\*.patch
+* Applies all patches in packages/$PKG/\*.patch.
-* Builds the package and installs it to $PREFIX
+* Builds the package and installs it to `$PREFIX`.
-* Creates a dpkg package file for distribution.
+* Creates a dpkg package file for distribution in `$HOME/termux/_deb`.
Reading and following build-package.sh is the best way to understand what's going on here.
else
: ${TERMUX_STANDALONE_TOOLCHAIN:="$HOME/lib/android-standalone-toolchain-${TERMUX_ARCH}-api${TERMUX_API_LEVEL}-clang38"}
fi
-: ${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="23.0.2"}
+: ${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="23.0.3"}
# We do not put all of build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/ into PATH
# to avoid stuff like arm-linux-androideabi-ld there to conflict with ones from
# the standalone toolchain.
+++ /dev/null
-#!/bin/sh
-
-# Read settings from .termuxrc if existing
-test -f $HOME/.termuxrc && . $HOME/.termuxrc
-: ${ANDROID_HOME:="${HOME}/lib/android-sdk"}
-
-$ANDROID_HOME/tools/android update sdk --no-ui --all --no-https -t "build-tools-23.0.2"
-$ANDROID_HOME/tools/android update sdk --no-ui --all --no-https -t "android-23"
TERMUX_PKG_HOMEPAGE=https://packages.debian.org/apt
TERMUX_PKG_DESCRIPTION="Front-end for the dpkg package manager"
TERMUX_PKG_DEPENDS="liblzma, libgnustl, dpkg, gnupg"
-TERMUX_PKG_VERSION=1.2.11
+TERMUX_PKG_VERSION=1.2.12
TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/a/apt/apt_${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--host=${TERMUX_ARCH}-linux --disable-rpath acl_cv_rpath=$TERMUX_PREFIX/lib gt_cv_func_CFPreferencesCopyAppValue=no gt_cv_func_CFLocaleCopyCurrent=no ac_cv_c_bigendian=no --no-create"
# When ready to drop bz2 support:
--- /dev/null
+diff -u -r ../apt-1.2.12/doc/makefile ./doc/makefile
+--- ../apt-1.2.12/doc/makefile 2016-05-11 08:57:51.000000000 +0000
++++ ./doc/makefile 2016-05-24 20:14:30.535233236 +0000
+@@ -10,7 +10,7 @@
+ LC = en
+ include $(DOCBOOK_H)
+
+-doc: manpages docbook
++doc: manpages
+
+ examples/sources.list: ../vendor/current/sources.list
+ ln -sf '$(abspath $^)' $@
+
TERMUX_PKG_FOLDERNAME="bind-$TERMUX_PKG_VERSION"
TERMUX_PKG_DEPENDS="openssl, readline, resolv-conf"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --with-gssapi=no --with-randomdev=/dev/random -with-ecdsa=no --with-gost=no --with-libxml2=no --with-libtool"
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-openssl=$TERMUX_PREFIX"
export BUILD_AR=ar
export BUILD_CC=gcc
+++ /dev/null
-diff -u -r ../dpkg-1.17.10/configure ./configure
---- ../dpkg-1.17.10/configure 2014-06-05 21:06:21.000000000 +0200
-+++ ./configure 2014-07-11 16:43:38.654247015 +0200
-@@ -23547,7 +23547,7 @@
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dpkg cpu type" >&5
- $as_echo_n "checking dpkg cpu type... " >&6; }
-
--cpu_type=$($srcdir/run-script $PERL scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH_CPU 2>/dev/null)
-+cpu_type=TERMUX_ARCH
-
- if test "x$cpu_type" = "x"; then
- cpu_type=$host_cpu
-@@ -23587,9 +23587,9 @@
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dpkg architecture name" >&5
--$as_echo_n "checking dpkg architecture name... " >&6; }
-+$as_echo_n "checking dpkg architecture name... $srcdir/run-script $PERL scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH" >&6; }
-
--dpkg_arch=$($srcdir/run-script $PERL scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH 2>/dev/null)
-+dpkg_arch=TERMUX_ARCH
-
- if test "x$dpkg_arch" = "x"; then
- as_fn_error $? "cannot determine host dpkg architecture" "$LINENO" 5
TERMUX_PKG_HOMEPAGE=https://packages.debian.org/dpkg
TERMUX_PKG_DESCRIPTION="Debian package management system"
-TERMUX_PKG_VERSION=1.18.4
-TERMUX_PKG_BUILD_REVISION=2
+TERMUX_PKG_VERSION=1.18.7
TERMUX_PKG_SRCURL=http://ftp.debian.org/debian/pool/main/d/dpkg/dpkg_${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-dselect --disable-shared --disable-start-stop-daemon --disable-largefile --disable-update-alternatives --host=${TERMUX_ARCH}-linux --without-selinux dpkg_cv_c99_snprintf=yes ac_cv_lib_selinux_setexecfilecon=no HAVE_SETEXECFILECON_FALSE=#"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --without-bz2"
--- /dev/null
+diff -u -r ../dpkg-1.18.7/configure ./configure
+--- ../dpkg-1.18.7/configure 2016-05-08 22:09:16.000000000 -0400
++++ ./configure 2016-05-24 16:52:40.683774088 -0400
+@@ -24862,7 +24862,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dpkg cpu type" >&5
+ $as_echo_n "checking dpkg cpu type... " >&6; }
+
+-cpu_type=$(PERL=$PERL $srcdir/run-script scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH_CPU 2>/dev/null)
++cpu_type=TERMUX_ARCH
+
+ if test "x$cpu_type" = "x"; then
+ cpu_type=$host_cpu
+@@ -24904,7 +24904,7 @@
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dpkg architecture name" >&5
+ $as_echo_n "checking dpkg architecture name... " >&6; }
+
+-dpkg_arch=$(PERL=$PERL $srcdir/run-script scripts/dpkg-architecture.pl -t$host -qDEB_HOST_ARCH 2>/dev/null)
++dpkg_arch=TERMUX_ARCH
+
+ if test "x$dpkg_arch" = "x"; then
+ as_fn_error $? "cannot determine host dpkg architecture" "$LINENO" 5
# XXX: We have to start with new host build each time
# to avoid build error when cross compiling.
rm -Rf $TERMUX_PKG_HOSTBUILD_DIR
+
+ # We cannot run a dumped emacs on Android 5.0+ due to the pie requirement.
+ # Also, the native emacs we build (bootstrap-emacs) cannot used dumps when
+ # building inside docker: https://github.com/docker/docker/issues/22801
+ export CANNOT_DUMP=yes
}
termux_step_host_build () {
# Build a bootstrap-emacs binary to be used in termux_step_post_configure.
- $TERMUX_PKG_SRCDIR/configure --prefix=$TERMUX_PREFIX --without-x --with-xpm=no --with-jpeg=no \
- --with-png=no --with-tiff=no --without-gconf --without-gsettings --without-all
- make
- export CANNOT_DUMP=yes
+ local NATIVE_PREFIX=$TERMUX_PKG_TMPDIR/emacs-native
+ mkdir -p $NATIVE_PREFIX/share/emacs/$TERMUX_PKG_VERSION
+ ln -s $TERMUX_PKG_SRCDIR/lisp $NATIVE_PREFIX/share/emacs/$TERMUX_PKG_VERSION/lisp
+
+ $TERMUX_PKG_SRCDIR/configure --prefix=$NATIVE_PREFIX --without-all --with-x-toolkit=no
+ make -j $TERMUX_MAKE_PROCESSES
}
termux_step_post_configure () {
TERMUX_PKG_DEPENDS="openssl"
TERMUX_PKG_VERSION=1.6.17
TERMUX_PKG_SRCURL=http://www.nlnetlabs.nl/downloads/ldns/ldns-${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ssl=$TERMUX_PREFIX"
TERMUX_PKG_RM_AFTER_INSTALL="bin/ldns-config share/man/man1/ldns-config.1"
--- /dev/null
+Patch allowing building with perl 5.22.
+
+Will be included in the next ldns release:
+ http://git.nlnetlabs.nl/ldns/commit/?h=develop&id=168ee09a
+
+diff --git a/doc/doxyparse.pl b/doc/doxyparse.pl
+index 96a1732..a09b2e8 100755
+--- a/doc/doxyparse.pl
++++ b/doc/doxyparse.pl
+@@ -57,10 +57,15 @@ This manpage was automaticly generated from the ldns source code by
+ use of Doxygen and some perl.
+ ";
+
+-getopts("m:",\%options);
++getopts("em:",\%options);
+ # if -m manpage file is given process that file
+ # parse the file which tells us what manpages go together
+ my $functions, $see_also;
++my $i = -1;
++my $report_errors = defined $options{'e'};
++my $errors = 0;
++my %unique;
++
+ if (defined $options{'m'}) {
+ # process
+ open(MAN, "<$options{'m'}") or die "Cannot open $options{'m'}";
+@@ -68,18 +73,35 @@ if (defined $options{'m'}) {
+ # func1, func2, .. | see_also1, see_also2, ...
+ while(<MAN>) {
+ chomp;
++ $i += 1;
+ if (/^#/) { next; }
+ if (/^$/) { next; }
+- ($functions, $see_also) = split /[\t ]*\|[\t ]*/, $_;
+- #print "{$functions}\n";
+- #print "{$see_also}\n";
++ my @parts = split /[\t ]*\|[\t ]*/, $_;
++ $functions = shift @parts;
++ $see_also = join ', ', @parts;
++ print "{$functions}\n";
++ print "{$see_also}\n";
+ my @funcs = split /[\t ]*,[\t ]*/, $functions;
+ my @also = split /[\t ]*,[\t ]*/, $see_also;
+ $manpages{$funcs[0]} = \@funcs;
+ $see_also{$funcs[0]} = \@also;
++ foreach (@funcs) {
++ if ($unique{$_}) {
++ push $unique{$_}, ($i,);
++ } else {
++ $unique{$_} = [$i];
++ }
++ }
+ #print "[", $funcs[0], "]\n";
+ }
+ close(MAN);
++ while (($func, $lines) = each %unique ) {
++ if (scalar @$lines > 1) {
++ print STDERR "$func in function_manpages on lines: "
++ . join(", ",@$lines) . "\n" if $report_errors;
++ $errors += 1;
++ }
++ }
+ } else {
+ print "Need -m file to process the .h files\n";
+ exit 1;
+@@ -95,7 +117,7 @@ mkdir "doc/man";
+ mkdir "doc/man/man$MAN_SECTION";
+
+ $state = 0;
+-my $i;
++$i = 0;
+ my @lines = <STDIN>;
+ my $max = @lines;
+
+@@ -273,7 +295,7 @@ foreach (keys %manpages) {
+
+ print MAN $MAN_MIDDLE;
+
+- if (defined(@$also)) {
++ if (@$also) {
+ print MAN "\n.SH SEE ALSO\n\\fI";
+ print MAN join "\\fR, \\fI", @$also;
+ print MAN "\\fR.\nAnd ";
+@@ -290,7 +312,7 @@ foreach (keys %manpages) {
+ # create symlinks
+ chdir("$BASE/man$MAN_SECTION");
+ foreach (@$name) {
+- print STDERR $_,"\n";
++ print STDOUT $_,"\n";
+ my $new_file = $_ . "." . $MAN_SECTION;
+ if ($new_file eq $symlink_file) {
+ next;
+@@ -301,3 +323,12 @@ foreach (keys %manpages) {
+ chdir("../../.."); # and back, tricky and fragile...
+ close(MAN);
+ }
++foreach (keys %api) {
++ next if (/ / || /^$/);
++ if (not $unique{$_}) {
++ print STDERR "no man page for $_\n" if $report_errors;
++ $errors += 1;
++ }
++}
++
++exit ($report_errors and $errors != 0);
TERMUX_PKG_VERSION=0.1.5.`date "+%Y%m%d%H%M"`
TERMUX_PKG_SRCURL=https://github.com/neovim/neovim/archive/master.zip
TERMUX_PKG_NO_SRC_CACHE=yes
-TERMUX_PKG_DEPENDS="libuv, libmsgpack, libandroid-support, libluajit, libvterm, libtermkey, libutil"
+TERMUX_PKG_DEPENDS="libuv, libmsgpack, libandroid-support, libvterm, libtermkey, libutil"
TERMUX_PKG_FOLDERNAME="neovim-master"
TERMUX_PKG_HOSTBUILD=true
}
termux_step_configure () {
- # Install dependencies on ubuntu:
- # apt install lua-lpeg luarocks; luarocks install lpeg; luarocks install mpack; luarocks install luabitop
cd $TERMUX_PKG_BUILDDIR
cmake -G "Unix Makefiles" .. \
-DCMAKE_AR=`which ${TERMUX_HOST_PLATFORM}-ar` \
TERMUX_PKG_DEPENDS="libcrypt, openssl"
_PICOLISP_YEAR=16
_PICOLISP_MONTH=5
-_PICOLISP_DAY=13
+_PICOLISP_DAY=18
TERMUX_PKG_VERSION=${_PICOLISP_YEAR}.${_PICOLISP_MONTH}.${_PICOLISP_DAY}
TERMUX_PKG_SRCURL=http://software-lab.de/picoLisp.tgz
TERMUX_PKG_FOLDERNAME=picoLisp
TERMUX_PKG_PLATFORM_INDEPENDENT=yes
termux_step_make_install () {
- python3.4 setup.py install --prefix=$TERMUX_PREFIX --force
+ python3.5 setup.py install --prefix=$TERMUX_PREFIX --force
}
termux_step_post_massage () {
find . -path '*/__pycache__*' -delete
-
- # Work around python 3.5 not being available on ubuntu 15.04:
- perl -p -i -e 's|python3.4|python3.5|g' bin/*
- mv lib/python3.4 lib/python3.5
- mv lib/python3.5/site-packages/ranger-${TERMUX_PKG_VERSION}-py3.{4,5}.egg-info
}
--- /dev/null
+#!/bin/sh
+
+# Install desired parts of the Android SDK:
+test -f $HOME/.termuxrc && . $HOME/.termuxrc
+: ${ANDROID_HOME:="${HOME}/lib/android-sdk"}
+echo y | $ANDROID_HOME/tools/android update sdk --no-ui --all --no-https -t "build-tools-23.0.3"
+echo y | $ANDROID_HOME/tools/android update sdk --no-ui --all --no-https -t "android-23"
PACKAGES="$PACKAGES gettext" # Provides 'msgfmt' which the apt build uses
PACKAGES="$PACKAGES help2man"
PACKAGES="$PACKAGES libc6-dev-i386" # Needed by luajit host part of the build for <sys/cdefs.h>
-PACKAGES="$PACKAGES libcurl4-openssl-dev" # Needed by apt build
+PACKAGES="$PACKAGES libcurl4-openssl-dev" # XXX: Needed by apt build
PACKAGES="$PACKAGES libgdk-pixbuf2.0-dev" # Provides 'gkd-pixbuf-query-loaders' which the librsvg build uses
PACKAGES="$PACKAGES libglib2.0-dev" # Provides 'glib-genmarshal' which the glib build uses
PACKAGES="$PACKAGES libncurses5-dev"
PACKAGES="$PACKAGES libtool"
PACKAGES="$PACKAGES lzip"
+PACKAGES="$PACKAGES subversion" # Used by the netpbm build.
+PACKAGES="$PACKAGES tar"
+PACKAGES="$PACKAGES unzip"
PACKAGES="$PACKAGES m4"
+PACKAGES="$PACKAGES openjdk-8-jdk" # Used for android-sdk.
PACKAGES="$PACKAGES pkg-config"
PACKAGES="$PACKAGES scons"
PACKAGES="$PACKAGES texinfo"
PACKAGES="$PACKAGES xmlto"
PACKAGES="$PACKAGES xutils-dev" # Provides u'makedepend' which the openssl build uses
-PACKAGES="$PACKAGES git"
-sudo apt install $PACKAGES
+sudo apt-get install -y $PACKAGES
sudo mkdir -p /data/data/com.termux/files/usr
sudo chown -R $USER /data