From ad9c0c0d9a263f85aa1bc785912a3100422a8131 Mon Sep 17 00:00:00 2001 From: Leonid Plyushch Date: Sat, 8 Jun 2019 14:26:07 +0300 Subject: [PATCH] docs: update info about setting up build environment --- docs/BUILD_ENVIRONMENT.md | 67 +++++++++++++++++++++++++++++++++++++++ docs/DOCKER.md | 39 ----------------------- 2 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 docs/BUILD_ENVIRONMENT.md delete mode 100644 docs/DOCKER.md diff --git a/docs/BUILD_ENVIRONMENT.md b/docs/BUILD_ENVIRONMENT.md new file mode 100644 index 000000000..b525fca38 --- /dev/null +++ b/docs/BUILD_ENVIRONMENT.md @@ -0,0 +1,67 @@ +# Build Environment Documentation + +This document is inteneded to describe how to set up a build environment. + +Builds are run on Ubuntu installations. + +## Docker + +For most people the best way to obtain an environment for building packages is +by using Docker. This should work everywhere Docker is supported (replace `/` +with `\` if using Windows) and ensures an up to date build environment that is +tested by other package builders. + +Run the following script to setup a container (from an image created by +[scripts/Dockerfile](../scripts/Dockerfile)) suitable for building packages: +```Shell +./scripts/run-docker.sh +``` +This source folder is mounted as the `/root/termux-packages` data volume, so +changes are kept in sync between the host and the container when trying things +out before committing, and built deb files will be available on the host in the +`debs/` directory just as when building on the host. + +The docker container used for building packages is a Ubuntu installation with +necessary packages pre-installed. The default user is a non-root user to avoid +problems with package builds modifying the system by mistake, but `sudo` can be +used to install additional Ubuntu packages to be used during development. + +Build commands can be given to be executed in the docker container directly: +```Shell +./scripts/run-docker.sh ./build-package.sh libandroid-support +``` +will launch the docker container, execute the `./build-package.sh libandroid-support` +command inside it and afterwards return you to the host prompt, with the newly +built deb in `debs/` to try out. + +For Windows users, there is also a PowerShell script available to start the +docker. Run with (be aware of backslashes and normal slashes): +```PowerShell +.\scripts\run-docker.ps1 ./build-package.sh libandroid-support +``` +Note that building packages can take up a lot of space (especially if `build-all.sh` +is used to build all packages) and you may need to [increase the base device size](http://www.projectatomic.io/blog/2016/03/daemon_option_basedevicesize/) +if running with a storage driver using a small base size of 10 GB. + +## Ubuntu PC + +If you can't run Docker you can use a Ubuntu 19.04 installation by using the +below scripts: + +- Run `scripts/setup-ubuntu.sh` to install required packages and setup the + `/data/` folder. + +- Run `scripts/setup-android-sdk.sh` to install the Android SDK and NDK at + `$HOME/lib/android-{sdk,ndk}`. + +## Ubuntu VM + +There is a [Vagrantfile](../scripts/Vagrantfile) for setting up a VirtualBox +Ubuntu installation. + +- Run `vagrant plugin install vagrant-disksize` to install disksize plugin for + Vagrant. + +- Run `cd scripts && vagrant up` to setup and launch the virtual machine. + +- Run `vagrant ssh` to ssh into the virtual machine. diff --git a/docs/DOCKER.md b/docs/DOCKER.md deleted file mode 100644 index c029a52c7..000000000 --- a/docs/DOCKER.md +++ /dev/null @@ -1,39 +0,0 @@ -# Build Environment Documentation - -This document is inteneded to describe how to set up a build environment. - -Builds are run on Ubuntu installations. - -## Docker - -For most people the best way to obtain an environment for building packages is by using Docker. This should work everywhere Docker is supported (replace `/` with `\` if using Windows) and ensures an up to date build environment that is tested by other package builders. - -Run the following script to setup a container (from an image created by [scripts/Dockerfile](../scripts/Dockerfile)) suitable for building packages: -```Shell -./scripts/run-docker.sh -``` -This source folder is mounted as the `/root/termux-packages` data volume, so changes are kept in sync between the host and the container when trying things out before committing, and built deb files will be available on the host in the `debs/` directory just as when building on the host. - -The docker container used for building packages is a Ubuntu installation with necessary packages pre-installed. The default user is a non-root user to avoid problems with package builds modifying the system by mistake, but `sudo` can be used to install additional Ubuntu packages to be used during development. - -Build commands can be given to be executed in the docker container directly: -```Shell -./scripts/run-docker.sh ./build-package.sh libandroid-support -``` -will launch the docker container, execute the `./build-package.sh libandroid-support` command inside it and afterwards return you to the host prompt, with the newly built deb in `debs/` to try out. - -For Windows users, there is also a PowerShell script available to start the docker. Run with (be aware of backslashes and normal slashes): -```PowerShell -.\scripts\run-docker.ps1 ./build-package.sh libandroid-support -``` -Note that building packages can take up a lot of space (especially if `build-all.sh` is used to build all packages) and you may need to [increase the base device size](http://www.projectatomic.io/blog/2016/03/daemon_option_basedevicesize/) if running with a storage driver using a small base size of 10 GB. - -## Ubuntu PC - -If you can't run Docker you can use a Ubuntu 18.10 installation (either by installing a virtual maching guest or on direct hardware) by using the below scripts: - -- Run `scripts/setup-ubuntu.sh` to install required packages and setup the `/data/` folder. - -- Run `scripts/setup-android-sdk.sh` to install the Android SDK and NDK at `$HOME/lib/android-{sdk,ndk}`. - -There is also a [Vagrantfile](../scripts/Vagrantfile) available as a shortcut for setting up an Ubuntu installation with the above steps applied.